fog-ovirt 1.2.2 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +10 -0
  4. data/.rubocop_todo.yml +17 -5
  5. data/Gemfile +0 -1
  6. data/README.md +2 -6
  7. data/Rakefile +2 -8
  8. data/fog-ovirt.gemspec +3 -3
  9. data/lib/fog/ovirt/compute.rb +5 -29
  10. data/lib/fog/ovirt/compute/v4.rb +27 -11
  11. data/lib/fog/ovirt/models/compute/interface.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 +4 -10
  17. data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +2 -2
  18. data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +2 -4
  19. data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +0 -2
  20. data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +0 -2
  21. data/lib/fog/ovirt/requests/compute/v4/list_vnic_profiles.rb +25 -0
  22. data/lib/fog/ovirt/requests/compute/v4/mock_files/operating_systems.xml +4 -4
  23. data/lib/fog/ovirt/requests/compute/v4/mock_files/template.xml +48 -45
  24. data/lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml +17 -2
  25. data/lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml +10 -0
  26. data/lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profiles.xml +42 -0
  27. data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +2 -1
  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/requests/compute/v4/client_tests.rb +1 -1
  31. metadata +18 -95
  32. data/lib/fog/ovirt/compute/v3.rb +0 -138
  33. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +0 -23
  34. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +0 -22
  35. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +0 -23
  36. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +0 -23
  37. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +0 -24
  38. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +0 -20
  39. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +0 -20
  40. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +0 -22
  41. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +0 -24
  42. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +0 -21
  43. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +0 -24
  44. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +0 -21
  45. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +0 -24
  46. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +0 -24
  47. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +0 -20
  48. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +0 -18
  49. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +0 -19
  50. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +0 -19
  51. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +0 -19
  52. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +0 -19
  53. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +0 -19
  54. data/lib/fog/ovirt/requests/compute/v3/get_volume.rb +0 -19
  55. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +0 -24
  56. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +0 -22
  57. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +0 -21
  58. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +0 -21
  59. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +0 -18
  60. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +0 -21
  61. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +0 -21
  62. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +0 -21
  63. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +0 -21
  64. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +0 -21
  65. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +0 -21
  66. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +0 -21
  67. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +0 -21
  68. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +0 -21
  69. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml +0 -8
  70. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml +0 -9
  71. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml +0 -17
  72. data/lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml +0 -20
  73. data/lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml +0 -39
  74. data/lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml +0 -17
  75. data/lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml +0 -58
  76. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml +0 -42
  77. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml +0 -197
  78. data/lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml +0 -10
  79. data/lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml +0 -10
  80. data/lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml +0 -7
  81. data/lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml +0 -36
  82. data/lib/fog/ovirt/requests/compute/v3/mock_files/template.xml +0 -39
  83. data/lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml +0 -110
  84. data/lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml +0 -52
  85. data/lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml +0 -152
  86. data/lib/fog/ovirt/requests/compute/v3/mock_files/volume.xml +0 -21
  87. data/lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml +0 -40
  88. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +0 -23
  89. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +0 -22
  90. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +0 -36
  91. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +0 -20
  92. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +0 -37
  93. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +0 -24
  94. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +0 -21
  95. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +0 -19
  96. data/tests/ovirt/requests/compute/v3/client_tests.rb +0 -31
  97. data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +0 -17
  98. data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +0 -14
  99. data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +0 -11
  100. data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +0 -10
  101. data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +0 -11
  102. data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +0 -14
  103. 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)
@@ -65,9 +65,8 @@ module Fog
65
65
  new_vm = OvirtSDK4::Vm.new(attrs)
66
66
  vms_service.add(new_vm, :clone => attrs[:clone])
67
67
  end
68
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
68
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
69
69
 
70
- # rubocop:disable Metrics/AbcSize
71
70
  def update_os_attrs(attrs)
72
71
  attrs[:os] ||= {}
73
72
  attrs[:os][:type] ||= "Other OS"
@@ -76,7 +75,6 @@ module Fog
76
75
 
77
76
  attrs[:os] = OvirtSDK4::OperatingSystem.new(:type => attrs[:os][:type], :boot => OvirtSDK4::Boot.new(:devices => attrs[:os][:boot]))
78
77
  end
79
- # rubocop:enable Metrics/AbcSize
80
78
  end
81
79
 
82
80
  class Mock
