ovirt-engine-sdk 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc70e7bc96b552de89ef13a91ae7ceb1f4a3bbb0
4
- data.tar.gz: 5ad0eb7711a5f490acf4774169bb480d65d8f0cc
3
+ metadata.gz: ecdf7ff085e2d14fdca2923dc0b77b35597c2af9
4
+ data.tar.gz: 620d7620903f1c24346b49e6b36c334e9b18ec29
5
5
  SHA512:
6
- metadata.gz: f2f28c98d659ae7a54fc0b7fdc98042d22005c3d01825b91d1e9df8018e480adbb79f69b751289cecc2a8cd2ff6ee3037cf3c7779d3781102e19957d3360c3e4
7
- data.tar.gz: 919165505e1e6b2fe06c80f2eda1d0556c9a628c53abf42309be2433e44b695de12b00ce14fb73de41f7c137d533938ca7d7fc4efbb9a1dfa4b991b52b56cefb
6
+ metadata.gz: 7f9d24ced354d42aa6f9e63b2122c59a898331d442742363f81345ecd3b96f02d3c5ac02de08e4d5534fe2651c6dea28dba7e5424c4047d20845dbb0d018e7dc
7
+ data.tar.gz: 8a14c4b538b101f78eee8f36e1862777f9574bb2c1bcf29664cb5b65b506fff966f3bfa10392968cf4b9c665d746a20d802532b79c8696aa67833c013d647dd9
data/CHANGES.adoc CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  This document describes the relevant changes between releases of the SDK.
4
4
 
5
+ == 4.0.2 / Sep 29 2016
6
+
7
+ New features:
8
+
9
+ * Add generic `Writer.write` method to support generating XML from
10
+ objects of unknown types.
11
+
12
+ * Add new `Probe.probe` method to detect the versions of the API
13
+ supported by the server.
14
+
15
+ Bug fixes:
16
+
17
+ * Add support for optional parameters to update methods.
18
+
19
+ * Use XML schema naming exceptions to correctly generate tag names like
20
+ `openstack_image_provider`.
21
+
22
+ * Write correctly lists of enum values https://bugzilla.redhat.com/1378066[#1378066].
23
+
24
+ * Write correctly empty lists of enum values.
25
+
5
26
  == 4.0.1 / Sep 6 2016
6
27
 
7
28
  Update to model 4.0.33.
data/lib/ovirtsdk4.rb CHANGED
@@ -37,3 +37,4 @@ require 'ovirtsdk4/writer.rb'
37
37
  require 'ovirtsdk4/writers.rb'
38
38
  require 'ovirtsdk4/service.rb'
39
39
  require 'ovirtsdk4/services.rb'
40
+ require 'ovirtsdk4/probe.rb'
@@ -137,6 +137,7 @@ module OvirtSDK4
137
137
  @kerberos = opts[:kerberos] || false
138
138
  @timeout = opts[:timeout] || 0
139
139
  @compress = opts[:compress] || false
140
+ @auth = opts[:auth] || :oauth
140
141
 
141
142
  # Check mandatory parameters:
142
143
  if url.nil?
@@ -179,7 +180,6 @@ module OvirtSDK4
179
180
  end
180
181
  end
181
182
  end
182
-
183
183
  end
184
184
 
185
185
  #
@@ -223,27 +223,16 @@ module OvirtSDK4
223
223
  # @api private
224
224
  #
225
225
  def send(request)
226
- # Check if we already have an SSO access token:
227
- @token ||= get_access_token
228
-
229
226
  # Build the URL:
230
227
  @curl.url = build_url({
231
228
  :path => request.path,
232
229
  :query => request.query,
233
230
  })
234
231
 
235
- # Add headers, avoiding those that have no value:
236
- @curl.headers.clear
237
- @curl.headers.merge!(request.headers)
238
- @curl.headers['User-Agent'] = "RubySDK/#{VERSION}"
239
- @curl.headers['Version'] = '4'
240
- @curl.headers['Content-Type'] = 'application/xml'
241
- @curl.headers['Accept'] = 'application/xml'
242
- @curl.headers['Authorization'] = "Bearer #{@token}"
243
-
232
+ set_headers!(request)
233
+ set_authentication!
244
234
  # Clear any data that may be in the buffers:
245
235
  @curl.post_body = nil
246
-
247
236
  # Send the request and wait for the response:
248
237
  case request.method
249
238
  when :DELETE
@@ -543,6 +532,34 @@ module OvirtSDK4
543
532
  return url
544
533
  end
545
534
 
535
+ private
536
+
537
+ # @api private
538
+ def set_authentication!
539
+ case @auth
540
+ when :oauth
541
+ # Check if we already have an SSO access token:
542
+ @token ||= get_access_token
543
+ @curl.headers['Authorization'] = "Bearer #{@token}"
544
+ when :basic
545
+ @curl.http_auth_types = :basic
546
+ @curl.username = @username
547
+ @curl.password = @password
548
+ end
549
+ end
550
+
551
+ # @api private
552
+ def set_headers!(request)
553
+ # Add headers, avoiding those that have no value:
554
+ @curl.headers.clear
555
+ @curl.headers['user-agent'] = "RubySDK/#{VERSION}"
556
+ @curl.headers['content-type'] = 'application/xml'
557
+ @curl.headers['accept'] = 'application/xml'
558
+ @curl.headers['version'] = 4
559
+ request.headers.each do |k,v|
560
+ @curl.headers[k.to_s.downcase] = v
561
+ end
562
+ end
546
563
  end
547
564
 
548
565
  end
@@ -0,0 +1,244 @@
1
+ #
2
+ # Copyright (c) 2016 Red Hat, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ module OvirtSDK4
18
+ #
19
+ # This class is used to probe the engine to find which API versions it supports.
20
+ #
21
+ class Probe
22
+ attr_reader :path_detector,
23
+ :version_detector
24
+
25
+ #
26
+ # This class method receives a set of options that define the server to probe and returns an arrays of objects of
27
+ # the OvirtSDK4::ProbeResult class containing the results of the probe.
28
+ #
29
+ # @options opts [Hash] The options used to create the probe.
30
+ #
31
+ # @option opts [String] :host The name or IP address of the host to probe.
32
+ #
33
+ # @option opts [Integer] :port (443) The port number to probe.
34
+ #
35
+ # @option opts [String] :username The name of the user, something like `admin@internal`.
36
+ #
37
+ # @option opts [String] :password The password of the user.
38
+ #
39
+ # @option opts [Boolean] :insecure (false) A boolean flag that indicates if the server TLS certificate and host
40
+ # name should be checked.
41
+ #
42
+ # @option opts [String] :ca_file The name of a PEM file containing the trusted CA certificates. The certificate
43
+ # presented by the server will be verified using these CA certificates. If not set then the system wide CA
44
+ # certificates store is used.
45
+ #
46
+ # @option opts [String] :log The logger where the log messages will be written.
47
+ #
48
+ # @option opts [Boolean] :debug (false) (false) A boolean flag indicating if debug output should be generated. If
49
+ # the values is `true` and the `log` parameter isn't `nil` then the data sent to and received from the server
50
+ # will be written to the log. Be aware that user names and passwords will also be written, so handle with care.
51
+ #
52
+ def self.probe(opts)
53
+ new(path_detector: PathDetector.new,
54
+ version_detector: VersionDetector.new)
55
+ .probe(opts)
56
+ end
57
+
58
+ #
59
+ # Creates a new probe instance.
60
+ #
61
+ # @param opts [Hash] The options for the initalization for the probe instance.
62
+ #
63
+ # @option opts [PathDetector] :path_detector An instance of a class that can recevie a connection and return the
64
+ # servers API path.
65
+ #
66
+ # @options opts [VersionDetector] :version_detector An instance of a class that can receive a connection and an
67
+ # API path and return the API versions the server supports.
68
+ #
69
+ # @api private
70
+ #
71
+ def initialize(opts)
72
+ @path_detector = opts[:path_detector]
73
+ @version_detector = opts[:version_detector]
74
+ end
75
+
76
+ #
77
+ # This instance method receives a set of options that define the server to probe and returns the API versions that
78
+ # the server supports.
79
+ #
80
+ # @param opts [Hash] The options to base the probing on. See the `probe` class method for details.
81
+ #
82
+ # @api private
83
+ #
84
+ def probe(opts)
85
+ path = path_detector.detect(opts)
86
+ raise OvirtSDK4::Error.new('API path not found') unless path
87
+ version_detector.detect(opts, path).map { |version| ProbeResult.new(version: version) }
88
+ end
89
+ end
90
+
91
+ #
92
+ # This class is responsible for detecting the API path an oVirt server.
93
+ #
94
+ # @api private
95
+ #
96
+ class PathDetector
97
+ PATH_CANDIDATES = [
98
+ '/api',
99
+ '/ovirt-engine/api'
100
+ ].freeze
101
+
102
+ def detect(opts)
103
+ PATH_CANDIDATES.each do |path|
104
+ begin
105
+ connection = ConnectionBuilder.build(opts.merge(path: path))
106
+ res = connection.send(request)
107
+ return path if res.code == 200
108
+ raise OvirtSDK4::Error.new('Unauthorized') if res.code == 401
109
+ ensure
110
+ connection.close if connection
111
+ end
112
+ end
113
+ nil
114
+ end
115
+
116
+ def request
117
+ Request.new(path: '')
118
+ end
119
+ end
120
+
121
+ #
122
+ # Class contains class methods to build connections from options.
123
+ #
124
+ # @api private
125
+ #
126
+ class ConnectionBuilder
127
+ DEFAULT_PORT = 443
128
+
129
+ def self.build(opts)
130
+ Connection.new(
131
+ url: build_url(opts),
132
+ username: opts[:username],
133
+ password: opts[:password],
134
+ insecure: opts[:insecure],
135
+ ca_file: opts[:ca_file],
136
+ log: opts[:log],
137
+ debug: opts[:debug],
138
+ auth: :basic
139
+ )
140
+ end
141
+
142
+ def self.build_url(opts)
143
+ host = opts[:host]
144
+ path = opts[:path]
145
+ port = opts[:port] || DEFAULT_PORT
146
+ "https://#{host}:#{port}#{path}"
147
+ end
148
+ end
149
+
150
+ #
151
+ # This class is responsible for detecting the API versions an oVirt server engine supports.
152
+ #
153
+ # @api private
154
+ #
155
+ class VersionDetector
156
+ attr_accessor :supported_versions,
157
+ :path,
158
+ :connection
159
+
160
+ def detect(connection_opts, path)
161
+ @connection = ConnectionBuilder.build(connection_opts.merge(path: path))
162
+ self.path = path
163
+ supported_versions = []
164
+ supported_versions << '3' if detect_v3
165
+ supported_versions << '4' if detect_v4
166
+ supported_versions
167
+ ensure
168
+ @connection.close if @connection
169
+ end
170
+
171
+ private
172
+
173
+ def detect_v3
174
+ res = connection.send(request_for_v3_detection)
175
+ special_response_regexp_in_api3 =~ res.body
176
+ end
177
+
178
+ def detect_v4
179
+ res = connection.send(request_for_v4_detection)
180
+ special_response_regexp_in_api4 =~ res.body
181
+ end
182
+
183
+ def request_for_v3_detection
184
+ OvirtSDK4::Request.new(
185
+ path: '',
186
+ headers: { version: 3 },
187
+ )
188
+ end
189
+
190
+ def request_for_v4_detection
191
+ OvirtSDK4::Request.new(
192
+ path: '',
193
+ headers: { version: 4 },
194
+ )
195
+ end
196
+
197
+ # The methods below are based on headers oVirt returns depending on the API
198
+ # version it supports when queried with <version: 3> or <version: 4> header.
199
+ # Refer to spec to see the return values.
200
+ def special_response_regexp_in_api3
201
+ /major=/
202
+ end
203
+
204
+ def special_response_regexp_in_api4
205
+ /<major>/
206
+ end
207
+ end
208
+
209
+ #
210
+ # The probe returns an array of instances of this class.
211
+ #
212
+ class ProbeResult
213
+ attr_reader :version
214
+
215
+ #
216
+ # This method is used to initialize a class instance,
217
+ #
218
+ # @param opts [Hash] The attributes of the result.
219
+ #
220
+ # @option opts [String] :version The version obtained as the result of the probe.
221
+ #
222
+ def initialize(opts)
223
+ @version = opts[:version]
224
+ end
225
+
226
+ # Override the comparison method.
227
+ def ==(o)
228
+ o.class == self.class && o.state == state
229
+ end
230
+
231
+ alias_method :eql?, :==
232
+
233
+ # Should always be overriden if one overrides ==, used to get a hash value
234
+ # for the object.
235
+ def hash
236
+ state.hash
237
+ end
238
+
239
+ #@api private
240
+ def state
241
+ [version]
242
+ end
243
+ end
244
+ end
@@ -810,7 +810,7 @@ module OvirtSDK4
810
810
  #
811
811
  # @return [AffinityGroup]
812
812
  #
813
- def update(group)
813
+ def update(group, opts = {})
814
814
  if group.is_a?(Hash)
815
815
  group = OvirtSDK4::AffinityGroup.new(group)
816
816
  end
@@ -1256,7 +1256,7 @@ module OvirtSDK4
1256
1256
  #
1257
1257
  # @return [AffinityLabel]
1258
1258
  #
1259
- def update(label)
1259
+ def update(label, opts = {})
1260
1260
  if label.is_a?(Hash)
1261
1261
  label = OvirtSDK4::AffinityLabel.new(label)
1262
1262
  end
@@ -2535,7 +2535,7 @@ module OvirtSDK4
2535
2535
  #
2536
2536
  # @return [Network]
2537
2537
  #
2538
- def update(network)
2538
+ def update(network, opts = {})
2539
2539
  if network.is_a?(Hash)
2540
2540
  network = OvirtSDK4::Network.new(network)
2541
2541
  end
@@ -3918,7 +3918,7 @@ module OvirtSDK4
3918
3918
  #
3919
3919
  # @return [Bookmark]
3920
3920
  #
3921
- def update(bookmark)
3921
+ def update(bookmark, opts = {})
3922
3922
  if bookmark.is_a?(Hash)
3923
3923
  bookmark = OvirtSDK4::Bookmark.new(bookmark)
3924
3924
  end
@@ -4203,7 +4203,7 @@ module OvirtSDK4
4203
4203
  #
4204
4204
  # @return [Cluster]
4205
4205
  #
4206
- def update(cluster)
4206
+ def update(cluster, opts = {})
4207
4207
  if cluster.is_a?(Hash)
4208
4208
  cluster = OvirtSDK4::Cluster.new(cluster)
4209
4209
  end
@@ -4787,7 +4787,7 @@ module OvirtSDK4
4787
4787
  #
4788
4788
  # @return [CpuProfile]
4789
4789
  #
4790
- def update(profile)
4790
+ def update(profile, opts = {})
4791
4791
  if profile.is_a?(Hash)
4792
4792
  profile = OvirtSDK4::CpuProfile.new(profile)
4793
4793
  end
@@ -5076,7 +5076,7 @@ module OvirtSDK4
5076
5076
  #
5077
5077
  # @return [DataCenter]
5078
5078
  #
5079
- def update(data_center)
5079
+ def update(data_center, opts = {})
5080
5080
  if data_center.is_a?(Hash)
5081
5081
  data_center = OvirtSDK4::DataCenter.new(data_center)
5082
5082
  end
@@ -5461,7 +5461,7 @@ module OvirtSDK4
5461
5461
  #
5462
5462
  # @return [DiskAttachment]
5463
5463
  #
5464
- def update(disk_attachment)
5464
+ def update(disk_attachment, opts = {})
5465
5465
  if disk_attachment.is_a?(Hash)
5466
5466
  disk_attachment = OvirtSDK4::DiskAttachment.new(disk_attachment)
5467
5467
  end
@@ -5727,7 +5727,7 @@ module OvirtSDK4
5727
5727
  #
5728
5728
  # @return [DiskProfile]
5729
5729
  #
5730
- def update(profile)
5730
+ def update(profile, opts = {})
5731
5731
  if profile.is_a?(Hash)
5732
5732
  profile = OvirtSDK4::DiskProfile.new(profile)
5733
5733
  end
@@ -8214,7 +8214,7 @@ module OvirtSDK4
8214
8214
  #
8215
8215
  # @return [Agent]
8216
8216
  #
8217
- def update(agent)
8217
+ def update(agent, opts = {})
8218
8218
  if agent.is_a?(Hash)
8219
8219
  agent = OvirtSDK4::Agent.new(agent)
8220
8220
  end
@@ -11422,7 +11422,7 @@ module OvirtSDK4
11422
11422
  #
11423
11423
  # @return [InstanceType]
11424
11424
  #
11425
- def update(instance_type)
11425
+ def update(instance_type, opts = {})
11426
11426
  if instance_type.is_a?(Hash)
11427
11427
  instance_type = OvirtSDK4::InstanceType.new(instance_type)
11428
11428
  end
@@ -11592,7 +11592,7 @@ module OvirtSDK4
11592
11592
  #
11593
11593
  # @return [Nic]
11594
11594
  #
11595
- def update(nic)
11595
+ def update(nic, opts = {})
11596
11596
  if nic.is_a?(Hash)
11597
11597
  nic = OvirtSDK4::Nic.new(nic)
11598
11598
  end
@@ -11843,7 +11843,7 @@ module OvirtSDK4
11843
11843
  #
11844
11844
  # @return [Watchdog]
11845
11845
  #
11846
- def update(watchdog)
11846
+ def update(watchdog, opts = {})
11847
11847
  if watchdog.is_a?(Hash)
11848
11848
  watchdog = OvirtSDK4::Watchdog.new(watchdog)
11849
11849
  end
@@ -12217,7 +12217,7 @@ module OvirtSDK4
12217
12217
  #
12218
12218
  # @return [IscsiBond]
12219
12219
  #
12220
- def update(bond)
12220
+ def update(bond, opts = {})
12221
12221
  if bond.is_a?(Hash)
12222
12222
  bond = OvirtSDK4::IscsiBond.new(bond)
12223
12223
  end
@@ -12906,7 +12906,7 @@ module OvirtSDK4
12906
12906
  #
12907
12907
  # @return [MacPool]
12908
12908
  #
12909
- def update(pool)
12909
+ def update(pool, opts = {})
12910
12910
  if pool.is_a?(Hash)
12911
12911
  pool = OvirtSDK4::MacPool.new(pool)
12912
12912
  end
@@ -13280,7 +13280,7 @@ module OvirtSDK4
13280
13280
  #
13281
13281
  # @return [Network]
13282
13282
  #
13283
- def update(network)
13283
+ def update(network, opts = {})
13284
13284
  if network.is_a?(Hash)
13285
13285
  network = OvirtSDK4::Network.new(network)
13286
13286
  end
@@ -13450,7 +13450,7 @@ module OvirtSDK4
13450
13450
  #
13451
13451
  # @return [NetworkAttachment]
13452
13452
  #
13453
- def update(attachment)
13453
+ def update(attachment, opts = {})
13454
13454
  if attachment.is_a?(Hash)
13455
13455
  attachment = OvirtSDK4::NetworkAttachment.new(attachment)
13456
13456
  end
@@ -14346,7 +14346,7 @@ module OvirtSDK4
14346
14346
  #
14347
14347
  # @return [OpenStackImageProvider]
14348
14348
  #
14349
- def update(provider)
14349
+ def update(provider, opts = {})
14350
14350
  if provider.is_a?(Hash)
14351
14351
  provider = OvirtSDK4::OpenStackImageProvider.new(provider)
14352
14352
  end
@@ -14878,7 +14878,7 @@ module OvirtSDK4
14878
14878
  #
14879
14879
  # @return [OpenStackNetworkProvider]
14880
14880
  #
14881
- def update(provider)
14881
+ def update(provider, opts = {})
14882
14882
  if provider.is_a?(Hash)
14883
14883
  provider = OvirtSDK4::OpenStackNetworkProvider.new(provider)
14884
14884
  end
@@ -15451,7 +15451,7 @@ module OvirtSDK4
15451
15451
  #
15452
15452
  # @return [OpenstackVolumeAuthenticationKey]
15453
15453
  #
15454
- def update(key)
15454
+ def update(key, opts = {})
15455
15455
  if key.is_a?(Hash)
15456
15456
  key = OvirtSDK4::OpenstackVolumeAuthenticationKey.new(key)
15457
15457
  end
@@ -15751,7 +15751,7 @@ module OvirtSDK4
15751
15751
  #
15752
15752
  # @return [OpenStackVolumeProvider]
15753
15753
  #
15754
- def update(provider)
15754
+ def update(provider, opts = {})
15755
15755
  if provider.is_a?(Hash)
15756
15756
  provider = OvirtSDK4::OpenStackVolumeProvider.new(provider)
