fog-ovirt 0.1.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +20 -0
- data/.rubocop_todo.yml +43 -0
- data/.travis.yml +3 -1
- data/Gemfile +1 -1
- data/Rakefile +15 -5
- data/fog-ovirt.gemspec +15 -14
- data/lib/fog/bin/ovirt.rb +1 -1
- data/lib/fog/ovirt.rb +1 -1
- data/lib/fog/ovirt/compute.rb +56 -112
- data/lib/fog/ovirt/compute/v3.rb +137 -0
- data/lib/fog/ovirt/core.rb +13 -4
- data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +2 -2
- data/lib/fog/ovirt/models/compute/clusters.rb +2 -2
- data/lib/fog/ovirt/models/compute/instance_types.rb +2 -2
- data/lib/fog/ovirt/models/compute/interfaces.rb +7 -5
- data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
- data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
- data/lib/fog/ovirt/models/compute/server.rb +37 -31
- data/lib/fog/ovirt/models/compute/servers.rb +2 -2
- data/lib/fog/ovirt/models/compute/template.rb +9 -9
- data/lib/fog/ovirt/models/compute/templates.rb +2 -2
- data/lib/fog/ovirt/models/compute/volume.rb +3 -3
- data/lib/fog/ovirt/models/compute/volumes.rb +6 -4
- data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +18 -0
- data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_template.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +19 -0
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +18 -0
- data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +21 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup_vms.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroups.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/cluster.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/clusters.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/data_centers.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/disks.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_type.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_types.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/nics.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/operating_systems.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/quotas.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/storage_domains.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/template.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/templates.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vm.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vms.xml +0 -0
- data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/volumes.xml +0 -0
- data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +23 -0
- data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +22 -0
- data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +36 -0
- data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +20 -0
- data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +37 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +24 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +21 -0
- data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +19 -0
- data/lib/fog/ovirt/version.rb +1 -1
- data/tests/helper.rb +1 -1
- data/tests/helpers/mock_helper.rb +4 -6
- data/tests/helpers/succeeds_helper.rb +1 -1
- data/tests/ovirt/compute_tests.rb +5 -6
- data/tests/ovirt/models/compute/cluster_tests.rb +10 -13
- data/tests/ovirt/models/compute/clusters_tests.rb +3 -5
- data/tests/ovirt/models/compute/interface_tests.rb +9 -11
- data/tests/ovirt/models/compute/interfaces_tests.rb +3 -5
- data/tests/ovirt/models/compute/operating_system_tests.rb +7 -13
- data/tests/ovirt/models/compute/operating_systems_tests.rb +4 -6
- data/tests/ovirt/models/compute/server_tests.rb +29 -32
- data/tests/ovirt/models/compute/servers_tests.rb +7 -9
- data/tests/ovirt/models/compute/template_tests.rb +10 -12
- data/tests/ovirt/models/compute/templates_tests.rb +3 -5
- data/tests/ovirt/requests/compute/client_tests.rb +31 -0
- data/tests/ovirt/requests/compute/create_vm_tests.rb +7 -16
- data/tests/ovirt/requests/compute/destroy_vm_tests.rb +8 -10
- data/tests/ovirt/requests/compute/list_datacenters_tests.rb +3 -5
- data/tests/ovirt/requests/compute/list_quotas_tests.rb +2 -4
- data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +3 -5
- data/tests/ovirt/requests/compute/update_vm_tests.rb +9 -11
- data/tests/ovirt/requests/compute/update_volume_tests.rb +9 -12
- metadata +70 -65
- data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
- data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
- data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
- data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
- data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
- data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
- data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
- data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
- data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
- data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
- data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
- data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
- data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
- data/lib/fog/ovirt/requests/compute/list_operating_systems.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
- data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
- data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
- data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
- data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
- data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
- data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
- data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def add_interface(id, options = {})
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
|
9
|
+
client.add_interface(id, options)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Mock
|
14
|
+
def add_interface(id, _options = {})
|
15
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def add_to_affinity_group(id, options = {})
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "affinity group id is a required parameter for add-to-affinity-group" unless options.key? :id
|
9
|
+
client.add_vm_to_affinity_group(options[:id], id)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Mock
|
14
|
+
def add_to_affinity_group(id, options = {})
|
15
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
16
|
+
raise ArgumentError, "affinity group id is a required parameter for add-to-affinity-group" unless options.key? :id
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
DISK_SIZE_TO_GB = 1_073_741_824
|
7
|
+
def add_volume(id, options = {})
|
8
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
9
|
+
options[:size] = options[:size_gb].to_i * DISK_SIZE_TO_GB if options[:size_gb]
|
10
|
+
client.add_volume(id, options)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def add_volume(id, _options = {})
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def attach_volume(id, options)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "volume id is a required parameter for attach-volume" unless options.key? :id
|
9
|
+
|
10
|
+
client.attach_volume(id, options[:id])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def attach_volume(id, options)
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
raise ArgumentError, "volume id is a required parameter for attach-volume" unless options.key? :id
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def create_affinity_group(attrs)
|
7
|
+
client.create_affinity_group(attrs)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Mock
|
12
|
+
def create_affinity_group(_attrs)
|
13
|
+
xml = read_xml("affinitygroup.xml")
|
14
|
+
OVIRT::AffinityGroup.new(self, Nokogiri::XML(xml).root)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def create_vm(attrs)
|
7
|
+
client.create_vm(attrs)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Mock
|
12
|
+
def create_vm(_attrs)
|
13
|
+
xml = read_xml("vm.xml")
|
14
|
+
OVIRT::VM.new(self, Nokogiri::XML(xml).root)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def datacenters(filter = {})
|
7
|
+
client.datacenters(filter).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Mock
|
12
|
+
def datacenters(_filters = {})
|
13
|
+
xml = read_xml "data_centers.xml"
|
14
|
+
Nokogiri::XML(xml).xpath("/data_centers/data_center").map do |dc|
|
15
|
+
ovirt_attrs OVIRT::DataCenter.new(self, dc)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def deactivate_volume(id, options)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "volume id is a required parameter for deactivate-volume" unless options.key? :id
|
9
|
+
|
10
|
+
client.deactivate_volume(id, options[:id])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def deactivate_volume(id, options)
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
raise ArgumentError, "volume id is a required parameter for deactivate-volume" unless options.key? :id
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def destroy_affinity_group(id)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
client.destroy_affinity_group(id)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Mock
|
13
|
+
def destroy_affinity_group(id)
|
14
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
15
|
+
true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def destroy_interface(id, options)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "interface id is a required parameter for destroy-interface" unless options.key? :id
|
9
|
+
|
10
|
+
client.destroy_interface(id, options[:id])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def destroy_interface(id, options)
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
raise ArgumentError, "interface id is a required parameter for destroy-interface" unless options.key? :id
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def destroy_vm(options = {})
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
|
8
|
+
client.destroy_vm(options[:id])
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Mock
|
13
|
+
def destroy_vm(options = {})
|
14
|
+
raise ArgumentError, "instance id is a required parameter" unless options.key? :id
|
15
|
+
true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def destroy_volume(id, options)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "volume id is a required parameter for destroy-volume" unless options.key? :id
|
9
|
+
|
10
|
+
client.destroy_volume(id, options[:id])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def destroy_volume(id, options)
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
raise ArgumentError, "volume id is a required parameter for destroy-volume" unless options.key? :id
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def detach_volume(id, options)
|
7
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
+
raise ArgumentError, "volume id is a required parameter for detach-volume" unless options.key? :id
|
9
|
+
|
10
|
+
client.detach_volume(id, options[:id])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mock
|
15
|
+
def detach_volume(id, options)
|
16
|
+
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
+
raise ArgumentError, "volume id is a required parameter for detach-volume" unless options.key? :id
|
18
|
+
true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_affinity_group(id)
|
7
|
+
ovirt_attrs client.affinity_group(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Mock
|
12
|
+
def get_affinity_group(_id)
|
13
|
+
xml = read_xml("affinitygroup.xml")
|
14
|
+
ovirt_attrs OVIRT::AffinityGroup.new(self, Nokogiri::XML(xml).root)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_cluster(id)
|
7
|
+
ovirt_attrs client.cluster(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_cluster(_id)
|
12
|
+
xml = read_xml("cluster.xml")
|
13
|
+
ovirt_attrs OVIRT::Cluster.new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_instance_type(id)
|
7
|
+
ovirt_attrs client.instance_type(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_instance_type(_id)
|
12
|
+
xml = read_xml "instance_type.xml"
|
13
|
+
ovirt_attrs OVIRT::InstanceType.new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_quota(id)
|
7
|
+
ovirt_attrs client.quota(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_quota(_id)
|
12
|
+
xml = read_xml("quota.xml")
|
13
|
+
ovirt_attrs OVIRT::Quota.new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_template(id)
|
7
|
+
ovirt_attrs client.template(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_template(_id)
|
12
|
+
xml = read_xml "template.xml"
|
13
|
+
ovirt_attrs OVIRT::Template.new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class Ovirt
|
4
|
+
class V3
|
5
|
+
class Real
|
6
|
+
def get_virtual_machine(id)
|
7
|
+
ovirt_attrs client.vm(id)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
class Mock
|
11
|
+
def get_virtual_machine(_id)
|
12
|
+
xml = read_xml "vm.xml"
|
13
|
+
ovirt_attrs OVIRT::VM.new(self, Nokogiri::XML(xml).root)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|