Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A09A5D123 for ; Thu, 9 Aug 2012 10:20:48 +0000 (UTC) Received: (qmail 75942 invoked by uid 500); 9 Aug 2012 10:20:48 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 75891 invoked by uid 500); 9 Aug 2012 10:20:46 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 75867 invoked by uid 99); 9 Aug 2012 10:20:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 10:20:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 10:20:42 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 838702388860 for ; Thu, 9 Aug 2012 10:19:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1371141 - in /deltacloud/trunk/site: content/command-tools.md content/curl-examples.md content/usage.md output/command-tools.html output/curl-examples.html output/usage.html Date: Thu, 09 Aug 2012 10:19:59 -0000 To: commits@deltacloud.apache.org From: marios@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120809101959.838702388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: marios Date: Thu Aug 9 10:19:58 2012 New Revision: 1371141 URL: http://svn.apache.org/viewvc?rev=1371141&view=rev Log: Site Docs: adds cURL examples and deprecation notice for deltacloudc Signed-off-by: marios Added: deltacloud/trunk/site/content/curl-examples.md deltacloud/trunk/site/output/curl-examples.html Modified: deltacloud/trunk/site/content/command-tools.md deltacloud/trunk/site/content/usage.md deltacloud/trunk/site/output/command-tools.html deltacloud/trunk/site/output/usage.html Modified: deltacloud/trunk/site/content/command-tools.md URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/command-tools.md?rev=1371141&r1=1371140&r2=1371141&view=diff ============================================================================== --- deltacloud/trunk/site/content/command-tools.md (original) +++ deltacloud/trunk/site/content/command-tools.md Thu Aug 9 10:19:58 2012 @@ -5,6 +5,20 @@ title: Command Line Tools
+ +

deltacloudc is being deprecated

+ +The deltacloudc command line tool is being deprecated. For now the code making up deltacloudc has been moved to the /deltacloud/clients/console directory but will ultimately be removed from the repo. If the command line client is important to you then please let us know. A new command line client may be put onto the roadmap if there is demand for one. + +The deltacloud core developers use (almost exclusively) cURL as a command line client for working with a deltacloud server. You can find more information on working with cURL against deltacloud here. + +
+
+

/deprecated:

+
+
+
+

Using Deltacloud command tool

Installing the Deltacloud Ruby client also gives you the deltacloudc command line tool. This executable uses the Deltacloud client library to speak to the Deltacloud server through the REST API. This means that you can control your cloud infrastructure from the command line. The general usage pattern for deltacloudc is:

@@ -18,7 +32,7 @@ title: Command Line Tools

Operation
- 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). Some collections respond to 'create' and 'destroy' operations. The collection of instances (realized virtual servers) responds to operations for managing the instance lifecycle, such as 'stop' or 'reboot'. + 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). Some collections respond to 'create' and 'destroy' operations. The collection of instances (realized virtual servers) responds to operations for managing the instance lifecycle, such as 'stop' or 'reboot'.
Options
Added: deltacloud/trunk/site/content/curl-examples.md URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/curl-examples.md?rev=1371141&view=auto ============================================================================== --- deltacloud/trunk/site/content/curl-examples.md (added) +++ deltacloud/trunk/site/content/curl-examples.md Thu Aug 9 10:19:58 2012 @@ -0,0 +1,269 @@ +--- +site_name: Deltacloud API +title: Working with cURL +--- + +
+ +
+ +
+ +

Working with cURL as a command line client

+ +

The cURL documentation is pretty comprehensive, but the following are some general points to remember for using cURL against Deltacloud. All the examples on this page assume the deltacloud server is running at localhost:3001:

+ +
    +
  • + Credentials are specified with --user "name:password" +
  • +
  • + Request headers are specified with -H "header: value" . For the "Accept" header Deltacloud offers a convenient way of specifying the desired response format; you can include the "?format=" parameter into the request URL rather than setting the Accept header +
  • +
  • + HTTP verbs are specified with -X VERB +
  • +
  • + The -i flag will show you the response headers and the -v flag will show you request and response headers as well as info about cURL activity: +
    +curl -v -X DELETE --user "username:password" -H "Accept: application/xml" http://localhost:3001/api/keys/mykey
    +      
    +
  • +
+ +
+ + +
+ +
+ +

Working with instances

+ +

Display a complete list of instances in xml format:

+ +
 curl --user "user:pass" http://localhost:3001/api/instances?format=xml 
+ +Alternatively and if you prefer you can manually specify the Accept header: + +
 curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/api/instances
+ +

Launch an instance. Note that in this example parameters are specified as application/x-www-form-urlencoded through the use of the -d flag:

+ +
 curl -X POST --user "user:pass" -d "image_id=ami-84db39ed&hwp_id=m1.small&keyname=marios_key"  http://localhost:3001/api/instances?format=xml 
+ +

Alternatively, you can use the -F flag to specify the parameters as multipart/form-data:

+ +
 curl -X POST --user "user:pass" -F "image_id=ami-84db39ed" -F "hwp_id=m1.small" -F "keyname=marios_key"  http://localhost:3001/api/instances?format=xml 
+ +

Launch an instance action - reboot:

+ +
 curl -X POST --user "user:pass" http://localhost:3001/api/instances/reboot?format=xml 
+ +

Run command on an instance (where available):

+ +
 curl -X POST --user "user:pass" -F "cmd=uname -a; ls -l" -F "private_key=`cat /location/of/ssh/keyfile`" http://localhost:3001/api/instances/i-d77cd0ac/run?format=xml 
+ +

Working with images

+ +

Get the details of a specific image:

+ +
 curl --user "user:pass" http://localhost:3001/api/images/ami-3dc06a54?format=xml 
+ +

Create an image from an existing instance (where available):

+ +
curl -X POST --user "user:pass" -d "instance_id=i-d77cd0ac&name=mariostestimage" http://localhost:3001/api/images?format=xml 
+ +

Delete an image:

+ +
curl -X DELETE --user "user:pass" http://localhost:3001/api/images/ami-3dc06a54?format=xml 
+ +

Working with hardware profiles

+ +

Get a list of all hardware profiles:

+ +
 curl --user "user:pass" http://localhost:3001/api/hardware_profiles?format=xml
+ +

Get the details of a specific hardware profile:

+ +
 curl --user "user:pass" http://localhost:3001/api/hardware_profiles/m2.4xlarge?format=xml 
+ +

Working with realms

+ +

Get a list of all realms:

+ +
 curl --user "user:pass" http://localhost:3001/api/realms?format=xml
+ +

Get the details of a specific realm:

+ +
 curl --user "user:pass" http://localhost:3001/api/realms/us-east-1a?format=xml 
+ +

Working with keys

+ +

Get a list of all keys:

+ +
 curl --user "user:pass" http://localhost:3001/api/keys?format=xml
+ +

Create a new key (where available):

+ +
 curl -X POST --user "user:pass" -d "name=mynewkey" http://localhost:3001/api/keys?format=xml 
+ +

Import an existing key (where available):

+ +
 curl -X POST --user "user:pass" -F "name=mynewkey" -F "public_key=`cat /location/of/public/key/id_rsa.pub`" http://localhost:3001/api/keys?format=xml 
+ +

Delete a key:

+ +
 curl -X DELETE --user "user:pass" http://localhost:3001/api/keys/mynewkey?format=xml 
+ +

Working with firewalls

+ +

Get a list of all firewalls:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/firewalls?format=xml 
+ +

Create a new firewall:

+ +
 curl -v -X POST --user "user:pass" -d "name=my_new_firewall&description=a test firewall" http://localhost:3001/api/firewalls?format=xml
+ +

Create a new firewall rule - port 22 tcp, with one source firewall (group) and 2 IP addresses:

+ +
 curl -v -X POST --user "user:pass" -F "protocol=tcp" -F "port_from=22" -F "port_to=22" -F "group1=default" -F "group1owner=821108636519" -F "ip_address1=192.168.1.1/24" -F "ip_address2=65.128.31.27/32" http://localhost:3001/api/firewalls/my_new_firewall/rules
+ +

Delete a firewall rule:

+ +
 curl -v -X DELETE --user "user:pass" http://localhost:3001/api/firewalls/marios_test_firewall/821108636519~tcp~22~22~@group,821108636519,default,@address,ipv4,192.168.1.1,24,@address,ipv4,65.128.31.27,32?format=xml 
+ +

Delete a firewall:

+ +
curl -v -X DELETE --user "user:pass" http://localhost:3001/api/firewalls/marios_test_firewall?format=xml 
+ +

Working with addresses

+ +

Get a list of all addresses:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/addresses?format=xml 
+ +

Create a new address:

+ +
 curl -v --user "user:pass" -X POST http://localhost:3001/api/addresses?format=xml
+ + +

Associate an address with an instance:

+ +
 curl -v -X POST --user "user:pass" -d "instance_id=i-d77cd0ac" http://localhost:3001/api/addresses/23.23.176.127/associate?format=xml 
+ + +

Disassociate an address from an instance:

+ +
curl -v -X POST --user "user:pass" http://localhost:3001/api/addresses/23.23.176.127/disassociate?format=xml  
+ +

Delete an address:

+ +
curl -v -X DELETE --user "user:pass" http://localhost:3001/api/addresses/23.23.176.127?format=xml  
+ +

Working with load balancers

+ +

Get a list of all load balancers:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/load_balancers?format=xml 
+ +

Create a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d "name=webtraffic-balancer&realm_id=us-east-1c&listener_protocol=HTTP&
+listener_balancer_port=80&listener_instance_port=3001" http://localhost:3001/api/load_balancers?format=xml 
+ +

Register an instance with a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d "instance_id=i-4f06b52e" http://localhost:3001/api/load_balancers/webtraffic-balancer/register?format=xml 
+ +

Unregister an instance from a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d  "instance_id=i-4f06b52e" http://localhost:3001/api/load_balancers/webtraffic-balancer/unregister?format=xml 
+ +

Delete a load balancer:

+ +
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/load_balancers/web-traffic-balancer
+ +

Working with buckets

+ +

Get the details of a bucket:

+ +
curl -v --user "user:pass" http://localhost:3001/api/buckets/my_bucket?format=xml
+ +

Create a new bucket:

+ +
curl -v --user "user:pass" -X POST -d "name=shinynewbucket" http://localhost:3001/api/buckets?format=xml
+ +

Create a new blob, specifying a content-type and some metadata:

+ +
curl -v --user "user:pass" -H "content-type: image/jpg" -H 'X-Deltacloud-Blobmeta-Name:mariosblob' -H 'X-Deltacloud-Blobmeta-Author:me' --upload-file "/some/location/image.jpg" http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml 
+ +

Note that the --upload-file parameter above causes cURL to issue a HTTP PUT

+ +

Get blob metadata:

+ +
 curl -v --user "user:pass" -X HEAD http://localhost:3001/api/buckets/shinynewbucket/newblob
+ +

Note that blob metadata is returned in the HTTP response headers. So the use of the -v flag is important here or you will not see the metadata.

+ +

Update blob metadata:

+ +
curl -v --user "user:pass" -X POST -H 'X-Deltacloud-Blobmeta-Name:mariosblobV2' -H 'X-Deltacloud-Blobmeta-Version:v2.1.1'  http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml
+ +

Delete a blob:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml
+ +

Delete a bucket:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/bucket/shinynewbucket
+ + +

Working with storage volumes

+ +

Get a list of all storage volumes:

+ +
curl -v --user "user:pass" http://localhost:3001/api/storage_volumes?format=xml
+ +

Create a new storage volume:

+ +
curl -v --user "user:pass" -X POST -d "capacity=10&realm_id=us-east-1c" http://localhost:3001/api/storage_volumes?format=xml
+ +

Attach a volume to a running instance:

+ +
curl -v --user "user:pass" -X POST -d "instance_id=i-b100b3d0&device=/dev/sdi" http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach?format=xml
+ +

Detach a volume (from whichever instance it is connected to):

+ +
curl -v --user "user:pass" -X POST  http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach?format=xml
+ +

Delete a storage volume:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/storage_volumes/vol-0bc0de60?format=xml
+ +

Working with storage snapshots

+ +

Get details about a specific storage snapshot:

+
curl -v --user "user:pass" http://localhost:3001/api/storage_snapshots/snap-45b8d024?format=xml
+ +

Create a new storage snapshot:

+
curl -v --user "user:pass" -X POST -d "volume_id=vol-99fbe5f2" http://localhost:3001/api/storage_snapshots?format=xml
+ +

