| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <title>CIMI cURL Examples - Volume 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="span8"> |
| |
| <h3 id="command">cURL examples for CIMI Volume resources</h3> |
| |
| <ul class="nav nav-pills"> |
| <li class="active"><a href="#volumes" data-toggle="tab">Working with Volumes</a></li> |
| <li><a href="#volume-images" data-toggle="tab">Working with VolumeImages</a></li> |
| <li><a href="#volume-configs" data-toggle="tab">Working with VolumeConfigurations</a></li> |
| <li><a href="#volume-templates" data-toggle="tab">Working with VolumeTemplates</a></li> |
| </ul> |
| |
| |
| </div> |
| |
| <div class="span4"> |
| |
| <ul class="nav nav-list well"> |
| <li class="nav-header"> |
| <a href="../cimi-curl.html">curl for CIMI Resources</a> |
| </li> |
| <ul class="nav nav-list"> |
| <li><a href="cimi-curl-machines.html">Machine</a></li> |
| <li class="active"><a href="cimi-curl-volumes.html">Volume</a></li> |
| <li><a href="cimi-curl-resource_metadata.html">ResourceMetadata</a></li> |
| </ul> |
| <br> |
| </ul> |
| |
| </div> |
| |
| </div> |
| |
| <div class="tab-content"> |
| |
| <div class="tab-pane active" id="volumes"> |
| |
| <hr> |
| |
| <h4>Working with Volumes</h4> |
| |
| <p>Retrieve the Volume Collection in json format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/json" http://localhost:3001/cimi/volumes </pre> |
| |
| <p>Retrieve a specific Volume in xml format: </p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/cimi/volumes/volume1 </pre> |
| |
| <p>Create Volume - with VolumeConfiguration by reference, XML body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Accept:application/xml" -X POST -d '<VolumeCreate><name> marios_new_volume </name> <description> a new volume </description><volumeTemplate><volumeConfig href="http://localhost:3001/cimi/volume_configurations/2"> </volumeConfig></volumeTemplate></VolumeCreate>' http://localhost:3001//cimi/volumes |
| </pre> |
| |
| <p>Create Volume - with VolumeConfiguration by reference, JSON body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Accept:application/xml" -X POST -d '{"name": "marios_new_volume", "description": "a new volume", "volumeTemplate": { "volumeConfig": {"href":"http://localhost:3001/cimi/volume_configurations/2" }}}' http://localhost:3001//cimi/volumes |
| </pre> |
| |
| <p>Create Volume - with VolumeConfiguration by value, XML body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Accept:application/xml" -X POST -d '<VolumeCreate><name> marios_volume </name><description> a new volume </description> <volumeTemplate><volumeConfig><type>http://schemas.dmtf.org/cimi/1/mapped</type><capacity> 1024 </capacity></volumeConfig></volumeTemplate> </VolumeCreate>' http://localhost:3001//cimi/volumes |
| </pre> |
| |
| <p>Create Volume - with VolumeConfiguration by value, JSON body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Accept:application/xml" -X POST -d '{"name": "marios_new_volume", "description": "a new volume", "volumeTemplate": { "volumeConfig": {"type":"http://schemas.dmtf.org/cimi/1/mapped", "capacity": 1024 }}}' http://localhost:3001/cimi/volumes |
| </pre> |
| |
| <p>Delete a Volume</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Accept: application/xml" -X DELETE http://localhost:3001/cimi/volumes/volume94275 |
| </pre> |
| |
| </div> |
| |
| <div class="tab-pane" id="volume-images"> |
| |
| <hr> |
| |
| <h4>Working with Volume Images</h4> |
| |
| <p>Retrieve the Volume Image Collection in xml format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/cimi/volume_images</pre> |
| |
| <p>Retrieve a specific Volume Image in json format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/json" http://localhost:3001/cimi/volume_images/vol_image1 </pre> |
| |
| <p>Create a Volume Image from an existing Volume, XML body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Content-Type: application/xml" -H "Accept: application/xml" -X POST -d '<VolumeImage xmlns="http://schemas.dmtf.org/cimi/1"><name> my_vol_image </name><description> marios first volume image </description><imageLocation href="http://localhost:3001/cimi/volumes/vol1"/></VolumeImage>' http://localhost:3001/cimi/volume_images |
| </pre> |
| |
| <p>Create a Volume Image from an existing Volume, JSON body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Content-Type: application/json" -H "Accept: application/xml" -X POST -d '{ "resourceURI": "http://schemas.dmtf.org/cimi/1/VolumeImage","name": "some_name", "description": "marios first volume image", "imageLocation": { "href": "http://localhost:3001/cimi/volumes/vol1"}}' http://localhost:3001/cimi/volume_images</pre> |
| |
| <p>Delete a Volume Image:</p> |
| |
| <pre>curl -v -X DELETE --user "mockuser:mockpassword" http://localhost:3001/cimi/volume_images/store_snapshot_1358516615</pre> |
| |
| </div> |
| |
| |
| <div class="tab-pane" id="volume-configs"> |
| |
| <hr> |
| |
| <h4>Working with Volume Configurations</h4> |
| |
| <p>Retrieve the Volume Configuration Collection in json format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/json" http://localhost:3001/cimi/volume_configurations </pre> |
| |
| <p>Retrieve a specific Volume Configuration in xml format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/cimi/volume_configurations/volume_config1 </pre> |
| |
| <p>Create a new Volume Configuration with XML body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Content-Type: application/xml" -H "Accept: application/xml" -X POST -d '<VolumeConfigurationCreate><name>marios_volume_config</name><description>a volume configuration</description><format>qcow2</format><type>http://schemas.dmtf.org/cimi/1/mapped</type> <capacity>10</capacity></VolumeConfigurationCreate>' http://localhost:3001/cimi/volume_configurations |
| </pre> |
| |
| <p>Create a new Volume Configuration with JSON body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Content-Type: application/json" -H "Accept: application/xml" -X POST -d '{ "resourceURI": "http://schemas.dmtf.org/cimi/1/VolumeConfiguration","name": "marios_volume_config", "description": "a volume configuration", "type": "http://schemas.dmtf.org/cimi/1/mapped", "format": "ext3", "capacity": 11}' http://localhost:3001/cimi/volume_configurations</pre> |
| |
| <p>Delete a Volume Configuration:</p> |
| |
| <pre>curl -v -X DELETE --user "mockuser:mockpassword" http://localhost:3001/cimi/volume_configurations/4 </pre> |
| |
| </div> |
| |
| |
| <div class="tab-pane" id="volume-templates"> |
| |
| <hr> |
| |
| <h4>Working with Volume Templates</h4> |
| |
| <p>Retrieve the Volume Template Collection in json format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/json" http://localhost:3001/cimi/volume_templates </pre> |
| |
| <p>Retrieve a specific Volume Template in xml format:</p> |
| |
| <pre> curl --user "user:pass" -H "Accept: application/xml" http://localhost:3001/cimi/volume_templates/vol_template123</pre> |
| |
| <p>Create a Volume Template with XML body:</p> |
| |
| <pre>curl --user "mockuser:mockpassword" -H "Content-Type: application/xml" -H "Accept: application/xml" -X POST -d '<VolumeTemplate xmlns="http://schemas.dmtf.org/cimi/1"> <name> marios_vol_template </name> <description> my first volume template </description> <volumeConfig href="http://localhost:3001/cimi/volume_configs/1"> </volumeConfig> </VolumeTemplate>' http://localhost:3001/cimi/volume_templates</pre> |
| |
| <p>Create a Volume Template with JSON body:</p> |
| |
| <pre>curl -v --user "mockuser:mockpassword" -H "Content-Type: application/json" -H "Accept: application/xml" -X POST -d '{ "resourceURI": "http://schemas.dmtf.org/cimi/1/VolumeTemplate","name": "marios_vol_template", "description": "my first volume template", "volumeConfig": { "href": "http://localhost:3001/cimi/volume_configs/1"} }' http://localhost:3001/cimi/volume_templates </pre> |
| |
| <p>Delete a Volume Template:</p> |
| |
| <pre>curl -v -X DELETE --user "mockuser:mockpassword" http://localhost:3001/cimi/volume_templates/vol_template123</pre> |
| |
| </div> |
| </div> |
| |
| |
| <footer class="footer"> |
| <p class="pull-right"><span class='icon-circle-arrow-up'> </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> |