@@ -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,25 @@
1
+ module Fog
2
+ module Ovirt
3
+ class Compute
4
+ class V4
5
+ class Real
6
+ def list_vnic_profiles(_opts = {})
7
+ dc_vnics = []
8
+ profiles = client.system_service.vnic_profiles_service.list
9
+ profiles.each do |profile|
10
+ vnic_network = client.follow_link(profile.network)
11
+ dc_vnics.append(profile) if vnic_network.data_center.id == datacenter
12
+ end
13
+ dc_vnics
14
+ end
15
+ end
16
+ class Mock
17
+ def list_vnic_profiles(_filters = {})
18
+ xml = read_xml "vnic_profiles.xml"
19
+ ovirt_attrs OvirtSDK4::Reader.read(Nokogiri::XML(xml).root.to_s)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -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>
@@ -0,0 +1,42 @@
1
+ <vnic_profiles>
2
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398" id="0000000a-000a-000a-000a-000000000398">
3
+ <name>ovirtmgmt</name>
4
+ <link href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398/permissions" rel="permissions"/>
5
+ <pass_through>
6
+ <mode>disabled</mode>
7
+ </pass_through>
8
+ <port_mirroring>false</port_mirroring>
9
+ <network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
10
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
11
+ </vnic_profile>
12
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/4e7431d7-bb74-4358-b065-7dc4a0a3f9a9" id="4e7431d7-bb74-4358-b065-7dc4a0a3f9a9">
13
+ <name>ovirtmgmt</name>
14
+ <link href="/ovirt-engine/api/vnicprofiles/4e7431d7-bb74-4358-b065-7dc4a0a3f9a9/permissions" rel="permissions"/>
15
+ <pass_through>
16
+ <mode>disabled</mode>
17
+ </pass_through>
18
+ <port_mirroring>false</port_mirroring>
19
+ <network href="/ovirt-engine/api/networks/f89cd192-657a-49aa-99ae-f325882eb70c" id="f89cd192-657a-49aa-99ae-f325882eb70c"/>
20
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
21
+ </vnic_profile>
22
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/51249f24-17d3-48e8-807e-689d85a22b14" id="51249f24-17d3-48e8-807e-689d85a22b14">
23
+ <name>test</name>
24
+ <link href="/ovirt-engine/api/vnicprofiles/51249f24-17d3-48e8-807e-689d85a22b14/permissions" rel="permissions"/>
25
+ <pass_through>
26
+ <mode>disabled</mode>
27
+ </pass_through>
28
+ <port_mirroring>true</port_mirroring>
29
+ <network href="/ovirt-engine/api/networks/f89cd192-657a-49aa-99ae-f325882eb70c" id="f89cd192-657a-49aa-99ae-f325882eb70c"/>
30
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
31
+ </vnic_profile>
32
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/8267104a-7597-474b-a617-9c787c1a8e9d" id="8267104a-7597-474b-a617-9c787c1a8e9d">
33
+ <name>fff</name>
34
+ <link href="/ovirt-engine/api/vnicprofiles/8267104a-7597-474b-a617-9c787c1a8e9d/permissions" rel="permissions"/>
35
+ <pass_through>
36
+ <mode>disabled</mode>
37
+ </pass_through>
38
+ <port_mirroring>false</port_mirroring>
39
+ <network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
40
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
41
+ </vnic_profile>
42
+ </vnic_profiles>
@@ -6,9 +6,10 @@ 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
- role_filter.nil? || sd.type == role_filter ? sd : nil
12
+ role_filter.nil? || Array(role_filter).include?(sd.type) ? sd : nil
12
13
  end.compact
13
14
  end
14
15
  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 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.2".freeze
3
+ VERSION = "2.0.1".freeze
4
4
  end
5
5
  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)
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-ovirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 2.0.1
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-11-10 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: fog-core
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: fog-json
28
+ name: fog-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: fog-xml
42
+ name: fog-json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: ovirt-engine-sdk
56
+ name: fog-xml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.3
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.3
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rbovirt
70
+ name: ovirt-engine-sdk
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.5
75
+ version: 4.3.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.5
82
+ version: 4.3.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -171,7 +171,6 @@ files:
171
171
  - lib/fog/bin/ovirt.rb
172
172
  - lib/fog/ovirt.rb
173
173
  - lib/fog/ovirt/compute.rb
174
- - lib/fog/ovirt/compute/v3.rb
175
174
  - lib/fog/ovirt/compute/v4.rb
176
175
  - lib/fog/ovirt/models/compute/affinity_group.rb
177
176
  - lib/fog/ovirt/models/compute/affinity_groups.rb
@@ -191,69 +190,6 @@ files:
191
190
  - lib/fog/ovirt/models/compute/templates.rb
192
191
  - lib/fog/ovirt/models/compute/volume.rb
193
192
  - 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/get_volume.rb
