Created
November 25, 2013 06:02
-
-
Save christophchamp/7636987 to your computer and use it in GitHub Desktop.
Upload a tarball to a Rackspace Cloud Files container and extract its contents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SEE: http://docs.rackspace.com/files/api/v1/cf-devguide/content/Extract_Archive-d1e2338.html | |
# NOTE: That "Content-Type: " _must_ be blank if you want the API to guess the types! | |
token=`./curl_authenticate.sh |grep ^X-Auth-Token |cut -d: -f2` | |
tarball=/home/champ/tmp/test_cf_extract.tar.gz | |
container=tmp | |
region=dfw | |
curl -i -XPUT \ | |
-H "X-Auth-Token: $token" \ | |
-H "Content-Type: " \ | |
https://storage101.${region}1.clouddrive.com/v1/MossoCloudFS_ffff-ffff-ffff-ffff-ffff/${container}/?extract-archive=tar.gz \ | |
--data-binary @$tarball |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment