fog-ovirt 1.2.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +7 -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 +3 -0
  11. data/lib/fog/ovirt/requests/compute/v4/mock_files/operating_systems.xml +4 -4
  12. data/lib/fog/ovirt/version.rb +1 -1
  13. metadata +20 -85
  14. data/lib/fog/ovirt/compute/v3.rb +0 -136
  15. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +0 -23
  16. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +0 -22
  17. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +0 -23
  18. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +0 -23
  19. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +0 -24
  20. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +0 -20
  21. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +0 -20
  22. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +0 -22
  23. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +0 -24
  24. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +0 -21
  25. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +0 -24
  26. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +0 -21
  27. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +0 -24
  28. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +0 -24
  29. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +0 -20
  30. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +0 -18
  31. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +0 -19
  32. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +0 -19
  33. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +0 -19
  34. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +0 -19
  35. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +0 -19
  36. data/lib/fog/ovirt/requests/compute/v3/get_volume.rb +0 -19
  37. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +0 -24
  38. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +0 -22
  39. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +0 -21
  40. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +0 -21
  41. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +0 -18
  42. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +0 -21
  43. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +0 -21
  44. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +0 -21
  45. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +0 -21
  46. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +0 -21
  47. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +0 -21
  48. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +0 -21
  49. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +0 -21
  50. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +0 -21
  51. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml +0 -8
  52. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml +0 -9
  53. data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml +0 -17
  54. data/lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml +0 -20
  55. data/lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml +0 -39
  56. data/lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml +0 -17
  57. data/lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml +0 -58
  58. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml +0 -42
  59. data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml +0 -197
  60. data/lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml +0 -10
  61. data/lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml +0 -10
  62. data/lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml +0 -7
  63. data/lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml +0 -36
  64. data/lib/fog/ovirt/requests/compute/v3/mock_files/template.xml +0 -39
  65. data/lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml +0 -110
  66. data/lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml +0 -52
  67. data/lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml +0 -152
  68. data/lib/fog/ovirt/requests/compute/v3/mock_files/volume.xml +0 -21
  69. data/lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml +0 -40
  70. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +0 -23
  71. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +0 -22
  72. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +0 -36
  73. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +0 -20
  74. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +0 -37
  75. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +0 -24
  76. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +0 -21
  77. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +0 -19
  78. data/tests/ovirt/requests/compute/v3/client_tests.rb +0 -31
  79. data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +0 -17
  80. data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +0 -14
  81. data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +0 -11
  82. data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +0 -10
  83. data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +0 -11
  84. data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +0 -14
  85. data/tests/ovirt/requests/compute/v3/update_volume_tests.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7b24b23699c22d16d6f7a5da99f613ec7e7066022e5d6f0097fc15236745db8
4
- data.tar.gz: e7f4357f8b657cd35625ebffe798cbc9bc09a65db3cb2aa6d5ec6f9706fad6c1
3
+ metadata.gz: '0018dbcebca7b9c47941e86933df6d71f9106c80348689ab8ff3e355c5bb550a'
4
+ data.tar.gz: 312123f1ff82516363de62ed8cc2617117f3a8a9bd11cb655244332bbcf3b6dc
5
5
  SHA512:
6
- metadata.gz: 805c36e9f5631026c94921b4278f1a193e5e52287a270e83a13c7bc1dfcdcd04a9588d76eb572ae5e2c632aba578acad499fd74a6bc3ca1965ac72ce72c37f9c
7
- data.tar.gz: 83ce48a44a9f6952b18e8314551529e44cb7caf5df055dfdfb2402a4e976966f1191970538f8c5215f67ecf917c195ef464f841f931e8b2707d6077bf704ab52
6
+ metadata.gz: b3218482b5f4b274c684c906688e59112ea1a67d78a437c89502840ab8a6edecdf5e311072cf8470f88c8752f31527e53e479924290b6f0323a73f3579d7ff27
7
+ data.tar.gz: e5aa103e4a011613b64a86d2150a4a936d13e0f331bb287c404a912bcce618431d32ecb8d6ddb3c57b2b8c456840d89dd83fba1735663552eecbb27ed49cf77f
@@ -24,3 +24,10 @@ Layout/EmptyLineAfterGuardClause:
24
24
 
25
25
  Metrics/AbcSize:
26
26
  Enabled: false
27
+
28
+ Gemspec/RequiredRubyVersion:
29
+ Enabled: false
30
+
31
+ AllCops:
32
+ Exclude:
33
+ - 'lib/fog/ovirt/compute.rb'
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-05-22 10:36:37 +0300 using RuboCop version 0.70.0.
3
+ # on 2020-10-15 17:29:26 +0300 using RuboCop version 0.81.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -11,11 +11,18 @@
11
11
  Metrics/ClassLength:
12
12
  Max: 150
13
13
 
14
- # Offense count: 10
14
+ # Offense count: 8
15
15
  # Configuration parameters: CountComments, ExcludedMethods.
16
16
  Metrics/MethodLength:
17
17
  Max: 26
18
18
 
19
+ # Offense count: 1
20
+ # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
21
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
22
+ Naming/FileName:
23
+ Exclude:
24
+ - 'Gemfile.local.rb'
25
+
19
26
  # Offense count: 1
20
27
  Style/ClassVars:
21
28
  Exclude:
@@ -26,7 +33,7 @@ Style/CommentedKeyword:
26
33
  Exclude:
27
34
  - 'lib/fog/ovirt/models/compute/server.rb'
28
35
 
29
- # Offense count: 188
36
+ # Offense count: 98
30
37
  Style/Documentation:
31
38
  Enabled: false
32
39
 
@@ -36,13 +43,18 @@ Style/DoubleNegation:
36
43
  - 'lib/fog/ovirt/models/compute/server.rb'
37
44
  - 'tests/helpers/succeeds_helper.rb'
38
45
 
39
- # Offense count: 133
46
+ # Offense count: 84
40
47
  # Cop supports --auto-correct.
41
48
  # Configuration parameters: EnforcedStyle.
42
- # SupportedStyles: always, never
49
+ # SupportedStyles: always, always_true, never
43
50
  Style/FrozenStringLiteralComment:
44
51
  Enabled: false
45
52
 
53
+ # Offense count: 3
54
+ Style/MissingRespondToMissing:
55
+ Exclude:
56
+ - 'lib/fog/ovirt/compute.rb'
57
+
46
58
  # Offense count: 4
47
59
  Style/MultilineTernaryOperator:
48
60
  Exclude:
data/Gemfile CHANGED
@@ -1,3 +1,2 @@
1
1
  source "https://rubygems.org"
2
-
3
2
  gemspec
File without changes
data/README.md CHANGED
@@ -40,9 +40,7 @@ compute = Fog::Compute.new(
40
40
 
41
41
  ## API Support
42
42
 
43
- This gem fully supports API v3 of oVirt.
44
-
45
- Version 1.0.2 adds support API V4 as well.
43
+ This gem fully supports API V4 of oVirt.
46
44
  The first version does not give full support.
47
45
  The supported requests for API V4 are:
48
46
 
@@ -72,9 +70,7 @@ This example shows the usage as a fog provider:
72
70
  :ovirt_url => url,
73
71
  :ovirt_datacenter => datacenter,
74
72
  :public_key => public_key,
75
- :api_version => 'v4'
76
73
  )
77
- The :api_version can be sent 'v3' or 'v4' to determine which API version to use.
78
74
 
79
75
 
80
76
  Feedback is welcome. Please feel free to open issues for the V4 support and contribute.
@@ -85,4 +81,4 @@ Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
85
81
 
86
82
  ## License
87
83
 
88
- Please refer to [LICENSE.md](LICENSE.md).
84
+ Please refer to [LICENSE.md](LICENSE.md).
data/Rakefile CHANGED
@@ -9,14 +9,8 @@ require "bundler/gem_tasks"
9
9
 
10
10
  mock = ENV["FOG_MOCK"] || "true"
11
11
 
12
- begin
13
- require "rubocop/rake_task"
14
- RuboCop::RakeTask.new do |t|
15
- t.patterns = Dir["{lib,spec,tests}/**/*.rb"]
16
- end
17
- rescue StandardError
18
- puts "Rubocop not loaded"
19
- end
12
+ require "rubocop/rake_task"
13
+ RuboCop::RakeTask.new
20
14
 
21
15
  task :test do
22
16
  sh("export FOG_MOCK=#{mock} && bundle exec shindont tests/ovirt")
@@ -17,13 +17,14 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0")
19
19
  spec.test_files = spec.files.grep(%r{^tests\/})
20
-
21
20
  spec.require_paths = ["lib"]
21
+ spec.required_ruby_version = ">= 2.0.0"
22
22
 
23
+ spec.add_dependency("activesupport")
23
24
  spec.add_dependency("fog-core")
24
25
  spec.add_dependency("fog-json")
25
26
  spec.add_dependency("fog-xml")
26
- spec.add_dependency("ovirt-engine-sdk", ">= 4.1.3")
27
+ spec.add_dependency("ovirt-engine-sdk", ">= 4.3.1")
27
28
  spec.add_dependency("rbovirt", "~> 0.1.5")
28
29
 
29
30
  spec.add_development_dependency "bundler"
@@ -50,22 +50,13 @@ module Fog
50
50
  end
51
51
  end
52
52
 
53
- require "fog/ovirt/compute/v3"
54
53
  require "fog/ovirt/compute/v4"
55
54
 
56
55
  def self.new(options = {})
57
56
  super(options)
58
-
59
- # rubocop:disable Style/ConditionalAssignment
60
- if options[:api_version] == "v4"
61
- @client = Fog::Ovirt::Compute::V4.new(options)
62
- else
63
- @client = Fog::Ovirt::Compute::V3.new(options)
64
- end
65
- # rubocop:enable Style/ConditionalAssignment
57
+ @client = Fog::Ovirt::Compute::V4.new(options)
66
58
  end
67
59
 
68
- # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
69
60
  def method_missing(symbol, *args)
70
61
  @client.__send__(symbol, *args)
71
62
  end
@@ -73,20 +64,13 @@ module Fog
73
64
  def respond_to?(symbol, include_all = false)
74
65
  @client.respond_to?(symbol, include_all)
75
66
  end
76
- # rubocop:enable Style/MethodMissingSuper, Style/MissingRespondToMissing
77
67
 
78
68
  class Mock
79
69
  def initialize(options = {})
80
- if options[:api_version] == "v4"
81
- Fog::Ovirt::Compute::V4::Mock.include Fog::Ovirt::Compute::Collections
82
- @client = Fog::Ovirt::Compute::V4::Mock.new(options)
83
- else
84
- Fog::Ovirt::Compute::V3::Mock.include Fog::Ovirt::Compute::Collections
85
- @client = Fog::Ovirt::Compute::V3::Mock.new(options)
86
- end
70
+ Fog::Ovirt::Compute::V4::Mock.include Fog::Ovirt::Compute::Collections
71
+ @client = Fog::Ovirt::Compute::V4::Mock.new(options)
87
72
  end
88
73
 
89
- # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
90
74
  def method_missing(symbol, *args)
91
75
  @client.__send__(symbol, *args)
92
76
  end
@@ -94,21 +78,14 @@ module Fog
94
78
  def respond_to?(symbol, include_all = false)
95
79
  @client.respond_to?(symbol, include_all)
96
80
  end
97
- # rubocop:enable Style/MethodMissingSuper, Style/MissingRespondToMissing
98
81
  end
99
82
 
100
83
  class Real
101
84
  def initialize(options = {})