216
- - lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb
217
- - lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb
218
- - lib/fog/ovirt/requests/compute/v3/list_clusters.rb
219
- - lib/fog/ovirt/requests/compute/v3/list_instance_types.rb
220
- - lib/fog/ovirt/requests/compute/v3/list_networks.rb
221
- - lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb
222
- - lib/fog/ovirt/requests/compute/v3/list_quotas.rb
223
- - lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb
224
- - lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb
225
- - lib/fog/ovirt/requests/compute/v3/list_templates.rb
226
- - lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb
227
- - lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb
228
- - lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb
229
- - lib/fog/ovirt/requests/compute/v3/list_volumes.rb
230
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml
231
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml
232
- - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml
233
- - lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml
234
- - lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml
235
- - lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml
236
- - lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml
237
- - lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml
238
- - lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml
239
- - lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml
240
- - lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml
241
- - lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml
242
- - lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml
243
- - lib/fog/ovirt/requests/compute/v3/mock_files/template.xml
244
- - lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml
245
- - lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml
246
- - lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml
247
- - lib/fog/ovirt/requests/compute/v3/mock_files/volume.xml
248
- - lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml
249
- - lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb
250
- - lib/fog/ovirt/requests/compute/v3/storage_domains.rb
251
- - lib/fog/ovirt/requests/compute/v3/update_interface.rb
252
- - lib/fog/ovirt/requests/compute/v3/update_vm.rb
253
- - lib/fog/ovirt/requests/compute/v3/update_volume.rb
254
- - lib/fog/ovirt/requests/compute/v3/vm_action.rb
255
- - lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb
256
- - lib/fog/ovirt/requests/compute/v3/vm_ticket.rb
257
193
  - lib/fog/ovirt/requests/compute/v4/add_interface.rb
258
194
  - lib/fog/ovirt/requests/compute/v4/add_volume.rb
259
195
  - lib/fog/ovirt/requests/compute/v4/create_vm.rb
@@ -279,6 +215,7 @@ files:
279
215
  - lib/fog/ovirt/requests/compute/v4/list_virtual_machines.rb
280
216
  - lib/fog/ovirt/requests/compute/v4/list_vm_interfaces.rb
281
217
  - lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
218
+ - lib/fog/ovirt/requests/compute/v4/list_vnic_profiles.rb
282
219
  - lib/fog/ovirt/requests/compute/v4/list_volumes.rb
283
220
  - lib/fog/ovirt/requests/compute/v4/mock_files/affinitygroup.xml
284
221
  - lib/fog/ovirt/requests/compute/v4/mock_files/affinitygroup_vms.xml
@@ -298,6 +235,8 @@ files:
298
235
  - lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml
299
236
  - lib/fog/ovirt/requests/compute/v4/mock_files/vm.xml
300
237
  - lib/fog/ovirt/requests/compute/v4/mock_files/vms.xml
238
+ - lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml
239
+ - lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profiles.xml
301
240
  - lib/fog/ovirt/requests/compute/v4/mock_files/volumes.xml
302
241
  - lib/fog/ovirt/requests/compute/v4/storage_domains.rb
303
242
  - lib/fog/ovirt/requests/compute/v4/update_interface.rb
@@ -325,14 +264,6 @@ files:
325
264
  - tests/ovirt/models/compute/servers_tests.rb
326
265
  - tests/ovirt/models/compute/template_tests.rb
327
266
  - tests/ovirt/models/compute/templates_tests.rb
328
- - tests/ovirt/requests/compute/v3/client_tests.rb
329
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
330
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
331
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
332
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
333
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
334
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
335
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
336
267
  - tests/ovirt/requests/compute/v4/client_tests.rb
337
268
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
338
269
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb
@@ -352,14 +283,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
283
  requirements:
353
284
  - - ">="
354
285
  - !ruby/object:Gem::Version
355
- version: '0'
286
+ version: 2.0.0
356
287
  required_rubygems_version: !ruby/object:Gem::Requirement
357
288
  requirements:
358
289
  - - ">="
359
290
  - !ruby/object:Gem::Version
360
291
  version: '0'
361
292
  requirements: []
362
- rubygems_version: 3.0.3
293
+ rubygems_version: 3.0.8
363
294
  signing_key:
364
295
  specification_version: 4
365
296
  summary: Module for the 'fog' gem to support Ovirt.
@@ -380,14 +311,6 @@ test_files:
380
311
  - tests/ovirt/models/compute/servers_tests.rb
381
312
  - tests/ovirt/models/compute/template_tests.rb
382
313
  - tests/ovirt/models/compute/templates_tests.rb
383
- - tests/ovirt/requests/compute/v3/client_tests.rb
384
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
385
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
386
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
387
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
388
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
389
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
390
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
391
314
  - tests/ovirt/requests/compute/v4/client_tests.rb
392
315
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
393
316
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb