blob: cc05b8bdf4103b6729927a26e4297561a2c76646 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Storage resources</title>
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le JavaScript -->
<script src="/assets/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="/assets/js/bootstrap-dropdown.js" type="text/javascript"></script>
<script src="/assets/js/jquery.tweet.js" type="text/javascript"></script>
<script src="/assets/js/application.js" type="text/javascript"></script>
<script src="/assets/js/bootstrap-transition.js"></script>
<script src="/assets/js/bootstrap-alert.js"></script>
<script src="/assets/js/bootstrap-modal.js"></script>
<script src="/assets/js/bootstrap-scrollspy.js"></script>
<script src="/assets/js/bootstrap-tab.js"></script>
<script src="/assets/js/bootstrap-tooltip.js"></script>
<script src="/assets/js/bootstrap-popover.js"></script>
<script src="/assets/js/bootstrap-button.js"></script>
<script src="/assets/js/bootstrap-collapse.js"></script>
<script src="/assets/js/bootstrap-carousel.js"></script>
<script src="/assets/js/bootstrap-typeahead.js"></script>
<!-- Le styles -->
<link href="/assets/css/bootstrap.css" rel="stylesheet">
<link href="/assets/css/application.css" rel="stylesheet">
<link rel="shortcut icon" href="/assets/img/favicon.ico">
</head>
<body><div style="background: red"><h1>2015/07/20 - Apache Deltacloud has been retired. </h1><h2>For more information, please explore the <a href="http://attic.apache.org/">Attic</a>. </h2></div>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/"><img src="/assets/img/logo.png" width="152"
alt="Deltacloud API"/></a>
<ul class="nav top-nav">
<li><a href="/">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/about.html">What is Deltacloud?</a></li>
<li><a href="/drivers.html#drivers">Supported Providers</a></li>
</ul>
</li>
<li><a href="/download.html">Download</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Installation<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/install-deltacloud.html">Install Deltacloud</a></li>
<li><a href="/run-deltacloud-server.html">Run the Deltacloud Server</a></li>
</ul>
</li>
<li class="dropdown">
<a href="/usage.html" class="dropdown-toggle" data-toggle="dropdown">Usage<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/usage.html#usingapi">Using API</a></li>
<li><a href="/usage.html#clients">Client Libraries</a></li>
<li><a href="/command-tools.html">Command Line Tools</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Contribute<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/getting-sources.html">Getting Sources</a></li>
<li><a href="/how-to-contribute.html">How Can I Contribute?</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">API<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/rest-api.html">Deltacloud REST API</a></li>
<li><a href="/curl-examples.html">Deltacloud API cURL examples</a></li>
<li><a href="/drivers.html">Drivers API</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CIMI<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/cimi-rest.html">CIMI REST API</a></li>
<li><a href="/cimi-curl.html">CIMI cURL Examples</a></li>
</ul>
</li>
<li><a href="/contact.html">Contact</a></li>
</ul>
</div>
</div>
</div>
<div class="container content">
<p><br></p>
<div class="row">
<div class="span9">
<h3 id="resources">Storage resources</h3>
<p>
Storage resources are divided into two groups:
</p>
<ul>
<li>
<strong>storage volumes</strong>, which can be attached to a running instance (accessible by the instance OS)</li>
<li>
<strong>blob storage</strong>, which represents a generic 'key &lt;−−&gt; value' based data store, as implemented by Rackspace CloudFiles or Amazon S3</li>
</ul>
<p>
<strong>Storage snapshots</strong> represent a storage volume, a backup which is created at a particular point of time (a snapshot).
</p>
<h3 id="volumes">Storage Volumes</h3>
<p>
A storage volume has
</p>
</div>
<div class="span3">
<ul class="nav nav-list well">
<li class="nav-header">
REST API
</li>
<li><a href="rest-api.html">Introduction</a></li>
<li><a href="api-entry-point.html">API entry point</a></li>
<li><a href="compute-resources.html">Compute resources</a></li>
<li class="active"><a href="#resources">Storage resources</a></li>
<ul class="nav nav-list">
<li><a href="#volumes">Storage volumes</a></li>
<li><a href="storage-snapshots.html">Storage snapshots</a></li>
<li><a href="blob-storage.html">Blob storage</a></li>
</ul>
</ul>
</div>
</div>
<ul>
<li>a <strong>capacity</strong> expressed in Gigabytes;</li>
<li>a <strong>created</strong> timestamp;</li>
<li>a <strong>realm_id</strong> specifying the realm in which the volume exists;</li>
<li>a <strong>state</strong> (for Amazon EC2 this is one of creating, available, in-use, deleting, deleted, error); and </li>
<li>a set of <strong>actions</strong>.</li>
</ul>
<p>
When attached to an instance, a storage volume will also expose a <strong>mount</strong> element
which contains the attributes <strong>instance </strong>and <strong>device</strong>, specifying the instance, to which the volume is attached, and the mount point (e.g. /dev/sdh), respectively.
</p>
<p><br></p>
<ul class="nav nav-pills">
<li class="active"><a href="#tab1" data-toggle="tab">Get a list of all volumes</a></li>
<li><a href="#tab2" data-toggle="tab">Get the details of volume</a></li>
<li><a href="#tab3" data-toggle="tab">Create/delete a volume</a></li>
<li><a href="#tab4" data-toggle="tab">Attach/detach a volume</a></li>
</ul>
<hr>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<h4>Get a list of all storage volumes</h4>
<p>
To list all storage volumes use call <strong>GET /api/storage_volumes</strong>.
</p>
<p>
Example request:
</p>
<pre>
GET /api/storage_volumes?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 200 OK
Content-Type: application/xml
Date: Thu, 28 Jul 2011 21:04:09 GMT
Content-Length: 1341
&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;storage_volumes&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' id='vol-0bc0de60'&gt;
&lt;created&gt;Thu Jul 28 20:44:18 UTC 2011&lt;/created&gt;
&lt;capacity unit='GB'&gt;10&lt;/capacity&gt;
&lt;realm_id&gt;us-east-1c&lt;/realm_id&gt;
&lt;state&gt;AVAILABLE&lt;/state&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2' id='vol-99fbe5f2'&gt;
&lt;created&gt;Thu Jul 28 20:56:07 UTC 2011&lt;/created&gt;
&lt;capacity unit='GB'&gt;15&lt;/capacity&gt;
&lt;realm_id&gt;us-east-1c&lt;/realm_id&gt;
&lt;state&gt;AVAILABLE&lt;/state&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
&lt;/storage_volumes&gt;
</pre>
</div>
<div class="tab-pane" id="tab2">
<h4>Get the details of a storage volume</h4>
<p>
To retrieve the details for the specified storage volume use call <strong>GET /api/storage_volumes/:id</strong>.
</p>
<p>Example request:</p>
<pre>
GET /api/storage_volumes/vol-99fbe5f2?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 200 OK
Content-Type: application/xml
Date: Thu, 28 Jul 2011 21:06:39 GMT
Content-Length: 794
&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2' id='vol-99fbe5f2'&gt;
&lt;created&gt;Thu Jul 28 20:56:07 UTC 2011&lt;/created&gt;
&lt;capacity unit='GB'&gt;15&lt;/capacity&gt;
&lt;realm_id&gt;us-east-1c&lt;/realm_id&gt;
&lt;state&gt;IN-USE&lt;/state&gt;
&lt;mount&gt;
&lt;instance href='i-b100b3d0' id='i-b100b3d0'&gt;&lt;/instance&gt;
&lt;device name='/dev/sdh'&gt;&lt;/device&gt;
&lt;/mount&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-99fbe5f2' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
</pre>
</div>
<div class="tab-pane" id="tab3">
<h4>Create a new storage volume</h4>
<p>
To create a new storage volume use call <strong>POST /api/storage_volumes</strong>. A client may specify a <strong>snapshot_id</strong> from which the storage volume is instantiated though this is optional. The <strong>capacity</strong> parameter, expressed in Gigabytes, is also optional and its default size is 1 GB. Finally clients may also specify the <strong>realm_id</strong>, as a storage volume can typically only be attached to instances running within the specified realm. If the realm is not specified it will set it at the first realm returned by the cloud provider. A successful operation will return <strong>HTTP 201 Created</strong> with the details of the new storage volume.
</p>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Note: </strong>
<p>
Fujitsu GCP requires the size to be a multiple of 10, so the specified capacity is rounded
up to the nearest multiple of ten, making the default size 10 GB.
</p>
</div>
<p>
As with the other POST operations in the Deltacloud API, clients may choose to specify operation parameters as multipart/form-data or as application/x-www-form-urlencoded data.
</p>
<p>Example request:</p>
<pre>
POST /api/storage_volumes?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
Content-Length: 31
Content-Type: application/x-www-form-urlencoded
capacity=10&amp;realm_id=us-east-1c
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 201 Created
Date: Thu, 28 Jul 2011 20:44:27 GMT
Content-Length: 649
&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' id='vol-0bc0de60'&gt;
&lt;created&gt;Thu Jul 28 20:44:18 UTC 2011&lt;/created&gt;
&lt;capacity unit='GB'&gt;10&lt;/capacity&gt;
&lt;realm_id&gt;us-east-1c&lt;/realm_id&gt;
&lt;state&gt;CREATING&lt;/state&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
</pre>
<h4>Delete a storage volume</h4>
<p>
To delete the specified storage volume use call <strong>DELETE /api/storage_volumes/:id</strong>. The operation will return a <strong>HTTP 204 No Content</strong> after a succesful operation.
</p>
<div class="alert alert-error">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong>Note:</strong>
<p> The operation will fail if the given storage_volume is currently attached to an instance. </p>
</div>
<p>Example request:</p>
<pre>
DELETE /api/storage_volumes/vol-0bc0de60?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 204 No Content
Date: Thu, 28 Jul 2011 22:34:29 GMT
</pre>
<p>Example request: (<strong>error deleting a volume currently attached to an instance</strong>)</p>
<pre>
DELETE /api/storage_volumes/vol-0bc0de60?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 502 Bad Gateway
Content-Type: application/xml
Date: Thu, 28 Jul 2011 22:30:07 GMT
Content-Length: 617
&lt;error status='502' url='/api/storage_volumes/vol-0bc0de60?format=xml'&gt;
&lt;kind&gt;backend_error&lt;/kind&gt;
&lt;backend driver='ec2'&gt;
&lt;code&gt;502&lt;/code&gt;
&lt;/backend&gt;
&lt;message&gt;&lt;![CDATA[Client.VolumeInUse: Volume vol-0bc0de60 is currently attached to i-b100b3d0
REQUEST=ec2.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAJATNOR5HKG3FK27Q&amp;Action=DeleteVolume&amp;SignatureMethod=HmacSHA256&amp;SignatureVersion=2&amp;Timestamp=2011-07-28T22%3A30%3A00.000Z&amp;Version=2010-08-31&amp;VolumeId=vol-0bc0de60&amp;Signature=WnZTd9vFaUZEwfuifyo3%2FWa2HBEG1S7R8Iv%2FHqc%2BmqE%3D
REQUEST ID=5dff67bb-d63a-4055-b550-f323fa16e185]]&gt;&lt;/message&gt;
&lt;/error&gt;
</pre>
</div>
<div class="tab-pane" id="tab4">
<h4>Attach a storage volume to a running instance</h4>
<p>
To attach the specified storage volume to a running instance use call <strong>POST /api/storage_volumes/:id/attach</strong>. Clients must specify the <strong>instance_id</strong> and the <strong>device</strong> as parameters. The device parameter is used as the <strong>mount point</strong>, that is the location at which the storage volume will be exposed to the given instance (e.g. /dev/sdh). The Deltacloud server will respond with a <strong>HTTP 202 Accepted</strong> after a succesful attach operation with details of the storage volume. In the example below, the state is reported as 'unknown' although the <strong>mount</strong> element is present. It is because the processing has not yet been completed (hence the 202 status code). Clients may specify the required parameters as multipart/form-data or as application/x-www-form-urlencoded data.
</p>
<p>Example request:</p>
<pre>
POST /api/storage_volumes/vol-0bc0de60/attach?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
Content-Length: 38
Content-Type: application/x-www-form-urlencoded
instance_id=i-b100b3d0&amp;device=/dev/sdi
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 202 Accepted
Date: Thu, 28 Jul 2011 21:36:17 GMT
Content-Length: 709
&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' id='vol-0bc0de60'&gt;
&lt;capacity unit='GB'&gt;&lt;/capacity&gt;
&lt;device&gt;/dev/sdi&lt;/device&gt;
&lt;state&gt;unknown&lt;/state&gt;
&lt;mount&gt;
&lt;instance href='i-b100b3d0' id='i-b100b3d0'&gt;&lt;/instance&gt;
&lt;device name='/dev/sdi'&gt;&lt;/device&gt;
&lt;/mount&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
</pre>
<h4>Detach a storage volume from an instance</h4>
<p>
To detach the given storage volume from the instance to which it is currently attached use call <strong>POST /api/storage_volumes/:id/detach</strong>. A succesful operation will return <strong>HTTP 201 Accepted</strong> with details of the storage volume. Similarly to attach operation, in the example below, the <strong>state</strong> is reported as 'unknown' and the <strong>mount</strong> element is still present as the processing has not been completed yet (hence the 202 status code).
</p>
<p>Example request:</p>
<pre>
POST /api/storage_volumes/vol-0bc0de60/detach?format=xml HTTP/1.1
Authorization: Basic AU1J3UB2121Afd1DdyQWxLaTYTmJMNF4zTXBoRGdhMDh2RUw5ZDAN9zVXVa==
User-Agent: curl/7.20.1 (i386-redhat-linux-gnu)
Host: localhost:3001
Accept: */*
</pre>
<p>Server response:</p>
<pre>
HTTP/1.1 202 Accepted
Content-Type: application/xml
Date: Thu, 28 Jul 2011 21:29:18 GMT
Content-Length: 709
&lt;?xml version='1.0' encoding='utf-8' ?&gt;
&lt;storage_volume href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' id='vol-0bc0de60'&gt;
&lt;capacity unit='GB'&gt;&lt;/capacity&gt;
&lt;device&gt;/dev/sdi&lt;/device&gt;
&lt;state&gt;unknown&lt;/state&gt;
&lt;mount&gt;
&lt;instance href='i-b100b3d0' id='i-b100b3d0'&gt;&lt;/instance&gt;
&lt;device name='/dev/sdi'&gt;&lt;/device&gt;
&lt;/mount&gt;
&lt;actions&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/attach' method='post' rel='attach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60/detach' method='post' rel='detach' /&gt;
&lt;link href='http://localhost:3001/api/storage_volumes/vol-0bc0de60' method='delete' rel='destroy' /&gt;
&lt;/actions&gt;
&lt;/storage_volume&gt;
</pre>
</div>
</div>
<p><a class="btn btn-inverse btn-large" style="float: right" href="storage-snapshots.html">Storage snapshots <i class="icon-arrow-right icon-white" style="vertical-align:baseline"> </i></a></p>
<p><br></p>
<footer class="footer">
<p class="pull-right"><span class='icon-circle-arrow-up'>&nbsp;</span><a href="#">Back to top</a></p>
<div class='row'>
<div class='span3'>
<img src="/assets/img/asf.png" alt="Apache Software Foundation"/>
</div>
<div class='span9'>
<strong>Apache Deltacloud</strong> is a top-level project at the <a
href="http://www.apache.org">Apache Software Foundation</a>,
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.
</div>
</div>
</footer>
</div> <!-- /container -->
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.salasaga.org/aeolus/piwik/" : "http://stats.salasaga.org/aeolus/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://stats.salasaga.org/aeolus/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</body>
</html>