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
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class StorageManager < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=SM
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :capabilities
|
13
|
-
attribute :configuration
|
14
|
-
attribute :copyright
|
15
|
-
attribute :driver_filename
|
16
|
-
attribute :features
|
17
|
-
attribute :description, :aliases => :name_description
|
18
|
-
attribute :name, :aliases => :name_label
|
19
|
-
attribute :other_config
|
20
|
-
attribute :required_api_version
|
21
|
-
attribute :type
|
22
|
-
attribute :uuid
|
23
|
-
attribute :vendor
|
24
|
-
attribute :version
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/storage_manager'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class StorageManagers < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::StorageManager
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'SM'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( sm_ref )
|
16
|
-
if sm_ref && sm = service.get_record( sm_ref, 'SM' )
|
17
|
-
new(sm)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/storage_repository'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
|
8
|
-
class StorageRepositories < Fog::Collection
|
9
|
-
|
10
|
-
model Fog::Compute::XenServer::StorageRepository
|
11
|
-
|
12
|
-
def all
|
13
|
-
data = service.get_records 'SR'
|
14
|
-
#data.delete_if {|sr| sr[:shared].eql?(false)}
|
15
|
-
#data.delete_if {|sr| sr[:content_type].eql?('iso')}
|
16
|
-
load(data)
|
17
|
-
end
|
18
|
-
|
19
|
-
def get( sr_ref )
|
20
|
-
if sr_ref && sr = service.get_record( sr_ref, 'SR' )
|
21
|
-
new(sr)
|
22
|
-
else
|
23
|
-
nil
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
|
7
|
-
class StorageRepository < Fog::Model
|
8
|
-
# API Reference here:
|
9
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=SR
|
10
|
-
|
11
|
-
identity :reference
|
12
|
-
|
13
|
-
attribute :name, :aliases => :name_label
|
14
|
-
attribute :description, :aliases => :name_description
|
15
|
-
attribute :uuid
|
16
|
-
attribute :blobs
|
17
|
-
attribute :allowed_operations
|
18
|
-
attribute :current_operations
|
19
|
-
attribute :introduced_by
|
20
|
-
attribute :local_cache_enabled
|
21
|
-
attribute :content_type
|
22
|
-
attribute :other_config
|
23
|
-
attribute :__pbds, :aliases => :PBDs
|
24
|
-
attribute :shared
|
25
|
-
attribute :type
|
26
|
-
attribute :tags
|
27
|
-
attribute :__vdis, :aliases => :VDIs
|
28
|
-
attribute :physical_size
|
29
|
-
attribute :physical_utilisation
|
30
|
-
attribute :sm_config
|
31
|
-
attribute :virtual_allocation
|
32
|
-
|
33
|
-
def vdis
|
34
|
-
__vdis.collect { |vdi| service.vdis.get vdi }
|
35
|
-
end
|
36
|
-
|
37
|
-
def pbds
|
38
|
-
__pbds.collect { |pbd| service.pbds.get pbd }
|
39
|
-
end
|
40
|
-
|
41
|
-
def scan
|
42
|
-
service.scan_sr reference
|
43
|
-
reload
|
44
|
-
end
|
45
|
-
|
46
|
-
def destroy
|
47
|
-
service.destroy_sr reference
|
48
|
-
end
|
49
|
-
|
50
|
-
def save
|
51
|
-
requires :name
|
52
|
-
requires :type
|
53
|
-
|
54
|
-
# host is not a model attribute (not in XAPI at least),
|
55
|
-
# but we need it here
|
56
|
-
host = attributes[:host]
|
57
|
-
raise ArgumentError.new('host is required for this operation') unless
|
58
|
-
host
|
59
|
-
|
60
|
-
# Not sure if this is always required, so not raising exception if nil
|
61
|
-
device_config = attributes[:device_config]
|
62
|
-
|
63
|
-
# create_sr request provides sane defaults if some attributes are
|
64
|
-
# missing
|
65
|
-
attr = service.get_record(
|
66
|
-
service.create_sr( host.reference,
|
67
|
-
name,
|
68
|
-
type,
|
69
|
-
description || '',
|
70
|
-
device_config || {},
|
71
|
-
physical_size || '0',
|
72
|
-
content_type || 'user',
|
73
|
-
shared || false,
|
74
|
-
sm_config || {}),
|
75
|
-
'SR'
|
76
|
-
)
|
77
|
-
merge_attributes attr
|
78
|
-
true
|
79
|
-
end
|
80
|
-
|
81
|
-
def set_attribute(name, *val)
|
82
|
-
data = service.set_attribute( 'SR', reference, name, *val )
|
83
|
-
# Do not reload automatically for performance reasons
|
84
|
-
# We can set multiple attributes at the same time and
|
85
|
-
# then reload manually
|
86
|
-
#reload
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
class Tunnel < Fog::Model
|
7
|
-
# API Reference here:
|
8
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=tunnel
|
9
|
-
|
10
|
-
identity :reference
|
11
|
-
|
12
|
-
attribute :access_pif, :aliases => :access_PIF
|
13
|
-
attribute :other_config
|
14
|
-
attribute :status
|
15
|
-
attribute :transport_pif, :aliases => :transport_PIF
|
16
|
-
attribute :uuid
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/tunnel'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
class Tunnels < Fog::Collection
|
8
|
-
model Fog::Compute::XenServer::Tunnel
|
9
|
-
|
10
|
-
def all(options={})
|
11
|
-
data = service.get_records 'tunnel'
|
12
|
-
load(data)
|
13
|
-
end
|
14
|
-
|
15
|
-
def get( tunnel_ref )
|
16
|
-
if tunnel_ref && tunnel = service.get_record( tunnel_ref, 'tunnel' )
|
17
|
-
new(tunnel)
|
18
|
-
else
|
19
|
-
nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
|
7
|
-
class VBD < Fog::Model
|
8
|
-
# API Reference here:
|
9
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VBD
|
10
|
-
|
11
|
-
identity :reference
|
12
|
-
|
13
|
-
attribute :uuid
|
14
|
-
attribute :currently_attached
|
15
|
-
attribute :allowed_operations
|
16
|
-
attribute :current_operations
|
17
|
-
attribute :__vdi, :aliases => :VDI
|
18
|
-
attribute :__vm, :aliases => :VM
|
19
|
-
attribute :device
|
20
|
-
attribute :status_detail
|
21
|
-
attribute :status_code
|
22
|
-
attribute :type
|
23
|
-
attribute :userdevice
|
24
|
-
attribute :empty
|
25
|
-
attribute :mode
|
26
|
-
attribute :other_config
|
27
|
-
attribute :storage_lock
|
28
|
-
attribute :runtime_properties
|
29
|
-
attribute :unpluggable
|
30
|
-
attribute :bootable
|
31
|
-
attribute :qos_supported_algorithms
|
32
|
-
attribute :qos_algorithm_params
|
33
|
-
attribute :qos_algorithm_type
|
34
|
-
attribute :qos_supported_algorithms
|
35
|
-
attribute :empty
|
36
|
-
attribute :__metrics, :aliases => :metrics
|
37
|
-
|
38
|
-
#
|
39
|
-
# May return nil
|
40
|
-
#
|
41
|
-
def vdi
|
42
|
-
service.vdis.get __vdi
|
43
|
-
end
|
44
|
-
|
45
|
-
#
|
46
|
-
# TODO: May it return nil?
|
47
|
-
#
|
48
|
-
def server
|
49
|
-
service.servers.get __vm
|
50
|
-
end
|
51
|
-
|
52
|
-
def save
|
53
|
-
requires :vdi, :server
|
54
|
-
ref = service.create_vbd attributes[:server], attributes[:vdi], attributes
|
55
|
-
merge_attributes service.vbds.get(ref).attributes
|
56
|
-
end
|
57
|
-
|
58
|
-
def unplug
|
59
|
-
service.unplug_vbd reference
|
60
|
-
end
|
61
|
-
|
62
|
-
def unplug_force
|
63
|
-
service.unplug_force_vbd reference
|
64
|
-
end
|
65
|
-
|
66
|
-
def eject
|
67
|
-
service.eject_vbd reference
|
68
|
-
end
|
69
|
-
|
70
|
-
def insert(vdi)
|
71
|
-
service.insert_vbd reference, vdi.reference
|
72
|
-
end
|
73
|
-
|
74
|
-
#
|
75
|
-
# return nil if the VBD is not attached
|
76
|
-
#
|
77
|
-
# TODO: Confirm that the VBD_metrics handle is invalid
|
78
|
-
# when the VBD is NOT attached. I get a HANDLE_INVALID
|
79
|
-
# exception in that case.
|
80
|
-
#
|
81
|
-
def metrics
|
82
|
-
return nil unless currently_attached
|
83
|
-
rec = service.get_record( __metrics, 'VBD_metrics' )
|
84
|
-
Fog::Compute::XenServer::VbdMetrics.new(rec)
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
|
7
|
-
class VbdMetrics < Fog::Model
|
8
|
-
# API Reference here:
|
9
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VBD_metrics
|
10
|
-
|
11
|
-
identity :reference
|
12
|
-
|
13
|
-
attribute :uuid
|
14
|
-
attribute :last_updated
|
15
|
-
attribute :other_config
|
16
|
-
attribute :io_read_kbs
|
17
|
-
attribute :io_write_kbs
|
18
|
-
|
19
|
-
def initialize(attributes = {})
|
20
|
-
super
|
21
|
-
self.last_updated = attributes[:last_updated].to_time
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'fog/core/collection'
|
2
|
-
require 'fog/xenserver/models/compute/vbd'
|
3
|
-
|
4
|
-
module Fog
|
5
|
-
module Compute
|
6
|
-
class XenServer
|
7
|
-
|
8
|
-
class Vbds < Fog::Collection
|
9
|
-
|
10
|
-
model Fog::Compute::XenServer::VBD
|
11
|
-
|
12
|
-
def initialize(attributes)
|
13
|
-
super
|
14
|
-
end
|
15
|
-
|
16
|
-
def all(options = {})
|
17
|
-
data = service.get_records 'VBD'
|
18
|
-
load(data)
|
19
|
-
end
|
20
|
-
|
21
|
-
def get( vbd_ref )
|
22
|
-
if vbd_ref && vbd = service.get_record( vbd_ref, 'VBD' )
|
23
|
-
new(vbd)
|
24
|
-
end
|
25
|
-
rescue Fog::XenServer::NotFound
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,105 +0,0 @@
|
|
1
|
-
require 'fog/core/model'
|
2
|
-
|
3
|
-
module Fog
|
4
|
-
module Compute
|
5
|
-
class XenServer
|
6
|
-
|
7
|
-
class VDI < Fog::Model
|
8
|
-
# API Reference here:
|
9
|
-
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VDI
|
10
|
-
|
11
|
-
identity :reference
|
12
|
-
|
13
|
-
attribute :uuid
|
14
|
-
attribute :is_a_snapshot
|
15
|
-
attribute :name, :aliases => :name_label
|
16
|
-
attribute :description, :aliases => :name_description
|
17
|
-
attribute :__parent, :aliases => :parent
|
18
|
-
attribute :virtual_size
|
19
|
-
attribute :__vbds, :aliases => :VBDs
|
20
|
-
attribute :__sr, :aliases => :SR
|
21
|
-
attribute :sharable
|
22
|
-
attribute :read_only
|
23
|
-
attribute :current_operations
|
24
|
-
attribute :allowed_operations
|
25
|
-
attribute :__crash_dumps, :aliases => :crash_dumps
|
26
|
-
attribute :type
|
27
|
-
attribute :other_config
|
28
|
-
attribute :tags
|
29
|
-
attribute :storage_lock
|
30
|
-
attribute :physical_utilisation
|
31
|
-
attribute :missing
|
32
|
-
attribute :location
|
33
|
-
attribute :managed
|
34
|
-
attribute :metadata_latest
|
35
|
-
attribute :metadata_of_pool
|
36
|
-
attribute :allow_caching
|
37
|
-
attribute :on_boot
|
38
|
-
attribute :sm_config
|
39
|
-
attribute :snapshot_time
|
40
|
-
attribute :__snapshots, :aliases => :snapshots
|
41
|
-
attribute :__snapshot_of, :aliases => :snapshot_of
|
42
|
-
attribute :xenstore_data
|
43
|
-
|
44
|
-
#
|
45
|
-
# Default VDI type is system
|
46
|
-
# Default size 8GB
|
47
|
-
# Sharable is false by default
|
48
|
-
# read_only is false by default
|
49
|
-
#
|
50
|
-
def initialize(attributes = {})
|
51
|
-
self.virtual_size ||= '8589934592' unless attributes[:virtual_size]
|
52
|
-
self.type ||= 'system' unless attributes[:type]
|
53
|
-
self.read_only ||= false unless attributes[:read_only]
|
54
|
-
self.sharable ||= false unless attributes[:sharable]
|
55
|
-
self.other_config ||= {} unless attributes[:other_config]
|
56
|
-
super
|
57
|
-
end
|
58
|
-
|
59
|
-
def set_attribute(name, *val)
|
60
|
-
data = service.set_attribute( 'VDI', reference, name, *val )
|
61
|
-
end
|
62
|
-
|
63
|
-
def snapshot_of
|
64
|
-
service.vdis.get __sr
|
65
|
-
end
|
66
|
-
|
67
|
-
def parent
|
68
|
-
service.vdis.get __parent
|
69
|
-
end
|
70
|
-
|
71
|
-
def snapshots
|
72
|
-
__snapshots.collect do |ref|
|
73
|
-
service.vdis.get ref
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def vbds
|
78
|
-
__vbds.collect do |ref|
|
79
|
-
service.vbds.get ref
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def save
|
84
|
-
requires :name, :storage_repository
|
85
|
-
ref = service.create_vdi attributes
|
86
|
-
merge_attributes service.vdis.get(ref).attributes
|
87
|
-
end
|
88
|
-
|
89
|
-
def destroy
|
90
|
-
service.destroy_vdi reference
|
91
|
-
end
|
92
|
-
|
93
|
-
def storage_repository
|
94
|
-
service.storage_repositories.get __sr
|
95
|
-
end
|
96
|
-
|
97
|
-
def sr
|
98
|
-
storage_repository
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|