Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Format: API Documentation tip added (2nd)

...

Optionally create a Virtual Appliance


Tip
title API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualApplianceResource.



Div
classwidecode tinycode

API Roles required:


Code Block
titleCREATE a Virtual Appliance
* This action requires the privilege VDC_MANAGE_VAPP


cURL:


Code Block
curl -X POST https://example.com/api/cloud/virtualdatacenters/490/virtualappliances \ 
	 -H 'Accept:application/vnd.abiquo.virtualappliance+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualappliance+json; version=4.2' \ 
	 -d @requestpayload.xml \ 
	 -u user:password --verbose 


Success status code: 201

Request payload:


Code Block
{
	"name":"vapp_vdc_m01j_001",
	"iconUrl":"https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png"
}


Response payload:


Expand
titleClick here to show/hide the example response



Code Block
{
   "id":836,
   "error":0,
   "highDisponibility":0,
   "name":"vapp_vdc_m01j_001",
   "publicApp":0,
   "state":"NOT_DEPLOYED",
   "iconUrl":"https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png",
   "notAllocatedVirtualMachines":0,
   "onVirtualMachines":0,
   "offVirtualMachines":0,
   "pausedVirtualMachines":0,
   "allocatedVirtualMachines":0,
   "configuredVirtualMachines":0,
   "unknownVirtualMachines":0,
   "lockedVirtualMachines":0,
   "links":[
      {
         "title":"vapp_vdc_m01j_001",
         "rel":"edit",
         "type":"application/vnd.abiquo.virtualappliance+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836"
      },
      {
         "title":"vdc_m01j",
         "rel":"virtualdatacenter",
         "type":"application/vnd.abiquo.virtualdatacenter+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490"
      },
      {
         "title":"AWS_enterprise_forBilling",
         "rel":"enterprise",
         "type":"application/vnd.abiquo.enterprise+json",
         "href":"https://example.com:443/api/admin/enterprises/65"
      },
      {
         "title":"virtual machines",
         "rel":"virtualmachines",
         "type":"application/vnd.abiquo.virtualmachines+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines"
      },
      {
         "title":"virtual appliances state",
         "rel":"state",
         "type":"application/vnd.abiquo.virtualappliancestate+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/state"
      },
      {
         "title":"undeploy",
         "rel":"undeploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/undeploy"
      },
      {
         "title":"deploy",
         "rel":"deploy",
         "type":"application/vnd.abiquo.acceptedrequest+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/deploy"
      },
      {
         "title":"price",
         "rel":"price",
         "type":"text/plain",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/price"
      },
      {
         "title":"layers",
         "rel":"layers",
         "type":"application/vnd.abiquo.layers+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/layers"
      },
      {
         "title":"alerts",
         "rel":"alerts",
         "type":"application/vnd.abiquo.alerts+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/alerts"
      },
      {
         "title":"spec",
         "rel":"spec",
         "type":"application/vnd.abiquo.virtualappliancespec+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/action/spec"
      },
      {
         "title":"tasks",
         "rel":"tasks",
         "type":"application/vnd.abiquo.tasks+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/tasks"
      },
      {
         "title":"scalinggroups",
         "rel":"scalinggroups",
         "type":"application/vnd.abiquo.scalinggroups+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/scalinggroups"
      },
      {
         "title":"metricsmetadata",
         "rel":"metricsmetadata",
         "type":"application/vnd.abiquo.metricsmetadata+json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/metrics"
      },
      {
         "title":"collectd",
         "rel":"collectd",
         "type":"application/json",
         "href":"https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/metrics/collectd"
      }
   ]
}





  

...

Get all the templates from the repository that are compatible with your virtual datacenter. In this example we only show one virtual machine template.


Tip
title API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualMachineTemplateResource.


API Roles required:

Code Block
titleGET all of the Virtual Machine Templates that are compatible with KVM
* This action requires the privilege VDC_ENUMERATE,VDC_MANAGE,VDC_MANAGE_VAP

...

So we will send a POST request with the VM object to the virtual machines link of the virtual appliance. Remember that until we deploy, the VM only exists in Abiquo – we haven't launched the VM in AWS yet.


Tip
title API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualMachineResource.


cURL:

Code Block
curl -X POST https://example.com:443/api/cloud/virtualdatacenters/490/virtualappliances/836/virtualmachines \ 
	 -H 'Accept:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.virtualmachine+json; version=4.2' \ 
	 -d @requestpayload.xml \ 
	 -u user:password --verbose 

...

Deploy a Virtual Machine

 

Tip
title API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualMachineResource.


Tip
title API Documentation

For the Abiquo API documentation of this feature, see Abiquo API Resources and the page for this resource VirtualApplianceResource.


Code Block
titleDEPLOY a Virtual Machine
* This action requires the privilege VAPP_DEPLOY_UNDEPLOY

...