fog-ovirt 1.2.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -0
  3. data/.rubocop_todo.yml +17 -5
  4. data/Gemfile +0 -1
  5. data/Gemfile.local.rb +0 -0
  6. data/README.md +2 -6
  7. data/Rakefile +2 -8
  8. data/fog-ovirt.gemspec +3 -2
  9. data/lib/fog/ovirt/compute.rb +5 -29
  10. data/lib/fog/ovirt/compute/v4.rb +42 -24
  11. data/lib/fog/ovirt/models/compute/instance_type.rb +1 -0
  12. data/lib/fog/ovirt/models/compute/interfaces.rb +0 -2
  13. data/lib/fog/ovirt/models/compute/server.rb +0 -2
  14. data/lib/fog/ovirt/models/compute/volume.rb +1 -0
  15. data/lib/fog/ovirt/models/compute/volumes.rb +0 -2
  16. data/lib/fog/ovirt/requests/compute/v4/add_interface.rb +0 -2
  17. data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +2 -2
  18. data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +4 -4
  19. data/lib/fog/ovirt/requests/compute/v4/get_volume.rb +19 -0
  20. data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +0 -2
  21. data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +0 -2
  22. data/lib/fog/ovirt/requests/compute/v4/mock_files/disk.xml +28 -0
  23. data/lib/fog/ovirt/requests/compute/v4/mock_files/operating_systems.xml +4 -4
  24. data/lib/fog/ovirt/requests/compute/v4/mock_files/template.xml +48 -45
  25. data/lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml +17 -2
  26. data/lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml +10 -0
  27. data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +1 -0
  28. data/lib/fog/ovirt/requests/compute/v4/update_vm.rb +0 -2
  29. data/lib/fog/ovirt/version.rb +1 -1
  30. data/tests/ovirt/models/compute/instance_type_tests.rb +23 -0
  31. data/tests/ovirt/models/compute/instance_types_tests.rb +7 -0
  32. data/tests/ovirt/requests/compute/v4/client_tests.rb +1 -1
  33. data/tests/ovirt/requests/compute/v4/create_vm_tests.rb +1 -0
  34. metadata +28 -84
  35. data/lib/fog/ovirt/compute/v3.rb +0 -137
  36. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +0 -23
  37. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +0 -22
  38. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +0 -23
  39. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +0 -23
  40. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +0 -24
  41. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +0 -20
  42. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +0 -20
  43. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +0 -22
  44. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +0 -24
  45. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +0 -21
  46. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +0 -24
  47. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +0 -21
  48. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +0 -24
  49. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +0 -24
  50. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +0 -20
  51. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +0 -18
  52. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +0 -19
  53. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +0 -19
  54. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +0 -19
  55. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +0 -19
  56. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +0 -19
  57. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +0 -24
  58. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +0 -22
  59. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +0 -21
  60. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +0 -21
  61. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +0 -18
  62. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +0 -21
  63. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +0 -21
  64. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +0 -21
  65. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +0 -21
  66. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +0 -21
  67. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +0 -21
  68. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +0 -21
  69. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +0 -21
  70. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +0 -21
  71. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml +0 -8
  72. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml +0 -9
  73. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml +0 -17
  74. data/lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml +0 -20
  75. data/lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml +0 -39
  76. data/lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml +0 -17
  77. data/lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml +0 -58
  78. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml +0 -42
  79. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml +0 -197
  80. data/lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml +0 -10
  81. data/lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml +0 -10
  82. data/lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml +0 -7
  83. data/lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml +0 -36
  84. data/lib/fog/ovirt/requests/compute/v3/mock_files/template.xml +0 -39
  85. data/lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml +0 -110
  86. data/lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml +0 -52
  87. data/lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml +0 -152
  88. data/lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml +0 -40
  89. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +0 -23
  90. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +0 -22
  91. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +0 -36
  92. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +0 -20
  93. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +0 -37
  94. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +0 -24
  95. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +0 -21
  96. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +0 -19
  97. data/tests/ovirt/requests/compute/v3/client_tests.rb +0 -31
  98. data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +0 -17
  99. data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +0 -14
  100. data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +0 -11
  101. data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +0 -10
  102. data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +0 -11
  103. data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +0 -14
  104. data/tests/ovirt/requests/compute/v3/update_volume_tests.rb +0 -15
