Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 4.4

Skip to end of metadata
Go to start of metadata

Contents:

Template Definition Resource

Main URI of the Resource

This class operates mainly over the Resource URI: /admin/enterprises/{enterprise}/appslib/templateDefinitions

Exposed Methods

Retrieve all the template definitions

This method retrieves all the Template Definitions for a given enterprise, including those that are being used in any Template Definition List.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions
Roles Required: APPLIB_ALLOW_MODIFY
Request Headers: Accept: application/vnd.abiquo.templatedefinitions+json; version=4.4; application/vnd.abiquo.templatedefinitions+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: TemplateDefinitions Media Type
Request Example:

 Click here to show or hide the request example

GET_adm_ents_X_appslib_tmpdefs_AC_tmpdefs_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/6362/appslib/templateDefinitions \ 
	 -H 'Accept:application/vnd.abiquo.templatedefinitions+json; version=3.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "diskFormatType": "VDI_FLAT", 
      "description": "9", 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "0"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/2435", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "6"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362/appslib/templateDefinitions/82", 
          "type": "application/vnd.abiquo.templatedefinition+json", 
          "rel": "edit", 
          "title": "7"
        }
      ], 
      "url": "http://13", 
      "productUrl": "10", 
      "productName": "8", 
      "iconUrl": "http://validuri.com/icon.png", 
      "diskFileSize": 14, 
      "productVersion": "12", 
      "osType": "OTHER_64", 
      "productVendor": "11", 
      "id": 82, 
      "name": "7"
    }, 
    {
      "diskFormatType": "VDI_FLAT", 
      "description": "18", 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "0"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/2435", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "6"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362/appslib/templateDefinitions/83", 
          "type": "application/vnd.abiquo.templatedefinition+json", 
          "rel": "edit", 
          "title": "16"
        }
      ], 
      "url": "http://22", 
      "productUrl": "19", 
      "productName": "17", 
      "iconUrl": "http://validuri.com/icon.png", 
      "diskFileSize": 23, 
      "productVersion": "21", 
      "osType": "OTHER_64", 
      "productVendor": "20", 
      "id": 83, 
      "name": "16"
    }, 
    {
      "diskFormatType": "VDI_FLAT", 
      "description": "27", 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "0"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/2435", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "6"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/6362/appslib/templateDefinitions/84", 
          "type": "application/vnd.abiquo.templatedefinition+json", 
          "rel": "edit", 
          "title": "25"
        }
      ], 
      "url": "http://31", 
      "productUrl": "28", 
      "productName": "26", 
      "iconUrl": "http://validuri.com/icon.png", 
      "diskFileSize": 32, 
      "productVersion": "30", 
      "osType": "OTHER_64", 
      "productVendor": "29", 
      "id": 84, 
      "name": "25"
    }
  ]
}

Create a template definition

If you have an OVF Envelope document available in an HTTP URL (e.g http://rs.bcn.abiquo.com:9000/ovf/10/) you can use it to add as a template definition into Abiquo. 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.

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions
Roles Required: APPLIB_ALLOW_MODIFY
Request Headers: Accept: application/vnd.abiquo.templatedefinition+json; version=4.4; application/vnd.abiquo.templatedefinition+xml; version=4.4;  Content-type:  application/vnd.abiquo.templatedefinition+json; version=4.4; application/vnd.abiquo.templatedefinition+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: TemplateDefinition Media Type
Response Message Body Entity: TemplateDefinition Media Type
Request Example:

 Click here to show or hide the request example

POST_adm_ents_X_appslib_tmpdefs_CT_tmpdef_j_AC_tmpdef_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/6363/appslib/templateDefinitions \ 
	 -H 'Accept:application/vnd.abiquo.templatedefinition+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.templatedefinition+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "iconUrl": "http://www.google.com/logos/2011/Albert_Szent_Gyorgyi-2011-hp.jpg", 
  "description": "test_created_desc", 
  "templatedefinitiondisks": [], 
  "url": "http://www.abiquo.com", 
  "links": [
    {
      "href": "", 
      "rel": "category", 
      "title": "category_1"
    }
  ], 
  "productName": "created_dec"
}

Response payload:

{
  "description": "test_created_desc", 
  "templatedefinitiondisks": [], 
  "url": "http://www.abiquo.com", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/6363", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "34"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/2436", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "category_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/6363/appslib/templateDefinitions/85", 
      "type": "application/vnd.abiquo.templatedefinition+json", 
      "rel": "edit"
    }
  ], 
  "productName": "created_dec", 
  "iconUrl": "http://www.google.com/logos/2011/Albert_Szent_Gyorgyi-2011-hp.jpg", 
  "osType": "OTHER_64", 
  "id": 85
}

 

Retrieve a template definition

Get the content of a Template Definition.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}
Roles Required: APPLIB_ALLOW_MODIFY
Request Headers: Accept: application/vnd.abiquo.templatedefinition+json; version=4.4; application/vnd.abiquo.templatedefinition+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: TemplateDefinition Media Type
Request Example:

 Click here to show or hide the request example

GET_adm_ents_X_appslib_tmpdefs_X_AC_tmpdef_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/1870/appslib/templateDefinitions/52 \ 
	 -H 'Accept:application/vnd.abiquo.templatedefinition+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "description": "templateDef_1", 
  "templatedefinitiondisks": [], 
  "url": "http://35", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1870", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "19"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/594", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "category_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1870/appslib/templateDefinitionLists/9", 
      "type": "application/vnd.abiquo.templatedefinitionlist+json", 
      "rel": "templateDefinitionList", 
      "title": "templateDefinitionList_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1870/appslib/templateDefinitionLists/10", 
      "type": "application/vnd.abiquo.templatedefinitionlist+json", 
      "rel": "templateDefinitionList", 
      "title": "templateDefinitionList_2"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1870/appslib/templateDefinitions/52", 
      "type": "application/vnd.abiquo.templatedefinition+json", 
      "rel": "edit", 
      "title": "29"
    }
  ], 
  "productName": "30", 
  "iconUrl": "http://validuri.com/icon.png", 
  "productUrl": "32", 
  "productVersion": "34", 
  "osType": "OTHER_64", 
  "productVendor": "33", 
  "id": 52, 
  "name": "29"
}

Modify a template definition

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

Synopsis: PUT http://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}
Roles Required: APPLIB_ALLOW_MODIFY
Request Headers: Accept: application/vnd.abiquo.templatedefinition+json; version=4.4; application/vnd.abiquo.templatedefinition+xml; version=4.4;  Content-type:  application/vnd.abiquo.templatedefinition+json; version=4.4; application/vnd.abiquo.templatedefinition+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: TemplateDefinition Media Type
Response Message Body Entity: TemplateDefinition Media Type
Request Example:

 Click here to show or hide the request example

PUT_adm_ents_X_appslib_tmpdefs_X_CT_tmpdef_j_AC_tmpdef_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/admin/enterprises/1872/appslib/templateDefinitions/54 \ 
	 -H 'Accept:application/vnd.abiquo.templatedefinition+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.templatedefinition+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "description": "new_description", 
  "templatedefinitiondisks": [], 
  "url": "http://some.com/url", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "57"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/596", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "category_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872/appslib/templateDefinitionLists/13", 
      "type": "application/vnd.abiquo.templatedefinitionlist+json", 
      "rel": "templateDefinitionList", 
      "title": "templateDefinitionList_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872/appslib/templateDefinitions/54", 
      "type": "application/vnd.abiquo.templatedefinition+json", 
      "rel": "edit", 
      "title": "67"
    }
  ], 
  "productName": "68", 
  "iconUrl": "http://validuri.com/icon.png", 
  "productUrl": "70", 
  "productVersion": "72", 
  "osType": "OTHER_64", 
  "productVendor": "71", 
  "id": 54, 
  "name": "67"
}

Response payload:

{
  "description": "new_description", 
  "templatedefinitiondisks": [], 
  "url": "http://some.com/url", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "57"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/596", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "category_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872/appslib/templateDefinitionLists/13", 
      "type": "application/vnd.abiquo.templatedefinitionlist+json", 
      "rel": "templateDefinitionList", 
      "title": "templateDefinitionList_1"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1872/appslib/templateDefinitions/54", 
      "type": "application/vnd.abiquo.templatedefinition+json", 
      "rel": "edit", 
      "title": "67"
    }
  ], 
  "productName": "68", 
  "iconUrl": "http://validuri.com/icon.png", 
  "productUrl": "70", 
  "productVersion": "72", 
  "osType": "OTHER_64", 
  "productVendor": "71", 
  "id": 54, 
  "name": "67"
}

 

Delete a template definition

If the current 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.

Synopsis: DELETE http://example.com/api/admin/enterprises/{enterprise}/appslib/templateDefinitions/{templateDefinition}
Roles Required: APPLIB_ALLOW_MODIFY
Request Headers: Accept: ; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity:
Request Example:

 Click here to show or hide the request example

DELETE_adm_ents_X_appslib_tmpdefs_X.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/admin/enterprises/1869/appslib/templateDefinitions/51 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--