Class: VSphereAutomation::Appliance::UpdatePendingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vsphere-automation-appliance/api/update_pending_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UpdatePendingApi

Returns a new instance of UpdatePendingApi.



16
17
18
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get(version, opts = {}) ⇒ ApplianceUpdatePendingResult|VapiStdErrorsAlreadyInDesiredStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Gets update information

Parameters:

  • version

    Update version

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



23
24
25
26
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 23

def get(version, opts = {})
  data, _status_code, _headers = get_with_http_info(version, opts)
  data
end

#get_with_http_info(version, opts = {}) ⇒ Array<(ApplianceUpdatePendingResult|VapiStdErrorsAlreadyInDesiredStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Gets update information

Parameters:

  • version

    Update version

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 33

def get_with_http_info(version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.get ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.get"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Appliance::ApplianceUpdatePendingResult',
	  '400' => 'Appliance::VapiStdErrorsAlreadyInDesiredStateError',
	  '401' => 'Appliance::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Appliance::VapiStdErrorsUnauthorizedError',
	  '404' => 'Appliance::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#install(version, request_body, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil

Starts operation of installing the appliance update. Will fail is the update is not staged

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



81
82
83
84
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 81

def install(version, request_body, opts = {})
  install_with_http_info(version, request_body, opts)
  nil
end

#install_with_http_info(version, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Starts operation of installing the appliance update. Will fail is the update is not staged

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 92

def install_with_http_info(version, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.install ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.install"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling UpdatePendingApi.install"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}?action=install'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#install\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(source_type, opts = {}) ⇒ ApplianceUpdatePendingListResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Checks if new updates are available.

Parameters:

  • source_type

    The SourceType enumerated type defines the supported types of sources of updates.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :url (String)

    specific URL to check at

Returns:



139
140
141
142
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 139

def list(source_type, opts = {})
  data, _status_code, _headers = list_with_http_info(source_type, opts)
  data
end

#list_with_http_info(source_type, opts = {}) ⇒ Array<(ApplianceUpdatePendingListResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Checks if new updates are available.

Parameters:

  • source_type

    The SourceType enumerated type defines the supported types of sources of updates.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :url (String)

    specific URL to check at

Returns:



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 150

def list_with_http_info(source_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.list ...'
  end
  # verify the required parameter 'source_type' is set
  if @api_client.config.client_side_validation && source_type.nil?
    fail ArgumentError, "Missing the required parameter 'source_type' when calling UpdatePendingApi.list"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['LAST_CHECK', 'LOCAL', 'LOCAL_AND_ONLINE'].include?(source_type)
    fail ArgumentError, "invalid value for 'source_type', must be one of LAST_CHECK, LOCAL, LOCAL_AND_ONLINE"
  end
  # resource path
  local_var_path = '/appliance/update/pending'

  # query parameters
  query_params = {}
  query_params[:'source_type'] = source_type
  query_params[:'url'] = opts[:'url'] if !opts[:'url'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Appliance::ApplianceUpdatePendingListResult',
	  '400' => 'Appliance::VapiStdErrorsErrorError',
	  '401' => 'Appliance::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Appliance::VapiStdErrorsUnauthorizedError',
	  '404' => 'Appliance::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#precheck(version, action, opts = {}) ⇒ ApplianceUpdatePendingPrecheckResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Runs update precheck

Parameters:

  • version

    Update version

  • action

    action&#x3D;precheck

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



204
205
206
207
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 204

def precheck(version, action, opts = {})
  data, _status_code, _headers = precheck_with_http_info(version, action, opts)
  data
end

#precheck_with_http_info(version, action, opts = {}) ⇒ Array<(ApplianceUpdatePendingPrecheckResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs update precheck

Parameters:

  • version

    Update version

  • action

    action&#x3D;precheck

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 215

def precheck_with_http_info(version, action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.precheck ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.precheck"
  end
  # verify the required parameter 'action' is set
  if @api_client.config.client_side_validation && action.nil?
    fail ArgumentError, "Missing the required parameter 'action' when calling UpdatePendingApi.precheck"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['precheck'].include?(action)
    fail ArgumentError, "invalid value for 'action', must be one of precheck"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'action'] = action

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Appliance::ApplianceUpdatePendingPrecheckResult',
	  '400' => 'Appliance::VapiStdErrorsNotAllowedInCurrentStateError',
	  '401' => 'Appliance::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Appliance::VapiStdErrorsUnauthorizedError',
	  '404' => 'Appliance::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#precheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stage(version, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil

Starts staging the appliance update. The updates are searched for in the following order: staged, CDROM, URL

Parameters:

  • version

    Update version

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



271
272
273
274
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 271

def stage(version, opts = {})
  stage_with_http_info(version, opts)
  nil
end

#stage_and_install(version, request_body, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil

Starts operation of installing the appliance update. Will stage update if not already staged The updates are searched for in the following order: staged, CDROM, URL

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



322
323
324
325
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 322

def stage_and_install(version, request_body, opts = {})
  stage_and_install_with_http_info(version, request_body, opts)
  nil
end

#stage_and_install_with_http_info(version, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Starts operation of installing the appliance update. Will stage update if not already staged The updates are searched for in the following order: staged, CDROM, URL

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 333

def stage_and_install_with_http_info(version, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.stage_and_install ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.stage_and_install"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling UpdatePendingApi.stage_and_install"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}?action=stage-and-install'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#stage_and_install\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stage_with_http_info(version, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Starts staging the appliance update. The updates are searched for in the following order: staged, CDROM, URL

Parameters:

  • version

    Update version

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 281

def stage_with_http_info(version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.stage ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.stage"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}?action=stage'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#stage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate(version, request_body, opts = {}) ⇒ ApplianceUpdatePendingValidateResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Validates the user provided data before the update installation.

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



380
381
382
383
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 380

def validate(version, request_body, opts = {})
  data, _status_code, _headers = validate_with_http_info(version, request_body, opts)
  data
end

#validate_with_http_info(version, request_body, opts = {}) ⇒ Array<(ApplianceUpdatePendingValidateResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Validates the user provided data before the update installation.

Parameters:

  • version

    Update version

  • request_body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/vsphere-automation-appliance/api/update_pending_api.rb', line 391

def validate_with_http_info(version, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UpdatePendingApi.validate ...'
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling UpdatePendingApi.validate"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling UpdatePendingApi.validate"
  end
  # resource path
  local_var_path = '/appliance/update/pending/{version}?action=validate'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Appliance::ApplianceUpdatePendingValidateResult',
	  '400' => 'Appliance::VapiStdErrorsNotAllowedInCurrentStateError',
	  '401' => 'Appliance::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Appliance::VapiStdErrorsUnauthorizedError',
	  '404' => 'Appliance::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UpdatePendingApi#validate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end