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.7

Skip to end of metadata
Go to start of metadata

Introduction

This document introduces the API from the perspective of the Abiquo user interface (UI). 

  • All Abiquo platform functionality as seen in the UI is also available through the Abiquo REST API.  
  • The UI runs as a client of the API, using the API to perform actions on the platform. 
  • Abiquo recommends that before you start working with the API, you should use the Abiquo UI to learn about the features and functionality of the platform. Or at least do the Abiquo Quick Tutorial.

This document describes a basic general flow to help you get started creating a VM and retrieving it, but you can apply the flow to other Abiquo entities.

  • Replace the URLs in the examples with the URL for your own environment
  • We provide example responses in case you are reading this without access to the platform
  • Due to release timing, some of the requests examples may be run using different versions and media types may vary slightly

More tutorials of specific use cases are also available in the API How Tos section of this wiki. For API reference documentation, see https://wiki.abiquo.com/api/latest 

Prerequisites

To follow along with this tutorial, we recommend that you use a Firefox or Chrome browser. The screenshots and instructions here are for Chromium

You will need a working Abiquo platform with:

  • Cloud infrastructure including a datacenter, rack, and hypervisor host
  • A virtual datacenter with a virtual appliance inside
  • An Abiquo private network in the virtual datacenter with two IP addresses added to it

You can create this environment in the UI first by following the Abiquo Quick Tutorial. Then add an extra IP address to your private network by following the instructions in Create IP addresses in private networks.

Authentication

You will need to authenticate with your own credentials as appropriate in your environment. For a complete guide, see Authentication. For this tutorial you could use:

  • Token authentication: you could use the token returned in the X-Abiquo-Token header in the format "Authentication: Token XXXXXXXX", replacing XXXXXXXX with the token.
  • Basic authentication: in a securely isolated test environment, you could use your user and password, in the format "-u user:password". To use basic authentication, you can add the insecure "-k" option to the request. 
  • OAuth authentication. See Authentication

Create an entity with the UI

First, create a VM with the UI.

  1. Open your connection to Abiquo and open your browser console to the Network tab
  2. Check that the browser is recording actions
  3. Create a VM in the UI, which will issue a post request to the API
  4. In the browser console, find the POST request

Screenshot from Chrome: the post request to create a VM is highlighted in red.

In Chrome, to display the Method column to easily identify the POST request, right-click on the header row to display the header options list, then select "Method"

To create a VM, the Abiquo UI makes the POST request to the virtualmachines link of the virtual appliance. This link contains the IDs of the virtual datacenter and virtual appliance.

https://example.com/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines

In this case, the ID values are both "2".

To copy a request directly from the UI, right-click on the request URL and select Copy as cURL. Note that you may have to delete UI cache details before you run the cURL.

In your browser console, select the POST request that created the VM and go to the Headers tab.

The following screenshot highlights the Request Payload and the API Location (in the Response headers) of a VM.

The Request Payload is the VM object that the UI sent to create the VM. It is very simple with just a friendly name label (which by default is the VM template name), a template link, plus the default option to enable remote access to the VM. This is one of the simplest data objects that you can use to create a VM.

Click "view source", and copy the request payload. If you format it with a JSON formatter, it should look similar to the following example.

{
   "label":"yvm2",
   "links":[
      {
         "title":"yvm2",
         "rel":"virtualmachinetemplate",
         "type":"application/vnd.abiquo.virtualmachinetemplate+json",
         "href":"https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/86"
      }
   ],
   "vdrpEnabled":true
} 


The Location link shows the VM location in the API, which is the URL of the VM, as shown here.

https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6 

The last element of the URL is the ID of the VM, which has a value of 6. We can use the above link to retrieve this VM.

To retrieve all the VMs in the virtual appliance, you can use the link to virtualmachines, without referring to any specific VM.

 https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines

These URLs are the API locations of the VMs.

Create an entity through the API

We are now going to create a new VM with a different friendly-name label.

To create the new VM, use the link to virtualmachines from the previous step, and send a POST request with the modified data entity.  For example, we could change "yvm2" to "yVM_New".

Here we have an example of an API request to create a VM:

curl --verbose -X POST 'https://mjsabiquo.bcn.abiquo.com/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines' \
 -H 'Content-Type: application/vnd.abiquo.virtualmachine+json;version=4.6' \
 -H 'Accept: application/vnd.abiquo.virtualmachine+json;version=4.6'  \
 -u user:password \
 -d '{"label":"yVM_New","links":[{"title":"yvm2", "rel":"virtualmachinetemplate", "type":"application/vnd.abiquo.virtualmachinetemplate+json", "href":"https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/86"}],"vdrpEnabled":true}' 

We are working with JSON objects and we specify them in the request headers that start with "-H". The Content-Type header refers to the VM object we are sending. And the Accept header refers to the API response we will receive.

You can also use XML instead of JSON with the Abiquo API and to do this, you would use "+xml" instead of "+json" in all the headers. Abiquo recommends JSON format. There may be some slight differences between the formats, so always retrieve an object in the format you are working with and modify it to ensure the correct data structure.

We specify the virtualmachine media type and the version number.

To control compatibility always specify the version number in your requests because if you do not specify a version, the API will always return the latest one, meaning that after an upgrade to the platform your code may cease to work as intended.

If the API creates the machine successfully, the response body contains the VM object.

From the VM object, note the link with a "rel" value of "edit". Also note that in the example the VM has an "id" of 8.

...
{  
   "links":[
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8",
      "type": "application/vnd.abiquo.virtualmachine+json",
      "rel": "edit",
      "title": "ABQ_06cfadf0-db57-48c5-8f4c-f9fe2ca76c46"
    },
...

Display the entity in the UI

When you've created the VM, return to the UI and you should be able to find the new VM!  

Retrieve an entity through the API

To retrieve the details of the VM you just created, perform a GET request to the edit link of the VM.

curl --verbose 'https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8' \
     -H 'Accept: application/vnd.abiquo.virtualmachine+json; version=4.6' \
	 -u admin:xabiquo

The result of this query is a VM data object in JSON format. The expanding section below contains the full request. On a Linux system, to format the response JSON body inline, you could try piping it to jq (with "| jq ."))

 Click here to expand...
user@user:~ $ curl --verbose 'https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8' \     
 -H 'Accept: application/vnd.abiquo.virtualmachine+json; version=4.6' \
 -u admin:xabiquo -k | jq . 
* Connected to mjsabiquo.bcn.abiquo.com (10.60.13.180) port 443 (#0)
* Server auth using Basic with user 'admin'
> GET /api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8 HTTP/1.1
> Authorization: Basic YWRtaW46eGFiaXF1bw==
> User-Agent: curl/7.35.0
> Host: mjsabiquo.bcn.abiquo.com
> Accept: application/vnd.abiquo.virtualmachine+json; version=4.6
> 
< HTTP/1.1 200 200
< Date: Wed, 19 Jun 2019 10:44:40 GMT
* Server Apache is not blacklisted
< Server: Apache
< Set-Cookie: ABQSESSIONID=4865559670616021033; Max-Age=1800; Expires=Wed, 19-Jun-2019 11:14:40 GMT; Path=/; Secure; HttpOnly
< X-Abiquo-Token: 2772ef503a95419ab7066ee6771751e6704c33567dfe339a73e3c009e36138f4
< Content-Type: application/vnd.abiquo.virtualmachine+json; version=4.6
< Transfer-Encoding: chunked
<  
{
  "links": [
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2",
      "type": "application/vnd.abiquo.enterprise+json",
      "rel": "enterprise",
      "title": "Cloudland"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8",
      "type": "application/vnd.abiquo.virtualmachine+json",
      "rel": "edit",
      "title": "ABQ_06cfadf0-db57-48c5-8f4c-f9fe2ca76c46"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/1/enterprises/2/virtualmachines/8/action/sendmail",
      "type": "application/vnd.abiquo.mail+json",
      "rel": "sendmail",
      "title": "send mail"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/users/1",
      "type": "application/vnd.abiquo.user+json",
      "rel": "user",
      "title": "Cloud Administrator"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2",
      "type": "application/vnd.abiquo.virtualdatacenter+json",
      "rel": "virtualdatacenter",
      "title": "bcdc_vdc_cloudland_01"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2",
      "type": "application/vnd.abiquo.virtualappliance+json",
      "rel": "virtualappliance",
      "title": "bcdc_vdc_cloudland_01_vapp_01"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/metadata",
      "type": "application/vnd.abiquo.metadata+json",
      "rel": "metadata",
      "title": "metadata"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/network/configurations",
      "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
      "rel": "configurations",
      "title": "vlan network configurations"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/network/nics",
      "type": "application/vnd.abiquo.nics+json",
      "rel": "nics",
      "title": "nics"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/storage/disks",
      "type": "application/vnd.abiquo.harddisks+json",
      "rel": "harddisks",
      "title": "disks"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/state",
      "type": "application/vnd.abiquo.virtualmachinestate+json",
      "rel": "state",
      "title": "NOT_ALLOCATED"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/undeploy",
      "type": "application/vnd.abiquo.acceptedrequest+json",
      "rel": "undeploy",
      "title": "virtual machine undeploy"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/deploy",
      "type": "application/vnd.abiquo.acceptedrequest+json",
      "rel": "deploy",
      "title": "virtual machine deploy"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/reset",
      "type": "application/vnd.abiquo.acceptedrequest+json",
      "rel": "reset",
      "title": "virtual machine reset"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/instance",
      "type": "application/vnd.abiquo.acceptedrequest+json",
      "rel": "instance",
      "title": "virtual machine snapshot"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/config/rdpaccess",
      "type": "application/vnd.abiquo.virtualmachineconsole+json",
      "rel": "rdpaccess",
      "title": "remote access"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/tasks",
      "type": "application/vnd.abiquo.tasks+json",
      "rel": "tasks",
      "title": "tasks"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/firewalls",
      "type": "application/vnd.abiquo.links+json",
      "rel": "firewalls",
      "title": "firewalls"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/loadbalancers",
      "type": "application/vnd.abiquo.loadbalancers+json",
      "rel": "loadbalancers",
      "title": "load balancers"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/backup/action/request",
      "type": "application/vnd.abiquo.ondemandbackup+json",
      "rel": "requestbackup",
      "title": "request on demand backup"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/backup/action/restore",
      "type": "application/vnd.abiquo.restore+json",
      "rel": "requestrestore",
      "title": "request a restore of a backup"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/vappmove",
      "type": "application/vnd.abiquo.links+json",
      "rel": "vappmove",
      "title": "move VM to a virtual appliance"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/move",
      "type": "application/vnd.abiquo.movevm+json",
      "rel": "move",
      "title": "move VM to another virtual datacenter"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/storage/volumes",
      "type": "application/vnd.abiquo.volumes+json",
      "rel": "volumes",
      "title": "volumes"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/disks/31",
      "type": "application/vnd.abiquo.harddisk+json",
      "rel": "disk0",
      "title": "9c83fcc3-e9cb-44bf-88d0-f8a98248fa69",
      "length": "64",
      "diskLabel": "Hard disk 1",
      "diskControllerType": "IDE"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1",
      "type": "application/vnd.abiquo.datastoretier+json",
      "rel": "datastoretier0",
      "title": "Default Tier"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/protect",
      "type": "text/plain",
      "rel": "protect",
      "title": "protect"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/unprotect",
      "type": "text/plain",
      "rel": "unprotect",
      "title": "unprotect"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/metrics",
      "type": "application/vnd.abiquo.metricsmetadata+json",
      "rel": "metricsmetadata",
      "title": "metricsmetadata"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/enablemonitoring",
      "type": "",
      "rel": "enablemonitoring",
      "title": "enablemonitoring"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/metrics/collectd",
      "type": "application/json",
      "rel": "collectd",
      "title": "collectd"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/alarms",
      "type": "application/vnd.abiquo.alarms+json",
      "rel": "alarmssearch",
      "title": "alarmssearch"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/8/action/clone",
      "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
      "rel": "clone",
      "title": "clone"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM",
      "type": "application/vnd.abiquo.hypervisortype+json",
      "rel": "hypervisortype",
      "title": "KVM"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/86",
      "type": "application/vnd.abiquo.virtualmachinetemplate+json",
      "rel": "virtualmachinetemplate",
      "title": "yvm2"
    },
    {
      "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1",
      "type": "application/vnd.abiquo.category+json",
      "rel": "category",
      "title": "Others"
    }
  ],
  "natrules": [],
  "generateGuestInitialPassword": false,
  "backuppolicies": [],
  "creationTimestamp": 1560939950000,
  "variables": {},
  "protected": false,
  "monitored": false,
  "ram": 48,
  "coresPerSocket": 1,
  "cpu": 1,
  "description": "A virtual machine",
  "label": "yVM_New",
  "name": "ABQ_06cfadf0-db57-48c5-8f4c-f9fe2ca76c46",
  "uuid": "06cfadf0-db57-48c5-8f4c-f9fe2ca76c46",
  "id": 8,
  "vdrpEnabled": true,
  "vdrpPort": 0,
  "idState": 1,
  "state": "NOT_ALLOCATED",
  "idType": 0,
  "type": "MANAGED",
  "highDisponibility": 0,
  "password": "VUFvbvoa"
}



To retrieve the collection of VMs in the virtual appliance, send a GET request to the virtualmachines link.

https://example.com/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines

The response contains metadata about the size of the collection and the default paging links.

 Click here to expand...
{
    "totalSize": 1,
    "links": [
        {
            "rel": "first",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines?limit=25&by=name&asc=true"
        },
        {
            "rel": "last",
            "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines?startwith=0&limit=25&by=name&asc=true"
        }
    ],
    "collection": [
        {
            "id": 6,
            "uuid": "331a9b47-5cf6-4166-bb02-021d5e8905df",
            "name": "ABQ_331a9b47-5cf6-4166-bb02-021d5e8905df",
            "label": "yvm2",
            "description": "A virtual machine",
            "cpu": 1,
            "coresPerSocket": 1,
            "ram": 48,
            "vdrpEnabled": true,
            "vdrpPort": 0,
            "idState": 1,
            "state": "NOT_ALLOCATED",
            "idType": 0,
            "type": "MANAGED",
            "highDisponibility": 0,
            "password": "LLY4OKtH",
            "monitored": false,
            "protected": false,
            "variables": {},
            "creationTimestamp": 1560936739000,
            "backuppolicies": [],
            "generateGuestInitialPassword": false,
            "natrules": [],
            "links": [
                {
                    "title": "Cloudland",
                    "rel": "enterprise",
                    "type": "application/vnd.abiquo.enterprise+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2"
                },
                {
                    "title": "ABQ_331a9b47-5cf6-4166-bb02-021d5e8905df",
                    "rel": "edit",
                    "type": "application/vnd.abiquo.virtualmachine+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6"
                },
                {
                    "title": "send mail",
                    "rel": "sendmail",
                    "type": "application/vnd.abiquo.mail+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/publiccloudregions/1/enterprises/2/virtualmachines/6/action/sendmail"
                },
                {
                    "title": "Cloud Admin",
                    "rel": "user",
                    "type": "application/vnd.abiquo.user+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/users/4"
                },
                {
                    "title": "bcdc_vdc_cloudland_01",
                    "rel": "virtualdatacenter",
                    "type": "application/vnd.abiquo.virtualdatacenter+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2"
                },
                {
                    "title": "bcdc_vdc_cloudland_01_vapp_01",
                    "rel": "virtualappliance",
                    "type": "application/vnd.abiquo.virtualappliance+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2"
                },
                {
                    "title": "metadata",
                    "rel": "metadata",
                    "type": "application/vnd.abiquo.metadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/metadata"
                },
                {
                    "title": "vlan network configurations",
                    "rel": "configurations",
                    "type": "application/vnd.abiquo.virtualmachinenetworkconfigurations+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/network/configurations"
                },
                {
                    "title": "nics",
                    "rel": "nics",
                    "type": "application/vnd.abiquo.nics+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/network/nics"
                },
                {
                    "title": "disks",
                    "rel": "harddisks",
                    "type": "application/vnd.abiquo.harddisks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/storage/disks"
                },
                {
                    "title": "NOT_ALLOCATED",
                    "rel": "state",
                    "type": "application/vnd.abiquo.virtualmachinestate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/state"
                },
                {
                    "title": "virtual machine undeploy",
                    "rel": "undeploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/undeploy"
                },
                {
                    "title": "virtual machine deploy",
                    "rel": "deploy",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/deploy"
                },
                {
                    "title": "virtual machine reset",
                    "rel": "reset",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/reset"
                },
                {
                    "title": "virtual machine snapshot",
                    "rel": "instance",
                    "type": "application/vnd.abiquo.acceptedrequest+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/instance"
                },
                {
                    "title": "remote access",
                    "rel": "rdpaccess",
                    "type": "application/vnd.abiquo.virtualmachineconsole+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/config/rdpaccess"
                },
                {
                    "title": "tasks",
                    "rel": "tasks",
                    "type": "application/vnd.abiquo.tasks+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/tasks"
                },
                {
                    "title": "firewalls",
                    "rel": "firewalls",
                    "type": "application/vnd.abiquo.links+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/firewalls"
                },
                {
                    "title": "load balancers",
                    "rel": "loadbalancers",
                    "type": "application/vnd.abiquo.loadbalancers+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/loadbalancers"
                },
                {
                    "title": "request on demand backup",
                    "rel": "requestbackup",
                    "type": "application/vnd.abiquo.ondemandbackup+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/backup/action/request"
                },
                {
                    "title": "request a restore of a backup",
                    "rel": "requestrestore",
                    "type": "application/vnd.abiquo.restore+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/backup/action/restore"
                },
                {
                    "title": "move VM to a virtual appliance",
                    "rel": "vappmove",
                    "type": "application/vnd.abiquo.links+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/vappmove"
                },
                {
                    "title": "move VM to another virtual datacenter",
                    "rel": "move",
                    "type": "application/vnd.abiquo.movevm+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/move"
                },
                {
                    "title": "volumes",
                    "rel": "volumes",
                    "type": "application/vnd.abiquo.volumes+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/storage/volumes"
                },
                {
                    "diskControllerType": "IDE",
                    "diskLabel": "Hard disk 1",
                    "length": "64",
                    "title": "66df65a9-8f61-4fce-9209-6dd32eefbb76",
                    "rel": "disk0",
                    "type": "application/vnd.abiquo.harddisk+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/disks/29"
                },
                {
                    "title": "Default Tier",
                    "rel": "datastoretier0",
                    "type": "application/vnd.abiquo.datastoretier+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/locations/1/datastoretiers/1"
                },
                {
                    "title": "protect",
                    "rel": "protect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/protect"
                },
                {
                    "title": "unprotect",
                    "rel": "unprotect",
                    "type": "text/plain",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/unprotect"
                },
                {
                    "title": "metricsmetadata",
                    "rel": "metricsmetadata",
                    "type": "application/vnd.abiquo.metricsmetadata+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/metrics"
                },
                {
                    "title": "enablemonitoring",
                    "rel": "enablemonitoring",
                    "type": "",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/enablemonitoring"
                },
                {
                    "title": "collectd",
                    "rel": "collectd",
                    "type": "application/json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/metrics/collectd"
                },
                {
                    "title": "alarmssearch",
                    "rel": "alarmssearch",
                    "type": "application/vnd.abiquo.alarms+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/alarms"
                },
                {
                    "title": "clone",
                    "rel": "clone",
                    "type": "application/vnd.abiquo.virtualmachinecloneoptions+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/cloud/virtualdatacenters/2/virtualappliances/2/virtualmachines/6/action/clone"
                },
                {
                    "title": "KVM",
                    "rel": "hypervisortype",
                    "type": "application/vnd.abiquo.hypervisortype+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/hypervisortypes/KVM"
                },
                {
                    "title": "yvm2",
                    "rel": "virtualmachinetemplate",
                    "type": "application/vnd.abiquo.virtualmachinetemplate+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/admin/enterprises/2/datacenterrepositories/1/virtualmachinetemplates/86"
                },
                {
                    "title": "Others",
                    "rel": "category",
                    "type": "application/vnd.abiquo.category+json",
                    "href": "https://mjsabiquo.bcn.abiquo.com:443/api/config/categories/1"
                }
            ]
        }
    ],
    "duplicatedvms": []
} 

So that is how you can create a VM and also how you can retrieve entities from the Abiquo API.  You can also retrieve any of the related entities and collections from their links with a simple GET request.

To work through how to modify and delete entities, see Get Started with the Abiquo API part 2.