Before you begin working with the Abiquo API, please read Get Started with the Abiquo API, which shows you how to obtain information about your environment's resources and the API by using the Abiquo UI and API together.
To perform tasks using multiple requests using the Abiquo API, work through the API Tutorials section.
...
For simplicity, user and password authentication is shown in the examples. However, for production systems, OAuth is recommended. See Authentication.
To enable cut and paste to a shell, backslashes are placed at the end of each line to escape the new line. Requests should contain single quotation marks, not back ticks, and every effort has been made to ensure that single quotation marks are used in the cURL commands in the examples, to enable copy and paste where required. However, if problems occur, try checking and modifying the command in a text editor before pasting it in a shell.
...
Please remember that the example payloads are not specially designed templates for creating a new resource or modifying a resource. For create requests, you may find additional examples of simple requests in the API Reference pages, in the Abiquo API Tutorials, or you may be able to find examples of simple entities by looking at requests made by the Abiquo UI. For modify requests, you should perform a get of an existing object and then make your changes. See also Get Started with the Abiquo API. The Abiquo API will return a response to post POST requests in the accept Accept media type you specify in your requests. When you use cURL, then the response payload will be raw data. You can then pipe this output to a formatter , such as xmllint, xmlindent or pjson. Or or cut and paste to format it in an online tool.
...
Code Block |
---|
curl -X POST --verbose -k https://my.abiquoserver.com/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines \ -H 'Content-Type: application/vnd.abiquo.virtualmachine+json; version=3.6' \ -H 'Accept: application/vnd.abiquo.virtualmachine+json; version=3.6' \ -u admin:xabiquo \ -d '{"label":"Core_new","links":[{"title":"Core","rel":"virtualmachinetemplate","type":"application/vnd.abiquo.virtualmachinetemplate+json", "href":"http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"}],"vdrpEnabled":true}' | python -m json.tool |