Class: NutanixVmm::EsxiVmApi

Inherits:
Object
  • Object
show all
Defined in:
lib/nutanix_vmm/api/esxi_vm_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EsxiVmApi

Returns a new instance of EsxiVmApi.



19
20
21
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#assign_vm_owner(ext_id, ntnx_request_id, vmm_v40_esxi_config_ownership_info, opts = {}) ⇒ AssignVmOwner202Response

Assign owner of a VM Assign the owner of a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 29

def assign_vm_owner(ext_id, ntnx_request_id, vmm_v40_esxi_config_ownership_info, opts = {})
  data, _status_code, _headers = assign_vm_owner_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_ownership_info, opts)
  data
end

#assign_vm_owner_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_ownership_info, opts = {}) ⇒ Array<(AssignVmOwner202Response, Integer, Hash)>

Assign owner of a VM Assign the owner of a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(AssignVmOwner202Response, Integer, Hash)>)

    AssignVmOwner202Response data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 41

def assign_vm_owner_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_ownership_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.assign_vm_owner ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.assign_vm_owner"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.assign_vm_owner, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.assign_vm_owner"
  end
  # verify the required parameter 'vmm_v40_esxi_config_ownership_info' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_ownership_info.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_ownership_info' when calling EsxiVmApi.assign_vm_owner"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/assign-owner'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_ownership_info)

  # return_type
  return_type = opts[:debug_return_type] || 'AssignVmOwner202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.assign_vm_owner",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#assign_vm_owner\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#associate_categories(ext_id, ntnx_request_id, vmm_v40_esxi_config_associate_vm_categories_params, opts = {}) ⇒ AssociateCategories202Response

Associate categories to a VM Associate categories to a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



115
116
117
118
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 115

def associate_categories(ext_id, ntnx_request_id, vmm_v40_esxi_config_associate_vm_categories_params, opts = {})
  data, _status_code, _headers = associate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_associate_vm_categories_params, opts)
  data
end

#associate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_associate_vm_categories_params, opts = {}) ⇒ Array<(AssociateCategories202Response, Integer, Hash)>

Associate categories to a VM Associate categories to a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 127

def associate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_associate_vm_categories_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.associate_categories ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.associate_categories"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.associate_categories, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.associate_categories"
  end
  # verify the required parameter 'vmm_v40_esxi_config_associate_vm_categories_params' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_associate_vm_categories_params.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_associate_vm_categories_params' when calling EsxiVmApi.associate_categories"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/associate-categories'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_associate_vm_categories_params)

  # return_type
  return_type = opts[:debug_return_type] || 'AssociateCategories202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.associate_categories",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#associate_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disassociate_categories(ext_id, ntnx_request_id, vmm_v40_esxi_config_disassociate_vm_categories_params, opts = {}) ⇒ DisassociateCategories202Response

Disassociate categories from a VM Disassociate categories from a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



201
202
203
204
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 201

def disassociate_categories(ext_id, ntnx_request_id, vmm_v40_esxi_config_disassociate_vm_categories_params, opts = {})
  data, _status_code, _headers = disassociate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_disassociate_vm_categories_params, opts)
  data
end

#disassociate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_disassociate_vm_categories_params, opts = {}) ⇒ Array<(DisassociateCategories202Response, Integer, Hash)>

Disassociate categories from a VM Disassociate categories from a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



213
214
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
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 213

def disassociate_categories_with_http_info(ext_id, ntnx_request_id, vmm_v40_esxi_config_disassociate_vm_categories_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.disassociate_categories ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.disassociate_categories"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.disassociate_categories, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.disassociate_categories"
  end
  # verify the required parameter 'vmm_v40_esxi_config_disassociate_vm_categories_params' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_disassociate_vm_categories_params.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_disassociate_vm_categories_params' when calling EsxiVmApi.disassociate_categories"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/disassociate-categories'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_disassociate_vm_categories_params)

  # return_type
  return_type = opts[:debug_return_type] || 'DisassociateCategories202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.disassociate_categories",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#disassociate_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_nutanix_guest_tools_by_id(ext_id, opts = {}) ⇒ GetNutanixGuestToolsById200Response

Get VM NGT configuration Retrieves the Nutanix Guest Tools configuration for a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

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

    the optional parameters

Returns:



285
286
287
288
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 285

def get_nutanix_guest_tools_by_id(ext_id, opts = {})
  data, _status_code, _headers = get_nutanix_guest_tools_by_id_with_http_info(ext_id, opts)
  data
end

#get_nutanix_guest_tools_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetNutanixGuestToolsById200Response, Integer, Hash)>

Get VM NGT configuration Retrieves the Nutanix Guest Tools configuration for a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

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

    the optional parameters

Returns:



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 295

def get_nutanix_guest_tools_by_id_with_http_info(ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.get_nutanix_guest_tools_by_id ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.get_nutanix_guest_tools_by_id"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.get_nutanix_guest_tools_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetNutanixGuestToolsById200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.get_nutanix_guest_tools_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#get_nutanix_guest_tools_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vm_by_id(ext_id, opts = {}) ⇒ GetVmById200Response

Get VM configuration details Retrieves configuration details for a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

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

    the optional parameters

Returns:



353
354
355
356
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 353

def get_vm_by_id(ext_id, opts = {})
  data, _status_code, _headers = get_vm_by_id_with_http_info(ext_id, opts)
  data
end

#get_vm_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetVmById200Response, Integer, Hash)>

Get VM configuration details Retrieves configuration details for a virtual machine.

Parameters:

  • ext_id (String)

    The globally unique identifier of an instance of type UUID.

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

    the optional parameters

Returns:

  • (Array<(GetVmById200Response, Integer, Hash)>)

    GetVmById200Response data, response status code and response headers



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 363

def get_vm_by_id_with_http_info(ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.get_vm_by_id ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.get_vm_by_id"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.get_vm_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVmById200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.get_vm_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#get_vm_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_insert_config, opts = {}) ⇒ InsertNutanixGuestTools202Response

Insert NGT ISO into an available CD-ROM for a VM Inserts the Nutanix Guest Tools installation and configuration ISO into a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



424
425
426
427
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 424

def insert_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_insert_config, opts = {})
  data, _status_code, _headers = insert_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_insert_config, opts)
  data
end

#insert_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_insert_config, opts = {}) ⇒ Array<(InsertNutanixGuestTools202Response, Integer, Hash)>

Insert NGT ISO into an available CD-ROM for a VM Inserts the Nutanix Guest Tools installation and configuration ISO into a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 437

def insert_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_insert_config, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.insert_nutanix_guest_tools ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.insert_nutanix_guest_tools"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.insert_nutanix_guest_tools, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.insert_nutanix_guest_tools"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.insert_nutanix_guest_tools"
  end
  # verify the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_insert_config' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_nutanix_guest_tools_insert_config.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_insert_config' when calling EsxiVmApi.insert_nutanix_guest_tools"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_nutanix_guest_tools_insert_config)

  # return_type
  return_type = opts[:debug_return_type] || 'InsertNutanixGuestTools202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.insert_nutanix_guest_tools",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#insert_nutanix_guest_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#install_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_install_config, opts = {}) ⇒ InstallNutanixGuestTools202Response

Install NGT in a VM Installs Nutanix Guest Tools in a Virtual Machine by using the provided credentials.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



517
518
519
520
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 517

def install_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_install_config, opts = {})
  data, _status_code, _headers = install_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_install_config, opts)
  data
end

#install_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_install_config, opts = {}) ⇒ Array<(InstallNutanixGuestTools202Response, Integer, Hash)>

Install NGT in a VM Installs Nutanix Guest Tools in a Virtual Machine by using the provided credentials.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 530

def install_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_install_config, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.install_nutanix_guest_tools ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.install_nutanix_guest_tools"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.install_nutanix_guest_tools, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.install_nutanix_guest_tools"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.install_nutanix_guest_tools"
  end
  # verify the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_install_config' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_nutanix_guest_tools_install_config.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_install_config' when calling EsxiVmApi.install_nutanix_guest_tools"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_nutanix_guest_tools_install_config)

  # return_type
  return_type = opts[:debug_return_type] || 'InstallNutanixGuestTools202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.install_nutanix_guest_tools",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#install_nutanix_guest_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_vms(opts = {}) ⇒ ListVms200Response

List VMs Lists the Virtual Machines defined on the system. List of Virtual Machines can be further filtered out using various filtering options.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results. (default to 0)

  • :limit (Integer)

    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set. (default to 50)

  • :filter (String)

    A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - cluster/extId - guestOsName - host/extId - memorySizeBytes - name - numCoresPerSocket - numCpus - powerState - virtualHardwareVersion

  • :orderby (String)

    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, &#39;$orderby&#x3D;templateName desc&#39; would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - guestOsName - memorySizeBytes - name - numCoresPerSocket - numCpus - virtualHardwareVersion

  • :select (String)

    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. - categories - cdRoms - cluster/extId - description - disks - extId - guestOsName - host/extId - links - memorySizeBytes - name - nics - numCoresPerSocket - numCpus - nutanixGuestTools/availableVersion - nutanixGuestTools/capabilities - nutanixGuestTools/guestOsVersion - nutanixGuestTools/isEnabled - nutanixGuestTools/isInstalled - nutanixGuestTools/isIsoInserted - nutanixGuestTools/isReachable - nutanixGuestTools/isVmMobilityDriversInstalled - nutanixGuestTools/isVssSnapshotCapable - nutanixGuestTools/version - ownershipInfo/owner - powerState - tenantId - virtualHardwareVersion