102
- if options[:api_version] == "v4"
103
- Fog::Ovirt::Compute::V4::Real.include Fog::Ovirt::Compute::Collections
104
- @client = Fog::Ovirt::Compute::V4::Real.new(options)
105
- else
106
- Fog::Ovirt::Compute::V3::Real.include Fog::Ovirt::Compute::Collections
107
- @client = Fog::Ovirt::Compute::V3::Real.new(options)
108
- end
85
+ Fog::Ovirt::Compute::V4::Real.include Fog::Ovirt::Compute::Collections
86
+ @client = Fog::Ovirt::Compute::V4::Real.new(options)
109
87
  end
110
88
 
111
- # rubocop:disable Style/MethodMissingSuper, Style/MissingRespondToMissing
112
89
  def method_missing(symbol, *args)
113
90
  @client.send(symbol, *args)
114
91
  end
@@ -116,7 +93,6 @@ module Fog
116
93
  def respond_to?(symbol, include_all = false)
117
94
  @client.respond_to?(symbol, include_all)
118
95
  end
119
- # rubocop:enable Style/MethodMissingSuper, Style/MissingRespondToMissing
120
96
  end
121
97
  end
122
98
  end
@@ -1,3 +1,6 @@
1
+ require "active_support"
2
+ require "active_support/core_ext"
3
+
1
4
  module Fog
2
5
  module Ovirt
3
6
  class Compute
@@ -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,5 +1,5 @@
1
1
  module Fog
2
2
  module Ovirt
3
- VERSION = "1.2.5".freeze
3
+ VERSION = "2.0.0".freeze
4
4
  end
5
5
  end
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.5
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: 2020-05-26 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,69 +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/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
208
  - lib/fog/ovirt/requests/compute/v4/add_interface.rb
258
209
  - lib/fog/ovirt/requests/compute/v4/add_volume.rb
259
210
  - lib/fog/ovirt/requests/compute/v4/create_vm.rb
@@ -326,14 +277,6 @@ files:
326
277
  - tests/ovirt/models/compute/servers_tests.rb
327
278
  - tests/ovirt/models/compute/template_tests.rb
328
279
  - tests/ovirt/models/compute/templates_tests.rb
329
- - tests/ovirt/requests/compute/v3/client_tests.rb
330
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
331
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
332
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
333
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
334
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
335
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
336
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
337
280
  - tests/ovirt/requests/compute/v4/client_tests.rb
338
281
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
339
282
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb
@@ -353,7 +296,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
353
296
  requirements:
354
297
  - - ">="
355
298
  - !ruby/object:Gem::Version
356
- version: '0'
299
+ version: 2.0.0
357
300
  required_rubygems_version: !ruby/object:Gem::Requirement
358
301
  requirements:
359
302
  - - ">="
@@ -381,14 +324,6 @@ test_files:
381
324
  - tests/ovirt/models/compute/servers_tests.rb
382
325
  - tests/ovirt/models/compute/template_tests.rb
383
326
  - tests/ovirt/models/compute/templates_tests.rb
384
- - tests/ovirt/requests/compute/v3/client_tests.rb
385
- - tests/ovirt/requests/compute/v3/create_vm_tests.rb
386
- - tests/ovirt/requests/compute/v3/destroy_vm_tests.rb
387
- - tests/ovirt/requests/compute/v3/list_datacenters_tests.rb
388
- - tests/ovirt/requests/compute/v3/list_quotas_tests.rb
389
- - tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb
390
- - tests/ovirt/requests/compute/v3/update_vm_tests.rb
391
- - tests/ovirt/requests/compute/v3/update_volume_tests.rb
392
327
  - tests/ovirt/requests/compute/v4/client_tests.rb
393
328
  - tests/ovirt/requests/compute/v4/create_vm_tests.rb
394
329
  - tests/ovirt/requests/compute/v4/destroy_vm_tests.rb