@@ -13,7 +13,7 @@ module Fog
13
13
  disk_attachments_service.add(disk)
14
14
  end
15
15
 
16
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
16
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
17
17
  def add_options_defaults(options)
18
18
  options = options.dup
19
19
  options = convert_string_to_bool(options)
@@ -35,7 +35,7 @@ module Fog
35
35
  options[:disk][:wipe_after_delete] = options.delete(:wipe_after_delete) if options[:disk][:wipe_after_delete].nil?
36
36
  options
37
37
  end
38
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
38
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
39
39
  end
40
40
 
41
41
  class Mock
@@ -21,7 +21,7 @@ module Fog
21
21
  opts.delete(:disks)
22
22
  end
23
23
 
24
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
24
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
25
25
  def create_vm(attrs)
26
26
  attrs = attrs.dup
27
27
  attrs = convert_string_to_bool(attrs)
@@ -40,6 +40,8 @@ module Fog
40
40
  end
41
41
 
42
42
  vms_service = client.system_service.vms_service
43
+
44
+ attrs[:type] = attrs.fetch(:type, OvirtSDK4::VmType::SERVER)
43
45
  attrs[:instance_type] = attrs[:instance_type].present? ? client.system_service.instance_types_service.instance_type_service(attrs[:instance_type]).get : nil
44
46
 
45
47
  if attrs[:template].present?
@@ -63,9 +65,8 @@ module Fog
63
65
  new_vm = OvirtSDK4::Vm.new(attrs)
64
66
  vms_service.add(new_vm, :clone => attrs[:clone])
65
67
  end
66
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
68
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
67
69
 
68
- # rubocop:disable Metrics/AbcSize
69
70
  def update_os_attrs(attrs)
70
71
  attrs[:os] ||= {}
71
72
  attrs[:os][:type] ||= "Other OS"
@@ -74,7 +75,6 @@ module Fog
74
75
 
75
76
  attrs[:os] = OvirtSDK4::OperatingSystem.new(:type => attrs[:os][:type], :boot => OvirtSDK4::Boot.new(:devices => attrs[:os][:boot]))
76
77
  end
77
- # rubocop:enable Metrics/AbcSize
78
78
  end
79
79
 
80
80
  class Mock
@@ -0,0 +1,19 @@
1
+ module Fog
2
+ module Ovirt
3
+ class Compute
4
+ class V4
5
+ class Real
6
+ def get_volume(id)
7
+ ovirt_attrs client.system_service.disks_service.disk_service(id).get
8
+ end
9
+ end
10
+ class Mock
11
+ def get_volume(_id)
12
+ xml = read_xml("disk.xml")
13
+ ovirt_attrs OvirtSDK4::Reader.read(Nokogiri::XML(xml).root.to_s)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -3,7 +3,6 @@ module Fog
3
3
  class Compute
4
4
  class V4
5
5
  class Real
6
- # rubocop:disable Metrics/AbcSize
7
6
  def list_template_volumes(template_id)
8
7
  template = client.system_service.templates_service.template_service(template_id).get
9
8
  attachments = client.follow_link(template.disk_attachments)
@@ -18,7 +17,6 @@ module Fog
18
17
  ovirt_attrs attachment_disk
19
18
  end
20
19
  end
21
- # rubocop:enable Metrics/AbcSize
22
20
  end
23
21
  class Mock
24
22
  def list_template_volumes(_template_id)
@@ -3,7 +3,6 @@ module Fog
3
3
  class Compute
4
4
  class V4
5
5
  class Real
6
- # rubocop:disable Metrics/AbcSize
7
6
  def list_vm_volumes(vm_id)
8
7
  vm = client.system_service.vms_service.vm_service(vm_id).get
9
8
  attachments = client.follow_link(vm.disk_attachments)
@@ -18,7 +17,6 @@ module Fog
18
17
  ovirt_attrs attachment_disk
19
18
  end
20
19
  end
21
- # rubocop:enable Metrics/AbcSize
22
20
  end
23
21
  class Mock
24
22
  def list_vm_volumes(_vm_id)
@@ -0,0 +1,28 @@
1
+ <disks>
2
+ <disk href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05" id="4d1abf9a-da81-4de2-bf20-f5f060018e05">
3
+ <actions>
4
+ <link href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05/export" rel="export"/>
5
+ <link href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05/move" rel="move"/>
6
+ <link href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05/copy" rel="copy"/>
7
+ </actions>
8
+ <name>Disk 2</name>
9
+ <link href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05/permissions" rel="permissions"/>
10
+ <link href="/api/disks/4d1abf9a-da81-4de2-bf20-f5f060018e05/statistics" rel="statistics"/>
11
+ <alias>Disk 2</alias>
12
+ <image_id>d6034a90-39fa-46ee-888f-208a76f3baa4</image_id>
13
+ <storage_domains>
14
+ <storage_domain id="a23a4329-33b9-4246-a393-4f91071825b6"/>
15
+ </storage_domains>
16
+ <provisioned_size>4294967296</provisioned_size>
17
+ <actual_size>1073741824</actual_size>
18
+ <status>ok</status>
19
+ <interface>virtio</interface>
20
+ <format>cow</format>
21
+ <qcow_version>qcow2_v3</qcow_version>
22
+ <sparse>true</sparse>
23
+ <bootable>false</bootable>
24
+ <shareable>false</shareable>
25
+ <wipe_after_delete>false</wipe_after_delete>
26
+ <propagate_errors>false</propagate_errors>
27
+ </disk>
28
+ </disks>
@@ -1,10 +1,10 @@
1
1
  <operating_systems>
2
- <operating_system href="/ovirt-engine/api/v3/operatingsystems/b51fe06a-9483-49e0-9577-9779826e7e82" id="b51fe06a-9483-49e0-9577-9779826e7e82">
2
+ <operating_system href="/ovirt-engine/api/v4/operatingsystems/b51fe06a-9483-49e0-9577-9779826e7e82" id="b51fe06a-9483-49e0-9577-9779826e7e82">
3
3
  <name>other</name>
4
4
  <description>Other OS</description>
5
- <large_icon href="/ovirt-engine/api/v3/icons/124c94be-be96-4df8-b109-ebf5d3cbf72b"
5
+ <large_icon href="/ovirt-engine/api/v4/icons/124c94be-be96-4df8-b109-ebf5d3cbf72b"
6
6
  id="124c94be-be96-4df8-b109-ebf5d3cbf72b" />
7
- <small_icon href="/ovirt-engine/api/v3/icons/55c8d56e-2ff0-46ef-aa27-9161db22fe21"
7
+ <small_icon href="/ovirt-engine/api/v4/icons/55c8d56e-2ff0-46ef-aa27-9161db22fe21"
8
8
  id="55c8d56e-2ff0-46ef-aa27-9161db22fe21"/>
9
9
  </operating_system>