Delete a storage snapshot:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/storage_snapshots/snap-dda6cebc?format=xml
+ Modified: deltacloud/trunk/site/content/usage.md URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/usage.md?rev=1371141&r1=1371140&r2=1371141&view=diff ============================================================================== --- deltacloud/trunk/site/content/usage.md (original) +++ deltacloud/trunk/site/content/usage.md Thu Aug 9 10:19:58 2012 @@ -1,4 +1,4 @@ ---- +--- site_name: Deltacloud API title: Usage --- @@ -10,7 +10,7 @@ title: Usage 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: +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
@@ -129,6 +129,12 @@ http://localhost:3001/api/buckets/mybuck 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. @@ -144,7 +150,7 @@ As of version 0.9, libdeltacloud is most

-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. +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 Modified: deltacloud/trunk/site/output/command-tools.html URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/command-tools.html?rev=1371141&r1=1371140&r2=1371141&view=diff ============================================================================== --- deltacloud/trunk/site/output/command-tools.html (original) +++ deltacloud/trunk/site/output/command-tools.html Thu Aug 9 10:19:58 2012 @@ -89,6 +89,17 @@


+

deltacloudc is being deprecated

+ +

The deltacloudc command line tool is being deprecated. For now the code making up deltacloudc has been moved to the /deltacloud/clients/console directory but will ultimately be removed from the repo. If the command line client is important to you then please let us know. A new command line client may be put onto the roadmap if there is demand for one.

+ +

The deltacloud core developers use (almost exclusively) cURL as a command line client for working with a deltacloud server. You can find more information on working with cURL against deltacloud here.

+ +


+

/deprecated:

+


+


+

Using Deltacloud command tool

Installing the Deltacloud Ruby client also gives you the deltacloudc command line tool. This executable uses the Deltacloud client library to speak to the Deltacloud server through the REST API. This means that you can control your cloud infrastructure from the command line. The general usage pattern for deltacloudc is:

@@ -102,7 +113,7 @@

Operation
- 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). Some collections respond to 'create' and 'destroy' operations. The collection of instances (realized virtual servers) responds to operations for managing the instance lifecycle, such as 'stop' or 'reboot'. + 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). Some collections respond to 'create' and 'destroy' operations. The collection of instances (realized virtual servers) responds to operations for managing the instance lifecycle, such as 'stop' or 'reboot'.
Options
Added: deltacloud/trunk/site/output/curl-examples.html URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/curl-examples.html?rev=1371141&view=auto ============================================================================== --- deltacloud/trunk/site/output/curl-examples.html (added) +++ deltacloud/trunk/site/output/curl-examples.html Thu Aug 9 10:19:58 2012 @@ -0,0 +1,366 @@ + + + + + Working with cURL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +


+ +
+ +
+ +

Working with cURL as a command line client

+ +

The cURL documentation is pretty comprehensive, but the following are some general points to remember for using cURL against Deltacloud. All the examples on this page assume the deltacloud server is running at localhost:3001:

+ +
    +
  • + Credentials are specified with --user "name:password" +
  • +
  • + Request headers are specified with -H "header: value" . For the "Accept" header Deltacloud offers a convenient way of specifying the desired response format; you can include the "?format=" parameter into the request URL rather than setting the Accept header +
  • +
  • + HTTP verbs are specified with -X VERB +
  • +
  • + The -i flag will show you the response headers and the -v flag will show you request and response headers as well as info about cURL activity: +
    +curl -v -X DELETE --user "username:password" -H "Accept: application/xml" http://localhost:3001/api/keys/mykey
    +      
    +
  • +
+
+ + +
+ +

Working with instances

+ +

Display a complete list of instances in xml format:

+ +
 curl --user "user:pass" http://localhost:3001/api/instances?format=xml 
+ +

Alternatively and if you prefer you can manually specify the Accept header:

+ +
 curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/api/instances
+ +

Launch an instance. Note that in this example parameters are specified as application/x-www-form-urlencoded through the use of the -d flag:

+ +
 curl -X POST --user "user:pass" -d "image_id=ami-84db39ed&hwp_id=m1.small&keyname=marios_key"  http://localhost:3001/api/instances?format=xml 
+ +

Alternatively, you can use the -F flag to specify the parameters as multipart/form-data:

+ +
 curl -X POST --user "user:pass" -F "image_id=ami-84db39ed" -F "hwp_id=m1.small" -F "keyname=marios_key"  http://localhost:3001/api/instances?format=xml 
+ +

Launch an instance action - reboot:

+ +
 curl -X POST --user "user:pass" http://localhost:3001/api/instances/reboot?format=xml 
+ +

Run command on an instance (where available):

+ +
 curl -X POST --user "user:pass" -F "cmd=uname -a; ls -l" -F "private_key=`cat /location/of/ssh/keyfile`" http://localhost:3001/api/instances/i-d77cd0ac/run?format=xml 
+ +

Working with images

+ +

Get the details of a specific image:

+ +
 curl --user "user:pass" http://localhost:3001/api/images/ami-3dc06a54?format=xml 
+ +

Create an image from an existing instance (where available):

+ +
curl -X POST --user "user:pass" -d "instance_id=i-d77cd0ac&name=mariostestimage" http://localhost:3001/api/images?format=xml 
+ +

Delete an image:

+ +
curl -X DELETE --user "user:pass" http://localhost:3001/api/images/ami-3dc06a54?format=xml 
+ +

Working with hardware profiles

+ +

Get a list of all hardware profiles:

+ +
 curl --user "user:pass" http://localhost:3001/api/hardware_profiles?format=xml
+ +

Get the details of a specific hardware profile:

+ +
 curl --user "user:pass" http://localhost:3001/api/hardware_profiles/m2.4xlarge?format=xml 
+ +

Working with realms

+ +

Get a list of all realms:

+ +
 curl --user "user:pass" http://localhost:3001/api/realms?format=xml
+ +

Get the details of a specific realm:

+ +
 curl --user "user:pass" http://localhost:3001/api/realms/us-east-1a?format=xml 
+ +

Working with keys

+ +

Get a list of all keys:

+ +
 curl --user "user:pass" http://localhost:3001/api/keys?format=xml
+ +

Create a new key (where available):

+ +
 curl -X POST --user "user:pass" -d "name=mynewkey" http://localhost:3001/api/keys?format=xml 
+ +

Import an existing key (where available):

+ +
 curl -X POST --user "user:pass" -F "name=mynewkey" -F "public_key=`cat /location/of/public/key/id_rsa.pub`" http://localhost:3001/api/keys?format=xml 
+ +

Delete a key:

+ +
 curl -X DELETE --user "user:pass" http://localhost:3001/api/keys/mynewkey?format=xml 
+ +

Working with firewalls

+ +

Get a list of all firewalls:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/firewalls?format=xml 
+ +

Create a new firewall:

+ +
 curl -v -X POST --user "user:pass" -d "name=my_new_firewall&description=a test firewall" http://localhost:3001/api/firewalls?format=xml
+ +

Create a new firewall rule - port 22 tcp, with one source firewall (group) and 2 IP addresses:

+ +
 curl -v -X POST --user "user:pass" -F "protocol=tcp" -F "port_from=22" -F "port_to=22" -F "group1=default" -F "group1owner=821108636519" -F "ip_address1=192.168.1.1/24" -F "ip_address2=65.128.31.27/32" http://localhost:3001/api/firewalls/my_new_firewall/rules
+ +

Delete a firewall rule:

+ +
 curl -v -X DELETE --user "user:pass" http://localhost:3001/api/firewalls/marios_test_firewall/821108636519~tcp~22~22~@group,821108636519,default,@address,ipv4,192.168.1.1,24,@address,ipv4,65.128.31.27,32?format=xml 
+ +

Delete a firewall:

+ +
curl -v -X DELETE --user "user:pass" http://localhost:3001/api/firewalls/marios_test_firewall?format=xml 
+ +

Working with addresses

+ +

Get a list of all addresses:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/addresses?format=xml 
+ +

Create a new address:

+ +
 curl -v --user "user:pass" -X POST http://localhost:3001/api/addresses?format=xml
+ +

Associate an address with an instance:

+ +
 curl -v -X POST --user "user:pass" -d "instance_id=i-d77cd0ac" http://localhost:3001/api/addresses/23.23.176.127/associate?format=xml 
+ +

Disassociate an address from an instance:

+ +
curl -v -X POST --user "user:pass" http://localhost:3001/api/addresses/23.23.176.127/disassociate?format=xml  
+ +

Delete an address:

+ +
curl -v -X DELETE --user "user:pass" http://localhost:3001/api/addresses/23.23.176.127?format=xml  
+ +

Working with load balancers

+ +

Get a list of all load balancers:

+ +
 curl -v --user "user:pass" http://localhost:3001/api/load_balancers?format=xml 
+ +

Create a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d "name=webtraffic-balancer&realm_id=us-east-1c&listener_protocol=HTTP&
+listener_balancer_port=80&listener_instance_port=3001" http://localhost:3001/api/load_balancers?format=xml 
+ +

Register an instance with a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d "instance_id=i-4f06b52e" http://localhost:3001/api/load_balancers/webtraffic-balancer/register?format=xml 
+ +

Unregister an instance from a load balancer:

+ +
 curl -v -X POST --user "user:pass" -d  "instance_id=i-4f06b52e" http://localhost:3001/api/load_balancers/webtraffic-balancer/unregister?format=xml 
+ +

Delete a load balancer:

+ +
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/load_balancers/web-traffic-balancer
+ +

Working with buckets

+ +

Get the details of a bucket:

+ +
curl -v --user "user:pass" http://localhost:3001/api/buckets/my_bucket?format=xml
+ +

Create a new bucket:

+ +
curl -v --user "user:pass" -X POST -d "name=shinynewbucket" http://localhost:3001/api/buckets?format=xml
+ +

Create a new blob, specifying a content-type and some metadata:

+ +
curl -v --user "user:pass" -H "content-type: image/jpg" -H 'X-Deltacloud-Blobmeta-Name:mariosblob' -H 'X-Deltacloud-Blobmeta-Author:me' --upload-file "/some/location/image.jpg" http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml 
+ +

Note that the --upload-file parameter above causes cURL to issue a HTTP PUT

+ +

Get blob metadata:

+ +
 curl -v --user "user:pass" -X HEAD http://localhost:3001/api/buckets/shinynewbucket/newblob
+ +

Note that blob metadata is returned in the HTTP response headers. So the use of the -v flag is important here or you will not see the metadata.

+ +

Update blob metadata:

+ +
curl -v --user "user:pass" -X POST -H 'X-Deltacloud-Blobmeta-Name:mariosblobV2' -H 'X-Deltacloud-Blobmeta-Version:v2.1.1'  http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml
+ +

Delete a blob:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/buckets/shinynewbucket/newblob?format=xml
+ +

Delete a bucket:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/bucket/shinynewbucket
+ +

Working with storage volumes

+ +

Get a list of all storage volumes:

+ +
curl -v --user "user:pass" http://localhost:3001/api/storage_volumes?format=xml
+ +

Create a new storage volume:

+ +
curl -v --user "user:pass" -X POST -d "capacity=10&realm_id=us-east-1c" http://localhost:3001/api/storage_volumes?format=xml
+ +

Attach a volume to a running instance:

+ +
curl -v --user "user:pass" -X POST -d "instance_id=i-b100b3d0&device=/dev/sdi" http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach?format=xml
+ +

Detach a volume (from whichever instance it is connected to):

+ +
curl -v --user "user:pass" -X POST  http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach?format=xml
+ +

Delete a storage volume:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/storage_volumes/vol-0bc0de60?format=xml
+ +

Working with storage snapshots

+ +

Get details about a specific storage snapshot:

+
curl -v --user "user:pass" http://localhost:3001/api/storage_snapshots/snap-45b8d024?format=xml
+ +

Create a new storage snapshot:

+
curl -v --user "user:pass" -X POST -d "volume_id=vol-99fbe5f2" http://localhost:3001/api/storage_snapshots?format=xml
+ +

Delete a storage snapshot:

+
curl -v --user "user:pass" -X DELETE http://localhost:3001/api/storage_snapshots/snap-dda6cebc?format=xml
+ +
+

 Back to top

+
+
+ Apache Software Foundation +
+
+ Apache Deltacloud is a top-level project at the Apache Software Foundation, + having graduated from the ASF Incubator in October + 2011. Through a collaborative and meritocratic development process, Apache + projects deliver enterprise-grade, freely available software products that + attract large communities of users. +
+
+
+ +
+ + + Modified: deltacloud/trunk/site/output/usage.html URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/usage.html?rev=1371141&r1=1371140&r2=1371141&view=diff ============================================================================== --- deltacloud/trunk/site/output/usage.html (original) +++ deltacloud/trunk/site/output/usage.html Thu Aug 9 10:19:58 2012 @@ -95,7 +95,7 @@

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:

+

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
@@ -211,7 +211,10 @@ http://localhost:3001/api/buckets/mybuck 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).

-

Libdeltacloud Client (C library)

+ +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.

@@ -226,7 +229,7 @@ As of version 0.9, libdeltacloud is most

-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. +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