fog-xenserver 0.0.1.alpha2 → 0.0.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +27 -0
- data/.travis.yml +19 -0
- data/CONTRIBUTING.md +6 -6
- data/Gemfile +1 -1
- data/LICENSE.md +1 -1
- data/README.md +3 -1
- data/Rakefile +10 -1
- data/fog-xenserver.gemspec +6 -4
- data/gemfiles/Gemfile.1.8.7 +7 -0
- data/gemfiles/Gemfile.1.9.2+ +6 -0
- data/lib/fog.rb +1 -1
- data/lib/fog/collection.rb +37 -0
- data/lib/fog/compute/xen_server.rb +132 -0
- data/lib/fog/compute/xen_server/mock.rb +27 -0
- data/lib/fog/compute/xen_server/models.rb +78 -0
- data/lib/fog/compute/xen_server/models/blob.rb +24 -0
- data/lib/fog/compute/xen_server/models/blobs.rb +11 -0
- data/lib/fog/compute/xen_server/models/bond.rb +26 -0
- data/lib/fog/compute/xen_server/models/bonds.rb +11 -0
- data/lib/fog/compute/xen_server/models/console.rb +23 -0
- data/lib/fog/compute/xen_server/models/consoles.rb +11 -0
- data/lib/fog/compute/xen_server/models/crash_dump.rb +22 -0
- data/lib/fog/compute/xen_server/models/crash_dumps.rb +11 -0
- data/lib/fog/compute/xen_server/models/dr_task.rb +20 -0
- data/lib/fog/compute/xen_server/models/dr_tasks.rb +11 -0
- data/lib/fog/compute/xen_server/models/gpu_group.rb +25 -0
- data/lib/fog/compute/xen_server/models/gpu_groups.rb +11 -0
- data/lib/fog/compute/xen_server/models/guest_metrics.rb +28 -0
- data/lib/fog/compute/xen_server/models/guests_metrics.rb +11 -0
- data/lib/fog/compute/xen_server/models/host.rb +121 -0
- data/lib/fog/compute/xen_server/models/host_cpu.rb +31 -0
- data/lib/fog/compute/xen_server/models/host_cpus.rb +11 -0
- data/lib/fog/compute/xen_server/models/host_crash_dump.rb +23 -0
- data/lib/fog/compute/xen_server/models/host_crash_dumps.rb +11 -0
- data/lib/fog/compute/xen_server/models/host_metrics.rb +28 -0
- data/lib/fog/compute/xen_server/models/host_patch.rb +28 -0
- data/lib/fog/compute/xen_server/models/host_patchs.rb +11 -0
- data/lib/fog/compute/xen_server/models/hosts.rb +11 -0
- data/lib/fog/compute/xen_server/models/hosts_metrics.rb +11 -0
- data/lib/fog/compute/xen_server/models/network.rb +65 -0
- data/lib/fog/compute/xen_server/models/networks.rb +11 -0
- data/lib/fog/compute/xen_server/models/pbd.rb +30 -0
- data/lib/fog/compute/xen_server/models/pbds.rb +11 -0
- data/lib/fog/compute/xen_server/models/pci.rb +25 -0
- data/lib/fog/compute/xen_server/models/pcis.rb +11 -0
- data/lib/fog/compute/xen_server/models/pgpu.rb +23 -0
- data/lib/fog/compute/xen_server/models/pgpus.rb +11 -0
- data/lib/fog/compute/xen_server/models/pif.rb +49 -0
- data/lib/fog/compute/xen_server/models/pif_metrics.rb +30 -0
- data/lib/fog/compute/xen_server/models/pifs.rb +11 -0
- data/lib/fog/compute/xen_server/models/pifs_metrics.rb +9 -0
- data/lib/fog/compute/xen_server/models/pool.rb +47 -0
- data/lib/fog/compute/xen_server/models/pool_patch.rb +27 -0
- data/lib/fog/compute/xen_server/models/pool_patchs.rb +11 -0
- data/lib/fog/compute/xen_server/models/pools.rb +11 -0
- data/lib/fog/compute/xen_server/models/role.rb +22 -0
- data/lib/fog/compute/xen_server/models/roles.rb +11 -0
- data/lib/fog/compute/xen_server/models/server.rb +203 -0
- data/lib/fog/compute/xen_server/models/server_appliance.rb +24 -0
- data/lib/fog/compute/xen_server/models/server_appliances.rb +11 -0
- data/lib/fog/compute/xen_server/models/server_metrics.rb +29 -0
- data/lib/fog/compute/xen_server/models/servers.rb +38 -0
- data/lib/fog/compute/xen_server/models/servers_metrics.rb +11 -0
- data/lib/fog/compute/xen_server/models/storage_manager.rb +30 -0
- data/lib/fog/compute/xen_server/models/storage_managers.rb +11 -0
- data/lib/fog/compute/xen_server/models/storage_repositories.rb +11 -0
- data/lib/fog/compute/xen_server/models/storage_repository.rb +77 -0
- data/lib/fog/compute/xen_server/models/tunnel.rb +23 -0
- data/lib/fog/compute/xen_server/models/tunnels.rb +11 -0
- data/lib/fog/compute/xen_server/models/vbd.rb +64 -0
- data/lib/fog/compute/xen_server/models/vbd_metrics.rb +27 -0
- data/lib/fog/compute/xen_server/models/vbds.rb +11 -0
- data/lib/fog/compute/xen_server/models/vbds_metrics.rb +11 -0
- data/lib/fog/compute/xen_server/models/vdi.rb +75 -0
- data/lib/fog/compute/xen_server/models/vdis.rb +11 -0
- data/lib/fog/compute/xen_server/models/vif.rb +53 -0
- data/lib/fog/compute/xen_server/models/vif_metrics.rb +22 -0
- data/lib/fog/compute/xen_server/models/vifs.rb +11 -0
- data/lib/fog/compute/xen_server/models/vifs_metrics.rb +11 -0
- data/lib/fog/compute/xen_server/models/vlan.rb +65 -0
- data/lib/fog/compute/xen_server/models/vlans.rb +11 -0
- data/lib/fog/compute/xen_server/models/vmpp.rb +38 -0
- data/lib/fog/compute/xen_server/models/vmpps.rb +11 -0
- data/lib/fog/compute/xen_server/models/vtpm.rb +21 -0
- data/lib/fog/compute/xen_server/models/vtpms.rb +11 -0
- data/lib/fog/compute/xen_server/real.rb +36 -0
- data/lib/fog/compute/xen_server/requests/builtin_templates.rb +21 -0
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/clone_server.rb +1 -5
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_network.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_server.rb +1 -14
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_sr.rb +1 -7
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vbd.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vdi.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vif.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vlan.rb +1 -6
- data/lib/fog/compute/xen_server/requests/custom_templates.rb +21 -0
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_network.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_server.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_sr.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vdi.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vif.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vlan.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/disable_host.rb +1 -7
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/eject_vbd.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/enable_host.rb +1 -7
- data/lib/fog/compute/xen_server/requests/get_record.rb +41 -0
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/get_records.rb +1 -9
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/insert_vbd.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/provision_server.rb +1 -5
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/reboot_host.rb +2 -8
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/reboot_server.rb +2 -8
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/scan_sr.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/set_affinity.rb +1 -9
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/set_attribute.rb +1 -9
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/shutdown_host.rb +2 -8
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/shutdown_server.rb +2 -8
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/snapshot_revert.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/snapshot_server.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/start_server.rb +1 -7
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/start_vm.rb +2 -8
- data/lib/fog/compute/xen_server/requests/templates.rb +21 -0
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/unplug_pbd.rb +1 -6
- data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/unplug_vbd.rb +1 -6
- data/lib/fog/model.rb +48 -0
- data/lib/fog/parsers/xen_server.rb +15 -0
- data/lib/fog/{xenserver/parser.rb → parsers/xen_server/base.rb} +1 -3
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_hosts.rb +1 -4
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_networks.rb +1 -4
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_pools.rb +1 -4
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_records.rb +1 -4
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_storage_repositories.rb +1 -4
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vbds.rb +2 -5
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vifs.rb +2 -5
- data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vms.rb +1 -5
- data/lib/fog/{xenserver/utilities.rb → utilities.rb} +0 -0
- data/lib/fog/{xenserver/core.rb → xen_server/connection.rb} +2 -40
- data/lib/fog/xen_server/invalid_login.rb +5 -0
- data/lib/fog/xen_server/nokogiri_stream_parser.rb +20 -0
- data/lib/fog/xen_server/not_found.rb +5 -0
- data/lib/fog/xen_server/request_failed.rb +5 -0
- data/lib/fog/xen_server/version.rb +5 -0
- data/lib/fog/xenserver.rb +27 -1
- data/lib/fog/xenserver/compute.rb +0 -176
- data/test/fog/compute/xen_server/models/blob_test.rb +40 -0
- data/test/fog/compute/xen_server/models/bond_test.rb +42 -0
- data/test/fog/compute/xen_server/models/console_test.rb +38 -0
- data/test/fog/compute/xen_server/models/crash_dump_test.rb +39 -0
- data/test/fog/compute/xen_server/models/dr_task_test.rb +35 -0
- data/test/fog/compute/xen_server/models/gpu_group_test.rb +45 -0
- data/test/fog/compute/xen_server/models/guest_metrics_test.rb +44 -0
- data/test/fog/compute/xen_server/models/host_cpu_test.rb +46 -0
- data/test/fog/compute/xen_server/models/host_crash_dump_test.rb +37 -0
- data/test/fog/compute/xen_server/models/host_metrics_test.rb +38 -0
- data/test/fog/compute/xen_server/models/host_patch_test.rb +45 -0
- data/test/fog/compute/xen_server/models/host_test.rb +102 -0
- data/test/fog/compute/xen_server/models/network_test.rb +51 -0
- data/test/fog/compute/xen_server/models/pbd_test.rb +40 -0
- data/test/fog/compute/xen_server/models/pci_test.rb +40 -0
- data/test/fog/compute/xen_server/models/pgpu_test.rb +41 -0
- data/test/fog/compute/xen_server/models/pif_metrics_test.rb +45 -0
- data/test/fog/compute/xen_server/models/pif_test.rb +81 -0
- data/test/fog/compute/xen_server/models/pool_patch_test.rb +43 -0
- data/test/fog/compute/xen_server/models/pool_test.rb +69 -0
- data/test/fog/compute/xen_server/models/role_test.rb +38 -0
- data/test/fog/compute/xen_server/models/server_appliance_test.rb +41 -0
- data/test/fog/compute/xen_server/models/server_metrics_test.rb +48 -0
- data/test/fog/compute/xen_server/models/server_test.rb +149 -0
- data/test/fog/compute/xen_server/models/storage_manger_test.rb +46 -0
- data/test/fog/compute/xen_server/models/storage_repository_test.rb +56 -0
- data/test/fog/compute/xen_server/models/tunnel_test.rb +40 -0
- data/test/fog/compute/xen_server/models/vbd_metrics_test.rb +37 -0
- data/test/fog/compute/xen_server/models/vbd_test.rb +58 -0
- data/test/fog/compute/xen_server/models/vdi_test.rb +71 -0
- data/test/fog/compute/xen_server/models/vif_metrics_test.rb +37 -0
- data/test/fog/compute/xen_server/models/vif_test.rb +59 -0
- data/test/fog/compute/xen_server/models/vlan_test.rb +40 -0
- data/test/fog/compute/xen_server/models/vmpp_test.rb +55 -0
- data/test/fog/compute/xen_server/models/vtpm_test.rb +36 -0
- data/test/minitest_helper.rb +28 -0
- metadata +239 -120
- data/lib/fog/compute.rb +0 -7
- data/lib/fog/xenserver/examples/README.md +0 -11
- data/lib/fog/xenserver/examples/chage_default_storage_repository.md +0 -99
- data/lib/fog/xenserver/examples/creating_servers.md +0 -168
- data/lib/fog/xenserver/examples/getting_started.md +0 -163
- data/lib/fog/xenserver/examples/networks-and-vlans.rb +0 -45
- data/lib/fog/xenserver/examples/storage_repositories.md +0 -94
- data/lib/fog/xenserver/models/compute/blob.rb +0 -22
- data/lib/fog/xenserver/models/compute/blobs.rb +0 -25
- data/lib/fog/xenserver/models/compute/bond.rb +0 -23
- data/lib/fog/xenserver/models/compute/bonds.rb +0 -25
- data/lib/fog/xenserver/models/compute/console.rb +0 -29
- data/lib/fog/xenserver/models/compute/consoles.rb +0 -25
- data/lib/fog/xenserver/models/compute/crash_dump.rb +0 -19
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +0 -25
- data/lib/fog/xenserver/models/compute/dr_task.rb +0 -17
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +0 -25
- data/lib/fog/xenserver/models/compute/gpu_group.rb +0 -22
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +0 -25
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +0 -29
- data/lib/fog/xenserver/models/compute/host.rb +0 -159
- data/lib/fog/xenserver/models/compute/host_cpu.rb +0 -38
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +0 -20
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +0 -25
- data/lib/fog/xenserver/models/compute/host_metrics.rb +0 -29
- data/lib/fog/xenserver/models/compute/host_patch.rb +0 -25
- data/lib/fog/xenserver/models/compute/host_patchs.rb +0 -25
- data/lib/fog/xenserver/models/compute/hosts.rb +0 -29
- data/lib/fog/xenserver/models/compute/network.rb +0 -92
- data/lib/fog/xenserver/models/compute/networks.rb +0 -33
- data/lib/fog/xenserver/models/compute/pbd.rb +0 -40
- data/lib/fog/xenserver/models/compute/pbds.rb +0 -33
- data/lib/fog/xenserver/models/compute/pci.rb +0 -22
- data/lib/fog/xenserver/models/compute/pcis.rb +0 -25
- data/lib/fog/xenserver/models/compute/pgpu.rb +0 -20
- data/lib/fog/xenserver/models/compute/pgpus.rb +0 -25
- data/lib/fog/xenserver/models/compute/pif.rb +0 -57
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +0 -28
- data/lib/fog/xenserver/models/compute/pifs.rb +0 -33
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +0 -25
- data/lib/fog/xenserver/models/compute/pool.rb +0 -79
- data/lib/fog/xenserver/models/compute/pool_patch.rb +0 -24
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +0 -25
- data/lib/fog/xenserver/models/compute/pools.rb +0 -33
- data/lib/fog/xenserver/models/compute/role.rb +0 -19
- data/lib/fog/xenserver/models/compute/roles.rb +0 -25
- data/lib/fog/xenserver/models/compute/server.rb +0 -250
- data/lib/fog/xenserver/models/compute/server_appliance.rb +0 -21
- data/lib/fog/xenserver/models/compute/server_appliances.rb +0 -25
- data/lib/fog/xenserver/models/compute/servers.rb +0 -68
- data/lib/fog/xenserver/models/compute/storage_manager.rb +0 -28
- data/lib/fog/xenserver/models/compute/storage_managers.rb +0 -25
- data/lib/fog/xenserver/models/compute/storage_repositories.rb +0 -31
- data/lib/fog/xenserver/models/compute/storage_repository.rb +0 -93
- data/lib/fog/xenserver/models/compute/tunnel.rb +0 -20
- data/lib/fog/xenserver/models/compute/tunnels.rb +0 -25
- data/lib/fog/xenserver/models/compute/vbd.rb +0 -91
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +0 -27
- data/lib/fog/xenserver/models/compute/vbds.rb +0 -33
- data/lib/fog/xenserver/models/compute/vdi.rb +0 -105
- data/lib/fog/xenserver/models/compute/vdis.rb +0 -29
- data/lib/fog/xenserver/models/compute/vif.rb +0 -60
- data/lib/fog/xenserver/models/compute/vifs.rb +0 -29
- data/lib/fog/xenserver/models/compute/vlan.rb +0 -81
- data/lib/fog/xenserver/models/compute/vlans.rb +0 -39
- data/lib/fog/xenserver/models/compute/vmpp.rb +0 -35
- data/lib/fog/xenserver/models/compute/vmpps.rb +0 -25
- data/lib/fog/xenserver/models/compute/vtpm.rb +0 -18
- data/lib/fog/xenserver/models/compute/vtpms.rb +0 -25
- data/lib/fog/xenserver/requests/compute/get_record.rb +0 -29
- data/lib/fog/xenserver/version.rb +0 -5
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::ServerAppliance do
|
4
|
+
let(:server_appliance_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::ServerAppliance
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::ServerAppliance
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
server_appliance_class.read_provider_class.must_equal('VM_appliance')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
server_appliance_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 7 attributes' do
|
26
|
+
server_appliance_class.attributes.must_equal([ :reference,
|
27
|
+
:allowed_operations,
|
28
|
+
:current_operations,
|
29
|
+
:description,
|
30
|
+
:name,
|
31
|
+
:uuid,
|
32
|
+
:__vms ])
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should have 4 aliases' do
|
36
|
+
server_appliance_class.aliases.must_equal({ :name_description => :description,
|
37
|
+
:name_label => :name,
|
38
|
+
:VMs => :__vms,
|
39
|
+
:vms => :__vms })
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::ServerMetrics do
|
4
|
+
let(:server_metrics_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::ServerMetrics
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::ServerMetrics
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
server_metrics_class.read_provider_class.must_equal('VM_metrics')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
server_metrics_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 13 attributes' do
|
26
|
+
server_metrics_class.attributes.must_equal([ :reference,
|
27
|
+
:install_time,
|
28
|
+
:last_updated,
|
29
|
+
:memory_actual,
|
30
|
+
:other_config,
|
31
|
+
:start_time,
|
32
|
+
:state,
|
33
|
+
:uuid,
|
34
|
+
:vcpus_cpu,
|
35
|
+
:vcpus_flags,
|
36
|
+
:vcpus_number,
|
37
|
+
:vcpus_params,
|
38
|
+
:vcpus_utilisation ])
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should have 6 aliases' do
|
42
|
+
server_metrics_class.aliases.must_equal({ :VCPUs_CPU => :vcpus_cpu,
|
43
|
+
:VCPUs_flags => :vcpus_flags,
|
44
|
+
:VCPUs_number => :vcpus_number,
|
45
|
+
:VCPUs_params => :vcpus_params,
|
46
|
+
:VCPUs_utilisation => :vcpus_utilisation })
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Server do
|
4
|
+
let(:server_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Server
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::Server
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
server_class.read_provider_class.must_equal('VM')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
server_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 77 attributes' do
|
26
|
+
server_class.attributes.must_equal([ :reference,
|
27
|
+
:actions_after_crash,
|
28
|
+
:actions_after_reboot,
|
29
|
+
:actions_after_shutdown,
|
30
|
+
:allowed_operations,
|
31
|
+
:blobs,
|
32
|
+
:blocked_operations,
|
33
|
+
:bios_strings,
|
34
|
+
:current_operations,
|
35
|
+
:domarch,
|
36
|
+
:domid,
|
37
|
+
:description,
|
38
|
+
:generation_id,
|
39
|
+
:ha_always_run,
|
40
|
+
:ha_restart_priority,
|
41
|
+
:hvm_boot_params,
|
42
|
+
:hvm_boot_policy,
|
43
|
+
:hvm_shadow_multiplier,
|
44
|
+
:is_a_snapshot,
|
45
|
+
:is_a_template,
|
46
|
+
:is_control_domain,
|
47
|
+
:is_snapshot_from_vmpp,
|
48
|
+
:last_booted_record,
|
49
|
+
:last_boot_cpu_flags,
|
50
|
+
:memory_dynamic_max,
|
51
|
+
:memory_dynamic_min,
|
52
|
+
:memory_overhead,
|
53
|
+
:memory_static_max,
|
54
|
+
:memory_static_min,
|
55
|
+
:memory_target,
|
56
|
+
:name,
|
57
|
+
:order,
|
58
|
+
:other_config,
|
59
|
+
:pci_bus,
|
60
|
+
:platform,
|
61
|
+
:power_state,
|
62
|
+
:pv_args,
|
63
|
+
:pv_bootloader,
|
64
|
+
:pv_bootloader_args,
|
65
|
+
:pv_kernel,
|
66
|
+
:pv_legacy_args,
|
67
|
+
:pv_ramdisk,
|
68
|
+
:recommendations,
|
69
|
+
:shutdown_delay,
|
70
|
+
:snapshot_info,
|
71
|
+
:snapshot_metadata,
|
72
|
+
:snapshot_time,
|
73
|
+
:start_delay,
|
74
|
+
:tags,
|
75
|
+
:template_name,
|
76
|
+
:transportable_snapshot_id,
|
77
|
+
:user_version,
|
78
|
+
:uuid,
|
79
|
+
:vcpus_at_startup,
|
80
|
+
:vcpus_max,
|
81
|
+
:vcpus_params,
|
82
|
+
:version,
|
83
|
+
:xenstore_data,
|
84
|
+
:__affinity,
|
85
|
+
:__appliance,
|
86
|
+
:__attached_pcis,
|
87
|
+
:__children,
|
88
|
+
:__consoles,
|
89
|
+
:__crash_dumps,
|
90
|
+
:__guest_metrics,
|
91
|
+
:__metrics,
|
92
|
+
:__parent,
|
93
|
+
:__protection_policy,
|
94
|
+
:__resident_on,
|
95
|
+
:__snapshots,
|
96
|
+
:__snapshot_of,
|
97
|
+
:__suspend_sr,
|
98
|
+
:__suspend_vdi,
|
99
|
+
:__vbds,
|
100
|
+
:__vgpus,
|
101
|
+
:__vifs,
|
102
|
+
:__vtpms ])
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'should have 42 aliases' do
|
106
|
+
server_class.aliases.must_equal({ :name_label => :name,
|
107
|
+
:name_description => :description,
|
108
|
+
:affinity => :__affinity,
|
109
|
+
:appliance => :__appliance,
|
110
|
+
:consoles => :__consoles,
|
111
|
+
:attached_PCIs => :__attached_pcis,
|
112
|
+
:attached_pcis => :__attached_pcis,
|
113
|
+
:children => :__children,
|
114
|
+
:crash_dumps => :__crash_dumps,
|
115
|
+
:guest_metrics => :__guest_metrics,
|
116
|
+
:last_boot_CPU_flags => :last_boot_cpu_flags,
|
117
|
+
:metrics => :__metrics,
|
118
|
+
:parent => :__parent,
|
119
|
+
:PV_args => :pv_args,
|
120
|
+
:PV_bootloader => :pv_bootloader,
|
121
|
+
:PV_bootloader_args => :pv_bootloader_args,
|
122
|
+
:PV_kernel => :pv_kernel,
|
123
|
+
:PV_ramdisk => :pv_ramdisk,
|
124
|
+
:PV_legacy_args => :pv_legacy_args,
|
125
|
+
:resident_on => :__resident_on,
|
126
|
+
:snapshot_of => :__snapshot_of,
|
127
|
+
:suspend_SR => :__suspend_sr,
|
128
|
+
:suspend_sr => :__suspend_sr,
|
129
|
+
:suspend_VDI => :__suspend_vdi,
|
130
|
+
:suspend_vdi => :__suspend_vdi,
|
131
|
+
:snapshots => :__snapshots,
|
132
|
+
:VGPUs => :__vgpus,
|
133
|
+
:vgpus => :__vgpus,
|
134
|
+
:VTPMs => :__vtpms,
|
135
|
+
:vtpms => :__vtpms,
|
136
|
+
:VBDs => :__vbds,
|
137
|
+
:vbds => :__vbds,
|
138
|
+
:protection_policy => :__protection_policy,
|
139
|
+
:VCPUs_at_startup => :vcpus_at_startup,
|
140
|
+
:VCPUs_max => :vcpus_max,
|
141
|
+
:VCPUs_params => :vcpus_params,
|
142
|
+
:VIFs => :__vifs,
|
143
|
+
:vifs => :__vifs,
|
144
|
+
:HVM_boot_policy => :hvm_boot_policy,
|
145
|
+
:HVM_boot_params => :hvm_boot_params,
|
146
|
+
:HVM_shadow_multiplier => :hvm_shadow_multiplier,
|
147
|
+
:PCI_bus => :pci_bus })
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::StorageManager do
|
4
|
+
let(:storage_manager_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::StorageManager
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::StorageManager
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
storage_manager_class.read_provider_class.must_equal('SM')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
storage_manager_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 14 attributes' do
|
26
|
+
storage_manager_class.attributes.must_equal([ :reference,
|
27
|
+
:capabilities,
|
28
|
+
:configuration,
|
29
|
+
:copyright,
|
30
|
+
:description,
|
31
|
+
:driver_filename,
|
32
|
+
:features,
|
33
|
+
:name,
|
34
|
+
:other_config,
|
35
|
+
:required_api_version,
|
36
|
+
:type,
|
37
|
+
:uuid,
|
38
|
+
:vendor,
|
39
|
+
:version ])
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should have 2 aliases' do
|
43
|
+
storage_manager_class.aliases.must_equal({ :name_description => :description,
|
44
|
+
:name_label => :name })
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::StorageRepository do
|
4
|
+
let(:storage_repository_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::StorageRepository
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::StorageRepository
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
storage_repository_class.read_provider_class.must_equal('SR')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
storage_repository_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 20 attributes' do
|
26
|
+
storage_repository_class.attributes.must_equal([ :reference,
|
27
|
+
:allowed_operations,
|
28
|
+
:blobs,
|
29
|
+
:content_type,
|
30
|
+
:current_operations,
|
31
|
+
:description,
|
32
|
+
:introduced_by,
|
33
|
+
:local_cache_enabled,
|
34
|
+
:name,
|
35
|
+
:other_config,
|
36
|
+
:physical_size,
|
37
|
+
:physical_utilisation,
|
38
|
+
:shared,
|
39
|
+
:sm_config,
|
40
|
+
:tags,
|
41
|
+
:type,
|
42
|
+
:uuid,
|
43
|
+
:virtual_allocation,
|
44
|
+
:__pbds,
|
45
|
+
:__vdis ])
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should have 6 aliases' do
|
49
|
+
storage_repository_class.aliases.must_equal({ :name_label => :name,
|
50
|
+
:name_description => :description,
|
51
|
+
:PBDs => :__pbds,
|
52
|
+
:pbds => :__pbds,
|
53
|
+
:VDIs => :__vdis,
|
54
|
+
:vdis => :__vdis })
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Tunnel do
|
4
|
+
let(:tunnel_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Tunnel
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::Tunnel
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
tunnel_class.read_provider_class.must_equal('tunnel')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
tunnel_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 6 attributes' do
|
26
|
+
tunnel_class.attributes.must_equal([ :reference,
|
27
|
+
:other_config,
|
28
|
+
:status,
|
29
|
+
:uuid,
|
30
|
+
:__access_pif,
|
31
|
+
:__transport_pif ])
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should have 4 aliases' do
|
35
|
+
tunnel_class.aliases.must_equal({ :access_PIF => :__access_pif,
|
36
|
+
:access_pif => :__access_pif,
|
37
|
+
:transport_PIF => :__transport_pif,
|
38
|
+
:transport_pif => :__transport_pif })
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::VbdMetrics do
|
4
|
+
let(:vbd_metrics_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::VbdMetrics
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::VbdMetrics
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
vbd_metrics_class.read_provider_class.must_equal('VBD_metrics')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
vbd_metrics_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 6 attributes' do
|
26
|
+
vbd_metrics_class.attributes.must_equal([ :reference,
|
27
|
+
:io_read_kbs,
|
28
|
+
:io_write_kbs,
|
29
|
+
:last_updated,
|
30
|
+
:other_config,
|
31
|
+
:uuid ])
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should't have aliases" do
|
35
|
+
vbd_metrics_class.aliases.must_equal({})
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe Fog::Compute::XenServer::Models::Vbd do
|
4
|
+
let(:vbd_class) do
|
5
|
+
class Fog::Compute::XenServer::Models::Vbd
|
6
|
+
def self.read_identity
|
7
|
+
instance_variable_get('@identity')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.read_provider_class
|
11
|
+
instance_variable_get('@provider_class')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
Fog::Compute::XenServer::Models::Vbd
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should associate to a provider class' do
|
18
|
+
vbd_class.read_provider_class.must_equal('VBD')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should have an unique id' do
|
22
|
+
vbd_class.read_identity.must_equal(:reference)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should have 23 attributes' do
|
26
|
+
vbd_class.attributes.must_equal([ :reference,
|
27
|
+
:allowed_operations,
|
28
|
+
:bootable,
|
29
|
+
:currently_attached,
|
30
|
+
:current_operations,
|
31
|
+
:device,
|
32
|
+
:empty,
|
33
|
+
:mode,
|
34
|
+
:other_config,
|
35
|
+
:qos_supported_algorithms,
|
36
|
+
:qos_algorithm_params,
|
37
|
+
:qos_algorithm_type,
|
38
|
+
:runtime_properties,
|
39
|
+
:status_code,
|
40
|
+
:status_detail,
|
41
|
+
:storage_lock,
|
42
|
+
:type,
|
43
|
+
:unpluggable,
|
44
|
+
:userdevice,
|
45
|
+
:uuid,
|
46
|
+
:__metrics,
|
47
|
+
:__vdi,
|
48
|
+
:__vm ])
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should have 5 aliases' do
|
52
|
+
vbd_class.aliases.must_equal({ :VDI => :__vdi,
|
53
|
+
:vdi => :__vdi,
|
54
|
+
:VM => :__vm,
|
55
|
+
:vm => :__vm,
|
56
|
+
:metrics => :__metrics })
|
57
|
+
end
|
58
|
+
end
|