Returns:



611
612
613
614
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 611

def list_vms(opts = {})
  data, _status_code, _headers = list_vms_with_http_info(opts)
  data
end

#list_vms_with_http_info(opts = {}) ⇒ Array<(ListVms200Response, Integer, Hash)>

List VMs Lists the Virtual Machines defined on the system. List of Virtual Machines can be further filtered out using various filtering options.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results. (default to 0)

  • :limit (Integer)

    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set. (default to 50)

  • :filter (String)

    A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter &#39;$filter&#x3D;name eq &#39;karbon-ntnx-1.0&#39; would filter the result on cluster name &#39;karbon-ntnx1.0&#39;, filter &#39;$filter&#x3D;startswith(name, &#39;C&#39;)&#39; would filter on cluster name starting with &#39;C&#39;. The filter can be applied to the following fields: - cluster/extId - guestOsName - host/extId - memorySizeBytes - name - numCoresPerSocket - numCpus - powerState - virtualHardwareVersion

  • :orderby (String)

    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, &#39;$orderby&#x3D;templateName desc&#39; would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - guestOsName - memorySizeBytes - name - numCoresPerSocket - numCpus - virtualHardwareVersion

  • :select (String)

    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. - categories - cdRoms - cluster/extId - description - disks - extId - guestOsName - host/extId - links - memorySizeBytes - name - nics - numCoresPerSocket - numCpus - nutanixGuestTools/availableVersion - nutanixGuestTools/capabilities - nutanixGuestTools/guestOsVersion - nutanixGuestTools/isEnabled - nutanixGuestTools/isInstalled - nutanixGuestTools/isIsoInserted - nutanixGuestTools/isReachable - nutanixGuestTools/isVmMobilityDriversInstalled - nutanixGuestTools/isVssSnapshotCapable - nutanixGuestTools/version - ownershipInfo/owner - powerState - tenantId - virtualHardwareVersion

Returns:

  • (Array<(ListVms200Response, Integer, Hash)>)

    ListVms200Response data, response status code and response headers



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 625

def list_vms_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.list_vms ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EsxiVmApi.list_vms, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EsxiVmApi.list_vms, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EsxiVmApi.list_vms, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'$page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'$limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
  query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListVms200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.list_vms",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#list_vms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#power_off_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ PowerOffVm202Response

Force power off a VM Forceably shuts down a virtual machine which is equivalent to removing the power cable. Note: The forced shutdown may result in data loss if any operations are in progress during the shutdown.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



693
694
695
696
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 693

def power_off_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = power_off_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#power_off_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(PowerOffVm202Response, Integer, Hash)>

Force power off a VM Forceably shuts down a virtual machine which is equivalent to removing the power cable. Note: The forced shutdown may result in data loss if any operations are in progress during the shutdown.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(PowerOffVm202Response, Integer, Hash)>)

    PowerOffVm202Response data, response status code and response headers



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 705

def power_off_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.power_off_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.power_off_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.power_off_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.power_off_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.power_off_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/power-off'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PowerOffVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.power_off_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#power_off_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#power_on_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ PowerOnVm202Response

Power on or resume a VM Powers a Virtual Machine on or resumes it from the suspended state.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



775
776
777
778
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 775

def power_on_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = power_on_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#power_on_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(PowerOnVm202Response, Integer, Hash)>

Power on or resume a VM Powers a Virtual Machine on or resumes it from the suspended state.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(PowerOnVm202Response, Integer, Hash)>)

    PowerOnVm202Response data, response status code and response headers



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 787

def power_on_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.power_on_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.power_on_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.power_on_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.power_on_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.power_on_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/power-on'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PowerOnVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.power_on_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#power_on_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reboot_guest_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ RebootGuestVm202Response

Issue an ESXi guest OS reboot command Issues a command to reboot ESXi guest OS. This operation requires ESXi tools installed.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



857
858
859
860
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 857

def reboot_guest_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = reboot_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#reboot_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(RebootGuestVm202Response, Integer, Hash)>

