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:

Virtual Machine Templates Resource

This resource represents VM templates in the Apps library.

Main URI of the Resource

This class operates mainly over the Resource URI: /admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates

Exposed Methods

List virtual machine templates

Returns all VM templates.

Paging Method

This method works with paging. Check out Basic Behaviors for information about how it works

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates
Roles Required: APPLIB_VIEW,VDC_ENUMERATE,VDC_MANAGE_VAPP, VAPP_CUSTOMISE_SETTINGS,VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.virtualmachinetemplates+json; version=4.4; application/vnd.abiquo.virtualmachinetemplates+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

categoryName

false

 

name of a category

hypervisorTypeName

false

 

type of an hypervisor

virtualdatacenter

false

 

identifier of a virtual datacenter

stateful

false

 

string value to inclued persistent templates, it can be ALL, USED or NOTUSED

imported

false

false

boolean to include imported templates

ostype

false

 

comma separated value, optionally filter by operating systems (null for no filter)

64bits

false

 

optionally filter by x64 architecture. It requires ''ostype'' param set to null
(null for any filter)

startwith

false

0

first element to retrieve

by

false

id

ordering the request.

has

false

 

filter the request. With this parameter the response just contains the elements
which name matches the filter value.

limit

false

25

number of elements to return

asc

false

true

order ascending or descending. By default the sort mode is ascending.

source

false

LOCAL

LOCAL: only retrieve templates in the database
REMOTE: (public cloud only) search in the provider, it doesn't contain already LOCAL templates
ALL: (public cloud only) both LOCAL and REMOTE templates, may contains duplicated templates (local and remote representation for the same template)

pluginfalse (only valid when ''source=REMOTE'') specify the plugin used to retrieve templates (e.g DOCKER)
externalfalsetrueif false does not return templates managed by a plugin (if you are using Docker, the container images are not physically downloaded to the NFS repository. If you need to filter the templates that physically exists in the repository you can use the "external" query parameter, setting to 'true' or 'false', to include or not the templates that are not present in the NFS)
statesfalse if present only returns templates in the desired states (comma separated values)
masterfalse if specified only returns templates with or without master link relation
diskformattypesfalse if specified only returns templates with this disk format type, for example ISO. See DiskFormatTypesResource#Retrievealldiskformattypes

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

List virtual machine templates

 Click here to show or hide the request example

 


GET_adm_ents_X_dcrpos_X_vmtmps_AC_vmtmps_j.0002.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplates+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 2, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates?limit=25&by=state&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates?startwith=0&limit=25&by=state&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "802"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/736", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "826"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/769", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "827"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/769/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/769/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/769/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/769/disks/718", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://828", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://localhost:9009/am/erepos/2146/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "1522090736", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:30.000+0000", 
      "id": "769", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "827", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }, 
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "802"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/737", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "830"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/770", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "831"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/770/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/770/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/770/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2146/datacenterrepositories/1354/virtualmachinetemplates/770/disks/719", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://832", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://localhost:9009/am/erepos/2146/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "400635096", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:30.000+0000", 
      "id": "770", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "831", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }
  ]
}

List virtual machine templates by disk format type

 Click here to show or hide the request example

GET_adm_ents_X_dcrpos_X_vmtmps_AC_vmtmps_j_dskfmttypes.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates?diskformattypes=ISO \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplates+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 1, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates?diskformattypes=ISO&limit=25&by=state&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates?diskformattypes=ISO&startwith=0&limit=25&by=state&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "1227"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/764", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "1251"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates/797", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "1252"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates/797/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates/797/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates/797/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2160/datacenterrepositories/1367/virtualmachinetemplates/797/disks/746", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://1253", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://localhost:9009/am/erepos/2160/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "1288082231", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:33.000+0000", 
      "id": "797", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "1252", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }
  ]
}
 

List virtual machine templates by disk format type and hypervisor type

 Click here to show or hide the request example

 

GET_adm_ents_X_dcrpos_X_vmtmps_AC_vmtmps_j_hypervisorTypeName_dskfmttypes.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates?hypervisorTypeName=TEST_HYPERVISOR&diskformattypes=VMDK_FLAT \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplates+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 1, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates?hypervisorTypeName=TEST_HYPERVISOR&diskformattypes=VMDK_FLAT&limit=25&by=state&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates?hypervisorTypeName=TEST_HYPERVISOR&diskformattypes=VMDK_FLAT&startwith=0&limit=25&by=state&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "874"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/742", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "898"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates/775", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "compatible-vbox"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates/775/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates/775/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates/775/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2148/datacenterrepositories/1356/virtualmachinetemplates/775/disks/724", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://899", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://localhost:9009/am/erepos/2148/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "400702842", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:31.000+0000", 
      "id": "775", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "compatible-vbox", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }
  ]
}

List virtual machine templates by parameters

 Click here to show or hide the request example
GET_adm_ents_X_dcrpos_X_vmtmps_AC_vmtmps_j_src_startw_lmt_by_id_asc_F_plugin_desc_path_ostype_name_crUser_shared_F_64bits_T.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/5923/datacenterrepositories/5228/virtualmachinetemplates?source=REMOTE&startwith=0&limit=1&by=id&asc=false&plugin=DOCKER_TEST&description=descriptionfor4&path=4&ostype=WINDOWS_8_64&name=0645BFD8EFA3D12BCD2F&creationUser=95A314FA2D0AED3DE089&shared=false&64bits=true \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplates+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "description": "descriptionfor4", 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/5923", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "178"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/2289", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "214"
        }, 
        {
          "href": "http://localhost:9009/api/config/hypervisortypes/DOCKER_TEST", 
          "type": "application/vnd.abiquo.hypervisortype+json", 
          "rel": "hypervisortype", 
          "title": "Docker test"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "3FE57AC69D9D473B76D6", 
      "ramRequired": 60, 
      "iconUrl": "http://626C01EF01C2E024BBC7", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "WINDOWS_8", 
      "id": "4", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "41E823581FE3B58775E6", 
      "enableRamHotAdd": false, 
      "enableNicsHotReconfigure": false, 
      "loginUser": "836DB2DC30D09C063226", 
      "shared": false, 
      "cpuRequired": 2, 
      "generateGuestInitialPassword": false
    }
  ]
}

 

Create a persistent template

This functionality creates a new persistent template from an existing template. To create the persistent template, the disk of the existing template will be dumped on a volume. The dto sent to this method contains:

  • two properties:
    • the name for the new volume 
    • the name for the new template
  • three required links: 
    • the link of the original template, which has the disk to dump to the volume
    • the link of the virtual datacenter, where the template will be accessible 
    • a link with the information about the storage device where the disk will be dumped, which could be a link to a specific volume or a link to a tier where a new volume will be created.

Important: this process requires a RAW conversion of the original template. If this conversion does not exist, it will be created as the first step of the process.

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates
Roles Required: VAPP_CREATE_STATEFUL,APPLIB_ALLOW_MODIFY,APPLIB_EXPORT_TO_PUBLIC,APPLIB_EXPORT_TO_PRIVATE
Request Headers: Accept: application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinetemplatepersistent+json; version=4.4; application/vnd.abiquo.virtualmachinetemplatepersistent+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineTemplatePersistent Media Type
Response Message Body Entity: AcceptedRequest Media Type
Request Example:

 Click here to show or hide the request example

POST_adm_ents_X_dcrpos_X_vmtmps_CT_vmtmppst_j_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/4151/datacenterrepositories/3559/virtualmachinetemplates \ 
	 -H 'Accept:application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplatepersistent+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "persistentTemplateName": "Persistent virtual machine template TEST", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4151/datacenterrepositories/3559/virtualmachinetemplates/1813", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2514", 
      "rel": "virtualdatacenter"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4151/datacenterrepositories/3559/virtualmachinetemplates/1813/disks/1562", 
      "rel": "disk0"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/2514/tiers/720", 
      "rel": "tier0", 
      "title": "Persistent volume TEST"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4151/datacenterrepositories/3559/virtualmachinetemplates/1814/tasks/2fc0f887-24a6-44fd-bfdd-5102e7170013", 
      "rel": "status"
    }
  ]
}

 

 

Request creation of a virtual machine template in a datacenter repository

You can create a VM template in the following ways:

  • Download: use a ''TemplateDefinition'' link in the VirtualMachineTemplateRequestDto
  • Promote: use an instance ''VirtualMachineTemplate'' link and the ''promotedName'' in VirtualMachineTemplateRequestDto
    • Since Abiquo 3.4, you can supply links to the disks to be included in the new template 
  • Duplicate: use a "virtualmachinetemplate" link and the "promotedName" in the VirtualMachineTemplateRequestDto (since Abiquo 3.4)
    • Supply links to the disks to be included in the new template
  • Export: make the request by posting to the URL of the target datacenter 

All methods pre-create the VM template and return a task to track the progress.

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates
Roles Required: VAPP_CREATE_STATEFUL,APPLIB_ALLOW_MODIFY,APPLIB_EXPORT_TO_PUBLIC,APPLIB_EXPORT_TO_PRIVATE
Request Headers: Accept: application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinetemplaterequest+json; version=4.4; application/vnd.abiquo.virtualmachinetemplaterequest+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VirtualMachineTemplateRequest Media Type
Response Message Body Entity: AcceptedRequest Media Type
Request Example:

Download a template definition to create a template

 Click here to show or hide the request

POST_adm_ents_X_dcrpos_X_vmtmps_CT_vmtmprq_j_AC_acrq_j.0003.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/3193/datacenterrepositories/2900/virtualmachinetemplates \ 
	 -H 'Accept:application/xml, application/vnd.abiquo.acceptedrequest+json; version=3.10' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplaterequest+json; version=3.10' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/3193/appslib/templateDefinitions/25", 
      "rel": "templateDefinition"
    }
  ]
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/3193/datacenterrepositories/2900/virtualmachinetemplates/1226/tasks/5997b80d-db7e-4df1-9722-4ebd7397edb3", 
      "rel": "status"
    }
  ], 
  "entity": "You can keep track of the progress in the link"
}

Promote an instance to create a template

 Click here to show or hide the request

POST_adm_ents_X_dcrpos_X_vmtmps_CT_vmtmprq_j_AC_acrq_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/1742/datacenterrepositories/1078/virtualmachinetemplates \ 
	 -H 'Accept:application/xml, application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplaterequest+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1742/appslib/templateDefinitions/1", 
      "rel": "templateDefinition"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1742/datacenterrepositories/1078/virtualmachinetemplates/442/tasks/245df2ae-feff-43ba-a8e0-4d989149f0e5", 
      "rel": "status"
    }
  ]
}

Duplicate an existing template to create a template

 Click here to show or hide the request


POST_adm_ents_X_dcrpos_X_vmtmps_CT_vmtmprq_j_AC_acrq_j.0014.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/1768/datacenterrepositories/1126/virtualmachinetemplates \ 
	 -H 'Accept:application/xml, application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplaterequest+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "promotedName": "duplicate", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1768/datacenterrepositories/1126/virtualmachinetemplates/487", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1768/datacenterrepositories/1126/virtualmachinetemplates/487/disks/451", 
      "rel": "disk0"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1768/datacenterrepositories/1126/virtualmachinetemplates/488/tasks/86b69f6f-71d9-4fe2-878a-93d4ceedd60c", 
      "rel": "status"
    }
  ]
}

Export a template to create a template

 Click here to show or hide the request


POST_adm_ents_X_dcrpos_X_vmtmps_CT_vmtmprq_j_AC_acrq_j.0017.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/1771/datacenterrepositories/1134/virtualmachinetemplates \ 
	 -H 'Accept:application/xml, application/vnd.abiquo.acceptedrequest+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplaterequest+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 202

Request payload:

{
  "promotedName": "promotedName", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1771/datacenterrepositories/1132/virtualmachinetemplates/496", 
      "rel": "virtualmachinetemplate"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1771/datacenterrepositories/1132/virtualmachinetemplates/496/disks/460", 
      "rel": "disk0"
    }
  ]
}

Response payload:

{
  "message": "You can keep track of the progress in the link", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1771/datacenterrepositories/1134/virtualmachinetemplates/497/tasks/72ee6f88-61cf-4797-8b69-199425c20b3a", 
      "rel": "status"
    }
  ]
}

 

 

Create a template in the datacenter repository based on template definition

Request a VM template download into a datacenter repository.

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates
Roles Required: VAPP_CREATE_STATEFUL,APPLIB_ALLOW_MODIFY,APPLIB_EXPORT_TO_PUBLIC,APPLIB_EXPORT_TO_PRIVATE
Request Headers: Accept: application/vnd.abiquo.acceptedrequest+json; version=4.4; application/vnd.abiquo.acceptedrequest+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: AcceptedRequest Media Type
Request Example:

 Click here to show or hide the request example

UPDATE EXAMPLE

Install template in datacenterrepository based on TemplateDefinition representation example
curl --verbose -u user:password -X POST example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates -H "content-type:application/vnd.abiquo.templatedefinition+xml;version=2.4" -H "accept:application/vnd.abiquo.acceptedrequest+xml;version=2.4" -d @dtos/templatedefinition.xml


> POST /api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: example.com
> accept:application/vnd.abiquo.acceptedrequest+xml;version=2.4
> content-type:application/vnd.abiquo.templatedefinition+xml;version=2.4
> Content-Length: 525


< HTTP/1.1 202 Aceptado
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTM2MzI1ODQ0MTgxMTpmZjIwZmY2NGE4Y2YwYjdhN2JlZWVmNGQ3YzFhNjI3YTpBQklRVU8; Expires=Thu, 14-Mar-2013 10:54:01 GMT; Path=/api
< Set-Cookie: JSESSIONID=5E1195809DDA3F7570F30B370B3079A1; Path=/api
< Content-Type: application/vnd.abiquo.acceptedrequest+xml;version=2.4
< Content-Length: 439
< Date: Thu, 14 Mar 2013 10:24:02 GMT


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<acceptedrequest>
    <link rel="status" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/2/tasks/f5cf66c4-ce19-436f-9f40-f3535f2f28f4"/>
    <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">You can keep track of the progress in the link</message>
</acceptedrequest>

 

 

 

Get a task on a virtual machine template

Displays a specific task on the VM template. Tasks are a set of jobs (operations on hypervisors). Any of these tasks may still be in progress. Every task has a UUID.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/tasks/{id}
Roles Required: APPLIB_VIEW,APPLIB_ALLOW_MODIFY,VDC_MANAGE_VAPP,VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.task+json; version=4.4; application/vnd.abiquo.task+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
GET_adm_ents_X_dcrpos_X_vmtmps_X_disks_X_tsks_X_AC_tsk_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/5532/datacenterrepositories/4864/virtualmachinetemplates/2284/disks/1949/tasks/e6c287c7-e50e-4ee7-927c-26bb9e62f2dd \ 
	 -H 'Accept:application/vnd.abiquo.task+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "creationTimestamp": 1512487966, 
  "jobs": {
    "links": [], 
    "collection": [
      {
        "type": "COPY_DISK", 
        "description": "Copy disk task's copy disk on virtual machine template with id 2284", 
        "links": [
          {
            "href": "http://localhost:9009/apihttp://localhost:9009/api/admin/enterprises/5532/datacenterrepositories/4864/virtualmachinetemplates/2284/disks/1949", 
            "rel": "disk"
          }
        ], 
        "parentTaskId": "e6c287c7-e50e-4ee7-927c-26bb9e62f2dd", 
        "rollbackState": "UNKNOWN", 
        "state": "PENDING", 
        "timestamp": 1512487966, 
        "creationTimestamp": 1512487966, 
        "id": "e6c287c7-e50e-4ee7-927c-26bb9e62f2dd.d5e08bd5-65db-4ecd-aa7d-27d98da3dfc1"
      }
    ]
  }, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/5532/datacenterrepositories/4864/virtualmachinetemplates/2284/disks/1949/tasks/e6c287c7-e50e-4ee7-927c-26bb9e62f2dd", 
      "rel": "self"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/5532/datacenterrepositories/4864/virtualmachinetemplates/2284/disks/1949/tasks", 
      "rel": "parent"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/5532/datacenterrepositories/4864/virtualmachinetemplates/2284/disks/1949", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "result"
    }
  ], 
  "timestamp": 1512487966, 
  "userId": "-1732742935", 
  "state": "FINISHED_SUCCESSFULLY", 
  "taskId": "e6c287c7-e50e-4ee7-927c-26bb9e62f2dd", 
  "ownerId": "2284", 
  "type": "COPY_DISK"
}

 

Retrieve a task for a virtual machine template example
curl --verbose -u user:password http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d -X GET -H "accept:application/vnd.abiquo.task+xml;version=2.4"

> GET /api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: example.com
> accept:application/vnd.abiquo.task+xml;version=2.4

< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTM1OTYyNzIyNzY5Mzo3NWRkZmY4ZDUyM2Q5YmFmNDJhNWJhZjI3NWNhMDE1ODpBQklRVU8; Expires=Thu, 31-Jan-2013 10:13:47 GMT; Path=/api
< Set-Cookie: JSESSIONID=E55F6C171504DFD98EEA70EC3C3AF7EB; Path=/api
< Content-Type: application/vnd.abiquo.task+xml;version=2.4
< Content-Length: 1196
< Date: Thu, 31 Jan 2013 09:43:47 GMT

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<task>
    <link rel="parent" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks"/>
    <link rel="result" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26"/>
    <link rel="self" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d"/>
    <creationTimestamp>1359624796</creationTimestamp>
    <jobs>
        <job>
            <creationTimestamp>1359624796</creationTimestamp>
            <description>Make persistent task's dump disk to volume on virtual machine template with id 26</description>
            <id>740268ef-0df8-46f7-b92d-9aae33ac481c</id>
            <parentTaskId>eee40847-974b-4501-801d-c36c87b09f9d</parentTaskId>
            <rollbackState>UNKNOWN</rollbackState>
            <state>DONE</state>
            <timestamp>1359624815</timestamp>
            <type>DUMP_DISK_TO_VOLUME</type>
        </job>
    </jobs>
    <ownerId>26</ownerId>
    <state>FINISHED_SUCCESSFULLY</state>
    <taskId>eee40847-974b-4501-801d-c36c87b09f9d</taskId>
    <timestamp>1359624815</timestamp>
    <type>MAKE_PERSISTENT</type>
    <userId>admin</userId>
</task>


Get a virtual machine template

Returns a VM template.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}
Roles Required: APPLIB_VIEW,VDC_ENUMERATE,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS,VAPP_PERFORM_ACTIONS,VAPP_DEPLOY_UNDEPLOY,VAPP_ASSIGN_NETWORK,VAPP_ASSIGN_VOLUME,VAPP_CREATE_STATEFUL,PHYS_DC_RETRIEVE_DETAILS,MANAGE_HARD_DISKS
Request Headers: Accept: application/vnd.abiquo.virtualmachinetemplate+json; version=4.4; application/vnd.abiquo.virtualmachinetemplate+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
GET_adm_ents_X_dcrpos_X_vmtmps_X_AC_vmtmp_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24 \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplate+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/70", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "90"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/29", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "169"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "edit", 
      "title": "dummyTemplate"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22", 
      "type": "application/vnd.abiquo.datacenterrepository+json", 
      "rel": "datacenterrepository", 
      "title": "repository"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/action/virtualmachines", 
      "type": "application/vnd.abiquo.virtualmachines+json", 
      "rel": "virtualmachines", 
      "title": "virtual machines"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/disks", 
      "type": "application/vnd.abiquo.disks+json", 
      "rel": "disks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/disks/24", 
      "type": "application/vnd.abiquo.disk+json", 
      "rel": "disk0"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/disks/25", 
      "type": "application/vnd.abiquo.disk+json", 
      "rel": "disk3"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/70/datacenterrepositories/22/virtualmachinetemplates/24/disks/26", 
      "type": "application/vnd.abiquo.disk+json", 
      "rel": "disk4"
    }, 
    {
      "href": "http://localhost:8080/am/erepos/70/templates/", 
      "rel": "templatePath", 
      "title": "template path"
    }
  ], 
  "state": "UNAVAILABLE", 
  "variables": {}, 
  "enableCpuHotAdd": false, 
  "creationUser": "92", 
  "ramRequired": 1, 
  "enableRemoteAccessHotReconfigure": false, 
  "enableDisksHotReconfigure": false, 
  "osType": "OTHER_64", 
  "creationDate": "2017-12-05T15:20:46.000+0000", 
  "id": "24", 
  "enableOnlyHPRecommended": false, 
  "chefEnabled": false, 
  "name": "dummyTemplate", 
  "enableNicsHotReconfigure": false, 
  "enableRamHotAdd": false, 
  "shared": false, 
  "cpuRequired": 1, 
  "generateGuestInitialPassword": false
}

List tasks on a virtual machine template

Displays the tasks on the VM template. Tasks are a set of jobs (operations). Any of these tasks may still be in progress.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/tasks
Roles Required: APPLIB_VIEW,APPLIB_ALLOW_MODIFY,VDC_MANAGE_VAPP
Request Headers: Accept: application/vnd.abiquo.tasks+json; version=4.4; application/vnd.abiquo.tasks+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

GET_adm_ents_X_dcrpos_X_vmtmps_X_tsks_AC_tsks_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2062/datacenterrepositories/1297/virtualmachinetemplates/691/tasks \ 
	 -H 'Accept:application/vnd.abiquo.tasks+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/2062/datacenterrepositories/1297/virtualmachinetemplates/691/tasks", 
      "rel": "self"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/2062/datacenterrepositories/1297/virtualmachinetemplates/691", 
      "rel": "parent"
    }
  ], 
  "collection": [
    {
      "creationTimestamp": 1512487461, 
      "jobs": {
        "links": [], 
        "collection": [
          {
            "type": "DUMP_DISK_TO_VOLUME", 
            "description": "Random description", 
            "links": [], 
            "parentTaskId": "ed34da81-86ba-43b8-af01-1a59b8059078", 
            "rollbackState": "UNKNOWN", 
            "state": "PENDING", 
            "timestamp": 1512487461, 
            "creationTimestamp": 1512487461, 
            "id": "6aec010c-880b-4633-b029-83358cc18991"
          }
        ]
      }, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2062/datacenterrepositories/1297/virtualmachinetemplates/691/tasks/ed34da81-86ba-43b8-af01-1a59b8059078", 
          "rel": "self"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2062/datacenterrepositories/1297/virtualmachinetemplates/691/tasks", 
          "rel": "parent"
        }
      ], 
      "timestamp": 1512487461, 
      "userId": "1970", 
      "state": "FINISHED_SUCCESSFULLY", 
      "taskId": "ed34da81-86ba-43b8-af01-1a59b8059078", 
      "ownerId": "691", 
      "type": "MAKE_PERSISTENT"
    }
  ]
}

Update a virtual machine template

Modifies a VM template.

You can also modify the recommended hardware profiles by adding the appropriate links, see HardwareProfiles, which explains how to retrieve these links.

Synopsis: PUT http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}
Roles Required: APPLIB_ALLOW_MODIFY,VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.virtualmachinetemplate+json; version=4.4; application/vnd.abiquo.virtualmachinetemplate+xml; version=4.4;  Content-type:  application/vnd.abiquo.virtualmachinetemplate+json; version=4.4; application/vnd.abiquo.virtualmachinetemplate+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

PUT_adm_ents_X_dcrpos_X_vmtmps_X_CT_vmtmp_j_AC_vmtmp_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519 \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplate+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachinetemplate+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "description": "new desc", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "351"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/534", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "396"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "edit", 
      "title": "370"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156", 
      "type": "application/vnd.abiquo.datacenterrepository+json", 
      "rel": "datacenterrepository", 
      "title": "repository"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/action/virtualmachines", 
      "type": "application/vnd.abiquo.virtualmachines+json", 
      "rel": "virtualmachines", 
      "title": "virtual machines"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/disks", 
      "type": "application/vnd.abiquo.disks+json", 
      "rel": "disks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/disks/483", 
      "type": "application/vnd.abiquo.disk+json", 
      "rel": "disk0"
    }, 
    {
      "href": "http://371", 
      "rel": "templatedefinition", 
      "title": "template definition"
    }
  ], 
  "variables": {}, 
  "enableCpuHotAdd": false, 
  "enableRamHotAdd": false, 
  "creationUser": "113718685", 
  "ramRequired": 4, 
  "iconUrl": "http://newicon.com/icon.jpg", 
  "enableRemoteAccessHotReconfigure": false, 
  "costCode": 1, 
  "enableDisksHotReconfigure": false, 
  "osType": "DEBIAN_64", 
  "osVersion": "2.0", 
  "loginPassword": "passpass", 
  "enableOnlyHPRecommended": false, 
  "creationDate": "2017-12-05T15:23:46.000+0000", 
  "chefEnabled": true, 
  "name": "new name", 
  "state": "DONE", 
  "id": "519", 
  "enableNicsHotReconfigure": false, 
  "loginUser": "useruser", 
  "shared": false, 
  "cpuRequired": 1, 
  "generateGuestInitialPassword": false
}

