Class: NutanixVmm::TemplatesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TemplatesApi

Returns a new instance of TemplatesApi.



19
20
21
# File 'lib/nutanix_vmm/api/templates_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/templates_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_guest_update(ext_id, ntnx_request_id, opts = {}) ⇒ CancelGuestUpdate202Response

Cancel guest OS update This operation cancels the update initiated by the "Initiate guest OS update" API for the given template. The temporary VM created during the update process is deleted, and the pending update status is cleared. Please note that any modifications made to the temporary VM will be lost upon cancelling the update operation.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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:



28
29
30
31
# File 'lib/nutanix_vmm/api/templates_api.rb', line 28

def cancel_guest_update(ext_id, ntnx_request_id, opts = {})
  data, _status_code, _headers = cancel_guest_update_with_http_info(ext_id, ntnx_request_id, opts)
  data
end

#cancel_guest_update_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(CancelGuestUpdate202Response, Integer, Hash)>

Cancel guest OS update This operation cancels the update initiated by the &quot;Initiate guest OS update&quot; API for the given template. The temporary VM created during the update process is deleted, and the pending update status is cleared. Please note that any modifications made to the temporary VM will be lost upon cancelling the update operation.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/nutanix_vmm/api/templates_api.rb', line 39

def cancel_guest_update_with_http_info(ext_id, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.cancel_guest_update ...'
  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 TemplatesApi.cancel_guest_update"
  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 TemplatesApi.cancel_guest_update, 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 TemplatesApi.cancel_guest_update"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{extId}/$actions/cancel-guest-update'.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[:'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] || 'CancelGuestUpdate202Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.cancel_guest_update",
    :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: TemplatesApi#cancel_guest_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#complete_guest_update(ext_id, ntnx_request_id, vmm_v40_content_complete_guest_update_spec, opts = {}) ⇒ CompleteGuestUpdate202Response

Complete guest OS update This operation finalizes the update initiated by the "Initiate guest OS update" API for the template. A new version is added to the template, the temporary VM created during the update process is deleted, and the pending update status is cleared.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_complete_guest_update_spec (VmmV40ContentCompleteGuestUpdateSpec)

    Request to complete the ongoing guest update on a template.

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

    the optional parameters

Returns:



104
105
106
107
# File 'lib/nutanix_vmm/api/templates_api.rb', line 104

def complete_guest_update(ext_id, ntnx_request_id, vmm_v40_content_complete_guest_update_spec, opts = {})
  data, _status_code, _headers = complete_guest_update_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_complete_guest_update_spec, opts)
  data
end

#complete_guest_update_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_complete_guest_update_spec, opts = {}) ⇒ Array<(CompleteGuestUpdate202Response, Integer, Hash)>

Complete guest OS update This operation finalizes the update initiated by the &quot;Initiate guest OS update&quot; API for the template. A new version is added to the template, the temporary VM created during the update process is deleted, and the pending update status is cleared.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_complete_guest_update_spec (VmmV40ContentCompleteGuestUpdateSpec)

    Request to complete the ongoing guest update on a template.

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

    the optional parameters

Returns:



116
117
118
119
120
121
122
123
124
125
126
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 116

def complete_guest_update_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_complete_guest_update_spec, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.complete_guest_update ...'
  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 TemplatesApi.complete_guest_update"
  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 TemplatesApi.complete_guest_update, 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 TemplatesApi.complete_guest_update"
  end
  # verify the required parameter 'vmm_v40_content_complete_guest_update_spec' is set
  if @api_client.config.client_side_validation && vmm_v40_content_complete_guest_update_spec.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_content_complete_guest_update_spec' when calling TemplatesApi.complete_guest_update"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{extId}/$actions/complete-guest-update'.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_content_complete_guest_update_spec)

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.complete_guest_update",
    :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: TemplatesApi#complete_guest_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_template(ntnx_request_id, vmm_v40_content_template, opts = {}) ⇒ CreateTemplate202Response

Create template from a VM Creates a template from the given VM identifier. A template stores the VM configuration and disks from the source VM.

Parameters:

  • 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_content_template (VmmV40ContentTemplate)

    Request to create a template.

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

    the optional parameters

Returns:



189
190
191
192
# File 'lib/nutanix_vmm/api/templates_api.rb', line 189

def create_template(ntnx_request_id, vmm_v40_content_template, opts = {})
  data, _status_code, _headers = create_template_with_http_info(ntnx_request_id, vmm_v40_content_template, opts)
  data
end

#create_template_with_http_info(ntnx_request_id, vmm_v40_content_template, opts = {}) ⇒ Array<(CreateTemplate202Response, Integer, Hash)>

Create template from a VM Creates a template from the given VM identifier. A template stores the VM configuration and disks from the source VM.

Parameters:

  • 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_content_template (VmmV40ContentTemplate)

    Request to create a template.

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

    the optional parameters

Returns:

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

    CreateTemplate202Response data, response status code and response headers



200
201
202
203
204
205
206
207
208
209
210
211
212
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 200

def create_template_with_http_info(ntnx_request_id, vmm_v40_content_template, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template ...'
  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 TemplatesApi.create_template"
  end
  # verify the required parameter 'vmm_v40_content_template' is set
  if @api_client.config.client_side_validation && vmm_v40_content_template.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_content_template' when calling TemplatesApi.create_template"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates'

  # 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_content_template)

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.create_template",
    :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: TemplatesApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_template_by_id(ext_id, ntnx_request_id, opts = {}) ⇒ DeleteTemplateById202Response

Delete a template and its associated versions Deletes the template and all of its versions for a given template identifier.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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:



264
265
266
267
# File 'lib/nutanix_vmm/api/templates_api.rb', line 264

def delete_template_by_id(ext_id, ntnx_request_id, opts = {})
  data, _status_code, _headers = delete_template_by_id_with_http_info(ext_id, ntnx_request_id, opts)
  data
end

#delete_template_by_id_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(DeleteTemplateById202Response, Integer, Hash)>

Delete a template and its associated versions Deletes the template and all of its versions for a given template identifier.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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:



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/nutanix_vmm/api/templates_api.rb', line 275

def delete_template_by_id_with_http_info(ext_id, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.delete_template_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 TemplatesApi.delete_template_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 TemplatesApi.delete_template_by_id, 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 TemplatesApi.delete_template_by_id"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{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']
  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] || 'DeleteTemplateById202Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.delete_template_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TemplatesApi#delete_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_template_version_by_id(template_ext_id, ext_id, ntnx_request_id, opts = {}) ⇒ DeleteTemplateVersionById202Response

Delete a template version Deletes a version for the given template version identifier.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • ext_id (String)

    The identifier of a version.

  • 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:



340
341
342
343
# File 'lib/nutanix_vmm/api/templates_api.rb', line 340

def delete_template_version_by_id(template_ext_id, ext_id, ntnx_request_id, opts = {})
  data, _status_code, _headers = delete_template_version_by_id_with_http_info(template_ext_id, ext_id, ntnx_request_id, opts)
  data
end

#delete_template_version_by_id_with_http_info(template_ext_id, ext_id, ntnx_request_id, opts = {}) ⇒ Array<(DeleteTemplateVersionById202Response, Integer, Hash)>

Delete a template version Deletes a version for the given template version identifier.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • ext_id (String)

    The identifier of a version.

  • 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:



352
353
354
355
356
357
358
359
360
361
362
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
415
416
417
# File 'lib/nutanix_vmm/api/templates_api.rb', line 352

def delete_template_version_by_id_with_http_info(template_ext_id, ext_id, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.delete_template_version_by_id ...'
  end
  # verify the required parameter 'template_ext_id' is set
  if @api_client.config.client_side_validation && template_ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_ext_id' when calling TemplatesApi.delete_template_version_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 && template_ext_id !~ pattern
    fail ArgumentError, "invalid value for 'template_ext_id' when calling TemplatesApi.delete_template_version_by_id, must conform to the pattern #{pattern}."
  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 TemplatesApi.delete_template_version_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 TemplatesApi.delete_template_version_by_id, 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 TemplatesApi.delete_template_version_by_id"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{templateExtId}/versions/{extId}'.sub('{' + 'templateExtId' + '}', CGI.escape(template_ext_id.to_s)).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[:'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] || 'DeleteTemplateVersionById202Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.delete_template_version_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TemplatesApi#delete_template_version_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deploy_template(ext_id, ntnx_request_id, vmm_v40_content_template_deployment, opts = {}) ⇒ DeployTemplate202Response

Deploy VMs from a template Deploys one or more VMs from a template. You can specify the number of VMs to deploy and their corresponding VM configuration overrides.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_template_deployment (VmmV40ContentTemplateDeployment)

    Request to deploy VMs from a template.

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

    the optional parameters

Returns:



426
427
428
429
# File 'lib/nutanix_vmm/api/templates_api.rb', line 426

def deploy_template(ext_id, ntnx_request_id, vmm_v40_content_template_deployment, opts = {})
  data, _status_code, _headers = deploy_template_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_template_deployment, opts)
  data
end

#deploy_template_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_template_deployment, opts = {}) ⇒ Array<(DeployTemplate202Response, Integer, Hash)>

Deploy VMs from a template Deploys one or more VMs from a template. You can specify the number of VMs to deploy and their corresponding VM configuration overrides.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_template_deployment (VmmV40ContentTemplateDeployment)

    Request to deploy VMs from a template.

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

    the optional parameters

Returns:

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

    DeployTemplate202Response data, response status code and response headers



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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 438

def deploy_template_with_http_info(ext_id, ntnx_request_id, vmm_v40_content_template_deployment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.deploy_template ...'
  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 TemplatesApi.deploy_template"
  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 TemplatesApi.deploy_template, 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 TemplatesApi.deploy_template"
  end
  # verify the required parameter 'vmm_v40_content_template_deployment' is set
  if @api_client.config.client_side_validation && vmm_v40_content_template_deployment.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_content_template_deployment' when calling TemplatesApi.deploy_template"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{extId}/$actions/deploy'.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_content_template_deployment)

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.deploy_template",
    :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: TemplatesApi#deploy_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_template_by_id(ext_id, opts = {}) ⇒ GetTemplateById200Response

Get template details Retrieves the template details for a given template identifier.

Parameters:

  • ext_id (String)

    The identifier of a template.

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

    the optional parameters

Returns:



510
511
512
513
# File 'lib/nutanix_vmm/api/templates_api.rb', line 510

def get_template_by_id(ext_id, opts = {})
  data, _status_code, _headers = get_template_by_id_with_http_info(ext_id, opts)
  data
end

#get_template_by_id_with_http_info(ext_id, opts = {}) ⇒ Array<(GetTemplateById200Response, Integer, Hash)>

Get template details Retrieves the template details for a given template identifier.

Parameters:

  • ext_id (String)

    The identifier of a template.

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

    the optional parameters

Returns:

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

    GetTemplateById200Response data, response status code and response headers



520
521
522
523
524
525
526
527
528
529
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 520

def get_template_by_id_with_http_info(ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.get_template_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 TemplatesApi.get_template_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 TemplatesApi.get_template_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{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] || 'GetTemplateById200Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.get_template_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: TemplatesApi#get_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_template_version_by_id(template_ext_id, ext_id, opts = {}) ⇒ GetTemplateVersionById200Response

Get the template version detail Retrieves the template version details of the given template and version identifier.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • ext_id (String)

    The identifier of a version.

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

    the optional parameters

Returns:



579
580
581
582
# File 'lib/nutanix_vmm/api/templates_api.rb', line 579

def get_template_version_by_id(template_ext_id, ext_id, opts = {})
  data, _status_code, _headers = get_template_version_by_id_with_http_info(template_ext_id, ext_id, opts)
  data
end

#get_template_version_by_id_with_http_info(template_ext_id, ext_id, opts = {}) ⇒ Array<(GetTemplateVersionById200Response, Integer, Hash)>

Get the template version detail Retrieves the template version details of the given template and version identifier.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • ext_id (String)

    The identifier of a version.

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

    the optional parameters

Returns:



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 590

def get_template_version_by_id_with_http_info(template_ext_id, ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.get_template_version_by_id ...'
  end
  # verify the required parameter 'template_ext_id' is set
  if @api_client.config.client_side_validation && template_ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_ext_id' when calling TemplatesApi.get_template_version_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 && template_ext_id !~ pattern
    fail ArgumentError, "invalid value for 'template_ext_id' when calling TemplatesApi.get_template_version_by_id, must conform to the pattern #{pattern}."
  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 TemplatesApi.get_template_version_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 TemplatesApi.get_template_version_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{templateExtId}/versions/{extId}'.sub('{' + 'templateExtId' + '}', CGI.escape(template_ext_id.to_s)).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] || 'GetTemplateVersionById200Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.get_template_version_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: TemplatesApi#get_template_version_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#initiate_guest_update(ext_id, ntnx_request_id, opts = {}) ⇒ InitiateGuestUpdate202Response

Initiate guest OS updates Initiates the process of updating the Guest OS from a given template version identifier. Only one guest OS update can be initiated for a template at a time. A temporary VM is created where the guest OS updates will be applied. The user must make the necessary modifications to this temporary VM. After completing the modifications, the user should issue the "Complete Guest OS Update" command to finalize the update. The "Cancel Guest OS Update" command can be issued at any time to abort an ongoing update.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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

Options Hash (opts):

Returns:



659
660
661
662
# File 'lib/nutanix_vmm/api/templates_api.rb', line 659

def initiate_guest_update(ext_id, ntnx_request_id, opts = {})
  data, _status_code, _headers = initiate_guest_update_with_http_info(ext_id, ntnx_request_id, opts)
  data
end

#initiate_guest_update_with_http_info(ext_id, ntnx_request_id, opts = {}) ⇒ Array<(InitiateGuestUpdate202Response, Integer, Hash)>

Initiate guest OS updates Initiates the process of updating the Guest OS from a given template version identifier. Only one guest OS update can be initiated for a template at a time. A temporary VM is created where the guest OS updates will be applied. The user must make the necessary modifications to this temporary VM. After completing the modifications, the user should issue the &quot;Complete Guest OS Update&quot; command to finalize the update. The &quot;Cancel Guest OS Update&quot; command can be issued at any time to abort an ongoing update.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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

Options Hash (opts):

Returns:



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 671

def initiate_guest_update_with_http_info(ext_id, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.initiate_guest_update ...'
  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 TemplatesApi.initiate_guest_update"
  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 TemplatesApi.initiate_guest_update, 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 TemplatesApi.initiate_guest_update"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{extId}/$actions/initiate-guest-update'.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(opts[:'vmm_v40_content_initiate_guest_update_spec'])

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.initiate_guest_update",
    :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: TemplatesApi#initiate_guest_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_template_versions(template_ext_id, opts = {}) ⇒ ListTemplateVersions200Response

List all versions in a template Lists all the versions of a template with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • 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: - versionName

  • :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: - createTime - versionName

  • :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. - createTime - createdBy - isActiveVersion - isGcOverrideEnabled - versionDescription - versionName - vmSpec

Returns:



744
745
746
747
# File 'lib/nutanix_vmm/api/templates_api.rb', line 744

def list_template_versions(template_ext_id, opts = {})
  data, _status_code, _headers = list_template_versions_with_http_info(template_ext_id, opts)
  data
end

#list_template_versions_with_http_info(template_ext_id, opts = {}) ⇒ Array<(ListTemplateVersions200Response, Integer, Hash)>

List all versions in a template Lists all the versions of a template with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination.

Parameters:

  • template_ext_id (String)

    The identifier of a template.

  • 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: - versionName

  • :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: - createTime - versionName

  • :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. - createTime - createdBy - isActiveVersion - isGcOverrideEnabled - versionDescription - versionName - vmSpec

Returns:



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 759

def list_template_versions_with_http_info(template_ext_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.list_template_versions ...'
  end
  # verify the required parameter 'template_ext_id' is set
  if @api_client.config.client_side_validation && template_ext_id.nil?
    fail ArgumentError, "Missing the required parameter 'template_ext_id' when calling TemplatesApi.list_template_versions"
  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 && template_ext_id !~ pattern
    fail ArgumentError, "invalid value for 'template_ext_id' when calling TemplatesApi.list_template_versions, must conform to the pattern #{pattern}."
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TemplatesApi.list_template_versions, 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 TemplatesApi.list_template_versions, 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 TemplatesApi.list_template_versions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{templateExtId}/versions'.sub('{' + 'templateExtId' + '}', CGI.escape(template_ext_id.to_s))

  # 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] || 'ListTemplateVersions200Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.list_template_versions",
    :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: TemplatesApi#list_template_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_templates(opts = {}) ⇒ ListTemplates200Response

List all templates Lists templates with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination.

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: - templateName

  • :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: - templateName - updateTime

  • :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. - createTime - createdBy - guestUpdateStatus - templateDescription - templateName - templateVersionSpec - updateTime - updatedBy

Returns:



838
839
840
841
# File 'lib/nutanix_vmm/api/templates_api.rb', line 838

def list_templates(opts = {})
  data, _status_code, _headers = list_templates_with_http_info(opts)
  data
end

#list_templates_with_http_info(opts = {}) ⇒ Array<(ListTemplates200Response, Integer, Hash)>

List all templates Lists templates with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination.

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: - templateName

  • :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: - templateName - updateTime

  • :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. - createTime - createdBy - guestUpdateStatus - templateDescription - templateName - templateVersionSpec - updateTime - updatedBy

Returns:

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

    ListTemplates200Response data, response status code and response headers



852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 852

def list_templates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.list_templates ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TemplatesApi.list_templates, 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 TemplatesApi.list_templates, 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 TemplatesApi.list_templates, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/vmm/v4.0/content/templates'

  # 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] || 'ListTemplates200Response'

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.list_templates",
    :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: TemplatesApi#list_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_template(ext_id, if_match, ntnx_request_id, vmm_v40_content_template_publish_spec, opts = {}) ⇒ PublishTemplate202Response

Set an active version Designate the template version identified by the given identifier as the active version. An active version is a default version for creating VMs from the template and starting the Guest OS Update.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_template_publish_spec (VmmV40ContentTemplatePublishSpec)

    Request to publish version of a template.

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

    the optional parameters

Returns:



921
922
923
924
# File 'lib/nutanix_vmm/api/templates_api.rb', line 921

def publish_template(ext_id, if_match, ntnx_request_id, vmm_v40_content_template_publish_spec, opts = {})
  data, _status_code, _headers = publish_template_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_content_template_publish_spec, opts)
  data
end

#publish_template_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_content_template_publish_spec, opts = {}) ⇒ Array<(PublishTemplate202Response, Integer, Hash)>

Set an active version Designate the template version identified by the given identifier as the active version. An active version is a default version for creating VMs from the template and starting the Guest OS Update.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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_content_template_publish_spec (VmmV40ContentTemplatePublishSpec)

    Request to publish version of a template.

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

    the optional parameters

Returns:

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

    PublishTemplate202Response data, response status code and response headers



934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 934

def publish_template_with_http_info(ext_id, if_match, ntnx_request_id, vmm_v40_content_template_publish_spec, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.publish_template ...'
  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 TemplatesApi.publish_template"
  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 TemplatesApi.publish_template, 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 TemplatesApi.publish_template"
  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 TemplatesApi.publish_template"
  end
  # verify the required parameter 'vmm_v40_content_template_publish_spec' is set
  if @api_client.config.client_side_validation && vmm_v40_content_template_publish_spec.nil?
    fail ArgumentError, "Missing the required parameter 'vmm_v40_content_template_publish_spec' when calling TemplatesApi.publish_template"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{extId}/$actions/publish'.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_content_template_publish_spec)

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.publish_template",
    :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: TemplatesApi#publish_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_template_by_id(ext_id, if_match, ntnx_request_id, opts = {}) ⇒ UpdateTemplateById202Response

Update a template Updates a template with the given template identifier. This operation updates the template configuration and/or adds a new version to the template. Unless otherwise specified, the newly created version is set as the active version.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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.

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

    the optional parameters

Options Hash (opts):

Returns:



1014
1015
1016
1017
# File 'lib/nutanix_vmm/api/templates_api.rb', line 1014

def update_template_by_id(ext_id, if_match, ntnx_request_id, opts = {})
  data, _status_code, _headers = update_template_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts)
  data
end

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

Update a template Updates a template with the given template identifier. This operation updates the template configuration and/or adds a new version to the template. Unless otherwise specified, the newly created version is set as the active version.

Parameters:

  • ext_id (String)

    The identifier of a template.

  • 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.

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

    the optional parameters

Options Hash (opts):

Returns:



1027
1028
1029
1030
1031
1032
1033
1034
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
# File 'lib/nutanix_vmm/api/templates_api.rb', line 1027

def update_template_by_id_with_http_info(ext_id, if_match, ntnx_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.update_template_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 TemplatesApi.update_template_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 TemplatesApi.update_template_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 TemplatesApi.update_template_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 TemplatesApi.update_template_by_id"
  end
  # resource path
  local_var_path = '/vmm/v4.0/content/templates/{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']
  # 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(opts[:'vmm_v40_content_template'])

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

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

  new_options = opts.merge(
    :operation => :"TemplatesApi.update_template_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: TemplatesApi#update_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end