Issue an ESXi guest OS reboot command Issues a command to reboot ESXi guest OS. This operation requires ESXi tools installed.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(RebootGuestVm202Response, Integer, Hash)>)

    RebootGuestVm202Response data, response status code and response headers



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 869

def reboot_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.reboot_guest_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.reboot_guest_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.reboot_guest_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.reboot_guest_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.reboot_guest_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/guest-reboot'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RebootGuestVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.reboot_guest_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#reboot_guest_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ ResetVm202Response

Reset an ESXi VM by sequentially powering it off and on Sequentially performs the power off and power on operations; any operation between these actions will fail.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



939
940
941
942
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 939

def reset_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = reset_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#reset_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(ResetVm202Response, Integer, Hash)>

Reset an ESXi VM by sequentially powering it off and on Sequentially performs the power off and power on operations; any operation between these actions will fail.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(ResetVm202Response, Integer, Hash)>)

    ResetVm202Response data, response status code and response headers



951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 951

def reset_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.reset_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.reset_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.reset_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.reset_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.reset_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/reset'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ResetVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.reset_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#reset_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revert_vm(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_revert_params, opts = {}) ⇒ RevertVm202Response

Revert the ESXi VM. Revert VM identified by extId. This does an in-place VM restore from a specified VM Recovery Point.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

  • vmm_v40_esxi_config_revert_params (VmmV40EsxiConfigRevertParams)

    Input for the VM revert operation. Specify the VM Recovery Point ID to which the VM would be reverted.

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

    the optional parameters

Returns:



1022
1023
1024
1025
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1022

def revert_vm(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_revert_params, opts = {})
  data, _status_code, _headers = revert_vm_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_revert_params, opts)
  data
end

#revert_vm_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_revert_params, opts = {}) ⇒ Array<(RevertVm202Response, Integer, Hash)>

Revert the ESXi VM. Revert VM identified by extId. This does an in-place VM restore from a specified VM Recovery Point.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

  • vmm_v40_esxi_config_revert_params (VmmV40EsxiConfigRevertParams)

    Input for the VM revert operation. Specify the VM Recovery Point ID to which the VM would be reverted.

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

    the optional parameters

Returns:

  • (Array<(RevertVm202Response, Integer, Hash)>)

    RevertVm202Response data, response status code and response headers



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1035

def revert_vm_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_revert_params, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.revert_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.revert_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.revert_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.revert_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.revert_vm"
  end
  # verify the required parameter 'vmm_v40_esxi_config_revert_params' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_revert_params.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_revert_params' when calling EsxiVmApi.revert_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/revert'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_revert_params)

  # return_type
  return_type = opts[:debug_return_type] || 'RevertVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.revert_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#revert_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#shutdown_guest_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ ShutdownGuestVm202Response

Shut down services on ESXi guest OS Issues a command to the ESXi guest OS to perform a clean shut down of services running on it. This operation requires ESXi tools to be installed.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1114
1115
1116
1117
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1114

def shutdown_guest_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = shutdown_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#shutdown_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(ShutdownGuestVm202Response, Integer, Hash)>

Shut down services on ESXi guest OS Issues a command to the ESXi guest OS to perform a clean shut down of services running on it. This operation requires ESXi tools to be installed.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(ShutdownGuestVm202Response, Integer, Hash)>)

    ShutdownGuestVm202Response data, response status code and response headers



1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1126

def shutdown_guest_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.shutdown_guest_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.shutdown_guest_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.shutdown_guest_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.shutdown_guest_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.shutdown_guest_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/guest-shutdown'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ShutdownGuestVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.shutdown_guest_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#shutdown_guest_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#suspend_vm(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ SuspendVm202Response

Pause/Suspend virtual machine execution Pause/Suspend execution in an ESXi virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1196
1197
1198
1199
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1196

def suspend_vm(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = suspend_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#suspend_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(SuspendVm202Response, Integer, Hash)>

Pause/Suspend virtual machine execution Pause/Suspend execution in an ESXi virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:

  • (Array<(SuspendVm202Response, Integer, Hash)>)

    SuspendVm202Response data, response status code and response headers



1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1208

def suspend_vm_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.suspend_vm ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.suspend_vm"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.suspend_vm, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.suspend_vm"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.suspend_vm"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/$actions/suspend'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SuspendVm202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.suspend_vm",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#suspend_vm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#uninstall_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ UninstallNutanixGuestTools202Response

Uninstall NGT from a VM Trigger an in-guest uninstallation of Nutanix Guest Tools.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1278
1279
1280
1281
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1278

def uninstall_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = uninstall_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

#uninstall_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ Array<(UninstallNutanixGuestTools202Response, Integer, Hash)>

Uninstall NGT from a VM Trigger an in-guest uninstallation of Nutanix Guest Tools.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1290

def uninstall_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.uninstall_nutanix_guest_tools ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.uninstall_nutanix_guest_tools"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.uninstall_nutanix_guest_tools, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.uninstall_nutanix_guest_tools"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.uninstall_nutanix_guest_tools"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UninstallNutanixGuestTools202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.uninstall_nutanix_guest_tools",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#uninstall_nutanix_guest_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_nutanix_guest_tools_by_id(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools, opts = {}) ⇒ UpdateNutanixGuestToolsById202Response

Update NGT configuration for a VM Updates the Nutanix Guest Tools configuration for a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided, the server will respond with an HTTP-428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow the successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP-412 (Precondition Failed) response will be returned.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1361
1362
1363
1364
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1361

def update_nutanix_guest_tools_by_id(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools, opts = {})
  data, _status_code, _headers = update_nutanix_guest_tools_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools, opts)
  data
end

#update_nutanix_guest_tools_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools, opts = {}) ⇒ Array<(UpdateNutanixGuestToolsById202Response, Integer, Hash)>

Update NGT configuration for a VM Updates the Nutanix Guest Tools configuration for a virtual machine.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided, the server will respond with an HTTP-428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow the successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP-412 (Precondition Failed) response will be returned.

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1374

def update_nutanix_guest_tools_by_id_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.update_nutanix_guest_tools_by_id ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.update_nutanix_guest_tools_by_id"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.update_nutanix_guest_tools_by_id, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.update_nutanix_guest_tools_by_id"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.update_nutanix_guest_tools_by_id"
  end
  # verify the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_nutanix_guest_tools.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools' when calling EsxiVmApi.update_nutanix_guest_tools_by_id"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_nutanix_guest_tools)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateNutanixGuestToolsById202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.update_nutanix_guest_tools_by_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#update_nutanix_guest_tools_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upgrade_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config, opts = {}) ⇒ UpgradeNutanixGuestTools202Response

Upgrade NGT inside a VM Trigger an in-guest upgrade of Nutanix Guest Tools.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1454
1455
1456
1457
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1454

def upgrade_nutanix_guest_tools(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config, opts = {})
  data, _status_code, _headers = upgrade_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config, opts)
  data
end

#upgrade_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config, opts = {}) ⇒ Array<(UpgradeNutanixGuestTools202Response, Integer, Hash)>

Upgrade NGT inside a VM Trigger an in-guest upgrade of Nutanix Guest Tools.

Parameters:

  • ext_id (String)

    A globally unique identifier of a VM of type UUID.

  • if_match (String)

    The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response

  • ntnx_request_id (String)

    A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request.

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

    the optional parameters

Returns:



1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
# File 'lib/nutanix_vmm/api/esxi_vm_api.rb', line 1467

def upgrade_nutanix_guest_tools_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EsxiVmApi.upgrade_nutanix_guest_tools ...'
  end
  # verify the required parameter 'ext_id' is set
  if @api_client.config.client_side_validation && ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'ext_id' when calling EsxiVmApi.upgrade_nutanix_guest_tools"
  end
  pattern = Regexp.new(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/)
  if @api_client.config.client_side_validation && ext_id !~ pattern
    fail ArgumentError, "invalid value for 'ext_id' when calling EsxiVmApi.upgrade_nutanix_guest_tools, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling EsxiVmApi.upgrade_nutanix_guest_tools"
  end
  # verify the required parameter 'ntnx_request_id' is set
  if @api_client.config.client_side_validation && ntnx_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'ntnx_request_id' when calling EsxiVmApi.upgrade_nutanix_guest_tools"
  end
  # verify the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config' is set
  if @api_client.config.client_side_validation && vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config' when calling EsxiVmApi.upgrade_nutanix_guest_tools"
  end
  # resource path
  local_var_path = '/vmm/v4.0/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade'.sub('{' + 'extId' + '}', CGI.escape(ext_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'NTNX-Request-Id'] = ntnx_request_id

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(vmm_v40_esxi_config_nutanix_guest_tools_upgrade_config)

  # return_type
  return_type = opts[:debug_return_type] || 'UpgradeNutanixGuestTools202Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apiKeyAuthScheme', 'basicAuthScheme']

  new_options = opts.merge(
    :operation => :"EsxiVmApi.upgrade_nutanix_guest_tools",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EsxiVmApi#upgrade_nutanix_guest_tools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end