@@ -1,136 +0,0 @@
1
- module Fog
2
- module Ovirt
3
- class Compute
4
- class V3 < Fog::Service
5
- requires :ovirt_username, :ovirt_password
6
- recognizes :ovirt_url, :ovirt_server, :ovirt_port, :ovirt_api_path, :ovirt_datacenter,
7
- :ovirt_filtered_api, :public_key, :api_version,
8
- :ovirt_ca_cert_store, :ovirt_ca_cert_file, :ovirt_ca_no_verify
9
- request_path "fog/ovirt/requests/compute/v3"
10
-
11
- request :vm_action
12
- request :vm_start_with_cloudinit
13
- request :destroy_vm
14
- request :create_vm
15
- request :update_vm
16
- request :datacenters
17
- request :storage_domains
18
- request :list_virtual_machines
19
- request :get_virtual_machine
20
- request :list_templates
21
- request :get_template
22
- request :list_instance_types
23
- request :get_instance_type
24
- request :list_clusters
25
- request :get_cluster
26
- request :add_interface
27
- request :destroy_interface
28
- request :update_interface
29
- request :list_vm_interfaces
30
- request :list_template_interfaces
31
- request :list_networks
32
- request :vm_ticket
33
- request :list_vm_volumes
34
- request :list_template_volumes
35
- request :list_volumes
36
- request :add_volume
37
- request :get_volume
38
- request :destroy_volume
39
- request :update_volume
40
- request :attach_volume
41
- request :detach_volume
42
- request :activate_volume
43
- request :deactivate_volume
44
- request :get_api_version
45
- request :list_quotas
46
- request :get_quota
47
- request :list_affinity_groups
48
- request :get_affinity_group
49
- request :list_affinity_group_vms
50
- request :create_affinity_group
51
- request :destroy_affinity_group
52
- request :add_to_affinity_group
53
- request :remove_from_affinity_group
54
- request :list_operating_systems
55
-
56
- module Shared
57
- # converts an OVIRT object into an hash for fog to consume.
58
- def ovirt_attrs(obj)
59
- opts = { :raw => obj }
60
- obj.instance_variables.each do |v|
61
- key = v.to_s.delete("@").to_sym
62
- value = obj.instance_variable_get(v)
63
- # ignore nil values
64
- next if value.nil?
65
-
66
- opts[key] = case value
67
- when OVIRT::Link
68
- value.id
69
- when OVIRT::TemplateVersion
70
- value
71
- when Array
72
- value
73
- when Hash
74
- value
75
- else
76
- value.to_s.strip
77
- end
78
- end
79
- opts
80
- end
81
- end
82
-
83
- class Mock
84
- include Shared
85
-
86
- def initialize(_options = {})
87
- require "rbovirt"
88
- end
89
-
90
- private
91
-
92
- def client
93
- return @client if defined?(@client)
94
- end
95
-
96
- # read mocks xml
97
- def read_xml(file_name)
98
- file_path = File.join(__dir__, "../requests", "compute/v3", "mock_files", file_name)
99
- File.read(file_path)
100
- end
101
- end
102
-
103
- class Real
104
- include Shared
105
-
106
- def initialize(options = {})
107
- require "rbovirt"
108
- username = options[:ovirt_username]
109
- password = options[:ovirt_password]
110
- server = options[:ovirt_server]
111
- port = options[:ovirt_port] || 8080
112
- api_path = options[:ovirt_api_path] || "/api"
113
- url = options[:ovirt_url] || "#{@scheme}://#{server}:#{port}#{api_path}"
114
-
115
- connection_opts = {}
116
- connection_opts[:datacenter_id] = options[:ovirt_datacenter]
117
- connection_opts[:ca_cert_store] = options[:ovirt_ca_cert_store]
118
- connection_opts[:ca_cert_file] = options[:ovirt_ca_cert_file]
119
- connection_opts[:ca_no_verify] = options[:ovirt_ca_no_verify]
120
- connection_opts[:filtered_api] = options[:ovirt_filtered_api]
121
-
122
- @client = ExceptionWrapper.new(OVIRT::Client.new(username, password, url, connection_opts))
123
- end
124
-
125
- def api_version
126
- client.api_version
127
- end
128
-
129
- private
130
-
131
- attr_reader :client
132
- end
133
- end
134
- end
135
- end
136
- end