Compute Resources

The compute resources are: instances, instance states, images, realms, hardware profiles, firewalls, load balancers, addresses and keys.

Realms

A realm represents a boundary containing resources, such as a data center. The exact definition of a realm is given by the cloud provider. In some cases, a realm may represent different datacenters, different continents or different pools of resources within a single datacenter. A cloud provider may insist that all the resources exist within a single realm in order to cooperate. For instance, storage volumes may only be allowed to be mounted to instances within the same realm. Generally speaking, going from one realm to another within the same cloud may change many aspects of the cloud, such as SLA’s, pricing terms, etc.

Get a list of all realms

To list all realms use call GET /api/realms. You can filter the list by adding a request parameter architecture to the realms that support a specific architecture, such as i386. The example below shows the retrieval of all realms for the AWS EC2 driver, which correspond to EC2 "availability zones":

Example request:

GET /api/realms?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 639
<?xml version='1.0' encoding='utf-8' ?>
<realms>
  <realm href='http://localhost:3001/api/realms/us-east-1a' id='us-east-1a'>
    <name>us-east-1a</name>
    <state>available</state>
  </realm>
  <realm href='http://localhost:3001/api/realms/us-east-1b' id='us-east-1b'>
    <name>us-east-1b</name>
    <state>available</state>
  </realm>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'>
    <name>us-east-1c</name>
    <state>available</state>
  </realm>
  <realm href='http://localhost:3001/api/realms/us-east-1d' id='us-east-1d'>
    <name>us-east-1d</name>
    <state>available</state>
  </realm>
</realms>

Get the details of a realm

To provide the details of a realm use call GET /api/realms/:id. The server responds with a name, a state and a limit applicable to the current requester. The name is an arbitrary label with no specific meaning in the API. The state can be either AVAILABLE or UNAVAILABLE.

The example below shows the realm for the Rackspace driver. Since Rackspace does not currently have a notion of realms, the Deltacloud Rackspace driver provides a single realm called 'US', signifying that all compute resources for that cloud provider are hosted in the United States:

Example request:

GET /api/realms/us?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 182

<?xml version='1.0' encoding='utf-8' ?>
<realm href='http://localhost:3001/api/realms/us' id='us'>
    <name>United States</name>
    <state>AVAILABLE</state>
    <limit></limit>
</realm>

Hardware profiles