{: versioni: data{‚"$/assets/img/deltacloud_concept/{: default{"/assets/less/bootstrap/{;{:pre"´/*! * Bootstrap v2.0.1 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ // CSS Reset @import "reset.less"; // Core variables and mixins @import "variables.less"; // Modify this for custom colors, font-sizes, etc @import "mixins.less"; // Grid system and page structure @import "scaffolding.less"; @import "grid.less"; @import "layouts.less"; // Base CSS @import "type.less"; @import "code.less"; @import "forms.less"; @import "tables.less"; // Components: common @import "sprites.less"; @import "dropdowns.less"; @import "wells.less"; @import "component-animations.less"; @import "close.less"; // Components: Buttons & Alerts @import "buttons.less"; @import "button-groups.less"; @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less // Components: Nav @import "navs.less"; @import "navbar.less"; @import "breadcrumbs.less"; @import "pagination.less"; @import "pager.less"; // Components: Popovers @import "modals.less"; @import "tooltip.less"; @import "popovers.less"; // Components: Misc @import "thumbnails.less"; @import "labels.less"; @import "progress-bars.less"; @import "accordion.less"; @import "carousel.less"; @import "hero-unit.less"; // Utility classes @import "utilities.less"; // Has to be last to override when necessary :raw@ : last@ " /#about/{;{"/{;{ ;"

What does Deltacloud give you?

  • an opportunity to manage cloud instances the way you want
  • a way to protect your apps from cloud API changes and incompatitibilities
  • support for all major cloud service providers
  • makes it easy for cloud providers to add their cloud
Learn more

For developers

Deltacloud:
  • is an open source Apache project
  • is a REST-based API for simple any-platform access
  • is written in Ruby with love
  • comes with client libraries for your favourite programming language
Contribute

Current release:
deltacloud-core-1.0.0
More about installation...


Found a bug?

; "J

What does Deltacloud give you?

  • an opportunity to manage cloud instances the way you want
  • a way to protect your apps from cloud API changes and incompatitibilities
  • support for all major cloud service providers
  • makes it easy for cloud providers to add their cloud
Learn more

For developers

Deltacloud:
  • is an open source Apache project
  • is a REST-based API for simple any-platform access
  • is written in Ruby with love
  • comes with client libraries for your favourite programming language
Contribute

Current release:
deltacloud-core-1.0.0
More about installation...


Found a bug?

: post" Deltacloud API

What does Deltacloud give you?

  • an opportunity to manage cloud instances the way you want
  • a way to protect your apps from cloud API changes and incompatitibilities
  • support for all major cloud service providers
  • makes it easy for cloud providers to add their cloud
Learn more

For developers

Deltacloud:
  • is an open source Apache project
  • is a REST-based API for simple any-platform access
  • is written in Ruby with love
  • comes with client libraries for your favourite programming language
Contribute

Current release:
deltacloud-core-1.0.0
More about installation...


Found a bug?

; @"/#send-patch/{;{" /usage/{;{ ;"¾


Using API

Clients

Instead of dealing with HTTP interface you can use various clients to communicate with Deltacloud server.

The Deltacloud Ruby Client

You need to install Ruby client seperately to the Deltacloud API server. Assuming you already have Ruby and RubyGems setup, you can install the Deltacloud client by simply typing:

$ sudo gem install deltacloud-client

The Deltacloud client consists of a Ruby library (packaged as a Ruby gem) which you can use to interact with the Deltacloud server and control your cloud infrastructure across cloud providers.

To use the client, you must require deltacloud:

require 'deltacloud'

Connect to a Deltacloud provider:

require 'deltacloud'

api_url      = 'http://localhost:3001/api'
api_name     = 'mockuser'
api_password = 'mockpassword'

client = DeltaCloud.new( api_name, api_password, api_url )

# work with client here

In addition to creating a client, you can specify operations within a block included on the initialization.

DeltaCloud.new( api_name, api_password, api_url ) do |client|
  # work with client here
end

In case of a failure, any underlying HTTP transport exceptions will be thrown away and returned back to the caller.

To work with another driver, just switch the client:

client = DeltaCloud.new( api_name, api_password, api_url )

# switch the client to use EC2 driver
ec2 = client.with_config(:driver => :ec2)

# switch the client to use OpenStack driver
openstack = client.with_config(:driver => :openstack)
Work with the Ruby client

HTTP clients - cURL

Basically, you interact with the Deltacloud server via HTTP calls, so you can use any HTTP client to talk to Deltacloud using the REST API.

cURL is a popular command line tool available on most modern linux distributions. See the following examples to learn how to use cURL to interact with Deltacloud. There is an assumption that the Deltacloud server is running on locahost:3001 and was started with the 'ec2' driver (i.e., deltacloudd -i ec2 ).

Get a list of all images available in the back-end cloud:

curl  --user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/images?format=xml"

The cURL --user option is used to specify the username:password credentials for access to the back-end cloud provider (Amazon EC2 in this case).

Create a new instance from the image with id 'ami-f51aff9c', in realm 'us-east-1c', with the hardware profile 'c1.medium', in firewall 'default':

curl -X POST -F "keyname=eftah" -F "image_id=ami-f51aff9c"
-F "realm_id=us-east-1c" -F "hwp_id=c1.medium" -F "firewalls1=default"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/instances?format=xml"

Delete a firewall called 'develgroup':

curl -X DELETE
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/firewalls/develgroup?format=xml

Create a blob called 'my_new_blob' within the bucket 'mybucket' from a local file with HTTP PUT specifying its content type and setting some metadata key:value pairs:

curl -H 'content-type: text/html' -H 'X-Deltacloud-Blobmeta-Name:mariosblob'
-H 'X-Deltacloud-Blobmeta-Version:2.1' --upload-file
"/home/marios/Desktop/somefile.html"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

Retrieve blob metadata for the blob called 'my_new_blob':

curl -iv -X HEAD
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

The '-iv' flags will ensure that cURL displays the request and response headers (blob metadata are reported in the response headers with an empty response body).

Working with cURL

Libdeltacloud Client (C library)

Libdeltacloud is a C/C++ library for accessing the Deltacloud API. It exports convenient structures and functions for manipulating cloud objects through the Deltacloud API.

Get the source code:
$ git clone git://git.fedorahosted.org/deltacloud/libdeltacloud.git

As of version 0.9, libdeltacloud is mostly API stable, but not ABI stable. The difference between the two is subtle but important. A library that is ABI (Application Binary Interface) stable means, that programs using the library don't need to be modified nor re-compiled when a new version of the library comes out. A library that is API (Application Programming Interface) stable means that programs using the library don't need to be modified, but may need to be re-compiled when a new version of the library comes out. The reason is that the sizes of structures in the library might change, which can lead to a misunderstanding between what the library and the program thinks the size of a structure is.

Due to the magic of libtool versioning, programs built against an older version of libdeltacloud will refuse to run against a newer version of libdeltacloud if the size of the structures has changed. If this happens, then the program must be recompiled against the newer libdeltacloud.

Libdeltacloud documentation
; "ª

Using API

Clients

Instead of dealing with HTTP interface you can use various clients to communicate with Deltacloud server.

The Deltacloud Ruby Client

You need to install Ruby client seperately to the Deltacloud API server. Assuming you already have Ruby and RubyGems setup, you can install the Deltacloud client by simply typing:
$ sudo gem install deltacloud-client

The Deltacloud client consists of a Ruby library (packaged as a Ruby gem) which you can use to interact with the Deltacloud server and control your cloud infrastructure across cloud providers.

To use the client, you must require deltacloud:

require 'deltacloud'

Connect to a Deltacloud provider:

require 'deltacloud'

api_url      = 'http://localhost:3001/api'
api_name     = 'mockuser'
api_password = 'mockpassword'

client = DeltaCloud.new( api_name, api_password, api_url )

# work with client here

In addition to creating a client, you can specify operations within a block included on the initialization.

DeltaCloud.new( api_name, api_password, api_url ) do |client|
  # work with client here
end

In case of a failure, any underlying HTTP transport exceptions will be thrown away and returned back to the caller.

To work with another driver, just switch the client:

client = DeltaCloud.new( api_name, api_password, api_url )

# switch the client to use EC2 driver
ec2 = client.with_config(:driver => :ec2)

# switch the client to use OpenStack driver
openstack = client.with_config(:driver => :openstack)
Work with the Ruby client

HTTP clients - cURL

Basically, you interact with the Deltacloud server via HTTP calls, so you can use any HTTP client to talk to Deltacloud using the REST API.

cURL is a popular command line tool available on most modern linux distributions. See the following examples to learn how to use cURL to interact with Deltacloud. There is an assumption that the Deltacloud server is running on locahost:3001 and was started with the 'ec2' driver (i.e., deltacloudd -i ec2 ).

Get a list of all images available in the back-end cloud:

curl  --user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/images?format=xml"

The cURL --user option is used to specify the username:password credentials for access to the back-end cloud provider (Amazon EC2 in this case).

Create a new instance from the image with id 'ami-f51aff9c', in realm 'us-east-1c', with the hardware profile 'c1.medium', in firewall 'default':

curl -X POST -F "keyname=eftah" -F "image_id=ami-f51aff9c"
-F "realm_id=us-east-1c" -F "hwp_id=c1.medium" -F "firewalls1=default"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/instances?format=xml"

Delete a firewall called 'develgroup':

curl -X DELETE
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/firewalls/develgroup?format=xml

Create a blob called 'my_new_blob' within the bucket 'mybucket' from a local file with HTTP PUT specifying its content type and setting some metadata key:value pairs:

curl -H 'content-type: text/html' -H 'X-Deltacloud-Blobmeta-Name:mariosblob'
-H 'X-Deltacloud-Blobmeta-Version:2.1' --upload-file
"/home/marios/Desktop/somefile.html"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

Retrieve blob metadata for the blob called 'my_new_blob':

curl -iv -X HEAD
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

The '-iv' flags will ensure that cURL displays the request and response headers (blob metadata are reported in the response headers with an empty response body).

Working with cURL

Libdeltacloud Client (C library)

Libdeltacloud is a C/C++ library for accessing the Deltacloud API. It exports convenient structures and functions for manipulating cloud objects through the Deltacloud API.

Get the source code:
$ git clone git://git.fedorahosted.org/deltacloud/libdeltacloud.git

As of version 0.9, libdeltacloud is mostly API stable, but not ABI stable. The difference between the two is subtle but important. A library that is ABI (Application Binary Interface) stable means, that programs using the library don't need to be modified nor re-compiled when a new version of the library comes out. A library that is API (Application Programming Interface) stable means that programs using the library don't need to be modified, but may need to be re-compiled when a new version of the library comes out. The reason is that the sizes of structures in the library might change, which can lead to a misunderstanding between what the library and the program thinks the size of a structure is.

Due to the magic of libtool versioning, programs built against an older version of libdeltacloud will refuse to run against a newer version of libdeltacloud if the size of the structures has changed. If this happens, then the program must be recompiled against the newer libdeltacloud.

Libdeltacloud documentation
; "»+ Usage


Using API

Clients

Instead of dealing with HTTP interface you can use various clients to communicate with Deltacloud server.

The Deltacloud Ruby Client

You need to install Ruby client seperately to the Deltacloud API server. Assuming you already have Ruby and RubyGems setup, you can install the Deltacloud client by simply typing:

$ sudo gem install deltacloud-client

The Deltacloud client consists of a Ruby library (packaged as a Ruby gem) which you can use to interact with the Deltacloud server and control your cloud infrastructure across cloud providers.

To use the client, you must require deltacloud:

require 'deltacloud'

Connect to a Deltacloud provider:

require 'deltacloud'

api_url      = 'http://localhost:3001/api'
api_name     = 'mockuser'
api_password = 'mockpassword'

client = DeltaCloud.new( api_name, api_password, api_url )

# work with client here

In addition to creating a client, you can specify operations within a block included on the initialization.

DeltaCloud.new( api_name, api_password, api_url ) do |client|
  # work with client here
end

In case of a failure, any underlying HTTP transport exceptions will be thrown away and returned back to the caller.

To work with another driver, just switch the client:

client = DeltaCloud.new( api_name, api_password, api_url )

# switch the client to use EC2 driver
ec2 = client.with_config(:driver => :ec2)

# switch the client to use OpenStack driver
openstack = client.with_config(:driver => :openstack)
Work with the Ruby client

HTTP clients - cURL

Basically, you interact with the Deltacloud server via HTTP calls, so you can use any HTTP client to talk to Deltacloud using the REST API.

cURL is a popular command line tool available on most modern linux distributions. See the following examples to learn how to use cURL to interact with Deltacloud. There is an assumption that the Deltacloud server is running on locahost:3001 and was started with the 'ec2' driver (i.e., deltacloudd -i ec2 ).

Get a list of all images available in the back-end cloud:

curl  --user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/images?format=xml"

The cURL --user option is used to specify the username:password credentials for access to the back-end cloud provider (Amazon EC2 in this case).

Create a new instance from the image with id 'ami-f51aff9c', in realm 'us-east-1c', with the hardware profile 'c1.medium', in firewall 'default':

curl -X POST -F "keyname=eftah" -F "image_id=ami-f51aff9c"
-F "realm_id=us-east-1c" -F "hwp_id=c1.medium" -F "firewalls1=default"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
"http://localhost:3001/api/instances?format=xml"

Delete a firewall called 'develgroup':

curl -X DELETE
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/firewalls/develgroup?format=xml

Create a blob called 'my_new_blob' within the bucket 'mybucket' from a local file with HTTP PUT specifying its content type and setting some metadata key:value pairs:

curl -H 'content-type: text/html' -H 'X-Deltacloud-Blobmeta-Name:mariosblob'
-H 'X-Deltacloud-Blobmeta-Version:2.1' --upload-file
"/home/marios/Desktop/somefile.html"
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

Retrieve blob metadata for the blob called 'my_new_blob':

curl -iv -X HEAD
--user "pGbAJ1TsVg5PKs3BK27O:dPs47ralgBlldqYNbLg3scthsg4g8v0L9d6Mb5DK"
http://localhost:3001/api/buckets/mybucket/my_new_blob?format=xml

The '-iv' flags will ensure that cURL displays the request and response headers (blob metadata are reported in the response headers with an empty response body).

Working with cURL

Libdeltacloud Client (C library)

Libdeltacloud is a C/C++ library for accessing the Deltacloud API. It exports convenient structures and functions for manipulating cloud objects through the Deltacloud API.

Get the source code:
$ git clone git://git.fedorahosted.org/deltacloud/libdeltacloud.git

As of version 0.9, libdeltacloud is mostly API stable, but not ABI stable. The difference between the two is subtle but important. A library that is ABI (Application Binary Interface) stable means, that programs using the library don't need to be modified nor re-compiled when a new version of the library comes out. A library that is API (Application Programming Interface) stable means that programs using the library don't need to be modified, but may need to be re-compiled when a new version of the library comes out. The reason is that the sizes of structures in the library might change, which can lead to a misunderstanding between what the library and the program thinks the size of a structure is.

Due to the magic of libtool versioning, programs built against an older version of libdeltacloud will refuse to run against a newer version of libdeltacloud if the size of the structures has changed. If this happens, then the program must be recompiled against the newer libdeltacloud.

Libdeltacloud documentation
; @"/supproted-providers/{;{ ;"; "; "ý Supported Providers
; @%"/#writing-tests/{;{",/assets/img/glyphicons-halflings-white/{;{"/assets/less/forms/{;{;"N(// Forms.less // Base styles for various input types, form layouts, and states // ------------------------------------------------------------- // GENERAL STYLES // -------------- // Make all forms have space below them form { margin: 0 0 @baseLineHeight; } fieldset { padding: 0; margin: 0; border: 0; } // Groups of fields with labels on top (legends) legend { display: block; width: 100%; padding: 0; margin-bottom: @baseLineHeight * 1.5; font-size: @baseFontSize * 1.5; line-height: @baseLineHeight * 2; color: @grayDark; border: 0; border-bottom: 1px solid #eee; // Small small { font-size: @baseLineHeight * .75; color: @grayLight; } } // Set font for forms label, input, button, select, textarea { #font > .shorthand(@baseFontSize,normal,@baseLineHeight); // Set size, weight, line-height here } input, button, select, textarea { #font > #family > .sans-serif(); // And only set font-family here for those that need it (note the missing label element) } // Identify controls by their labels label { display: block; margin-bottom: 5px; color: @grayDark; } // Inputs, Textareas, Selects input, textarea, select, .uneditable-input { display: inline-block; width: 210px; height: @baseLineHeight; padding: 4px; margin-bottom: 9px; font-size: @baseFontSize; line-height: @baseLineHeight; color: @gray; border: 1px solid #ccc; .border-radius(3px); } .uneditable-textarea { width: auto; height: auto; } // Inputs within a label label input, label textarea, label select { display: block; } // Mini reset for unique input types input[type="image"], input[type="checkbox"], input[type="radio"] { width: auto; height: auto; padding: 0; margin: 3px 0; *margin-top: 0; /* IE7 */ line-height: normal; cursor: pointer; .border-radius(0); border: 0 \9; /* IE9 and down */ } input[type="image"] { border: 0; } // Reset the file input to browser defaults input[type="file"] { width: auto; padding: initial; line-height: initial; border: initial; background-color: @white; background-color: initial; .box-shadow(none); } // Help out input buttons input[type="button"], input[type="reset"], input[type="submit"] { width: auto; height: auto; } // Set the height of select and file controls to match text inputs select, input[type="file"] { height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */ *margin-top: 4px; /* For IE7, add top margin to align select with labels */ line-height: 28px; } // Reset line-height for IE input[type="file"] { line-height: 18px \9; } // Chrome on Linux and Mobile Safari need background-color select { width: 220px; // default input width + 10px of padding that doesn't get applied background-color: @white; } // Make multiple select elements height not fixed select[multiple], select[size] { height: auto; } // Remove shadow from image inputs input[type="image"] { .box-shadow(none); } // Make textarea height behave textarea { height: auto; } // Hidden inputs input[type="hidden"] { display: none; } // CHECKBOXES & RADIOS // ------------------- // Indent the labels to position radios/checkboxes as hanging .radio, .checkbox { padding-left: 18px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { float: left; margin-left: -18px; } // Move the options list down to align with labels .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 5px; // has to be padding because margin collaspes } // Radios and checkboxes on same line // TODO v3: Convert .inline to .control-inline .radio.inline, .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { margin-left: 10px; // space out consecutive inline controls } // FOCUS STATE // ----------- input, textarea { .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); @transition: border linear .2s, box-shadow linear .2s; .transition(@transition); } input:focus, textarea:focus { border-color: rgba(82,168,236,.8); @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); .box-shadow(@shadow); outline: 0; outline: thin dotted \9; /* IE6-9 */ } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus, select:focus { .box-shadow(none); // override for file inputs .tab-focus(); } // INPUT SIZES // ----------- // General classes for quick sizes .input-mini { width: 60px; } .input-small { width: 90px; } .input-medium { width: 150px; } .input-large { width: 210px; } .input-xlarge { width: 270px; } .input-xxlarge { width: 530px; } // Grid style input sizes input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input { float: none; margin-left: 0; } // GRID SIZING FOR INPUTS // ---------------------- #inputGridSystem > .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth); // DISABLED STATE // -------------- // Disabled and read-only inputs input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] { background-color: #f5f5f5; border-color: #ddd; cursor: not-allowed; } // FORM FIELD FEEDBACK STATES // -------------------------- // Warning .control-group.warning { .formFieldState(@warningText, @warningText, @warningBackground); } // Error .control-group.error { .formFieldState(@errorText, @errorText, @errorBackground); } // Success .control-group.success { .formFieldState(@successText, @successText, @successBackground); } // HTML5 invalid states // Shares styles with the .control-group.error above input:focus:required:invalid, textarea:focus:required:invalid, select:focus:required:invalid { color: #b94a48; border-color: #ee5f5b; &:focus { border-color: darken(#ee5f5b, 10%); .box-shadow(0 0 6px lighten(#ee5f5b, 20%)); } } // FORM ACTIONS // ------------ .form-actions { padding: (@baseLineHeight - 1) 20px @baseLineHeight; margin-top: @baseLineHeight; margin-bottom: @baseLineHeight; background-color: #f5f5f5; border-top: 1px solid #ddd; } // For text that needs to appear as an input but should not be an input .uneditable-input { display: block; background-color: @white; border-color: #eee; .box-shadow(inset 0 1px 2px rgba(0,0,0,.025)); cursor: not-allowed; } // Placeholder text gets special styles; can't be bundled together though for some reason .placeholder(@grayLight); // HELP TEXT // --------- .help-block { display: block; // account for any element using help-block margin-top: 5px; margin-bottom: 0; color: @grayLight; } .help-inline { display: inline-block; .ie7-inline-block(); margin-bottom: 9px; vertical-align: middle; padding-left: 5px; } // INPUT GROUPS // ------------ // Allow us to put symbols and text within the input field for a cleaner look .input-prepend, .input-append { margin-bottom: 5px; .clearfix(); // Clear the float to prevent wrapping input, .uneditable-input { .border-radius(0 3px 3px 0); &:focus { position: relative; z-index: 2; } } .uneditable-input { border-left-color: #ccc; } .add-on { float: left; display: block; width: auto; min-width: 16px; height: @baseLineHeight; margin-right: -1px; padding: 4px 5px; font-weight: normal; line-height: @baseLineHeight; color: @grayLight; text-align: center; text-shadow: 0 1px 0 @white; background-color: #f5f5f5; border: 1px solid #ccc; .border-radius(3px 0 0 3px); } .active { background-color: lighten(@green, 30); border-color: @green; } } .input-prepend { .add-on { *margin-top: 1px; /* IE6-7 */ } } .input-append { input, .uneditable-input { float: left; .border-radius(3px 0 0 3px); } .uneditable-input { border-left-color: #eee; border-right-color: #ccc; } .add-on { margin-right: 0; margin-left: -1px; .border-radius(0 3px 3px 0); } input:first-child { // In IE7, having a hasLayout container (from clearfix's zoom:1) can make the first input // inherit the sum of its ancestors' margins. *margin-left: -160px; &+.add-on { *margin-left: -21px; } } } // SEARCH FORM // ----------- .search-query { padding-left: 14px; padding-right: 14px; margin-bottom: 0; // remove the default margin on all inputs .border-radius(14px); } // HORIZONTAL & VERTICAL FORMS // --------------------------- // Common properties // ----------------- .form-search, .form-inline, .form-horizontal { input, textarea, select, .help-inline, .uneditable-input { display: inline-block; margin-bottom: 0; } // Re-hide hidden elements due to specifity .hide { display: none; } } .form-search label, .form-inline label, .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { display: inline-block; } // Make the prepend and append add-on vertical-align: middle; .form-search .input-append .add-on, .form-inline .input-prepend .add-on, .form-search .input-append .add-on, .form-inline .input-prepend .add-on { vertical-align: middle; } // Inline checkbox/radio labels .form-search .radio, .form-inline .radio, .form-search .checkbox, .form-inline .checkbox { margin-bottom: 0; vertical-align: middle; } // Margin to space out fieldsets .control-group { margin-bottom: @baseLineHeight / 2; } // Legend collapses margin, so next element is responsible for spacing legend + .control-group { margin-top: @baseLineHeight; -webkit-margin-top-collapse: separate; } // Horizontal-specific styles // -------------------------- .form-horizontal { // Increase spacing between groups .control-group { margin-bottom: @baseLineHeight; .clearfix(); } // Float the labels left .control-label { float: left; width: 140px; padding-top: 5px; text-align: right; } // Move over all input controls and content .controls { margin-left: 160px; } // Move over buttons in .form-actions to align with .controls .form-actions { padding-left: 160px; } } ; @/; @/" /ruby/{;{ ;"|


Installing the Deltacloud client also gives you the deltacloudc command line tool. This executable makes use of the Deltacloud client library to speak to the Deltacloud server using the REST API. This allows you to to control your IAAS cloud infrastructure from the command line. If you are familiar with linux scripting, you can knock up a bash script in no time to automate your cloud infrastructure tasks.The general usage pattern for deltacloudc is:

$ deltacloudc collection operation [options]
collection
refers to the Deltacloud object collections, such as Instances, Images, Buckets, Realms etc, as described in greater detail in the REST API
operation
nanoc is collection dependant. All collections respond to 'index' and 'show' operations (retrieve details on all objects in a given collection or on a specific object, respectively); some collections respond to 'create' and 'destroy' operations. The instances collection (realised virtual servers) responds to operations for managing the instance lifecycle, such as 'stop', 'reboot' etc.
options
are listed by invoking deltacloudc -h One important option is -u, with which you specify the API_URL, where the Deltacloud server is running. The API_URL takes the form http://[user]:[password]@[api_url]:[port]/[api] (examples follow). Alternatively, rather than having to supply the API_URL for every invocation of deltacloudc you have the choice of setting the API_URL environment variable (e.g., export API_URL=http://mockuser:mockpassword@localhost:3001/api). A listing of the credentials you need to provide for each back-end cloud provider is available here.
; "t

Installing the Deltacloud client also gives you the deltacloudc command line tool. This executable makes use of the Deltacloud client library to speak to the Deltacloud server using the REST API. This allows you to to control your IAAS cloud infrastructure from the command line. If you are familiar with linux scripting, you can knock up a bash script in no time to automate your cloud infrastructure tasks.The general usage pattern for deltacloudc is:

$ deltacloudc collection operation [options]
collection
refers to the Deltacloud object collections, such as Instances, Images, Buckets, Realms etc, as described in greater detail in the REST API
operation
nanoc is collection dependant. All collections respond to 'index' and 'show' operations (retrieve details on all objects in a given collection or on a specific object, respectively); some collections respond to 'create' and 'destroy' operations. The instances collection (realised virtual servers) responds to operations for managing the instance lifecycle, such as 'stop', 'reboot' etc.
options
are listed by invoking deltacloudc -h One important option is -u, with which you specify the API_URL, where the Deltacloud server is running. The API_URL takes the form http://[user]:[password]@[api_url]:[port]/[api] (examples follow). Alternatively, rather than having to supply the API_URL for every invocation of deltacloudc you have the choice of setting the API_URL environment variable (e.g., export API_URL=http://mockuser:mockpassword@localhost:3001/api). A listing of the credentials you need to provide for each back-end cloud provider is available here.
; "0 The Deltacloud Ruby Client


Installing the Deltacloud client also gives you the deltacloudc command line tool. This executable makes use of the Deltacloud client library to speak to the Deltacloud server using the REST API. This allows you to to control your IAAS cloud infrastructure from the command line. If you are familiar with linux scripting, you can knock up a bash script in no time to automate your cloud infrastructure tasks.The general usage pattern for deltacloudc is:

$ deltacloudc collection operation [options]
collection
refers to the Deltacloud object collections, such as Instances, Images, Buckets, Realms etc, as described in greater detail in the REST API
operation
nanoc is collection dependant. All collections respond to 'index' and 'show' operations (retrieve details on all objects in a given collection or on a specific object, respectively); some collections respond to 'create' and 'destroy' operations. The instances collection (realised virtual servers) responds to operations for managing the instance lifecycle, such as 'stop', 'reboot' etc.
options
are listed by invoking deltacloudc -h One important option is -u, with which you specify the API_URL, where the Deltacloud server is running. The API_URL takes the form http://[user]:[password]@[api_url]:[port]/[api] (examples follow). Alternatively, rather than having to supply the API_URL for every invocation of deltacloudc you have the choice of setting the API_URL environment variable (e.g., export API_URL=http://mockuser:mockpassword@localhost:3001/api). A listing of the credentials you need to provide for each back-end cloud provider is available here.
; @5"/contact/{;{ ;" 


Contact us!

We'd love to hear about your experiences with Deltacloud.

Please don't hesitate to get in touch if you have any questions about the project, if you've had any issues with installing or using Deltacloud or even just to tell us how great you think Deltacloud is!

; "

Contact us!

We'd love to hear about your experiences with Deltacloud.

Please don't hesitate to get in touch if you have any questions about the project, if you've had any issues with installing or using Deltacloud or even just to tell us how great you think Deltacloud is!

; "  Contact


Contact us!

We'd love to hear about your experiences with Deltacloud.

Please don't hesitate to get in touch if you have any questions about the project, if you've had any issues with installing or using Deltacloud or even just to tell us how great you think Deltacloud is!

; @;"/instances/{;{ ;"œl


Instances

An instance represents the core of all cloud compute activity: a running virtual machine. An instance is created from an image, with a specified hardware profile and in a given realm. Each instance can have a number of other attributes, not all of which are exposed for all back-end cloud providers. The full list of possible instance attributes is:

Attribute Meaning
owner_id the id of the cloud provider account that launched the instance
image_id the id of the image from which the instance was launched
name a human readable name for the instance given at launch time
realm_id realm into which the instance was launched
state current state of the instance (e.g. 'running')
actions actions that a client may effect on the instance, based on current state
public_addresses the globally routable IP address of the instance
private_addresses the private IP address of the instance, routable within its private network
instance_profile the specific values of memory, cpu, storage
launch_time timestamp at which the instance was launched
keyname name of authentication key, if this method is used for authentication (e.g. EC2)
username the username for authentication when connecting to the instance
password the password used together with username above
firewalls the firewalls that this instance was launched into (EC2 specific)

Get a list of all current instances

To produce a list of all current instances in the given cloud (belonging to the specified account) use call GET /api/instances. The example below displays instances in the Amazon EC2 cloud.

Example request:

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

Client response:

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2790
<?xml version='1.0' encoding='utf-8' ?>
<instances>
  <instance href='http://localhost:3001/api/instances/i-1fbc627e' id='i-1fbc627e'>
    <name>ami-f51aff9c</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-1fbc627e/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/run;id=i-1fbc627e' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:29:48.000Z</launch_time>
    <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
  <instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
    <name>ami-2b5fba42</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-2b5fba42' id='ami-2b5fba42'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1d' id='us-east-1d'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.small' id='m1.small'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:32:25.000Z</launch_time>
    <public_addresses><address>ec2-184-73-78-87.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>ip-10-196-89-221.ec2.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
      <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
</instances>

Get the details of an instance

To get the details of a specific instance use call GET /api/instances/:id. The example below shows an instance launched in the Rackspace Cloudservers cloud. As you can see, the type of authentication is password but the username and password attributes are blank. The reason why these attributes are blank is that Rackspace only reports these values once, during instance creation and not for subsequent requests. To find an example of the response from an instance go to the Create an instance section.

Example request:

GET /api/instances/20112212?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: 1167
<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Launch an action on an instance

To launch an action on an instance use call POST /api/instances/:id/:action. The valid actions for an instance are specified by the instance states entity. The set of permissible actions that a client may perform on an instance at a given time depends on the current instance state. These are reported by the <actions> attribute in the Deltacloud server response to the GET /api/instances/:id call (Get the details of an instance section). The first example below shows a reboot action on a currently running instance, followed by a stop action.

After invoking the stop operation, the instance state may still be reported as RUNNING in the Deltacloud server response. It is because it may take some time for the instance state to change in the back-end cloud provider (and this will vary between providers). You can assure yourself that the action was performed correctly by requesting a list of instances or a by requesting a specific instance.

The Deltacloud server also allows a special 'run-on-instance' action for some cloud provider instances.This enables a client to perform a command on a running instance over SSH. The Deltacloud server will return the output of that command to the client. This is reported as the run action in the list of instance actions, if it is available. The cmd parameter specifies the command, which is executed on a running instance.The private_key parameter specifies the authentication for cloud providers that expect key based authentication for connecting to instances . For those cloud providers that use username/password for authentication, the password parameter specifies the authentication. Examples below illustrate the run-on-instance feature for an Amazon EC2 instance and a Rackspace Cloudservers instance. The examples differ in how authentication is performed (private RSA Key for EC2 and username/password for Rackspace).

Example request (reboot):

POST /api/instances/i-f3ba6492/reboot?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: 1322

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T11:29:48.000Z</launch_time>
  <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
  <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
  <firewalls>  <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall></firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

Example request (stop):

POST /api/instances/20112212/stop?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: 1167

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>STOPPED</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Example request (run-on-instance Amazon EC2):

× Note:

Run-on-instance requests to EC2 instances will fail with 502 Bad Gateway - Execution Expired if the firewall in which the instance was launched does not grant SSH access (tcp, port 22) to the requesting client's IP address. This access may be given using the firewalls collection.

POST /api/instances/i-afde73ce/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Content-Length: 1927
Content-Type: multipart/form-data; boundary=----------------------------332ed6691ab8

------------------------------332ed6691ab8
Content-Disposition: form-data; name="cmd"

uname -a; ls -l
------------------------------332ed6691ab8
Content-Disposition: form-data; name="private_key"

-----BEGIN RSA PRIVATE KEY-----.BTTEpATBAAKDAQEA4t3R/PgUo3KDDuX4
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
3NPbG3aHYPSnwsSxkFSG4Q6ukqYlxT9TPF/+wvdxfAtp3nYw3ZGuSX/DOtToWtQ8
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
9Dabu9BVZrl5BTOKlbAgrKnzsGKvaBST/D2.AB/HB9/GOT36OoBmEr1y9gFwu4Xf
aKw+AXVf9y9TKxVD3TE5uB.oDZG8s4gr2e691xHG9YGzBBBbNzfFh94b3Td5JBGS
zRDTKYBfOgv+Zu5N+WyeaZ0ab50DwK9BXYB5hsRu5zbAqObbTZkwN9qwBOZHzATX
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
qo2VP5WDZeOhRWEUY96./pWN3hNFDkT44vDpeXQUh3rBHyD5DWvWxAze9Ds+UTO/
esuLwP5vXhfoYp6gV9XG.BEBzSVq8kZ2kZtlbWHTR/SGepTkDgYEA9zwHTDhtKR2
KS8/BSFZQ884ZqFkbwT9fTW6s0rgUSBDTUDgYEA9W5HXTOEPGFDnqBhKPLN.xD9D
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
DAAeVWKU1OyDXfN4v6Zn1nNrhSkdrd+XV0nTLExsfg==.-----END RSA PRIVAT
E KEY-----
------------------------------332ed6691ab8--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 12:56:02 GMT
Content-Length: 497

<instance href='http://localhost:3001/api/instances/i-afde73ce' id='i-afde73ce'>
  <public_address>
    ec2-50-19-59-126.compute-1.amazonaws.com
  </public_address>
  <command>
    uname -a; ls -l
  </command>
  <output>Linux domU-12-31-39-0F-E1-78 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 i686 i386 GNU/Linux
  total 140
  -rw-r--r-- 1 root root 137263 Mar 26  2008 ec2-ami-tools-1.3-19974.noarch.rpm
  -rw-r--r-- 1 root root      0 Mar 26  2008 firstlogin
  </output>
</instance>

Example request (run-on-instance Rackspace Cloudservers):

POST /api/instances/20117112/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 275
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9b05ece66f4d
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="cmd"

uname -a; ifconfig; pwd
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="password"

myserverqB2Uwk21I
------------------------------9b05ece66f4d--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 13:02:15 GMT
Content-Length: 1781

<instance href='http://localhost:3002/api/instances/20117112' id='20117112'>
  <public_address>
    50.57.117.249
  </public_address>
  <command>
    uname -a; ifconfig; pwd
  </command>
  <output>Linux myserver 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
  eth0      Link encap:Ethernet  HWaddr 40:40:B1:7A:52:7E
            inet addr:50.57.117.249  Bcast:50.57.117.255  Mask:255.255.255.0
            inet6 addr: fe80::4240:b1ff:fe7a:527e/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:54 errors:0 dropped:0 overruns:0 frame:0
            TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:5880 (5.7 KiB)  TX bytes:6331 (6.1 KiB)
            Interrupt:24

  eth1      Link encap:Ethernet  HWaddr 40:40:8E:4B:52:23
            inet addr:10.182.131.159  Bcast:10.182.159.255  Mask:255.255.224.0
            inet6 addr: fe80::4240:8eff:fe4b:5223/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:3 errors:0 dropped:0 overruns:0 frame:0
            TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:188 (188.0 b)  TX bytes:720 (720.0 b)
            Interrupt:25

  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  /root</output>
</instance>

Create a new instance

To create a new instance use call POST /api/instances. At least, clients must specify the image from which the virtual machine instance is created. Optionally, a client may also specify a hardware profile and a realm (with default values used otherwise). Clients can also provide a name for the new instance though this is not supported by all back-end cloud providers. You can check whether a given feature is available in the response to the Deltacloud server API entry point. The details of the new instance are returned in response to this operation.

To create an instance in the Amazon EC2 cloud a client can also specify the name of the used EC2 keypair as well as the firewalls (EC2 security groups) that the instance should be launched into. The EC2 keypair is specified with the parameter keyname while firewalls are specified sequentially as firewalls1 ... firewalls2 ... etc.

See the example below. The values for public and private addresses are blank in the server response, because they have not yet been assigned by the cloud provider. Subsequent requests for the instance details will provide these values.

As with other POST operations in the Deltacloud API, clients may specify parameters as multipart/form-data or as x-www-url-form-urlencoded content type, as you can see in examples below.

Client request (AWS EC2):

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
Content-Length: 107
Content-Type: application/x-www-form-urlencoded

keyname=eftah&image_id=ami-f51aff9c&realm_id=us-east-1c&hwp_id=c1.medium&
firewalls1=default&firewalls2=test

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 1183

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-cbb861aa' id='i-cbb861aa'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-cbb861aa/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-cbb861aa/run;id=i-cbb861aa' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T16:09:45.000Z</launch_time>
  <public_addresses></public_addresses>
  <private_addresses></private_addresses>
  <firewalls>
    <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
  </firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

In the following example you can see that the client provides the optional name parameter and that the created instance uses password type of authentication. Furthermore, the client uses a content-type of application/x-www-form-urlencoded. The username and password are returned with the details of the new instance:

Example request: (Rackspace Cloudservers)

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 34
Content-Type: application/x-www-form-urlencoded

image_id=53&hwp_id=1&name=myserver

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 883

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password>myserver4OvKh7Ak3</password>
    </login>
  </authentication>
</instance>
×

Note:

The Deltacloud does not report potential errors, if you are creating an instance in vSphere. When you launch an instance, Deltacloud does not wait until the task is finished. Instead of that, Deltacloud creates a YAML representation of the instance in vSphere datastore. The YAML instance is in a 'PENDING' state until the 'real' instance is created. If the real instance fails to create, the YAML representation is removed. However, Deltacloud does not send you any error message.

Keys


; ".m

Instances

An instance represents the core of all cloud compute activity: a running virtual machine. An instance is created from an image, with a specified hardware profile and in a given realm. Each instance can have a number of other attributes, not all of which are exposed for all back-end cloud providers. The full list of possible instance attributes is:

Attribute Meaning
owner_id the id of the cloud provider account that launched the instance
image_id the id of the image from which the instance was launched
name a human readable name for the instance given at launch time
realm_id realm into which the instance was launched
state current state of the instance (e.g. 'running')
actions actions that a client may effect on the instance, based on current state
public_addresses the globally routable IP address of the instance
private_addresses the private IP address of the instance, routable within its private network
instance_profile the specific values of memory, cpu, storage
launch_time timestamp at which the instance was launched
keyname name of authentication key, if this method is used for authentication (e.g. EC2)
username the username for authentication when connecting to the instance
password the password used together with username above
firewalls the firewalls that this instance was launched into (EC2 specific)

Get a list of all current instances

To produce a list of all current instances in the given cloud (belonging to the specified account) use call GET /api/instances. The example below displays instances in the Amazon EC2 cloud.

Example request:

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

Client response:

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2790
<?xml version='1.0' encoding='utf-8' ?>
<instances>
  <instance href='http://localhost:3001/api/instances/i-1fbc627e' id='i-1fbc627e'>
    <name>ami-f51aff9c</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-1fbc627e/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/run;id=i-1fbc627e' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:29:48.000Z</launch_time>
    <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
  <instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
    <name>ami-2b5fba42</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-2b5fba42' id='ami-2b5fba42'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1d' id='us-east-1d'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.small' id='m1.small'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:32:25.000Z</launch_time>
    <public_addresses><address>ec2-184-73-78-87.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>ip-10-196-89-221.ec2.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
      <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
</instances>

Get the details of an instance

To get the details of a specific instance use call GET /api/instances/:id. The example below shows an instance launched in the Rackspace Cloudservers cloud. As you can see, the type of authentication is password but the username and password attributes are blank. The reason why these attributes are blank is that Rackspace only reports these values once, during instance creation and not for subsequent requests. To find an example of the response from an instance go to the Create an instance section.

Example request:

GET /api/instances/20112212?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: 1167
<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Launch an action on an instance

To launch an action on an instance use call POST /api/instances/:id/:action. The valid actions for an instance are specified by the instance states entity. The set of permissible actions that a client may perform on an instance at a given time depends on the current instance state. These are reported by the <actions> attribute in the Deltacloud server response to the GET /api/instances/:id call (Get the details of an instance section). The first example below shows a reboot action on a currently running instance, followed by a stop action.

After invoking the stop operation, the instance state may still be reported as RUNNING in the Deltacloud server response. It is because it may take some time for the instance state to change in the back-end cloud provider (and this will vary between providers). You can assure yourself that the action was performed correctly by requesting a list of instances or a by requesting a specific instance.

The Deltacloud server also allows a special 'run-on-instance' action for some cloud provider instances.This enables a client to perform a command on a running instance over SSH. The Deltacloud server will return the output of that command to the client. This is reported as the run action in the list of instance actions, if it is available. The cmd parameter specifies the command, which is executed on a running instance.The private_key parameter specifies the authentication for cloud providers that expect key based authentication for connecting to instances . For those cloud providers that use username/password for authentication, the password parameter specifies the authentication. Examples below illustrate the run-on-instance feature for an Amazon EC2 instance and a Rackspace Cloudservers instance. The examples differ in how authentication is performed (private RSA Key for EC2 and username/password for Rackspace).

Example request (reboot):

POST /api/instances/i-f3ba6492/reboot?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: 1322

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T11:29:48.000Z</launch_time>
  <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
  <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
  <firewalls>  <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall></firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

Example request (stop):

POST /api/instances/20112212/stop?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: 1167

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>STOPPED</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Example request (run-on-instance Amazon EC2):

× Note:

Run-on-instance requests to EC2 instances will fail with 502 Bad Gateway - Execution Expired if the firewall in which the instance was launched does not grant SSH access (tcp, port 22) to the requesting client's IP address. This access may be given using the firewalls collection.

POST /api/instances/i-afde73ce/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Content-Length: 1927
Content-Type: multipart/form-data; boundary=----------------------------332ed6691ab8

------------------------------332ed6691ab8
Content-Disposition: form-data; name="cmd"

uname -a; ls -l
------------------------------332ed6691ab8
Content-Disposition: form-data; name="private_key"

-----BEGIN RSA PRIVATE KEY-----.BTTEpATBAAKDAQEA4t3R/PgUo3KDDuX4
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
3NPbG3aHYPSnwsSxkFSG4Q6ukqYlxT9TPF/+wvdxfAtp3nYw3ZGuSX/DOtToWtQ8
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
9Dabu9BVZrl5BTOKlbAgrKnzsGKvaBST/D2.AB/HB9/GOT36OoBmEr1y9gFwu4Xf
aKw+AXVf9y9TKxVD3TE5uB.oDZG8s4gr2e691xHG9YGzBBBbNzfFh94b3Td5JBGS
zRDTKYBfOgv+Zu5N+WyeaZ0ab50DwK9BXYB5hsRu5zbAqObbTZkwN9qwBOZHzATX
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
qo2VP5WDZeOhRWEUY96./pWN3hNFDkT44vDpeXQUh3rBHyD5DWvWxAze9Ds+UTO/
esuLwP5vXhfoYp6gV9XG.BEBzSVq8kZ2kZtlbWHTR/SGepTkDgYEA9zwHTDhtKR2
KS8/BSFZQ884ZqFkbwT9fTW6s0rgUSBDTUDgYEA9W5HXTOEPGFDnqBhKPLN.xD9D
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
DAAeVWKU1OyDXfN4v6Zn1nNrhSkdrd+XV0nTLExsfg==.-----END RSA PRIVAT
E KEY-----
------------------------------332ed6691ab8--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 12:56:02 GMT
Content-Length: 497

<instance href='http://localhost:3001/api/instances/i-afde73ce' id='i-afde73ce'>
  <public_address>
    ec2-50-19-59-126.compute-1.amazonaws.com
  </public_address>
  <command>
    uname -a; ls -l
  </command>
  <output>Linux domU-12-31-39-0F-E1-78 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 i686 i386 GNU/Linux
  total 140
  -rw-r--r-- 1 root root 137263 Mar 26  2008 ec2-ami-tools-1.3-19974.noarch.rpm
  -rw-r--r-- 1 root root      0 Mar 26  2008 firstlogin
  </output>
</instance>

Example request (run-on-instance Rackspace Cloudservers):

POST /api/instances/20117112/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 275
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9b05ece66f4d
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="cmd"

uname -a; ifconfig; pwd
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="password"

myserverqB2Uwk21I
------------------------------9b05ece66f4d--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 13:02:15 GMT
Content-Length: 1781

<instance href='http://localhost:3002/api/instances/20117112' id='20117112'>
  <public_address>
    50.57.117.249
  </public_address>
  <command>
    uname -a; ifconfig; pwd
  </command>
  <output>Linux myserver 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
  eth0      Link encap:Ethernet  HWaddr 40:40:B1:7A:52:7E
            inet addr:50.57.117.249  Bcast:50.57.117.255  Mask:255.255.255.0
            inet6 addr: fe80::4240:b1ff:fe7a:527e/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:54 errors:0 dropped:0 overruns:0 frame:0
            TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:5880 (5.7 KiB)  TX bytes:6331 (6.1 KiB)
            Interrupt:24

  eth1      Link encap:Ethernet  HWaddr 40:40:8E:4B:52:23
            inet addr:10.182.131.159  Bcast:10.182.159.255  Mask:255.255.224.0
            inet6 addr: fe80::4240:8eff:fe4b:5223/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:3 errors:0 dropped:0 overruns:0 frame:0
            TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:188 (188.0 b)  TX bytes:720 (720.0 b)
            Interrupt:25

  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  /root</output>
</instance>

Create a new instance

To create a new instance use call POST /api/instances. At least, clients must specify the image from which the virtual machine instance is created. Optionally, a client may also specify a hardware profile and a realm (with default values used otherwise). Clients can also provide a name for the new instance though this is not supported by all back-end cloud providers. You can check whether a given feature is available in the response to the Deltacloud server API entry point. The details of the new instance are returned in response to this operation.

To create an instance in the Amazon EC2 cloud a client can also specify the name of the used EC2 keypair as well as the firewalls (EC2 security groups) that the instance should be launched into. The EC2 keypair is specified with the parameter keyname while firewalls are specified sequentially as firewalls1 ... firewalls2 ... etc.

See the example below. The values for public and private addresses are blank in the server response, because they have not yet been assigned by the cloud provider. Subsequent requests for the instance details will provide these values.

As with other POST operations in the Deltacloud API, clients may specify parameters as multipart/form-data or as x-www-url-form-urlencoded content type, as you can see in examples below.

Client request (AWS EC2):

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
Content-Length: 107
Content-Type: application/x-www-form-urlencoded

keyname=eftah&image_id=ami-f51aff9c&realm_id=us-east-1c&hwp_id=c1.medium&
firewalls1=default&firewalls2=test

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 1183

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-cbb861aa' id='i-cbb861aa'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-cbb861aa/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-cbb861aa/run;id=i-cbb861aa' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T16:09:45.000Z</launch_time>
  <public_addresses></public_addresses>
  <private_addresses></private_addresses>
  <firewalls>
    <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
  </firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

In the following example you can see that the client provides the optional name parameter and that the created instance uses password type of authentication. Furthermore, the client uses a content-type of application/x-www-form-urlencoded. The username and password are returned with the details of the new instance:

Example request: (Rackspace Cloudservers)

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 34
Content-Type: application/x-www-form-urlencoded

image_id=53&hwp_id=1&name=myserver

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 883

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password>myserver4OvKh7Ak3</password>
    </login>
  </authentication>
</instance>
×

Note:

The Deltacloud does not report potential errors, if you are creating an instance in vSphere. When you launch an instance, Deltacloud does not wait until the task is finished. Instead of that, Deltacloud creates a YAML representation of the instance in vSphere datastore. The YAML instance is in a 'PENDING' state until the 'real' instance is created. If the real instance fails to create, the YAML representation is removed. However, Deltacloud does not send you any error message.

Keys
; "€ Instances


Instances

An instance represents the core of all cloud compute activity: a running virtual machine. An instance is created from an image, with a specified hardware profile and in a given realm. Each instance can have a number of other attributes, not all of which are exposed for all back-end cloud providers. The full list of possible instance attributes is:

Attribute Meaning
owner_id the id of the cloud provider account that launched the instance
image_id the id of the image from which the instance was launched
name a human readable name for the instance given at launch time
realm_id realm into which the instance was launched
state current state of the instance (e.g. 'running')
actions actions that a client may effect on the instance, based on current state
public_addresses the globally routable IP address of the instance
private_addresses the private IP address of the instance, routable within its private network
instance_profile the specific values of memory, cpu, storage
launch_time timestamp at which the instance was launched
keyname name of authentication key, if this method is used for authentication (e.g. EC2)
username the username for authentication when connecting to the instance
password the password used together with username above
firewalls the firewalls that this instance was launched into (EC2 specific)

Get a list of all current instances

To produce a list of all current instances in the given cloud (belonging to the specified account) use call GET /api/instances. The example below displays instances in the Amazon EC2 cloud.

Example request:

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

Client response:

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2790
<?xml version='1.0' encoding='utf-8' ?>
<instances>
  <instance href='http://localhost:3001/api/instances/i-1fbc627e' id='i-1fbc627e'>
    <name>ami-f51aff9c</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-1fbc627e/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-1fbc627e/run;id=i-1fbc627e' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:29:48.000Z</launch_time>
    <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
  <instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
    <name>ami-2b5fba42</name>
    <owner_id>393485797142</owner_id>
    <image href='http://localhost:3001/api/images/ami-2b5fba42' id='ami-2b5fba42'></image>
    <realm href='http://localhost:3001/api/realms/us-east-1d' id='us-east-1d'></realm>
    <state>RUNNING</state>
    <hardware_profile href='http://localhost:3001/api/hardware_profiles/m1.small' id='m1.small'>
    </hardware_profile>
    <actions>
      <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
      <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
    </actions>
    <launch_time>2011-07-22T11:32:25.000Z</launch_time>
    <public_addresses><address>ec2-184-73-78-87.compute-1.amazonaws.com</address></public_addresses>
    <private_addresses><address>ip-10-196-89-221.ec2.internal</address></private_addresses>
    <firewalls>
      <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
      <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    </firewalls>
    <authentication type='key'>
      <login>
        <keyname>eftah</keyname>
      </login>
    </authentication>
  </instance>
</instances>

Get the details of an instance

To get the details of a specific instance use call GET /api/instances/:id. The example below shows an instance launched in the Rackspace Cloudservers cloud. As you can see, the type of authentication is password but the username and password attributes are blank. The reason why these attributes are blank is that Rackspace only reports these values once, during instance creation and not for subsequent requests. To find an example of the response from an instance go to the Create an instance section.

Example request:

GET /api/instances/20112212?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: 1167
<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Launch an action on an instance

To launch an action on an instance use call POST /api/instances/:id/:action. The valid actions for an instance are specified by the instance states entity. The set of permissible actions that a client may perform on an instance at a given time depends on the current instance state. These are reported by the <actions> attribute in the Deltacloud server response to the GET /api/instances/:id call (Get the details of an instance section). The first example below shows a reboot action on a currently running instance, followed by a stop action.

After invoking the stop operation, the instance state may still be reported as RUNNING in the Deltacloud server response. It is because it may take some time for the instance state to change in the back-end cloud provider (and this will vary between providers). You can assure yourself that the action was performed correctly by requesting a list of instances or a by requesting a specific instance.

The Deltacloud server also allows a special 'run-on-instance' action for some cloud provider instances.This enables a client to perform a command on a running instance over SSH. The Deltacloud server will return the output of that command to the client. This is reported as the run action in the list of instance actions, if it is available. The cmd parameter specifies the command, which is executed on a running instance.The private_key parameter specifies the authentication for cloud providers that expect key based authentication for connecting to instances . For those cloud providers that use username/password for authentication, the password parameter specifies the authentication. Examples below illustrate the run-on-instance feature for an Amazon EC2 instance and a Rackspace Cloudservers instance. The examples differ in how authentication is performed (private RSA Key for EC2 and username/password for Rackspace).

Example request (reboot):

POST /api/instances/i-f3ba6492/reboot?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: 1322

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-f3ba6492' id='i-f3ba6492'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-f3ba6492/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-f3ba6492/run;id=i-f3ba6492' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T11:29:48.000Z</launch_time>
  <public_addresses><address>ec2-50-16-183-107.compute-1.amazonaws.com</address></public_addresses>
  <private_addresses><address>domU-12-31-39-0F-79-D4.compute-1.internal</address></private_addresses>
  <firewalls>  <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall></firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

Example request (stop):

POST /api/instances/20112212/stop?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: 1167

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>STOPPED</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/reboot' method='post' rel='reboot' />
    <link href='http://localhost:3002/api/instances/20112212/stop' method='post' rel='stop' />
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
    <link href='http://localhost:3002/api/images;instance_id=20112212' method='post' rel='create_image' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password></password>
    </login>
  </authentication>
</instance>

Example request (run-on-instance Amazon EC2):

× Note:

Run-on-instance requests to EC2 instances will fail with 502 Bad Gateway - Execution Expired if the firewall in which the instance was launched does not grant SSH access (tcp, port 22) to the requesting client's IP address. This access may be given using the firewalls collection.

POST /api/instances/i-afde73ce/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Content-Length: 1927
Content-Type: multipart/form-data; boundary=----------------------------332ed6691ab8

------------------------------332ed6691ab8
Content-Disposition: form-data; name="cmd"

uname -a; ls -l
------------------------------332ed6691ab8
Content-Disposition: form-data; name="private_key"

-----BEGIN RSA PRIVATE KEY-----.BTTEpATBAAKDAQEA4t3R/PgUo3KDDuX4
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
3NPbG3aHYPSnwsSxkFSG4Q6ukqYlxT9TPF/+wvdxfAtp3nYw3ZGuSX/DOtToWtQ8
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
9Dabu9BVZrl5BTOKlbAgrKnzsGKvaBST/D2.AB/HB9/GOT36OoBmEr1y9gFwu4Xf
aKw+AXVf9y9TKxVD3TE5uB.oDZG8s4gr2e691xHG9YGzBBBbNzfFh94b3Td5JBGS
zRDTKYBfOgv+Zu5N+WyeaZ0ab50DwK9BXYB5hsRu5zbAqObbTZkwN9qwBOZHzATX
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
qo2VP5WDZeOhRWEUY96./pWN3hNFDkT44vDpeXQUh3rBHyD5DWvWxAze9Ds+UTO/
esuLwP5vXhfoYp6gV9XG.BEBzSVq8kZ2kZtlbWHTR/SGepTkDgYEA9zwHTDhtKR2
KS8/BSFZQ884ZqFkbwT9fTW6s0rgUSBDTUDgYEA9W5HXTOEPGFDnqBhKPLN.xD9D
vZZpZuXFkAA/5X2lFRY2/xsQqbPz9utPOsUoPf9Aajy+.vGRJrO2KAJ9U/JTNDzr
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
F/+GvHTHKDQSB+TeEs1Sa/PFwxpspB+RqHbqOTWPsFOHL+9sZGTqd6D4B.R6DBNh
wVTZU+eTz.39OZPqu4fQwrBN13lDbUoZxlqT9g2+haQBB9sTDzQEZ08QKBgQDJyw
lBBZqQKBgQDz5E2rL59lNS5pBxDO9r6B9rXtBBTZ5tZUWNFRvyNsxY5nJT03.KDw
DAAeVWKU1OyDXfN4v6Zn1nNrhSkdrd+XV0nTLExsfg==.-----END RSA PRIVAT
E KEY-----
------------------------------332ed6691ab8--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 12:56:02 GMT
Content-Length: 497

<instance href='http://localhost:3001/api/instances/i-afde73ce' id='i-afde73ce'>
  <public_address>
    ec2-50-19-59-126.compute-1.amazonaws.com
  </public_address>
  <command>
    uname -a; ls -l
  </command>
  <output>Linux domU-12-31-39-0F-E1-78 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 i686 i386 GNU/Linux
  total 140
  -rw-r--r-- 1 root root 137263 Mar 26  2008 ec2-ami-tools-1.3-19974.noarch.rpm
  -rw-r--r-- 1 root root      0 Mar 26  2008 firstlogin
  </output>
</instance>

Example request (run-on-instance Rackspace Cloudservers):

POST /api/instances/20117112/run?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 275
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------9b05ece66f4d
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="cmd"

uname -a; ifconfig; pwd
------------------------------9b05ece66f4d
Content-Disposition: form-data; name="password"

myserverqB2Uwk21I
------------------------------9b05ece66f4d--

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
Date: Mon, 25 Jul 2011 13:02:15 GMT
Content-Length: 1781

<instance href='http://localhost:3002/api/instances/20117112' id='20117112'>
  <public_address>
    50.57.117.249
  </public_address>
  <command>
    uname -a; ifconfig; pwd
  </command>
  <output>Linux myserver 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
  eth0      Link encap:Ethernet  HWaddr 40:40:B1:7A:52:7E
            inet addr:50.57.117.249  Bcast:50.57.117.255  Mask:255.255.255.0
            inet6 addr: fe80::4240:b1ff:fe7a:527e/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:54 errors:0 dropped:0 overruns:0 frame:0
            TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:5880 (5.7 KiB)  TX bytes:6331 (6.1 KiB)
            Interrupt:24

  eth1      Link encap:Ethernet  HWaddr 40:40:8E:4B:52:23
            inet addr:10.182.131.159  Bcast:10.182.159.255  Mask:255.255.224.0
            inet6 addr: fe80::4240:8eff:fe4b:5223/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:3 errors:0 dropped:0 overruns:0 frame:0
            TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:188 (188.0 b)  TX bytes:720 (720.0 b)
            Interrupt:25

  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

  /root</output>
</instance>

Create a new instance

To create a new instance use call POST /api/instances. At least, clients must specify the image from which the virtual machine instance is created. Optionally, a client may also specify a hardware profile and a realm (with default values used otherwise). Clients can also provide a name for the new instance though this is not supported by all back-end cloud providers. You can check whether a given feature is available in the response to the Deltacloud server API entry point. The details of the new instance are returned in response to this operation.

To create an instance in the Amazon EC2 cloud a client can also specify the name of the used EC2 keypair as well as the firewalls (EC2 security groups) that the instance should be launched into. The EC2 keypair is specified with the parameter keyname while firewalls are specified sequentially as firewalls1 ... firewalls2 ... etc.

See the example below. The values for public and private addresses are blank in the server response, because they have not yet been assigned by the cloud provider. Subsequent requests for the instance details will provide these values.

As with other POST operations in the Deltacloud API, clients may specify parameters as multipart/form-data or as x-www-url-form-urlencoded content type, as you can see in examples below.

Client request (AWS EC2):

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
Content-Length: 107
Content-Type: application/x-www-form-urlencoded

keyname=eftah&image_id=ami-f51aff9c&realm_id=us-east-1c&hwp_id=c1.medium&
firewalls1=default&firewalls2=test

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 1183

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3001/api/instances/i-cbb861aa' id='i-cbb861aa'>
  <name>ami-f51aff9c</name>
  <owner_id>393485797142</owner_id>
  <image href='http://localhost:3001/api/images/ami-f51aff9c' id='ami-f51aff9c'></image>
  <realm href='http://localhost:3001/api/realms/us-east-1c' id='us-east-1c'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3001/api/hardware_profiles/c1.medium' id='c1.medium'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3001/api/instances/i-cbb861aa/stop' method='post' rel='stop' />
    <link href='http://localhost:3001/api/instances/i-cbb861aa/run;id=i-cbb861aa' method='post' rel='run' />
  </actions>
  <launch_time>2011-07-22T16:09:45.000Z</launch_time>
  <public_addresses></public_addresses>
  <private_addresses></private_addresses>
  <firewalls>
    <firewall href='http://localhost:3001/api/firewalls/test' id='test'></firewall>
    <firewall href='http://localhost:3001/api/firewalls/default' id='default'></firewall>
  </firewalls>
  <authentication type='key'>
    <login>
      <keyname>eftah</keyname>
    </login>
  </authentication>
</instance>

In the following example you can see that the client provides the optional name parameter and that the created instance uses password type of authentication. Furthermore, the client uses a content-type of application/x-www-form-urlencoded. The username and password are returned with the details of the new instance:

Example request: (Rackspace Cloudservers)

POST /api/instances?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3002
Accept: */*
Content-Length: 34
Content-Type: application/x-www-form-urlencoded

image_id=53&hwp_id=1&name=myserver

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Content-Length: 883

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://localhost:3002/api/instances/20112212' id='20112212'>
  <name>myserver</name>
  <owner_id>mandreou</owner_id>
  <image href='http://localhost:3002/api/images/53' id='53'></image>
  <realm href='http://localhost:3002/api/realms/us' id='us'></realm>
  <state>PENDING</state>
  <hardware_profile href='http://localhost:3002/api/hardware_profiles/1' id='1'>
  </hardware_profile>
  <actions>
    <link href='http://localhost:3002/api/instances/20112212/run;id=20112212' method='post' rel='run' />
  </actions>
  <public_addresses><address>50.57.116.72</address></public_addresses>
  <private_addresses><address>10.182.143.64</address></private_addresses>
  <authentication type='password'>
    <login>
      <username>root</username>
      <password>myserver4OvKh7Ak3</password>
    </login>
  </authentication>
</instance>
×

Note:

The Deltacloud does not report potential errors, if you are creating an instance in vSphere. When you launch an instance, Deltacloud does not wait until the task is finished. Instead of that, Deltacloud creates a YAML representation of the instance in vSphere datastore. The YAML instance is in a 'PENDING' state until the 'real' instance is created. If the real instance fails to create, the YAML representation is removed. However, Deltacloud does not send you any error message.

Keys


; @A" /assets/js/bootstrap-modal/{;{;"£/* ========================================================= * bootstrap-modal.js v2.0.1 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ !function( $ ){ "use strict" /* MODAL CLASS DEFINITION * ====================== */ var Modal = function ( content, options ) { this.options = options this.$element = $(content) .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) } Modal.prototype = { constructor: Modal , toggle: function () { return this[!this.isShown ? 'show' : 'hide']() } , show: function () { var that = this if (this.isShown) return $('body').addClass('modal-open') this.isShown = true this.$element.trigger('show') escape.call(this) backdrop.call(this, function () { var transition = $.support.transition && that.$element.hasClass('fade') !that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position that.$element .show() if (transition) { that.$element[0].offsetWidth // force reflow } that.$element.addClass('in') transition ? that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.trigger('shown') }) } , hide: function ( e ) { e && e.preventDefault() if (!this.isShown) return var that = this this.isShown = false $('body').removeClass('modal-open') escape.call(this) this.$element .trigger('hide') .removeClass('in') $.support.transition && this.$element.hasClass('fade') ? hideWithTransition.call(this) : hideModal.call(this) } } /* MODAL PRIVATE METHODS * ===================== */ function hideWithTransition() { var that = this , timeout = setTimeout(function () { that.$element.off($.support.transition.end) hideModal.call(that) }, 500) this.$element.one($.support.transition.end, function () { clearTimeout(timeout) hideModal.call(that) }) } function hideModal( that ) { this.$element .hide() .trigger('hidden') backdrop.call(this) } function backdrop( callback ) { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $('