O'Reilly logo

60 Recipes for Apache CloudStack by Sébastien Goasguen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. API Clients

3.1. The CloudStack API

The CloudStack API is not a standard like OGF OCCI or DMTF CIMI, but is easy to learn. A mapping exists between the AWS API and the CloudStack API, as we will see in Chapter 4. Recently, a Google Compute Engine interface was also developed that maps the GCE REST API to the CloudStack API described here. The API docs are a good place to start learning the extent of the API. Multiple clients exist on GitHub to use this API, and you should be able to find one in your favorite language. The reference documentation for the API and changes that might occur from version to version is available online. This short section is aimed at providing a quick summary to give you a base understanding of how to use this API. As a quick start, a good way to explore the API is to navigate the dashboard with a firebug console (or similar developer console) to study the queries.

In a succinct statement, the CloudStack query API can be used via HTTP GET requests made against your cloud endpoint (e.g., http://localhost:8080/client/api). The API name is passed using the command key, and the various parameters for this API call are passed as key/value pairs. The request is signed using the secret key of the user making the call. Some calls are synchronous; while some are asynchronous, this is documented in the API docs. Asynchronous calls return a jobid, and the status and result of a job can be queried with the queryAsyncJobResult call. Let’s get started and give ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required