{"id":385,"date":"2016-01-22T14:51:32","date_gmt":"2016-01-22T14:51:32","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=385"},"modified":"2016-01-22T18:45:51","modified_gmt":"2016-01-22T18:45:51","slug":"exporting-rackspace-cloud-server-image-to-cloud-files-so-you-can-download-it","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/01\/22\/exporting-rackspace-cloud-server-image-to-cloud-files-so-you-can-download-it\/","title":{"rendered":"Exporting Rackspace Cloud Server Image to Cloud Files (so you can download it)"},"content":{"rendered":"<p>So today, a customer wanted to know if there was a way to export a Rackspace Cloud Server image out of Rackspace to download it. Yes, this is possible and can be done using the Images API and Cloud Files. Here is a summary of the basic process below;<\/p>\n<p>Step 1: Make container called &#8216;export&#8217; in cloud files; You can do this thru the mycloud control panel by navigating to your cloud files and simply clicking create container, call it &#8216;export&#8217;.<\/p>\n<p><a href=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/01\/Screen-Shot-2016-01-22-at-2.46.56-PM.png\" rel=\"attachment wp-att-386\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.haxed.me.uk\/wp-content\/uploads\/2016\/01\/Screen-Shot-2016-01-22-at-2.46.56-PM.png\" alt=\"Screen Shot 2016-01-22 at 2.46.56 PM\" width=\"655\" height=\"486\" class=\"alignnone size-full wp-image-386\" srcset=\"https:\/\/haxed.me.uk\/wp-content\/uploads\/2016\/01\/Screen-Shot-2016-01-22-at-2.46.56-PM.png 655w, https:\/\/haxed.me.uk\/wp-content\/uploads\/2016\/01\/Screen-Shot-2016-01-22-at-2.46.56-PM-300x223.png 300w, https:\/\/haxed.me.uk\/wp-content\/uploads\/2016\/01\/Screen-Shot-2016-01-22-at-2.46.56-PM-404x300.png 404w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/a><\/p>\n<p>Step 2:  Create bash script to query API with correct user, apikey and imageid;<\/p>\n<pre>\r\nvim mybashscript.sh\r\n<\/pre>\n<pre>\r\n#!\/bin\/bash\r\n\r\n# Username used to login to control panel\r\nUSERNAME='mycloudusernamehere'\r\n# Find the APIKey in the 'account settings' part of the menu of the control panel\r\nAPIKEY='mycloudapikeyhere'\r\n# Find the image ID you'd like to make available on cloud files\r\n# set the image id below of the image you want to copy to cloud files, see in control panel\r\nIMAGEID=\"5fb24bf2-afae-4277-b8fa-0b69bc98185a\"\r\n\r\n# This section simply retrieves the TOKEN\r\nTOKEN=`curl https:\/\/identity.api.rackspacecloud.com\/v2.0\/tokens -X POST -d '{ \"auth\":{\"RAX-KSKEY:apiKeyCredentials\": { \"username\":\"'$USERNAME'\", \"apiKey\": \"'$APIKEY'\" }} }' -H \"Content-type: application\/json\" |  python -mjson.tool | grep -A5 token | grep id | cut -d '\"' -f4`\r\n\r\n# This section requests the Glance API to copy the cloud server image uuid to a cloud files container called export\r\ncurl https:\/\/lon.images.api.rackspacecloud.com\/v2\/10045567\/tasks -X POST -H \"X-Auth-Token: $TOKEN\" -H \"Content-Type: application\/json\" -d '{\"type\": \"export\", \"input\": {\"image_uuid\": \"'\"$IMAGEID\"'\", \"receiving_swift_container\": \"exports\"}}'\r\n<\/pre>\n<p>It&#8217;s so simple I had to check myself that it was really this simple.<\/p>\n<p>It is. yay! Next guide shows you how to download the image you made.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So today, a customer wanted to know if there was a way to export a Rackspace Cloud Server image out of Rackspace to download it. Yes, this is possible and can be done using the Images API and Cloud Files. &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/01\/22\/exporting-rackspace-cloud-server-image-to-cloud-files-so-you-can-download-it\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,19,14,30,9,7,11],"tags":[],"class_list":["post-385","post","type-post","status-publish","format-standard","hentry","category-api","category-bash","category-cloud-files","category-glance-api","category-linux","category-management-tools","category-openstack"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=385"}],"version-history":[{"count":3,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/385\/revisions\/391"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}