Skip to content

Instantly share code, notes, and snippets.

@HugoKuo
Created April 8, 2014 03:09
Show Gist options
  • Save HugoKuo/10086319 to your computer and use it in GitHub Desktop.
Save HugoKuo/10086319 to your computer and use it in GitHub Desktop.
swiftstack@swiftstack-paco:~/data$ ls
0 1 10 11 12 13 2 3 5 6 7 8 9 number.tar.gz
swiftstack@swiftstack-paco:~/data$ curl -X PUT -H "x-auth-token: $TK" http://192.168.56.10/v1/AUTH_ss/test?extract-archive=tar.gz -T number.tar.gz
Number Files Created: 13
Response Body:
Response Status: 201 Created
Errors:
swiftstack@swiftstack-paco:~/data$ swift list
1
test
swiftstack@swiftstack-paco:~/data$ swift list test
0
1
10
11
12
13
2
3
5
6
7
8
9
swiftstack@swiftstack-paco:~/data$ curl -X PUT -H "x-auth-token: $TK" -H "Accept: application/json" http://192.168.56.10/v1/AUTH_ss/test?extract-archive=tar.gz -T number.tar.gz
{"Number Files Created": 13, "Response Status": "201 Created", "Errors": [], "Response Body": ""}swiftstack@swiftstack-paco:~/data$
swiftstack@swiftstack-paco:~/data$ mkdir test
swiftstack@swiftstack-paco:~/data/test$ ls
swiftstack@swiftstack-paco:~/data/test$ mkdir dir1
swiftstack@swiftstack-paco:~/data/test$ mkdir dir2
swiftstack@swiftstack-paco:~/data/test$ mkdir dir3
swiftstack@swiftstack-paco:~/data/test$ mkdir dir-empty
swiftstack@swiftstack-paco:~/data/test$ ls
dir1 dir2 dir3 dir-empty
swiftstack@swiftstack-paco:~/data/test$ ls *
dir1:
dir1-obj1 dir1-obj2
dir2:
dir2-obj1
dir3:
dir3-obj1
dir-empty:
swiftstack@swiftstack-paco:~/data/test$ tar czvf dirs.tar.gz *
dir1/
dir1/dir1-obj2
dir1/dir1-obj1
dir2/
dir2/dir2-obj1
dir3/
dir3/dir3-obj1
dir-empty/
swiftstack@swiftstack-paco:~/data/test$ curl -v -X PUT -H "x-auth-token: $TK" -H "Accept: application/json" http://192.168.56.10/v1/AUTH_ss/test2?extract-archive=tar.gz -T dirs.tar.gz | python -mjson.tool
* About to connect() to 192.168.56.10 port 80 (#0)
* Trying 192.168.56.10... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
> PUT /v1/AUTH_ss/test2?extract-archive=tar.gz HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.56.10
> x-auth-token: AUTH_tk1059ad744586413f9c52c6e370b42567
> Accept: application/json
> Content-Length: 270
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [data not shown]
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Content-Type: application/json
< X-Trans-Id: tx4c7f1c4e99184e20adad2-00534367bc
< Date: Tue, 08 Apr 2014 03:06:36 GMT
< Transfer-Encoding: chunked
<
{ [data not shown]
100 366 0 96 100 270 522 1468 --:--:-- --:--:-- --:--:-- 1491
* Connection #0 to host 192.168.56.10 left intact
* Closing connection #0
{
"Errors": [],
"Number Files Created": 4,
"Response Body": "",
"Response Status": "201 Created"
}
swiftstack@swiftstack-paco:~/data/test$ swift list test2
dir1/dir1-obj1
dir1/dir1-obj2
dir2/dir2-obj1
dir3/dir3-obj1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment