Many Clouds, One API

Exploring the API with Your Browser

Once the server is running, point your browser at http://HOSTNAME:PORT/api . This returns an HTML version of the top-level entry point, listing all the collections the driver knows about. From here, the rest of the API can be explored: You can click on Images to list all the images the current back end knows about. At this point, you will have to enter the credentials for the back-end cloud, in the case of the mock driver, these are mockuser and mockpassword . The Deltacloud documentation lists where to find the credentials for each driver.

The top-level entry point also links to documentation of the API, which is generated from the internal API specification of each server and driver. An important piece of information in the documentation is what parameters each operation requires from a resource. For example, http://HOSTNAME:PORT/api/docs/instances/create describes the instance creation operation, including which feature is responsible for adding which parameter.

From the list of images, you can navigate to a specific image – for example, img1 at http://HOSTNAME:PORT/api/images/img1 – and click on Launch . After filling the resulting form and clicking Create , you are taken to the details of the newly created instance.

The HTML version of the API is really only meant for exploration and experimenting. More serious use will involve the XML or JSON versions of the API; to view the XML for a resource on your browser, you simply append ?format=xml to any URL; for example, going to http://HOSTNAME:PORT/api/instances/inst3?format=xml will give you the XML version of the details about instance inst3.

Switching Drivers with Every Request

Because it is not really practical to run a different server for every cloud, including separate servers for different regions of the same cloud, the Deltacloud server makes it possible to switch drivers on the go – either by including the HTTP headers X-Deltacloud-Driver and X-Deltacloud-Provider in each request, or by setting corresponding matrix parameters in the requested URL. The provider talks to different endpoints of the same cloud (e.g., to different regions of Amazon’s EC2) or to specify the endpoint of a RHEV-M installation.

In this test setup, you can talk to Amazon’s EC2 us-east-1 region by going to the URL http://HOSTNAME:PORT/api;driver=ec2;provider=us-west-1 . From the resulting page, you can now follow the exact same steps as above, but this time you will launch a real instance, costing real money, in EC2, rather than a fake one with the mock driver.

In moving from the mock driver to the EC2 driver, it is worth noting the list of available collection changes: The EC2 driver offers additional collections, like Addresses for public IP addresses, Firewalls to manage security groups, and Keys to handle SSH keys. Also, the instance creation form has additional fields for EC2. These are included because the EC2 driver supports certain features, like launching multiple instances or applying security groups for instance creation that the mock driver does not. How the XML for the top-level entry point advertises different features between the two drivers, and how that information is used to provide additional fields in the instance creation form, is worth understanding.

Related content

  • Red Hat's cloud and virtualization portfolio
    Red Hat massively expanded its cloud portfolio during 2012. This overview can help you evaluate Red Hat's products in the context of VMware and others.
  • Red Hat’s Cloud Tools

    Red Hat massively expanded its cloud portfolio during 2012. This overview can help you evaluate Red Hat’s products in the context of VMware and others.

  • Overview of cloud platforms and appliances
    The current trend toward cloud computing is obfuscated by a cloud of buzzwords and acronyms. Pushing the buzzwords aside, we take a look at the nitty gritty of the current crop of offerings.
  • ownCloud

    ownCloud is an alternative to the many online storage services whose data protection promises could turn out to be as nebulous as their offerings.

  • Moving HPC to the Cloud

    HPC has a unique set of requirements that might not fit into standard clouds. However, plenty of commercial options, including cloud-like services, provide the advantages of real HPC without the capital expense of buying hardware.

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs

Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>


		<div class=