15757
15757
  end
@@ -16642,7 +16642,7 @@ module OvirtSDK4
16642
16642
  #
16643
16643
  # @return [Qos]
16644
16644
  #
16645
- def update(qos)
16645
+ def update(qos, opts = {})
16646
16646
  if qos.is_a?(Hash)
16647
16647
  qos = OvirtSDK4::Qos.new(qos)
16648
16648
  end
@@ -16893,7 +16893,7 @@ module OvirtSDK4
16893
16893
  #
16894
16894
  # @return [Quota]
16895
16895
  #
16896
- def update(quota)
16896
+ def update(quota, opts = {})
16897
16897
  if quota.is_a?(Hash)
16898
16898
  quota = OvirtSDK4::Quota.new(quota)
16899
16899
  end
@@ -17602,7 +17602,7 @@ module OvirtSDK4
17602
17602
  #
17603
17603
  # @return [Role]
17604
17604
  #
17605
- def update(role)
17605
+ def update(role, opts = {})
17606
17606
  if role.is_a?(Hash)
17607
17607
  role = OvirtSDK4::Role.new(role)
17608
17608
  end
@@ -18004,7 +18004,7 @@ module OvirtSDK4
18004
18004
  #
18005
18005
  # @return [SchedulingPolicy]
18006
18006
  #
18007
- def update(policy)
18007
+ def update(policy, opts = {})
18008
18008
  if policy.is_a?(Hash)
18009
18009
  policy = OvirtSDK4::SchedulingPolicy.new(policy)
18010
18010
  end
@@ -19097,7 +19097,7 @@ module OvirtSDK4
19097
19097
  #
19098
19098
  # @return [SshPublicKey]
19099
19099
  #
19100
- def update(key)
19100
+ def update(key, opts = {})
19101
19101
  if key.is_a?(Hash)
19102
19102
  key = OvirtSDK4::SshPublicKey.new(key)
19103
19103
  end
@@ -19968,7 +19968,7 @@ module OvirtSDK4
19968
19968
  #
19969
19969
  # @return [StorageDomain]
19970
19970
  #
19971
- def update(storage_domain)
19971
+ def update(storage_domain, opts = {})
19972
19972
  if storage_domain.is_a?(Hash)
19973
19973
  storage_domain = OvirtSDK4::StorageDomain.new(storage_domain)
19974
19974
  end
@@ -21320,7 +21320,7 @@ module OvirtSDK4
21320
21320
  #
21321
21321
  # @return [StorageConnection]
21322
21322
  #
21323
- def update(connection)
21323
+ def update(connection, opts = {})
21324
21324
  if connection.is_a?(Hash)
21325
21325
  connection = OvirtSDK4::StorageConnection.new(connection)
21326
21326
  end
@@ -21448,7 +21448,7 @@ module OvirtSDK4
21448
21448
  #
21449
21449
  # @return [StorageConnectionExtension]
21450
21450
  #
21451
- def update(extension)
21451
+ def update(extension, opts = {})
21452
21452
  if extension.is_a?(Hash)
21453
21453
  extension = OvirtSDK4::StorageConnectionExtension.new(extension)
21454
21454
  end
@@ -22565,7 +22565,7 @@ module OvirtSDK4
22565
22565
  #
22566
22566
  # @return [Tag]
22567
22567
  #
22568
- def update(tag)
22568
+ def update(tag, opts = {})
22569
22569
  if tag.is_a?(Hash)
22570
22570
  tag = OvirtSDK4::Tag.new(tag)
22571
22571
  end
@@ -22852,7 +22852,7 @@ module OvirtSDK4
22852
22852
  #
22853
22853
  # @return [Template]
22854
22854
  #
22855
- def update(template)
22855
+ def update(template, opts = {})
22856
22856
  if template.is_a?(Hash)
22857
22857
  template = OvirtSDK4::Template.new(template)
22858
22858
  end
@@ -23640,7 +23640,7 @@ module OvirtSDK4
23640
23640
  #
23641
23641
  # @return [Nic]
23642
23642
  #
23643
- def update(nic)
23643
+ def update(nic, opts = {})
23644
23644
  if nic.is_a?(Hash)
23645
23645
  nic = OvirtSDK4::Nic.new(nic)
23646
23646
  end
@@ -23891,7 +23891,7 @@ module OvirtSDK4
23891
23891
  #
23892
23892
  # @return [Watchdog]
23893
23893
  #
23894
- def update(watchdog)
23894
+ def update(watchdog, opts = {})
23895
23895
  if watchdog.is_a?(Hash)
23896
23896
  watchdog = OvirtSDK4::Watchdog.new(watchdog)
23897
23897
  end
@@ -25576,7 +25576,7 @@ module OvirtSDK4
25576
25576
  #
25577
25577
  # @return [Vm]
25578
25578
  #
25579
- def update(vm)
25579
+ def update(vm, opts = {})
25580
25580
  if vm.is_a?(Hash)
25581
25581
  vm = OvirtSDK4::Vm.new(vm)
25582
25582
  end
@@ -26084,7 +26084,7 @@ module OvirtSDK4
26084
26084
  #
26085
26085
  # @return [Cdrom]
26086
26086
  #
26087
- def update(cdrom)
26087
+ def update(cdrom, opts = {})
26088
26088
  if cdrom.is_a?(Hash)
26089
26089
  cdrom = OvirtSDK4::Cdrom.new(cdrom)
26090
26090
  end
@@ -26415,7 +26415,7 @@ module OvirtSDK4
26415
26415
  #
26416
26416
  # @return [Disk]
26417
26417
  #
26418
- def update(disk)
26418
+ def update(disk, opts = {})
26419
26419
  if disk.is_a?(Hash)
26420
26420
  disk = OvirtSDK4::Disk.new(disk)
26421
26421
  end
@@ -27085,7 +27085,7 @@ module OvirtSDK4
27085
27085
  #
27086
27086
  # @return [Nic]
27087
27087
  #
27088
- def update(nic)
27088
+ def update(nic, opts = {})
27089
27089
  if nic.is_a?(Hash)
27090
27090
  nic = OvirtSDK4::Nic.new(nic)
27091
27091
  end
@@ -27364,7 +27364,7 @@ module OvirtSDK4
27364
27364
  #
27365
27365
  # @return [VirtualNumaNode]
27366
27366
  #
27367
- def update(node)
27367
+ def update(node, opts = {})
27368
27368
  if node.is_a?(Hash)
27369
27369
  node = OvirtSDK4::VirtualNumaNode.new(node)
27370
27370
  end
@@ -27649,7 +27649,7 @@ module OvirtSDK4
27649
27649
  #
27650
27650
  # @return [VmPool]
27651
27651
  #
27652
- def update(pool)
27652
+ def update(pool, opts = {})
27653
27653
  if pool.is_a?(Hash)
27654
27654
  pool = OvirtSDK4::VmPool.new(pool)
27655
27655
  end
@@ -28240,7 +28240,7 @@ module OvirtSDK4
28240
28240
  #
28241
28241
  # @return [Watchdog]
28242
28242
  #
28243
- def update(watchdog)
28243
+ def update(watchdog, opts = {})
28244
28244
  if watchdog.is_a?(Hash)
28245
28245
  watchdog = OvirtSDK4::Watchdog.new(watchdog)
28246
28246
  end
@@ -28810,7 +28810,7 @@ module OvirtSDK4
28810
28810
  #
28811
28811
  # @return [VnicProfile]
28812
28812
  #
28813
- def update(profile)
28813
+ def update(profile, opts = {})
28814
28814
  if profile.is_a?(Hash)
28815
28815
  profile = OvirtSDK4::VnicProfile.new(profile)
28816
28816
  end
@@ -29646,7 +29646,7 @@ module OvirtSDK4
29646
29646
  #
29647
29647
  # @return [ExternalHostProvider]
29648
29648
  #
29649
- def update(provider)
29649
+ def update(provider, opts = {})
29650
29650
  if provider.is_a?(Hash)
29651
29651
  provider = OvirtSDK4::ExternalHostProvider.new(provider)
29652
29652
  end
@@ -30924,7 +30924,7 @@ module OvirtSDK4
30924
30924
  #
30925
30925
  # @return [Host]
30926
30926
  #
30927
- def update(host)
30927
+ def update(host, opts = {})
30928
30928
  if host.is_a?(Hash)
30929
30929
  host = OvirtSDK4::Host.new(host)
30930
30930
  end