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,27 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class XenServer
|
4
|
+
module Models
|
5
|
+
class PoolPatch < Fog::Model
|
6
|
+
# API Reference here:
|
7
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=pool_patch
|
8
|
+
|
9
|
+
provider_class :pool_patch
|
10
|
+
|
11
|
+
identity :reference
|
12
|
+
|
13
|
+
attribute :after_apply_guidance
|
14
|
+
attribute :description, :aliases => :name_description
|
15
|
+
attribute :name, :aliases => :name_label
|
16
|
+
attribute :other_config
|
17
|
+
attribute :pool_applied
|
18
|
+
attribute :size
|
19
|
+
attribute :uuid
|
20
|
+
attribute :version
|
21
|
+
|
22
|
+
has_many :host_patches, :host_patchs
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class XenServer
|
4
|
+
module Models
|
5
|
+
class Role < Fog::Model
|
6
|
+
# API Reference here:
|
7
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=role
|
8
|
+
|
9
|
+
provider_class :role
|
10
|
+
|
11
|
+
identity :reference
|
12
|
+
|
13
|
+
attribute :description, :aliases => :name_description
|
14
|
+
attribute :name, :aliases => :name_label
|
15
|
+
attribute :uuid
|
16
|
+
|
17
|
+
has_many :subroles, :roles
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,203 @@
|
|
1
|
+
require 'fog/compute/models/server'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class XenServer
|
6
|
+
module Models
|
7
|
+
class Server < Fog::Compute::Server
|
8
|
+
# API Reference here:
|
9
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM
|
10
|
+
|
11
|
+
provider_class :VM
|
12
|
+
|
13
|
+
identity :reference
|
14
|
+
|
15
|
+
attribute :actions_after_crash
|
16
|
+
attribute :actions_after_reboot
|
17
|
+
attribute :actions_after_shutdown
|
18
|
+
attribute :allowed_operations
|
19
|
+
attribute :blobs
|
20
|
+
attribute :blocked_operations
|
21
|
+
attribute :bios_strings
|
22
|
+
attribute :current_operations
|
23
|
+
attribute :domarch
|
24
|
+
attribute :domid
|
25
|
+
attribute :description, :aliases => :name_description
|
26
|
+
attribute :generation_id
|
27
|
+
attribute :ha_always_run
|
28
|
+
attribute :ha_restart_priority
|
29
|
+
attribute :hvm_boot_params, :aliases => :HVM_boot_params
|
30
|
+
attribute :hvm_boot_policy, :aliases => :HVM_boot_policy
|
31
|
+
attribute :hvm_shadow_multiplier, :aliases => :HVM_shadow_multiplier
|
32
|
+
attribute :is_a_snapshot
|
33
|
+
attribute :is_a_template
|
34
|
+
attribute :is_control_domain
|
35
|
+
attribute :is_snapshot_from_vmpp
|
36
|
+
attribute :last_booted_record
|
37
|
+
attribute :last_boot_cpu_flags, :aliases => :last_boot_CPU_flags
|
38
|
+
attribute :memory_dynamic_max
|
39
|
+
attribute :memory_dynamic_min
|
40
|
+
attribute :memory_overhead
|
41
|
+
attribute :memory_static_max
|
42
|
+
attribute :memory_static_min
|
43
|
+
attribute :memory_target
|
44
|
+
attribute :name, :aliases => :name_label
|
45
|
+
attribute :order
|
46
|
+
attribute :other_config
|
47
|
+
attribute :pci_bus, :aliases => :PCI_bus
|
48
|
+
attribute :platform
|
49
|
+
attribute :power_state
|
50
|
+
attribute :pv_args, :aliases => :PV_args
|
51
|
+
attribute :pv_bootloader, :aliases => :PV_bootloader
|
52
|
+
attribute :pv_bootloader_args, :aliases => :PV_bootloader_args
|
53
|
+
attribute :pv_kernel, :aliases => :PV_kernel
|
54
|
+
attribute :pv_legacy_args, :aliases => :PV_legacy_args
|
55
|
+
attribute :pv_ramdisk, :aliases => :PV_ramdisk
|
56
|
+
attribute :recommendations
|
57
|
+
attribute :shutdown_delay
|
58
|
+
attribute :snapshot_info
|
59
|
+
attribute :snapshot_metadata
|
60
|
+
attribute :snapshot_time
|
61
|
+
attribute :start_delay
|
62
|
+
attribute :tags
|
63
|
+
attribute :template_name
|
64
|
+
attribute :transportable_snapshot_id
|
65
|
+
attribute :user_version
|
66
|
+
attribute :uuid
|
67
|
+
attribute :vcpus_at_startup, :aliases => :VCPUs_at_startup
|
68
|
+
attribute :vcpus_max, :aliases => :VCPUs_max
|
69
|
+
attribute :vcpus_params, :aliases => :VCPUs_params
|
70
|
+
attribute :version
|
71
|
+
attribute :xenstore_data
|
72
|
+
|
73
|
+
has_one :affinity, :hosts
|
74
|
+
has_one :appliance, :server_appliances
|
75
|
+
has_many :attached_pcis, :pcis, :aliases => :attached_PCIs
|
76
|
+
has_many :children, :servers
|
77
|
+
has_many :consoles, :consoles
|
78
|
+
has_many :crash_dumps, :crash_dumps
|
79
|
+
has_one :guest_metrics, :guests_metrics
|
80
|
+
has_one :metrics, :servers_metrics
|
81
|
+
has_one :parent, :servers
|
82
|
+
has_one :protection_policy, :vmpps
|
83
|
+
has_one :resident_on, :hosts
|
84
|
+
has_many :snapshots, :servers
|
85
|
+
has_one :snapshot_of, :servers
|
86
|
+
has_one :suspend_sr, :storage_repositories, :aliases => :suspend_SR
|
87
|
+
has_one :suspend_vdi, :vdis, :aliases => :suspend_VDI
|
88
|
+
has_many :vbds, :vbds, :aliases => :VBDs
|
89
|
+
has_many :vgpus, :vgpus, :aliases => :VGPUs
|
90
|
+
has_many :vifs, :vifs, :aliases => :VIFs
|
91
|
+
has_many :vtpms, :vtpms, :aliases => :VTPMs
|
92
|
+
|
93
|
+
def destroy
|
94
|
+
# Make sure it's halted
|
95
|
+
stop('hard')
|
96
|
+
vbds.each do |vbd|
|
97
|
+
if vbd.type == "Disk"
|
98
|
+
vbd.unplug \
|
99
|
+
if vbd.allowed_operations.include?("unplug")
|
100
|
+
vbd.vdi.destroy \
|
101
|
+
if vbd.vdi.allowed_operations.include?("destroy")
|
102
|
+
end
|
103
|
+
end
|
104
|
+
service.destroy_server( reference )
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
def tools_installed?
|
109
|
+
!guest_metrics.nil?
|
110
|
+
end
|
111
|
+
|
112
|
+
def home_hypervisor
|
113
|
+
service.hosts.first
|
114
|
+
end
|
115
|
+
|
116
|
+
def mac_address
|
117
|
+
networks.first.MAC
|
118
|
+
end
|
119
|
+
|
120
|
+
def running?
|
121
|
+
reload
|
122
|
+
power_state == "Running"
|
123
|
+
end
|
124
|
+
|
125
|
+
def halted?
|
126
|
+
reload
|
127
|
+
power_state == "Halted"
|
128
|
+
end
|
129
|
+
|
130
|
+
# operations
|
131
|
+
def start
|
132
|
+
return false if running?
|
133
|
+
service.start_server( reference )
|
134
|
+
true
|
135
|
+
end
|
136
|
+
|
137
|
+
def save(params = {})
|
138
|
+
requires :name
|
139
|
+
nets = attributes[:networks] || []
|
140
|
+
if params[:auto_start].nil?
|
141
|
+
auto_start = true
|
142
|
+
else
|
143
|
+
auto_start = params[:auto_start]
|
144
|
+
end
|
145
|
+
if template_name
|
146
|
+
attr = service.get_record(
|
147
|
+
service.create_server( name, template_name, nets, :auto_start => auto_start),
|
148
|
+
'VM'
|
149
|
+
)
|
150
|
+
else
|
151
|
+
attr = service.get_record(
|
152
|
+
service.create_server_raw(attributes),
|
153
|
+
'VM'
|
154
|
+
)
|
155
|
+
end
|
156
|
+
merge_attributes attr
|
157
|
+
true
|
158
|
+
end
|
159
|
+
|
160
|
+
def reboot(stype = 'clean')
|
161
|
+
service.reboot_server(reference, stype)
|
162
|
+
true
|
163
|
+
end
|
164
|
+
|
165
|
+
def hard_reboot
|
166
|
+
reboot 'hard'
|
167
|
+
end
|
168
|
+
|
169
|
+
def clean_reboot
|
170
|
+
reboot 'clean'
|
171
|
+
end
|
172
|
+
|
173
|
+
def stop(stype = 'clean')
|
174
|
+
return false if !running?
|
175
|
+
service.shutdown_server( reference, stype )
|
176
|
+
wait_for { power_state == 'Halted' }
|
177
|
+
true
|
178
|
+
end
|
179
|
+
|
180
|
+
def hard_shutdown
|
181
|
+
stop 'hard'
|
182
|
+
end
|
183
|
+
|
184
|
+
def clean_shutdown
|
185
|
+
stop 'clean'
|
186
|
+
end
|
187
|
+
|
188
|
+
def provision
|
189
|
+
service.provision_server reference
|
190
|
+
end
|
191
|
+
|
192
|
+
def snapshot(name)
|
193
|
+
service.snapshot_server(reference, name)
|
194
|
+
end
|
195
|
+
|
196
|
+
def revert(snapshot_ref)
|
197
|
+
service.snapshot_revert(snapshot_ref)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class XenServer
|
4
|
+
module Models
|
5
|
+
class ServerAppliance < Fog::Model
|
6
|
+
# API Reference here:
|
7
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM_appliance
|
8
|
+
|
9
|
+
provider_class :VM_appliance
|
10
|
+
|
11
|
+
identity :reference
|
12
|
+
|
13
|
+
attribute :allowed_operations
|
14
|
+
attribute :current_operations
|
15
|
+
attribute :description, :aliases => :name_description
|
16
|
+
attribute :name, :aliases => :name_label
|
17
|
+
attribute :uuid
|
18
|
+
|
19
|
+
has_many :vms, :servers, :aliases => :VMs
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class XenServer
|
4
|
+
module Models
|
5
|
+
class ServerMetrics < Fog::Model
|
6
|
+
# API Reference here:
|
7
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VM_metrics
|
8
|
+
|
9
|
+
provider_class :VM_metrics
|
10
|
+
|
11
|
+
identity :reference
|
12
|
+
|
13
|
+
attribute :install_time
|
14
|
+
attribute :last_updated
|
15
|
+
attribute :memory_actual
|
16
|
+
attribute :other_config
|
17
|
+
attribute :start_time
|
18
|
+
attribute :state
|
19
|
+
attribute :uuid
|
20
|
+
attribute :vcpus_cpu, :aliases => :VCPUs_CPU
|
21
|
+
attribute :vcpus_flags, :aliases => :VCPUs_flags
|
22
|
+
attribute :vcpus_number, :aliases => :VCPUs_number
|
23
|
+
attribute :vcpus_params, :aliases => :VCPUs_params
|
24
|
+
attribute :vcpus_utilisation, :aliases => :VCPUs_utilisation
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Compute
|
5
|
+
class XenServer
|
6
|
+
module Models
|
7
|
+
class Servers < Fog::Collection
|
8
|
+
model Fog::Compute::XenServer::Models::Server
|
9
|
+
|
10
|
+
def templates
|
11
|
+
warn 'This method is DEPRECATED. Call #templates directly on the connection instead.'
|
12
|
+
service.templates
|
13
|
+
end
|
14
|
+
|
15
|
+
def custom_templates
|
16
|
+
warn 'This method is DEPRECATED. Call #custom_templates directly on the connection instead.'
|
17
|
+
service.custom_templates
|
18
|
+
end
|
19
|
+
|
20
|
+
def builtin_templates
|
21
|
+
warn 'This method is DEPRECATED. Call #builtin_templates directly on the connection instead.'
|
22
|
+
service.builtin_templates
|
23
|
+
end
|
24
|
+
|
25
|
+
def all(options = {})
|
26
|
+
data = service.get_records 'VM'
|
27
|
+
# Exclude templates
|
28
|
+
data.delete_if { |vm| vm[:is_control_domain] or vm[:is_a_template] }
|
29
|
+
data.delete_if { |vm| vm[:is_a_snapshot] and !options[:include_snapshots] }
|
30
|
+
data.delete_if { |vm| options[:name_matches] and (vm[:name_label] !~ /#{Regexp.escape(options[:name_matches])}/i ) }
|
31
|
+
data.delete_if { |vm| options[:name_equals] and (vm[:name_label] != options[:name_equals] ) }
|
32
|
+
load(data)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class XenServer
|
4
|
+
module Models
|
5
|
+
class StorageManager < Fog::Model
|
6
|
+
# API Reference here:
|
7
|
+
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=SM
|
8
|
+
|
9
|
+
provider_class :SM
|
10
|
+
|
11
|
+
identity :reference
|
12
|
+
|
13
|
+
attribute :capabilities
|
14
|
+
attribute :configuration
|
15
|
+
attribute :copyright
|
16
|
+
attribute :description, :aliases => :name_description
|
17
|
+
attribute :driver_filename
|
18
|
+
attribute :features
|
19
|
+
attribute :name, :aliases => :name_label
|
20
|
+
attribute :other_config
|
21
|
+
attribute :required_api_version
|
22
|
+
attribute :type
|
23
|
+
attribute :uuid
|
24
|
+
attribute :vendor
|
25
|
+
attribute :version
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|