{"id":409,"date":"2016-02-02T16:49:39","date_gmt":"2016-02-02T16:49:39","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=409"},"modified":"2016-02-02T16:52:05","modified_gmt":"2016-02-02T16:52:05","slug":"testing-cloud-files-api-calls","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/02\/02\/testing-cloud-files-api-calls\/","title":{"rendered":"Testing Cloud Files API calls"},"content":{"rendered":"<p>So a customer was having issues with cloudfuse, the virtual &#8216;cloud files&#8217; hard disk. So we needed to test whether their auth is working correctly:<\/p>\n<p>#!\/bin\/bash<br \/>\n# Diagnostic script by Adam Bull<br \/>\n# Test Cloud Files Auth<br \/>\n# Tuesday, 02\/02\/2016 <\/p>\n<p># Username used to login to control panel<br \/>\nUSERNAME=&#8217;mycloudusername&#8217;<\/p>\n<p># Find the APIKey in the &#8216;account settings&#8217; part of the menu of the control panel<br \/>\nAPIKEY=&#8217;mycloudapikey&#8217;<\/p>\n<p># This section simply retrieves and sets the TOKEN<\/p>\n<p>TOKEN=`curl https:\/\/identity.api.rackspacecloud.com\/v2.0\/tokens -X POST -d &#8216;{ &#8220;auth&#8221;:{&#8220;RAX-KSKEY:apiKeyCredentials&#8221;: { &#8220;username&#8221;:&#8221;&#8216;$USERNAME'&#8221;, &#8220;apiKey&#8221;: &#8220;&#8216;$APIKEY'&#8221; }} }&#8217; -H &#8220;Content-type: application\/json&#8221; |  python -mjson.tool | grep -A5 token | grep id | cut -d &#8216;&#8221;&#8216; -f4`<\/p>\n<p># Container to Upload to (container must exist)<\/p>\n<p>CONTAINER=testing<\/p>\n<p>LOCALFILENAME=&#8221;\/root\/mytest.txt&#8221;<br \/>\nFILENAME=&#8221;mytest.txt&#8221;<\/p>\n<p># Put command, note MossoCloufFS_customeridhere needs to be populated with the correct value. This is the number in the mycloud url when logging in.<br \/>\ncurl -i -v -X PUT &#8220;https:\/\/storage101.lon3.clouddrive.com\/v1\/MossoCloudFS_101100\/$CONTAINER\/$FILENAME&#8221; -T &#8220;$LOCALFILENAME&#8221; -H &#8220;X-Auth-Token: $TOKEN&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So a customer was having issues with cloudfuse, the virtual &#8216;cloud files&#8217; hard disk. So we needed to test whether their auth is working correctly: #!\/bin\/bash # Diagnostic script by Adam Bull # Test Cloud Files Auth # Tuesday, 02\/02\/2016 &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/02\/02\/testing-cloud-files-api-calls\/\">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,15,14,10],"tags":[],"class_list":["post-409","post","type-post","status-publish","format-standard","hentry","category-api","category-cloud","category-cloud-files","category-filesystem"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/409","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=409"}],"version-history":[{"count":5,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/409\/revisions"}],"predecessor-version":[{"id":414,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/409\/revisions\/414"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}