10
- </operating_systems>
10
+ </operating_systems>
@@ -1,45 +1,48 @@
1
- <templates>
2
- <template href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323" id="2a08ba05-f3b1-4e5a-ade9-496466a8b323">
3
- <name>hwp_small</name>
4
- <description>hardware profile small</description>
5
- <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/disks" rel="disks"/>
6
- <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/nics" rel="nics"/>
7
- <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/cdroms" rel="cdroms"/>
8
- <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/permissions" rel="permissions"/>
9
- <type>server</type>
10
- <status>ok</status>
11
- <memory>536870912</memory>
12
- <cpu>
13
- <topology>
14
- <cores>1</cores>
15
- <sockets>1</sockets>
16
- </topology>
17
- </cpu>
18
- <os>
19
- <type>unassigned</type>
20
- <boot>
21
- <devices>
22
- <device>network</device>
23
- </devices>
24
- </boot>
25
- <kernel/>
26
- <initrd/>
27
- <cmdline/>
28
- </os>
29
- <cluster href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95" id="99408929-82cf-4dc7-a532-9d998063fa95"/>
30
- <creation_time>2012-01-31T07:47:03.811Z</creation_time>
31
- <origin>rhev</origin>
32
- <high_availability>
33
- <enabled>false</enabled>
34
- <priority>1</priority>
35
- </high_availability>
36
- <display>
37
- <type>spice</type>
38
- <monitors>1</monitors>
39
- </display>
40
- <stateless>false</stateless>
41
- <usb>
42
- <enabled>true</enabled>
43
- </usb>
44
- </template>
45
- </templates>
1
+ <template href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323" id="2a08ba05-f3b1-4e5a-ade9-496466a8b323">
2
+ <name>hwp_small</name>
3
+ <description>hardware profile small</description>
4
+ <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/disks" rel="disks"/>
5
+ <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/nics" rel="nics"/>
6
+ <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/cdroms" rel="cdroms"/>
7
+ <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/permissions" rel="permissions"/>
8
+ <type>server</type>
9
+ <memory>536870912</memory>
10
+ <cpu>
11
+ <topology>
12
+ <cores>1</cores>
13
+ <sockets>1</sockets>
14
+ </topology>
15
+ </cpu>
16
+ <os>
17
+ <type>unassigned</type>
18
+ <boot>
19
+ <devices>
20
+ <device>network</device>
21
+ </devices>
22
+ </boot>
23
+ <kernel/>
24
+ <initrd/>
25
+ <cmdline/>
26
+ </os>
27
+ <cluster href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95" id="99408929-82cf-4dc7-a532-9d998063fa95"/>
28
+ <creation_time>2012-01-31T07:47:03.811Z</creation_time>
29
+ <origin>rhev</origin>
30
+ <high_availability>
31
+ <enabled>false</enabled>
32
+ <priority>1</priority>
33
+ </high_availability>
34
+ <display>
35
+ <type>spice</type>
36
+ <monitors>1</monitors>
37
+ </display>
38
+ <stateless>false</stateless>
39
+ <usb>
40
+ <enabled>true</enabled>
41
+ </usb>
42
+ <status>ok</status>
43
+ <version>
44
+ <version_name>base version</version_name>
45
+ <version_number>1</version_number>
46
+ <base_template href="/ovirt-engine/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323" id="2a08ba05-f3b1-4e5a-ade9-496466a8b323"/>
47
+ </version>
48
+ </template>
@@ -8,6 +8,11 @@
8
8
  <link href="/api/templates/00000000-0000-0000-0000-000000000000/permissions" rel="permissions"/>
9
9
  <type>desktop</type>
10
10
  <status>ok</status>
11
+ <version>
12
+ <version_name>base version</version_name>
13
+ <version_number>1</version_number>
14
+ <base_template href="/ovirt-engine/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
15
+ </version>
11
16
  <memory>536870912</memory>
12
17
  <cpu>
13
18
  <topology>
@@ -47,7 +52,6 @@
47
52
  <link href="/api/templates/05a5144f-8ef7-4151-b7f9-5014510b489e/cdroms" rel="cdroms"/>
48
53
  <link href="/api/templates/05a5144f-8ef7-4151-b7f9-5014510b489e/permissions" rel="permissions"/>
49
54
  <type>server</type>
50
- <status>ok</status>
51
55
  <memory>1073741824</memory>
52
56
  <cpu>
53
57
  <topology>
@@ -81,6 +85,12 @@
81
85
  <usb>
82
86
  <enabled>true</enabled>
83
87
  </usb>
88
+ <status>ok</status>
89
+ <version>
90
+ <version_name>base version</version_name>
91
+ <version_number>1</version_number>
92
+ <base_template href="/ovirt-engine/api/templates/05a5144f-8ef7-4151-b7f9-5014510b489e" id="05a5144f-8ef7-4151-b7f9-5014510b489e"/>
93
+ </version>
84
94
  </template>
85
95
  <template href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323" id="2a08ba05-f3b1-4e5a-ade9-496466a8b323">
86
96
  <name>hwp_small</name>
@@ -90,7 +100,6 @@
90
100
  <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/cdroms" rel="cdroms"/>
91
101
  <link href="/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323/permissions" rel="permissions"/>
92
102
  <type>server</type>
93
- <status>ok</status>
94
103
  <memory>536870912</memory>
95
104
  <cpu>
96
105
  <topology>
@@ -124,5 +133,11 @@
124
133
  <usb>
125
134
  <enabled>true</enabled>
126
135
  </usb>
136
+ <status>ok</status>
137
+ <version>
138
+ <version_name>base version</version_name>
139
+ <version_number>1</version_number>
140
+ <base_template href="/ovirt-engine/api/templates/2a08ba05-f3b1-4e5a-ade9-496466a8b323" id="2a08ba05-f3b1-4e5a-ade9-496466a8b323"/>
141
+ </version>
127
142
  </template>
128
143
  </templates>
@@ -0,0 +1,10 @@
1
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398" id="0000000a-000a-000a-000a-000000000398">
2
+ <name>ovirtmgmt</name>
3
+ <link href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398/permissions" rel="permissions"/>
4
+ <pass_through>
5
+ <mode>disabled</mode>
6
+ </pass_through>
7
+ <port_mirroring>false</port_mirroring>
8
+ <network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
9
+ <network_filter href="/ovirt-engine/api/networkfilters/593567f3-0314-011f-020e-0000000002d2" id="593567f3-0314-011f-020e-0000000002d2"/>
10
+ </vnic_profile>
@@ -6,6 +6,7 @@ module Fog
6
6
  def storage_domains(filter = {})
7
7
  filter = filter.dup
8
8
  role_filter = filter.delete(:role)
9
+ filter[:search] = create_search_by_datacenter(:search => filter[:search], :datacenter => datacenter_hash[:name])
9
10
  client.system_service.storage_domains_service.list(filter).collect do |sd|
10
11
  # Filter by role is not supported by the search language. The work around is to list all, then filter.
11
12
  role_filter.nil? || sd.type == role_filter ? sd : nil
@@ -3,7 +3,6 @@ module Fog
3
3
  class Compute
4
4
  class V4
5
5
  class Real
6
- # rubocop:disable Metrics/AbcSize
7
6
  def update_vm(attrs)
8
7
  attrs = attrs.dup
9
8
  attrs = convert_string_to_bool(attrs)
@@ -34,7 +33,6 @@ module Fog
34
33
  end
35
34
  vm_service.update(attrs)
36
35
  end
37
- # rubocop:enable Metrics/AbcSize
38
36
 
39
37
  def wrap_attribute(attrs, attribute, klass)
40
38
  if attrs[attribute].present?
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Ovirt
3
- VERSION = "1.2.1".freeze
3
+ VERSION = "2.0.0".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,23 @@
1
+ Shindo.tests("Fog::Ovirt::Compute.new | instance_type model", ["ovirt"]) do
2
+ instance_types = Fog::Ovirt::Compute.new.instance_types
3
+ instance_type = instance_types.last
4
+
5
+ tests("The instance_type model should") do
6
+ tests("have attributes") do
7
+ model_attribute_hash = instance_type.attributes
8
+ attributes = %i[id name memory sockets cores]
9
+
10
+ tests("The instance type model should respond to") do
11
+ attributes.each do |attribute|
12
+ test(attribute.to_s) { instance_type.respond_to? attribute }
13
+ end
14
+ end
15
+ tests("The attributes hash should have key") do
16
+ attributes.each do |attribute|
17
+ test(attribute.to_s) { model_attribute_hash.key? attribute }
18
+ end
19
+ end
20
+ end
21
+ test("be a kind of Fog::Ovirt::Compute::InstanceType") { instance_type.is_a? Fog::Ovirt::Compute::InstanceType }
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ Shindo.tests("Fog::Ovirt::Compute.new | instance types collection", ["ovirt"]) do
2
+ instance_types = Fog::Ovirt::Compute.new.instance_types
3
+
4
+ tests("The instance types collection") do
5
+ test("should be a kind of Fog::Ovirt::Compute::InstanceTypes") { instance_types.is_a? Fog::Ovirt::Compute::InstanceTypes }
6
+ end
7
+ end
@@ -2,7 +2,7 @@ Shindo.tests("Fog::Ovirt::Compute.new | client", ["ovirt"]) do
2
2
  before do
3
3
  @client_mock = Object.new
4
4
  def @client_mock.foo
5
- raise OVIRT::OvirtException, "Test"
5
+ raise ::Fog::Ovirt::Errors::OvirtError, "Test"
6
6
  end
7
7
 
8
8
  @object_under_test = Fog::Ovirt::Compute::ExceptionWrapper.new(@client_mock)
@@ -5,6 +5,7 @@ Shindo.tests("Fog::Ovirt::Compute v4 | vm_create request", "ovirt") do
5
5
  tests("Create VM") do
6
6
  response = compute.create_vm(:name => "fog-" + name_base.to_s, :cluster_name => "Default")
7
7
  test("should be a kind of OvirtSDK4::Vm") { response.is_a? OvirtSDK4::Vm }
8
+ test("should be a 'OvirtSDK4::VmType::SERVER' VM type by default") { response.type == OvirtSDK4::VmType::SERVER }
8
9
  end
9
10
 
10
11
  tests("Create VM from template (clone)") do
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-ovirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ori Rabin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-11 00:00:00.000000000 Z
11
+ date: 2020-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: fog-core
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +72,14 @@ dependencies:
58
72
  requirements:
59
73
  - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 4.1.3
75
+ version: 4.3.1
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 4.1.3
82
+ version: 4.3.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rbovirt
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +178,7 @@ files:
164
178
  - CONTRIBUTING.md
165
179
  - CONTRIBUTORS.md
166
180
  - Gemfile
181
+ - Gemfile.local.rb
167
182
  - LICENSE.md
168
183
  - README.md
169
184
  - Rakefile
@@ -171,7 +186,6 @@ files:
171
186
  - lib/fog/bin/ovirt.rb
172
187
  - lib/fog/ovirt.rb
173
188
  - lib/fog/ovirt/compute.rb
174
- - lib/fog/ovirt/compute/v3.rb
175
189
  - lib/fog/ovirt/compute/v4.rb
176
190
  - lib/fog/ovirt/models/compute/affinity_group.rb
177
191
  - lib/fog/ovirt/models/compute/affinity_groups.rb
@@ -191,67 +205,6 @@ files:
191
205
  - lib/fog/ovirt/models/compute/templates.rb
192
206
  - lib/fog/ovirt/models/compute/volume.rb
193
207
  - lib/fog/ovirt/models/compute/volumes.rb
194
- - lib/fog/ovirt/requests/compute/v3/activate_volume.rb
195
- - lib/fog/ovirt/requests/compute/v3/add_interface.rb
196
- - lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb
197
- - lib/fog/ovirt/requests/compute/v3/add_volume.rb
198
- - lib/fog/ovirt/requests/compute/v3/attach_volume.rb
199
- - lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb
200
- - lib/fog/ovirt/requests/compute/v3/create_vm.rb
201
- - lib/fog/ovirt/requests/compute/v3/datacenters.rb
202
- - lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb
203
- - lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb
204
- - lib/fog/ovirt/requests/compute/v3/destroy_interface.rb
205
- - lib/fog/ovirt/requests/compute/v3/destroy_vm.rb
206
- - lib/fog/ovirt/requests/compute/v3/destroy_volume.rb
207
- - lib/fog/ovirt/requests/compute/v3/detach_volume.rb
208
- - lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb
209
- - lib/fog/ovirt/requests/compute/v3/get_api_version.rb
210
- - lib/fog/ovirt/requests/compute/v3/get_cluster.rb
211
- - lib/fog/ovirt/requests/compute/v3/get_instance_type.rb
212
- - lib/fog/ovirt/requests/compute/v3/get_quota.rb
213
- - lib/fog/ovirt/requests/compute/v3/get_template.rb
214
- - lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb
215
- - lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb
216
- - lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb
217
- - lib/fog/ovirt/requests/compute/v3/list_clusters.rb
218
- - lib/fog/ovirt/requests/compute/v3/list_instance_types.rb
219
- - lib/fog/ovirt/requests/compute/v3/list_networks.rb
220
- - lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb
221
- - lib/fog/ovirt/requests/compute/v3/list_quotas.rb
222
- - lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb
223
- - lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb
224
- - lib/fog/ovirt/requests/compute/v3/list_templates.rb
225
- - lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb
226
- - lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb
227
- - lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb
228
- - lib/fog/ovirt/requests/compute/v3/list_volumes.rb
229
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml
230
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml
231
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml
232
- - lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml
233
- - lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml
234
- - lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml
235
- - lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml
236
- - lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml
237
- - lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml
238
- - lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml
239
- - lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml
240
- - lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml
241
- - lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml
242
- - lib/fog/ovirt/requests/compute/v3/mock_files/template.xml
243
- - lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml
244
- - lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml
245
- - lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml
246
- - lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml
247
- - lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb
248
- - lib/fog/ovirt/requests/compute/v3/storage_domains.rb
249
- - lib/fog/ovirt/requests/compute/v3/update_interface.rb
250
- - lib/fog/ovirt/requests/compute/v3/update_vm.rb
251
- - lib/fog/ovirt/requests/compute/v3/update_volume.rb
252
- - lib/fog/ovirt/requests/compute/v3/vm_action.rb
253
- - lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb
254
- - lib/fog/ovirt/requests/compute/v3/vm_ticket.rb
255
208
  - lib/fog/ovirt/requests/compute/v4/add_interface.rb
256
209
  - lib/fog/ovirt/requests/compute/v4/add_volume.rb
257
210
  - lib/fog/ovirt/requests/compute/v4/create_vm.rb
@@ -265,6 +218,7 @@ files:
265
218
  - lib/fog/ovirt/requests/compute/v4/get_quota.rb
266
219
  - lib/fog/ovirt/requests/compute/v4/get_template.rb
267
220
  - lib/fog/ovirt/requests/compute/v4/get_virtual_machine.rb
221
+ - lib/fog/ovirt/requests/compute/v4/get_volume.rb
268
222
  - lib/fog/ovirt/requests/compute/v4/list_clusters.rb
269
223
  - lib/fog/ovirt/requests/compute/v4/list_instance_types.rb
270
224
  - lib/fog/ovirt/requests/compute/v4/list_networks.rb
@@ -283,6 +237,7 @@ files:
283
237
  - lib/fog/ovirt/requests/compute/v4/mock_files/cluster.xml
284
238
  - lib/fog/ovirt/requests/compute/v4/mock_files/clusters.xml
285
239
  - lib/fog/ovirt/requests/compute/v4/mock_files/data_centers.xml
