templates_api#

class TemplatesApi(api_client=None)#

Bases: object

cancel_guest_update(extId, **kwargs)#

Cancel guest OS update

>>> response = api.cancel_guest_update(extId)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.cancel_guest_update(extId, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class CancelGuestUpdateApiResponse.

If the method is called asynchronously, returns the request thread.

complete_guest_update(extId, body, **kwargs)#

Complete guest OS update

>>> response = api.complete_guest_update(extId, body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.complete_guest_update(extId, body, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • body (CompleteGuestUpdateSpec, required) – Request to complete the ongoing guest update on a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class CompleteGuestUpdateApiResponse.

If the method is called asynchronously, returns the request thread.

create_template(body, **kwargs)#

Create template from a VM

>>> response = api.create_template(body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.create_template(body, async_req=True)
>>> result = thread.get()
Parameters:
  • body (Template, required) – Request to create a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class CreateTemplateApiResponse.

If the method is called asynchronously, returns the request thread.

delete_template_by_id(extId, **kwargs)#

Delete a template and its associated versions

>>> response = api.delete_template_by_id(extId)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.delete_template_by_id(extId, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class DeleteTemplateApiResponse.

If the method is called asynchronously, returns the request thread.

delete_template_version_by_id(templateExtId, extId, **kwargs)#

Delete a template version

>>> response = api.delete_template_version_by_id(templateExtId, extId)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.delete_template_version_by_id(templateExtId, extId, async_req=True)
>>> result = thread.get()
Parameters:
  • templateExtId (str, required) – The identifier of a template.

  • extId (str, required) – The identifier of a version.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class DeleteTemplateVersionApiResponse.

If the method is called asynchronously, returns the request thread.

deploy_template(extId, body, **kwargs)#

Deploy VMs from a template

>>> response = api.deploy_template(extId, body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.deploy_template(extId, body, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • body (TemplateDeployment, required) – Request to deploy VMs from a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class DeployTemplateApiResponse.

If the method is called asynchronously, returns the request thread.

get_template_by_id(extId, **kwargs)#

Get template details

>>> response = api.get_template_by_id(extId)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.get_template_by_id(extId, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class GetTemplateApiResponse.

If the method is called asynchronously, returns the request thread.

get_template_version_by_id(templateExtId, extId, **kwargs)#

Get the template version detail

>>> response = api.get_template_version_by_id(templateExtId, extId)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.get_template_version_by_id(templateExtId, extId, async_req=True)
>>> result = thread.get()
Parameters:
  • templateExtId (str, required) – The identifier of a template.

  • extId (str, required) – The identifier of a version.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class GetTemplateVersionApiResponse.

If the method is called asynchronously, returns the request thread.

initiate_guest_update(extId, body=None, **kwargs)#

Initiate guest OS updates

>>> response = api.initiate_guest_update(extId, (optional) body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.initiate_guest_update(extId, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • body (InitiateGuestUpdateSpec) – Request to initiate guest update on a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class InitiateGuestUpdateApiResponse.

If the method is called asynchronously, returns the request thread.

list_template_versions(templateExtId, _page=None, _limit=None, _filter=None, _orderby=None, _select=None, **kwargs)#

List all versions in a template

>>> response = api.list_template_versions(templateExtId, (optional) _page, (optional) _limit, (optional) _filter, (optional) _orderby, (optional) _select)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.list_template_versions(templateExtId, async_req=True)
>>> result = thread.get()
Parameters:
  • templateExtId (str, required) – The identifier of a template.

  • _page (int) – 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.

  • _limit (int) – 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.

  • _filter (str) – 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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter ‘$filter=name eq ‘karbon-ntnx-1.0’ would filter the result on cluster name ‘karbon-ntnx1.0’, filter ‘$filter=startswith(name, ‘C’)’ would filter on cluster name starting with ‘C’. The filter can be applied to the following fields: - versionName

  • _orderby (str) – 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, ‘$orderby=templateName desc’ would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - createTime - versionName

  • _select (str) – 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](https://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

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class ListTemplateVersionsApiResponse.

If the method is called asynchronously, returns the request thread.

list_templates(_page=None, _limit=None, _filter=None, _orderby=None, _select=None, **kwargs)#

List all templates

>>> response = api.list_templates((optional) _page, (optional) _limit, (optional) _filter, (optional) _orderby, (optional) _select)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.list_templates(async_req=True)
>>> result = thread.get()
Parameters:
  • _page (int) – 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.

  • _limit (int) – 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.

  • _filter (str) – 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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. For example, filter ‘$filter=name eq ‘karbon-ntnx-1.0’ would filter the result on cluster name ‘karbon-ntnx1.0’, filter ‘$filter=startswith(name, ‘C’)’ would filter on cluster name starting with ‘C’. The filter can be applied to the following fields: - templateName

  • _orderby (str) – 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, ‘$orderby=templateName desc’ would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields: - templateName - updateTime

  • _select (str) – 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](https://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

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class ListTemplatesApiResponse.

If the method is called asynchronously, returns the request thread.

publish_template(extId, body, **kwargs)#

Set an active version

>>> response = api.publish_template(extId, body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.publish_template(extId, body, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • body (TemplatePublishSpec, required) – Request to publish version of a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class PublishTemplateApiResponse.

If the method is called asynchronously, returns the request thread.

update_template_by_id(extId, body=None, **kwargs)#

Update a template

>>> response = api.update_template_by_id(extId, (optional) body)

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True.

>>> thread = api.update_template_by_id(extId, async_req=True)
>>> result = thread.get()
Parameters:
  • extId (str, required) – The identifier of a template.

  • body (Template) – Request to update a template.

  • kwargs

    kwargs for the method. The following can be passed for an asynchronous HTTP call:

    async_req=True
    

Returns:

An instance of class UpdateTemplateApiResponse.

If the method is called asynchronously, returns the request thread.