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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +20 -0
  3. data/.rubocop_todo.yml +43 -0
  4. data/.travis.yml +3 -1
  5. data/Gemfile +1 -1
  6. data/Rakefile +15 -5
  7. data/fog-ovirt.gemspec +15 -14
  8. data/lib/fog/bin/ovirt.rb +1 -1
  9. data/lib/fog/ovirt.rb +1 -1
  10. data/lib/fog/ovirt/compute.rb +56 -112
  11. data/lib/fog/ovirt/compute/v3.rb +137 -0
  12. data/lib/fog/ovirt/core.rb +13 -4
  13. data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
  14. data/lib/fog/ovirt/models/compute/affinity_groups.rb +2 -2
  15. data/lib/fog/ovirt/models/compute/clusters.rb +2 -2
  16. data/lib/fog/ovirt/models/compute/instance_types.rb +2 -2
  17. data/lib/fog/ovirt/models/compute/interfaces.rb +7 -5
  18. data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
  19. data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
  20. data/lib/fog/ovirt/models/compute/server.rb +37 -31
  21. data/lib/fog/ovirt/models/compute/servers.rb +2 -2
  22. data/lib/fog/ovirt/models/compute/template.rb +9 -9
  23. data/lib/fog/ovirt/models/compute/templates.rb +2 -2
  24. data/lib/fog/ovirt/models/compute/volume.rb +3 -3
  25. data/lib/fog/ovirt/models/compute/volumes.rb +6 -4
  26. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +23 -0
  27. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +22 -0
  28. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +23 -0
  29. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +23 -0
  30. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +24 -0
  31. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +20 -0
  32. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +20 -0
  33. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +22 -0
  34. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +24 -0
  35. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +21 -0
  36. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +24 -0
  37. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +21 -0
  38. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +24 -0
  39. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +24 -0
  40. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +20 -0
  41. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +18 -0
  42. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +19 -0
  43. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +19 -0
  44. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +19 -0
  45. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +19 -0
  46. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +19 -0
  47. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +24 -0
  48. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +22 -0
  49. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +21 -0
  50. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +21 -0
  51. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +18 -0
  52. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +21 -0
  53. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +21 -0
  54. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +21 -0
  55. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +21 -0
  56. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +21 -0
  57. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +21 -0
  58. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +21 -0
  59. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +21 -0
  60. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +21 -0
  61. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup.xml +0 -0
  62. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup_vms.xml +0 -0
  63. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroups.xml +0 -0
  64. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/cluster.xml +0 -0
  65. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/clusters.xml +0 -0
  66. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/data_centers.xml +0 -0
  67. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/disks.xml +0 -0
  68. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_type.xml +0 -0
  69. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_types.xml +0 -0
  70. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/nics.xml +0 -0
  71. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/operating_systems.xml +0 -0
  72. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/quotas.xml +0 -0
  73. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/storage_domains.xml +0 -0
  74. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/template.xml +0 -0
  75. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/templates.xml +0 -0
  76. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vm.xml +0 -0
  77. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vms.xml +0 -0
  78. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/volumes.xml +0 -0
  79. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +23 -0
  80. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +22 -0
  81. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +36 -0
  82. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +20 -0
  83. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +37 -0
  84. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +24 -0
  85. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +21 -0
  86. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +19 -0
  87. data/lib/fog/ovirt/version.rb +1 -1
  88. data/tests/helper.rb +1 -1
  89. data/tests/helpers/mock_helper.rb +4 -6
  90. data/tests/helpers/succeeds_helper.rb +1 -1
  91. data/tests/ovirt/compute_tests.rb +5 -6
  92. data/tests/ovirt/models/compute/cluster_tests.rb +10 -13
  93. data/tests/ovirt/models/compute/clusters_tests.rb +3 -5
  94. data/tests/ovirt/models/compute/interface_tests.rb +9 -11
  95. data/tests/ovirt/models/compute/interfaces_tests.rb +3 -5
  96. data/tests/ovirt/models/compute/operating_system_tests.rb +7 -13
  97. data/tests/ovirt/models/compute/operating_systems_tests.rb +4 -6
  98. data/tests/ovirt/models/compute/server_tests.rb +29 -32
  99. data/tests/ovirt/models/compute/servers_tests.rb +7 -9
  100. data/tests/ovirt/models/compute/template_tests.rb +10 -12
  101. data/tests/ovirt/models/compute/templates_tests.rb +3 -5
  102. data/tests/ovirt/requests/compute/client_tests.rb +31 -0
  103. data/tests/ovirt/requests/compute/create_vm_tests.rb +7 -16
  104. data/tests/ovirt/requests/compute/destroy_vm_tests.rb +8 -10
  105. data/tests/ovirt/requests/compute/list_datacenters_tests.rb +3 -5
  106. data/tests/ovirt/requests/compute/list_quotas_tests.rb +2 -4
  107. data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +3 -5
  108. data/tests/ovirt/requests/compute/update_vm_tests.rb +9 -11
  109. data/tests/ovirt/requests/compute/update_volume_tests.rb +9 -12
  110. metadata +70 -65
  111. data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
  112. data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
  113. data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
  114. data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
  115. data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
  116. data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
  117. data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
  118. data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
  119. data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
  120. data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
  121. data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
  122. data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
  123. data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
  124. data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
  125. data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
  126. data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
  127. data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
  128. data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
  129. data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
  130. data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
  131. data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
  132. data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
  133. data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
  134. data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
  135. data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
  136. data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
  137. data/lib/fog/ovirt/requests/compute/list_operating_systems.rb +0 -19
  138. data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
  139. data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
  140. data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
  141. data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
  142. data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
  143. data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
  144. data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
  145. data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
  146. data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
  147. data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
  148. data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
  149. data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
  150. data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
  151. data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
  152. data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
  153. data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
@@ -1,22 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_affinity_group_vms(id)
6
- client.affinity_group_vms(id).map {|vm| servers.get(vm.id)}
7
- end
8
- end
9
-
10
- class Mock
11
- def list_affinity_group_vms(id)
12
- vms = []
13
- Nokogiri::XML(read_xml('affinitygroup_vms.xml')).xpath('/vms/vm/@id').each do |id|
14
- xml = Nokogiri::XML(read_xml('vms.xml')).xpath("/vms/vm[@id='%s']" % id.value).first
15
- vms << ovirt_attrs(OVIRT::VM::new(self, xml))
16
- end
17
- vms
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,20 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_affinity_groups(filters = {})
6
- client.affinity_groups(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
-
10
- class Mock
11
- def list_affinity_groups(filters = {})
12
- xml = read_xml('affinitygroups.xml')
13
- Nokogiri::XML(xml).xpath('/affinity_groups/affinity_group').map do |ag|
14
- ovirt_attrs OVIRT::AffinityGroup::new(self, ag)
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_clusters(filters = {})
6
- client.clusters(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_clusters(filters = {})
11
- xml = read_xml 'clusters.xml'
12
- Nokogiri::XML(xml).xpath('/clusters/cluster').map do |cl|
13
- ovirt_attrs OVIRT::Cluster::new(self, cl)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_instance_types(filters = {})
6
- client.instance_types(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_instance_types(filters = {})
11
- xml = read_xml 'instance_types.xml'
12
- Nokogiri::XML(xml).xpath('/instance_types/instance_type').map do |t|
13
- ovirt_attrs OVIRT::InstanceType::new(self, t)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,16 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_networks(cluster_id)
6
- client.networks(:cluster_id => cluster_id)
7
- end
8
- end
9
- class Mock
10
- def list_networks(cluster_id)
11
- []
12
- end
13
- end
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_operating_systems
6
- client.operating_systems.map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_operating_systems
11
- xml = read_xml 'operating_systems.xml'
12
- Nokogiri::XML(xml).xpath('/operating_systems/operating_system').map do |os|
13
- ovirt_attrs OVIRT::OperatingSystem::new(self, os)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_quotas(filters = {})
6
- client.quotas(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_quotas(filters = {})
11
- xml = read_xml 'quotas.xml'
12
- Nokogiri::XML(xml).xpath('/quotas/quota').map do |q|
13
- ovirt_attrs OVIRT::Quotas::new(self, q)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_template_interfaces(vm_id)
6
- client.template_interfaces(vm_id).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_template_interfaces(vm_id)
11
- xml = read_xml 'nics.xml'
12
- Nokogiri::XML(xml).xpath('/nics/nic').map do |nic|
13
- ovirt_attrs OVIRT::Interface::new(self, nic)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_template_volumes(template_id)
6
- client.template_volumes(template_id).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_template_volumes(template_id)
11
- xml = read_xml 'volumes.xml'
12
- Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
13
- ovirt_attrs OVIRT::Volume::new(self, vol)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_templates(filters = {})
6
- client.templates(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_templates(filters = {})
11
- xml = read_xml 'templates.xml'
12
- Nokogiri::XML(xml).xpath('/templates/template').map do |t|
13
- ovirt_attrs OVIRT::Template::new(self, t)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_virtual_machines(filters = {})
6
- client.vms(filters).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_virtual_machines(filters = {})
11
- xml = read_xml 'vms.xml'
12
- Nokogiri::XML(xml).xpath('/vms/vm').map do |vm|
13
- ovirt_attrs OVIRT::VM::new(self, vm)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_vm_interfaces(vm_id)
6
- client.vm_interfaces(vm_id).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_vm_interfaces(vm_id)
11
- xml = read_xml 'nics.xml'
12
- Nokogiri::XML(xml).xpath('/nics/nic').map do |nic|
13
- ovirt_attrs OVIRT::Interface::new(self, nic)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_vm_volumes(vm_id)
6
- client.vm_volumes(vm_id).map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_vm_volumes(vm_id)
11
- xml = read_xml 'volumes.xml'
12
- Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
13
- ovirt_attrs OVIRT::Volume::new(self, vol)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def list_volumes
6
- client.disks.map {|ovirt_obj| ovirt_attrs ovirt_obj}
7
- end
8
- end
9
- class Mock
10
- def list_volumes
11
- xml = read_xml 'disks.xml'
12
- Nokogiri::XML(xml).xpath('/disks/disk').map do |vol|
13
- ovirt_attrs OVIRT::Volume::new(self, vol)
14
- end
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,21 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def remove_from_affinity_group(id, options = {})
6
- raise ArgumentError, "instance id is a required parameter" unless id
7
- raise ArgumentError, "affinity group id is a required parameter for remove-from-affinity-group" unless options.key? :id
8
- client.delete_vm_from_affinity_group(options[:id], id)
9
- end
10
- end
11
-
12
- class Mock
13
- def remove_from_affinity_group(id, options = {})
14
- raise ArgumentError, "instance id is a required parameter" unless id
15
- raise ArgumentError, "affinity group id is a required parameter for remove-from-affinity-group" unless options.key? :id
16
- true
17
- end
18
- end
19
- end
20
- end
21
- end
@@ -1,20 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def storage_domains filter={}
6
- client.storagedomains(filter)
7
- end
8
- end
9
-
10
- class Mock
11
- def storage_domains(filters = {})
12
- xml = read_xml 'storage_domains.xml'
13
- Nokogiri::XML(xml).xpath('/storage_domains/storage_domain').map do |sd|
14
- OVIRT::StorageDomain::new(self, sd)
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,35 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
-
5
- module Shared
6
- def check_arguments(id, options)
7
- raise ArgumentError, "instance id is a required parameter" unless id
8
- raise ArgumentError, "interface id is a required parameter for update-interface" unless options.key? :id
9
- end
10
- end
11
-
12
- class Real
13
- extend ::Fog::Compute::Ovirt::Shared
14
-
15
- def update_interface(id, options)
16
- check_arguments(id, options)
17
-
18
- interface_id = options[:id]
19
- options.delete(:id)
20
-
21
- client.update_interface(id, interface_id, options)
22
- end
23
- end
24
-
25
- class Mock
26
- extend ::Fog::Compute::Ovirt::Shared
27
-
28
- def update_interface(id, options)
29
- check_arguments(id, options)
30
- true
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,18 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def update_vm(attrs)
6
- client.update_vm(attrs)
7
- end
8
- end
9
-
10
- class Mock
11
- def update_vm(attrs)
12
- xml = read_xml('vm.xml')
13
- OVIRT::VM::new(self, Nokogiri::XML(xml).root)
14
- end
15
- end
16
- end
17
- end
18
- end
@@ -1,39 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
-
5
- module Shared
6
- def check_arguments(id, options)
7
- raise ArgumentError, "instance id is a required parameter" unless id
8
- raise ArgumentError, "disk id is a required parameter for update-volume" unless options.has_key? :id
9
- end
10
- end
11
-
12
-
13
- class Real
14
- extend ::Fog::Compute::Ovirt::Shared
15
-
16
- def update_volume(id, options)
17
- check_arguments(id, options)
18
-
19
- disk_id = options[:id]
20
- options.delete(:id)
21
-
22
- client.update_volume(id, disk_id, options)
23
- true # If we come here, expect success and return true
24
- end
25
-
26
- end
27
-
28
- class Mock
29
- extend ::Fog::Compute::Ovirt::Shared
30
-
31
- def update_volume(id, options)
32
- check_arguments(id, options)
33
- true
34
- end
35
- end
36
-
37
- end
38
- end
39
- end
@@ -1,22 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Ovirt
4
- class Real
5
- def vm_action(options = {})
6
- raise ArgumentError, "instance id is a required parameter" unless options.key? :id
7
- raise ArgumentError, "action is a required parameter" unless options.key? :action
8
-
9
- client.vm_action options[:id], options[:action]
10
- end
11
- end
12
-
13
- class Mock
14
- def vm_action(options = {})
15
- raise ArgumentError, "id is a required parameter" unless options.key? :id
16
- raise ArgumentError, "action is a required parameter" unless options.key? :action
17
- true
18
- end
19
- end
20
- end
21
- end
22
- end