240
+ - lib/fog/ovirt/requests/compute/v4/mock_files/disk.xml
286
241
  - lib/fog/ovirt/requests/compute/v4/mock_files/disks.xml
287
242
  - lib/fog/ovirt/requests/compute/v4/mock_files/instance_type.xml
288
243
  - lib/fog/ovirt/requests/compute/v4/mock_files/instance_types.xml
@@ -294,6 +249,7 @@ files:
294
249
  - lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml
295
250
  - lib/fog/ovirt/requests/compute/v4/mock_files/vm.xml
296
251
  - lib/fog/ovirt/requests/compute/v4/mock_files/vms.xml
252
+ - lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml
297
253
  - lib/fog/ovirt/requests/compute/v4/mock_files/volumes.xml
298
254
  - lib/fog/ovirt/requests/compute/v4/storage_domains.rb
299
255
  - lib/fog/ovirt/requests/compute/v4/update_interface.rb
@@ -311,6 +267,8 @@ files:
311
267
  - tests/ovirt/compute_tests.rb
312
268
  - tests/ovirt/models/compute/cluster_tests.rb
313
269
  - tests/ovirt/models/compute/clusters_tests.rb
270
+ - tests/ovirt/models/compute/instance_type_tests.rb
271
+ - tests/ovirt/models/compute/instance_types_tests.rb
314
272
  - tests/ovirt/models/compute/interface_tests.rb
315
273
  - tests/ovirt/models/compute/interfaces_tests.rb
316
274
  - tests/ovirt/models/compute/operating_system_tests.rb
@@ -319,14 +277,6 @@ files:
319
277
  - tests/ovirt/models/compute/servers_tests.rb
320
278
  - tests/ovirt/models/compute/template_tests.rb
321
279
  - tests/ovirt/models/compute/templates_tests.rb
322
- - tests/ovirt/requests/compute/v3/client_tests.rb
323
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
324
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
325
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
326
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
327
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
328
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
329
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
330
280
  - tests/ovirt/requests/compute/v4/client_tests.rb
331
281
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
332
282
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb
@@ -346,14 +296,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
346
296
  requirements:
347
297
  - - ">="
348
298
  - !ruby/object:Gem::Version
349
- version: '0'
299
+ version: 2.0.0
350
300
  required_rubygems_version: !ruby/object:Gem::Requirement
351
301
  requirements:
352
302
  - - ">="
353
303
  - !ruby/object:Gem::Version
354
304
  version: '0'
355
305
  requirements: []
356
- rubygems_version: 3.0.3
306
+ rubygems_version: 3.0.8
357
307
  signing_key:
358
308
  specification_version: 4
359
309
  summary: Module for the 'fog' gem to support Ovirt.
@@ -364,6 +314,8 @@ test_files:
364
314
  - tests/ovirt/compute_tests.rb
365
315
  - tests/ovirt/models/compute/cluster_tests.rb
366
316
  - tests/ovirt/models/compute/clusters_tests.rb
317
+ - tests/ovirt/models/compute/instance_type_tests.rb
318
+ - tests/ovirt/models/compute/instance_types_tests.rb
367
319
  - tests/ovirt/models/compute/interface_tests.rb
368
320
  - tests/ovirt/models/compute/interfaces_tests.rb
369
321
  - tests/ovirt/models/compute/operating_system_tests.rb
@@ -372,14 +324,6 @@ test_files:
372
324
  - tests/ovirt/models/compute/servers_tests.rb
373
325
  - tests/ovirt/models/compute/template_tests.rb
374
326
  - tests/ovirt/models/compute/templates_tests.rb
375
- - tests/ovirt/requests/compute/v3/client_tests.rb
376
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
377
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
378
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
379
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
380
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
381
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
382
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
383
327
  - tests/ovirt/requests/compute/v4/client_tests.rb
384
328
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
385
329
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb