TemplateDefinitionsResource


Create a template definition


If you have an OVF Envelope document available at an HTTP URL (e.g http://rs.bcn.abiquo.com:9000/ovf/10/) you can add it to Abiquo as a template definition
Category and Icon links: you can add new icons and categories while creating a Template Definition by adding the icon path in the title field of the link and/or the category name in the title field. Template definitions created using this method do not belong to any template definition list.

POST https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Content-Type : templatedefinition Accept : templatedefinition

Example

List template definitions


Retrieves template definitions for a given enterprise, including those being used in any template definition list.

GET https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Example

Delete a template definition


If the template definition being deleted is used in a template definition list, then the list is updated to exclude the deleted Template Definition. If the template is downloaded (a virtual machine template exists) then this method does NOT delete from the datacenter repository. It only makes the current template definition unavailable for downloading again.

DELETE https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Example

Get a template definition


Retrieve a template definition

GET https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Error Codes

  • OVF-PACKAGE-0 - The requested OVF package does not exist

Example

Update a template definition


Updates the content of a Template Definition. The new attribute values do not affect virtual machine templates that were already downloaded.

PUT https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Content-Type : templatedefinition Accept : templatedefinition

Error Codes

  • VIMAGE-45 - Could not modify a template with multiple disks
  • VIMAGE-46 - Could not modify disk info.

Example

Install template definition on datacenter repository


Deprecated. Use ''create virtual machine template''.

Install a template into a datacenter repository.
This method initiate the creation of a virtual machine template, by downloading the content of the template definition into the datacenter repository. The virtual machine template will be ready when the download asynchronously completes, track the download progress using 'actions/repositoryStatus'

POST https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}/actions/repositoryInstall

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Get the state of a template definition in a datacenter repository


Retrieve the state of a template definition in a given datacenter

Request to the appliance manager remote repository to retrieve the current download state of the template (NOT_DOWNLOAD, DOWNLOADING, DOWNLOAD or ERROR), on DOWNLOADING also include the ''progress'' and for ERROR the ''errorCause''

GET https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}/actions/repositoryStatus

Roles : [ROLE_APPLIB_ALLOW_MODIFY]

Parameter Type Default Value Description
datacenterId Integer Required. Identifier of the datacenter

Accept : templatestate

Example

Uninstall template definition on datacenter repository


Deprecated. Use ''delete virtual machine template''.

Cancel an install template action
Discard a template in DOWNLOADING state, do not use this method once the virtual machine template is ready, please refer to ''delete a virtual machine template'' in order to properly remove a DOWNLOAD template

POST https://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}/actions/repositoryUninstall

Roles : [ROLE_APPLIB_ALLOW_MODIFY]