Response payload:

{
  "description": "new desc", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "351"
    }, 
    {
      "href": "http://localhost:9009/api/config/categories/534", 
      "type": "application/vnd.abiquo.category+json", 
      "rel": "category", 
      "title": "396"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519", 
      "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
      "rel": "edit", 
      "title": "new name"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/tasks", 
      "type": "application/vnd.abiquo.tasks+json", 
      "rel": "tasks", 
      "title": "tasks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156", 
      "type": "application/vnd.abiquo.datacenterrepository+json", 
      "rel": "datacenterrepository", 
      "title": "repository"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/action/virtualmachines", 
      "type": "application/vnd.abiquo.virtualmachines+json", 
      "rel": "virtualmachines", 
      "title": "virtual machines"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/disks", 
      "type": "application/vnd.abiquo.disks+json", 
      "rel": "disks", 
      "title": "disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1795/datacenterrepositories/1156/virtualmachinetemplates/519/disks/483", 
      "type": "application/vnd.abiquo.disk+json", 
      "rel": "disk0"
    }, 
    {
      "href": "http://371", 
      "rel": "templatedefinition", 
      "title": "template definition"
    }
  ], 
  "variables": {}, 
  "enableCpuHotAdd": false, 
  "enableRamHotAdd": false, 
  "creationUser": "113718685", 
  "ramRequired": 4, 
  "iconUrl": "http://newicon.com/icon.jpg", 
  "enableRemoteAccessHotReconfigure": false, 
  "costCode": 1, 
  "enableDisksHotReconfigure": false, 
  "osType": "DEBIAN_64", 
  "osVersion": "2.0", 
  "loginPassword": "passpass", 
  "enableOnlyHPRecommended": false, 
  "creationDate": "2017-12-05T15:23:46.000+0000", 
  "chefEnabled": true, 
  "name": "new name", 
  "state": "DONE", 
  "id": "519", 
  "enableNicsHotReconfigure": false, 
  "loginUser": "useruser", 
  "shared": false, 
  "cpuRequired": 1, 
  "generateGuestInitialPassword": false
}

 

Delete a virtual machine template

Deletes a virtual machine template.

Synopsis: DELETE http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}
Roles Required: APPLIB_ALLOW_MODIFY,VAPP_CREATE_STATEFUL
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_dcrpos_X_vmtmps_X.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/admin/enterprises/1671/datacenterrepositories/1024/virtualmachinetemplates/394 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Make a VM template unavailable

If the VM template is in use (by instances or virtual machines) you cannot delete it but you can mark it as unavailable. This will remove the template disk file from the repository filesystem but keep the reference to the template in the API as a VM template with state = UNAVAILABLE

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/action/deletefile
Roles Required: APPLIB_ALLOW_MODIFY,VAPP_CREATE_STATEFUL
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

POST_adm_ents_X_dcrpos_X_vmtmps_X_act_delfile.0001.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/1882/datacenterrepositories/1201/virtualmachinetemplates/588/action/deletefile \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

 

Get a task and job info for a virtual machine template

This request provides additional information about jobs in a task on a virtual machine template. Displays a specific task on the virtual machine template. Tasks are a set of jobs (operations on hypervisors). Any of these tasks may still be in progress. Every task has a UUID. Extra job information includes downloading progress or error cause.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/tasks/{id}
Roles Required: ROLE_APPLIB_VIEW,ROLE_APPLIB_ALLOW_MODIFY,ROLE_VDC_MANAGE_VAPP,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.taskextended+json; version=4.4; application/vnd.abiquo.taskextended+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
UPDATE EXAMPLE

 

Retrieve a task including additional job info (progress, errorCause) for a virtual machine template example
curl --verbose -u user:password http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d -X GET -H "accept:application/vnd.abiquo.taskextended+xml;version=2.4"

> GET /api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: example.com
> accept:application/vnd.abiquo.taskextended+xml;version=2.4

< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTM1OTYyNzI5NjA1NTo2YzE0MzE5MzU3MmU1YzViNjgxODY1ZDlmNmMxN2E5ZTpBQklRVU8; Expires=Thu, 31-Jan-2013 10:14:56 GMT; Path=/api
< Set-Cookie: JSESSIONID=CF17A6EF50AD63A1DA78F1C969373AC9; Path=/api
< Content-Type: application/vnd.abiquo.taskextended+xml;version=2.4
< Content-Length: 1146
< Date: Thu, 31 Jan 2013 09:44:56 GMT

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<taskextended>
    <link rel="parent" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks"/>
    <link rel="result" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26"/>
    <link rel="self" href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/26/tasks/eee40847-974b-4501-801d-c36c87b09f9d"/>
    <ownerId>26</ownerId>
    <state>FINISHED_SUCCESSFULLY</state>
    <taskId>eee40847-974b-4501-801d-c36c87b09f9d</taskId>
    <timestamp>1359624815</timestamp>
    <type>MAKE_PERSISTENT</type>
    <userId>admin</userId>
    <jobsExtended>
        <jobextended>
            <description>Make persistent task's dump disk to volume on virtual machine template with id 26</description>
            <id>740268ef-0df8-46f7-b92d-9aae33ac481c</id>
            <parentTaskId>eee40847-974b-4501-801d-c36c87b09f9d</parentTaskId>
            <rollbackState>UNKNOWN</rollbackState>
            <state>DONE</state>
            <timestamp>1359624815</timestamp>
            <type>DUMP_DISK_TO_VOLUME</type>
        </jobextended>
    </jobsExtended>
</taskextended>


 

 

List instances of a virtual machine template

Returns all the virtual machine templates instances of the current (master) virtual machine template

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/action/instances
Roles Required: APPLIB_VIEW,VDC_MANAGE_VAPP,VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept: application/vnd.abiquo.virtualmachinetemplates+json; version=4.4; application/vnd.abiquo.virtualmachinetemplates+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

allenterprises

false

false

a cloudadmin can see all the virtual machine templates in all enterprises (by default only see those in its current enterprise)

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

 Click here to show or hide the request example

GET_adm_ents_X_dcrpos_X_vmtmps_X_act_insts_AC_vmtmps_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/681/action/instances \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachinetemplates+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "2604"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/686", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "2623"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/682", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "2627"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/682/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/682/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/681", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "master", 
          "title": "2624"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/682/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/682/disks/631", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://2628", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://somewhere/am/erepos/2050/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "657192210", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:19.000+0000", 
      "id": "682", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "2627", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }, 
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "2604"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/686", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "2623"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/683", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "2630"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/683/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/683/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/681", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "master", 
          "title": "2624"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/683/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/683/disks/632", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://2631", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://somewhere/am/erepos/2050/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }, 
        {
          "href": "http://localhost:9009/api/admin/scopes/1700", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scope", 
          "title": "Global scope"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "-1696631429", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:19.000+0000", 
      "id": "683", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "2630", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": true, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }, 
    {
      "links": [
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "2604"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/686", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "2623"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/684", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "edit", 
          "title": "2633"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/684/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292", 
          "type": "application/vnd.abiquo.datacenterrepository+json", 
          "rel": "datacenterrepository", 
          "title": "repository"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/684/action/virtualmachines", 
          "type": "application/vnd.abiquo.virtualmachines+json", 
          "rel": "virtualmachines", 
          "title": "virtual machines"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/681", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "master", 
          "title": "2624"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/684/disks", 
          "type": "application/vnd.abiquo.disks+json", 
          "rel": "disks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2050/datacenterrepositories/1292/virtualmachinetemplates/684/disks/633", 
          "type": "application/vnd.abiquo.disk+json", 
          "rel": "disk0"
        }, 
        {
          "href": "http://2634", 
          "rel": "templatedefinition", 
          "title": "template definition"
        }, 
        {
          "href": "http://somewhere/am/erepos/2050/templates/", 
          "rel": "templatePath", 
          "title": "template path"
        }
      ], 
      "variables": {}, 
      "enableCpuHotAdd": false, 
      "creationUser": "-511541139", 
      "ramRequired": 4, 
      "iconUrl": "http://validiconurl.com/icon.jpg", 
      "enableRemoteAccessHotReconfigure": false, 
      "enableDisksHotReconfigure": false, 
      "osType": "OTHER_64", 
      "creationDate": "2017-12-05T15:24:19.000+0000", 
      "id": "684", 
      "enableOnlyHPRecommended": false, 
      "chefEnabled": false, 
      "name": "2633", 
      "state": "DONE", 
      "enableNicsHotReconfigure": false, 
      "enableRamHotAdd": false, 
      "shared": false, 
      "cpuRequired": 1, 
      "generateGuestInitialPassword": false
    }
  ]
}

 

List virtual machines using a template

Returns all the virtual machines with relation to the current virtual machine template

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/action/virtualmachines
Roles Required: APPLIB_VIEW,VDC_MANAGE_VAPP, VAPP_CUSTOMISE_SETTINGS
Request Headers: Accept: application/vnd.abiquo.virtualmachine+json; version=4.4; application/vnd.abiquo.virtualmachine+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

allenterprises

false

false

a cloudadmin can see all the virtual machine templates in all enterprises (by default only see those in its current enterprise)

hashypervisorfalse 

if provided filter returned vms having/not having a relation to some hypervisor

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

 Click here to show or hide the request example
GET_adm_ents_X_dcrpos_X_vmtmps_X_act_vms_AC_vms_j_hashv_F.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/2086/datacenterrepositories/1307/virtualmachinetemplates/702/action/virtualmachines?hashypervisor=false \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachines+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "edit", 
          "title": "imnotdeployed"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2086", 
          "type": "application/vnd.abiquo.enterprise+json", 
          "rel": "enterprise", 
          "title": "3025"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2086/users/2002", 
          "type": "application/vnd.abiquo.user+json", 
          "rel": "user", 
          "title": "3035 3036"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "3051"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453", 
          "type": "application/vnd.abiquo.virtualappliance+json", 
          "rel": "virtualappliance", 
          "title": "3048"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/metadata", 
          "type": "application/vnd.abiquo.metadata+json", 
          "rel": "metadata", 
          "title": "metadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/network/configurations", 
          "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json", 
          "rel": "configurations", 
          "title": "vlan network configurations"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/network/nics", 
          "type": "application/vnd.abiquo.nics+json", 
          "rel": "nics", 
          "title": "nics"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/storage/disks", 
          "type": "application/vnd.abiquo.harddisks+json", 
          "rel": "harddisks", 
          "title": "disks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/state", 
          "type": "application/vnd.abiquo.virtualmachinestate+json", 
          "rel": "state", 
          "title": "NOT_ALLOCATED"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/undeploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "undeploy", 
          "title": "virtual machine undeploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/deploy", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "deploy", 
          "title": "virtual machine deploy"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/reset", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "reset", 
          "title": "virtual machine reset"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/instance", 
          "type": "application/vnd.abiquo.acceptedrequest+json", 
          "rel": "instance", 
          "title": "virtual machine snapshot"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/config/rdpaccess", 
          "type": "application/vnd.abiquo.virtualmachineconsole+json", 
          "rel": "rdpaccess", 
          "title": "remote access"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/tasks", 
          "type": "application/vnd.abiquo.tasks+json", 
          "rel": "tasks", 
          "title": "tasks"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/firewalls", 
          "type": "application/vnd.abiquo.links+json", 
          "rel": "firewalls", 
          "title": "firewalls"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/loadbalancers", 
          "type": "application/vnd.abiquo.loadbalancers+json", 
          "rel": "loadbalancers", 
          "title": "load balancers"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/backup/action/request", 
          "type": "application/vnd.abiquo.ondemandbackup+json", 
          "rel": "requestbackup", 
          "title": "request on demand backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/backup/action/restore", 
          "type": "application/vnd.abiquo.restore+json", 
          "rel": "requestrestore", 
          "title": "request a restore of a backup"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/storage/volumes", 
          "type": "application/vnd.abiquo.volumes+json", 
          "rel": "volumes", 
          "title": "volumes"
        }, 
        {
          "length": "10", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/disks/1650", 
          "rel": "disk0", 
          "title": "a2b22125-ba09-4221-81a3-a3fbee6bb7b2", 
          "diskControllerType": "IDE", 
          "type": "application/vnd.abiquo.harddisk+json"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/protect", 
          "type": "text/plain", 
          "rel": "protect", 
          "title": "protect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/unprotect", 
          "type": "text/plain", 
          "rel": "unprotect", 
          "title": "unprotect"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/metrics", 
          "type": "application/vnd.abiquo.metricsmetadata+json", 
          "rel": "metricsmetadata", 
          "title": "metricsmetadata"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/metrics/collectd", 
          "type": "application/json", 
          "rel": "collectd", 
          "title": "collectd"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/alarms", 
          "type": "application/vnd.abiquo.alarms+json", 
          "rel": "alarms", 
          "title": "alarms"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplans+json", 
          "rel": "actionplans", 
          "title": "actionplans"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/actionplans", 
          "type": "application/vnd.abiquo.virtualmachineactionplansflat+json", 
          "rel": "actionplansflat", 
          "title": "actionplansflat"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/683/virtualappliances/453/virtualmachines/433/action/clone", 
          "type": "application/vnd.abiquo.virtualmachinecloneoptions+json", 
          "rel": "clone", 
          "title": "clone"
        }, 
        {
          "href": "http://localhost:9009/api/config/hypervisortypes/TEST_HYPERVISOR", 
          "type": "application/vnd.abiquo.hypervisortype+json", 
          "rel": "hypervisortype", 
          "title": "TestHypervisor"
        }, 
        {
          "href": "http://localhost:9009/api/admin/enterprises/2086/datacenterrepositories/1307/virtualmachinetemplates/702", 
          "type": "application/vnd.abiquo.virtualmachinetemplate+json", 
          "rel": "virtualmachinetemplate", 
          "title": "3045"
        }, 
        {
          "href": "http://localhost:9009/api/config/categories/701", 
          "type": "application/vnd.abiquo.category+json", 
          "rel": "category", 
          "title": "3044"
        }
      ], 
      "idType": 0, 
      "variables": {}, 
      "ram": 4, 
      "highDisponibility": 0, 
      "creationTimestamp": 1512487463000, 
      "id": 433, 
      "uuid": "240fa92e-7bb8-44bf-b42f-b67d27a0deef", 
      "vdrpPort": 0, 
      "backuppolicies": [], 
      "monitored": false, 
      "name": "imnotdeployed", 
      "idState": 1, 
      "vdrpEnabled": true, 
      "state": "NOT_ALLOCATED", 
      "protected": false, 
      "lastSynchronize": 1512487463000, 
      "type": "NOT_MANAGED", 
      "cpu": 1, 
      "generateGuestInitialPassword": false, 
      "metadata": null
    }
  ]
}