This wiki section refers to the RESTful API for creating and managing cloud resources with the Abiquo server. You can administer physical resources and then expose them to requests made by the virtual appliances.
How to use this API
The Abiquo model normally divides Resources into two sections: The Resource Data Model shows the Resource fields, and the Related Methods Model shows the available actions to send to modify the Resource.
Resource Data Model
These fields are split into the following columns:
| Name | Description |
|---|---|
| Field name | The key of the name into the XML representation |
| Type | The type of the value of the XML representation |
| Occurs | How many times we can see this fields into the representation |
| Required | It could have three values: true, that means the field is mandatory; optional, you can or cannot use this field in the message body request; or false, where you should not send this field in the message body request |
| Description | A brief description of the field |
Related methods
This Model shows the specifications to call any resource and its given response. You should be able to develop code to send-receive message from your client to our API using this Model as a guide.
| Key | Content | Commonly useful in |
|---|---|---|
| Synopsis | Schematic call with the tuple METHOD - URI | All methods |
| Request Headers | The mandatory headers to send the call | All methods |
| Request Parameters | A table with the Web Params used to filter the request | GET methods |
| Request Message Body | The Resource Data Model object to send with the request | POST and PUT methods |
| Request Example | A simple example for a better understand | All methods |
| Response Headers | The response Headers that will be informed | All methods |
| Response Message Body | The Resource Data Model object sent by the response | GET and POST methods |
| Response Status | The header status the client could receive | All methods |
| Response Example | A simple example to show the response | All methods |
Examples
Below is an example for both specifications (Request and Response):
% curl --verbose 'http://example.com/api/admin/datacenters/1/racks/1/machines/3' \ -X PUT \ -H "Content-type:application/xml" \ -H "Accept:application/xml" \ -d '<machine> <id>3</id> <name>machine_3</name> <cpu>3</cpu> <description>Machine 3 updated</description> <hd>3000000</hd> <ram>1024</ram> <link rel="edit" href="http://example.com/api/admin/datacenters/1/racks/1/machines/3"/> <machine>' > PUT /api/admin/datacenters/1/racks/1/machines/3 HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 > Host: example.com > Content-type:application/xml > Accept:application/xml > <machine> <id>3</id> <name>machine_3</name> <cpu>3</cpu> <description>Machine 3 updated</description> <hd>3000000</hd> <ram>1024</ram> <link rel="edit" href="http://example.com/api/admin/datacenters/1/racks/1/machines/3" <machine>
where you can see:
- The curl execution (marked with the %). Inside him you can distinguish the Request Header (defined by -H parameter) and the Request Message Body (defined by '-d' parameter)
- The --verbose mode reveals all the lines that belong to API input parameters (marked by '>') and API output parameters (marked by '<'). You cannot see the API output parameters in the above example because it is a Request message.
Currently we only support the API for the application/xml media type. We hope to offer more media types soon.

