diff --git a/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml b/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml
index 81998c9..d33f112 100644
--- a/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml
+++ b/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml
@@ -82,24 +82,18 @@ format="SVG" scale="60"/>
system.
cURL Authenticate
-
-curl \
+ $ curl \
\
\
- https://auth.api.yourcloud.com/v1.0
-
-
-
-HTTP/1.1 204 No Content
+ https://auth.api.yourcloud.com/v1.0
+HTTP/1.1 204 No Content
Date: Thu, 09 Jul 2009 15:31:39 GMT
Server: Apache/2.2.3
X-Storage-Url: https://storage.swiftdrive.com/v1/CF_xer7_343
X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae
Content-Length: 0
Connection: close
-Content-Type: application/octet-stream
-
-
+Content-Type: application/octet-stream
The storage URL and authentication token are returned in
the headers of the response. After authentication, you can
@@ -116,21 +110,15 @@ Content-Type: application/octet-stream
headers to terminal output (stdout).
cURL Get Storage Space
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343
+ HTTP/1.1 204 No Content
Date: Thu, 09 Jul 2009 15:38:14 GMT
Server: Apache
X-Account-Container-Count: 22
X-Account-Bytes-Used: 9891628380
-Content-Type: text/plain
-
-
+Content-Type: text/plain
The HTTP request must include a header to specify the
authentication token. The HTTP headers in the response
@@ -144,23 +132,17 @@ Content-Type: text/plain
any containers yet isn't terribly exciting:
cURL List Storage Container
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343
+ HTTP/1.1 204 No Content
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 0
Accept-Ranges: bytes
X-Trans-Id: txe8ca5138ac8643ec84070543a0c9c91e
Content-Length: 0
-Date: Mon, 07 Nov 2011 17:07:01 GMT
-
-
+Date: Mon, 07 Nov 2011 17:07:01 GMT
So, you take the X-Auth-Token obtained from the
authentication operation, pass it as a header value,
@@ -172,22 +154,16 @@ Date: Mon, 07 Nov 2011 17:07:01 GMT
again:
cURL Create Storage Container
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/george
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/george
+ HTTP/1.1 201 Created
Content-Length: 18
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txb25576385284476d9fa6c73835f21650
Date: Mon, 07 Nov 2011 17:44:20 GMT
-201 Created
-
-
+201 Created
Append the container name to the URL and force the PUT
verb. That creates a container, which we can now see when
@@ -195,14 +171,10 @@ Date: Mon, 07 Nov 2011 17:44:20 GMT
cURL List Storage Container After a
Creation
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 1
@@ -212,9 +184,7 @@ Content-Type: text/plain; charset=utf-8
X-Trans-Id: txaedd6b080626453399c9f5febbddb73b
Date: Mon, 07 Nov 2011 17:44:23 GMT
-george
-
-
+george
You may have noticed the account metadata that comes
back from the listing call. As you'd guess, it'll tell you
@@ -230,14 +200,10 @@ george
looks like with five containers:
cURL List Storage Container (long list)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 5
@@ -251,23 +217,17 @@ cosmo
dogs
elaine
george
-jerry
-
-
+jerry
Suppose I want a page size of 2, all I do is append a
""?limit=2"" to my URL:
cURL List Storage Container with Paging (first
page)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343?limit=2
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343?limit=2
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 5
@@ -278,9 +238,7 @@ X-Trans-Id: tx940ee02c1a65451e96a2a2532e3a7ce7
Date: Mon, 07 Nov 2011 19:05:30 GMT
cosmo
-dogs
-
-
+dogs
Not surprisingly, I only get two containers. To get the
next page, you tell the system which item you last saw
@@ -288,14 +246,10 @@ dogs
cURL List Storage Container with Paging (later
pages)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343?marker=dogs\&limit=2
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343?marker=dogs\&limit=2
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 5
@@ -306,9 +260,7 @@ X-Trans-Id: tx2a69f7ec38c34078a185c5875a4c0e34
Date: Mon, 07 Nov 2011 19:15:00 GMT
elaine
-george
-
-
+george
Notice that I had to use \& so that my bash shell
didn't try to interpret the & as wanting to run
@@ -326,14 +278,10 @@ george
dreaming about.
cURL List Storage Container (JSON output)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343?format=json
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343?format=json
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 5
@@ -347,20 +295,14 @@ Date: Mon, 07 Nov 2011 19:17:33 GMT
{"name":"dogs","count":0,"bytes":0},
{"name":"elaine","count":0,"bytes":0},
{"name":"george","count":0,"bytes":0},
-{"name":"jerry","count":0,"bytes":0}]
-
-
+{"name":"jerry","count":0,"bytes":0}]
cURL List Storage Container (XML output)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343?format=xml
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343?format=xml
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 5
@@ -377,9 +319,7 @@ Date: Mon, 07 Nov 2011 19:17:38 GMT
<container><name>elaine</name><count>0</count><bytes>0</bytes></container>
<container><name>george</name><count>0</count><bytes>0</bytes></container>
<container><name>jerry</name><count>0</count><bytes>0</bytes></container>
-</account>
-
-
+</account>
The remainder of the examples in this document will use
the standard, non-serialized output but all operations
@@ -396,55 +336,39 @@ Date: Mon, 07 Nov 2011 19:17:38 GMT
request:
cURL List Container Metadata
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
+ HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Bytes-Used: 0
Accept-Ranges: bytes
X-Trans-Id: tx3dd984f9482341dd97546e9d49d65e90
Content-Length: 0
-Date: Mon, 07 Nov 2011 20:39:41 GMT
-
-
+Date: Mon, 07 Nov 2011 20:39:41 GMT
Not very exciting without any objects in the container,
but you get the idea. While you cannot update or delete
container metadata, you can delete a container:
cURL Delete Storage Container
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/george
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/george
+ HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx3fa3857f266f44319d9b8f4bf7ce7fc8
-Date: Mon, 07 Nov 2011 20:42:58 GMT
-
-
+Date: Mon, 07 Nov 2011 20:42:58 GMT
Then let's confirm the delete by listing the containers
again:
cURL List Containers After a Delete
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343
+ HTTP/1.1 200 OK
X-Account-Object-Count: 0
X-Account-Bytes-Used: 0
X-Account-Container-Count: 4
@@ -457,9 +381,7 @@ Date: Mon, 07 Nov 2011 20:43:08 GMT
cosmo
dogs
elaine
-jerry
-
-
+jerry
@@ -474,22 +396,16 @@ jerry
situation:
cURL List Container Showing Lack of ACL
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
+ HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Bytes-Used: 0
Accept-Ranges: bytes
X-Trans-Id: tx3aa52e951fc64b63bc1fda27902b9bd3
Content-Length: 0
-Date: Tue, 15 Nov 2011 03:29:22 GMT
-
-
+Date: Tue, 15 Nov 2011 03:29:22 GMT
Now we'll set the X-Container-Read. For a full
explanation of valid values, see:
@@ -498,15 +414,11 @@ Date: Tue, 15 Nov 2011 03:29:22 GMT
to anybody:
cURL Setting an ACL on a Container
-
-curl \
+ $ curl \
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
-
-
-
-HTTP/1.1 202 Accepted
+ https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
+ HTTP/1.1 202 Accepted
Content-Length: 58
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txf2befb56b1854a50995f710f2db48089
@@ -514,30 +426,22 @@ Date: Tue, 15 Nov 2011 03:33:16 GMT
202 Accepted
-The request is accepted for processing.
-
-
+The request is accepted for processing.
To see the metadata change, do a listing again:
cURL List Container Showing with an ACL
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/jerry
+ HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 0
Accept-Ranges: bytes
X-Trans-Id: txb40eb86d949345f7bc66b01e8b63c3a5
Content-Length: 0
-Date: Tue, 15 Nov 2011 03:33:36 GMT
-
-
+Date: Tue, 15 Nov 2011 03:33:36 GMT
The side effect of giving anybody read access is that
any object in the container is now accessible from a
@@ -556,30 +460,23 @@ Date: Tue, 15 Nov 2011 03:33:36 GMT
dog pictures:
Sample File Listing
-
+ $ ls -l
-$ ls -l
total 504
-rw-r--r--@ 1 petecj2 staff 44765 Nov 7 14:49 JingleRocky.jpg
-rw-r--r--@ 1 petecj2 staff 100864 Nov 7 14:47 RockyAndBuster.jpg
--rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
-
-
+-rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
In order to put one of them in a container called "dogs"
with cURL, you'd do this:
Creating and Uploading an Object to a
Container
-
-curl \
+ $ curl \
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
+ HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: f7d40eceffdd9c2ecab226105737b2a6
@@ -598,9 +495,7 @@ Date: Mon, 07 Nov 2011 22:51:30 GMT
</body>
-</html>
-
-
+</html>
The object gets named from whatever we append to the URL
path beyond the container name and the -T switch lets us
@@ -610,14 +505,10 @@ Date: Mon, 07 Nov 2011 22:51:30 GMT
cURL List Container Showing Newly Uploaded
Object
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
+ HTTP/1.1 200 OK
X-Container-Object-Count: 1
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 44765
@@ -627,9 +518,7 @@ Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx83be89d4e1a34eacbfeebcdfc7a7f2e7
Date: Mon, 07 Nov 2011 22:56:25 GMT
-JingleRocky.jpg
-
-
+JingleRocky.jpg
Notice that the container metadata now reflects the
number of objects and the bytes match what we saw when we
@@ -638,14 +527,10 @@ JingleRocky.jpg
cURL List Container Showing Multiple Newly Uploaded
Objects
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs
+ HTTP/1.1 200 OK
X-Container-Object-Count: 3
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 252732
@@ -657,9 +542,7 @@ Date: Mon, 07 Nov 2011 23:00:56 GMT
JingleRocky.jpg
RockyAndBuster.jpg
-SittingBuster.jpg
-
-
+SittingBuster.jpg
@@ -678,45 +561,27 @@ SittingBuster.jpg
details.
Uploading first segment
-
-curl
- https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-one
-
-
-
-HTTP/1.1 201 Created
+ $ curl
+ https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-one
+ HTTP/1.1 201 Created
Content-Length: 4000000
-Etag: f7365c1419b4f349592c00bd0cfb9b9a
-
-
+Etag: f7365c1419b4f349592c00bd0cfb9b9a
Uploading second segment
-
-curl
- https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-two
-
-
-
-HTTP/1.1 201 Created
+ $ curl
+ https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-two
+ HTTP/1.1 201 Created
Content-Length: 2000000
-Etag: ad81e97b10e870613aecb5ced52adbaa
-
-
+Etag: ad81e97b10e870613aecb5ced52adbaa
Uploading final segment
-
-curl
- https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-three
-
-
-
-HTTP/1.1 201 Created
+ $ curl
+ https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-three
+ HTTP/1.1 201 Created
Content-Length: 1000
-Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3
-
-
+Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3
At this stage we are ready to create the manifest
listing. Notice that the size and ETag are copied from
@@ -725,9 +590,7 @@ Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3
content:
Manifest List Example
-
-
- [
+ [
{
"path": "segments/terrier-jpg-one",
"etag": "f7365c1419b4f349592c00bd0cfb9b9a",
@@ -743,9 +606,7 @@ Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3
"size_bytes": 1000
{
}
- ]
-
-
+ ]
The final operation is to upload this content into a
manifest object. To indicate that this is a manifest
@@ -754,26 +615,18 @@ Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3
string.
Uploading manifest object
-
-curl
- https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg?multipart-manifest=put
-
+ $ curl
+ https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg?multipart-manifest=put
We can now examine our static large object. Notice that
the size is the total size of all the segments.
Examining a manifest object
-
-curl
- https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg
-
-
-
-HTTP/1.1 200 OK
+ $ curl
+ https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg
+ HTTP/1.1 200 OK
Content-Length: 6001000
-Etag: "0c922c37f915efb1c9b97e6328b3e660"
-
-
+Etag: "0c922c37f915efb1c9b97e6328b3e660"
@@ -785,14 +638,10 @@ Etag: "0c922c37f915efb1c9b97e6328b3e660"
variable:
cURL List Objects (first page)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs?limit=2
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs?limit=2
+ HTTP/1.1 200 OK
X-Container-Object-Count: 3
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 252732
@@ -803,21 +652,15 @@ X-Trans-Id: tx5e00fa9fa895423198bc814cb0c6162d
Date: Tue, 15 Nov 2011 03:53:51 GMT
JingleRocky.jpg
-RockyAndBuster.jpg
-
-
+RockyAndBuster.jpg
And the second page fetched with:
cURL List Objects with Paging (later pages)
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs?marker=RockyAndBuster.jpg\&limit=2
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs?marker=RockyAndBuster.jpg\&limit=2
+ HTTP/1.1 200 OK
X-Container-Object-Count: 3
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 252732
@@ -827,9 +670,7 @@ Content-Type: text/plain; charset=utf-8
X-Trans-Id: txe1287a7179dc4dfd98610850a0fff157
Date: Tue, 15 Nov 2011 03:54:21 GMT
-SittingBuster.jpg
-
-
+SittingBuster.jpg
@@ -838,9 +679,8 @@ SittingBuster.jpg
we'll remove the local copy:
Removing Local Copies
-
+ $ ls -l
-$ ls -l
total 504
-rw-r--r--@ 1 petecj2 staff 44765 Nov 7 14:49 JingleRocky.jpg
-rw-r--r--@ 1 petecj2 staff 100864 Nov 7 14:47 RockyAndBuster.jpg
@@ -849,28 +689,21 @@ $ rm JingleRocky.jpg
$ ls -l
total 416
-rw-r--r--@ 1 petecj2 staff 100864 Nov 7 14:47 RockyAndBuster.jpg
--rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
-
-
+-rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
Be sure not to use -i switch here since what we want is
the raw data, which we'll then pipe to a file:
cURL Retrieve an Object
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg > JingleRocky.jpg
-
-
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg > JingleRocky.jpg
+ $ ls -l
-$ ls -l
total 504
-rw-r--r-- 1 petecj2 staff 44765 Nov 7 15:11 JingleRocky.jpg
-rw-r--r--@ 1 petecj2 staff 100864 Nov 7 14:47 RockyAndBuster.jpg
--rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
-
-
+-rw-r--r--@ 1 petecj2 staff 107103 Nov 7 14:47 SittingBuster.jpg
Next, Object Storage provides a facility to copy objects
from one container to another entirely on the server side.
@@ -879,16 +712,12 @@ total 504
header and a Content-Length of zero:
cURL Server-side Copy an Object
-
-curl \
+ $ curl \
\
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/JingleRocky.jpg
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/JingleRocky.jpg
+ HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: f7d40eceffdd9c2ecab226105737b2a6
@@ -908,9 +737,7 @@ Date: Mon, 07 Nov 2011 23:23:54 GMT
</body>
-</html>
-
-
+</html>
You can then confirm the new location of the object. To
do this, you do a GET with the destination container to
@@ -918,14 +745,10 @@ Date: Mon, 07 Nov 2011 23:23:54 GMT
cURL Confirming the Server-side Copy an
Object
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/
+ HTTP/1.1 200 OK
X-Container-Object-Count: 1
X-Container-Bytes-Used: 44765
Accept-Ranges: bytes
@@ -934,49 +757,35 @@ Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx46986b4a09b34790924fd43842b2b0dd
Date: Mon, 07 Nov 2011 23:24:05 GMT
-JingleRocky.jpg
-
-
+JingleRocky.jpg
To delete an object from its container, simply use the
DELETE verb:
cURL Delete an Object
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/JingleRocky.jpg
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/JingleRocky.jpg
+ HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txd45f04422b034e6f8447de400b78cbf3
-Date: Mon, 07 Nov 2011 23:32:39 GMT
-
-
+Date: Mon, 07 Nov 2011 23:32:39 GMT
Confirming the deletion by doing a container
listing:
cURL Confirming the Delete an Object
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/elaine/
+ HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Bytes-Used: 0
Accept-Ranges: bytes
X-Trans-Id: txc9b43bf4d896405eb9a88ca468bf7b2d
Content-Length: 0
-Date: Mon, 07 Nov 2011 23:32:41 GMT
-
-
+Date: Mon, 07 Nov 2011 23:32:41 GMT
@@ -987,51 +796,39 @@ Date: Mon, 07 Nov 2011 23:32:41 GMT
this:
cURL Set Object Metadata
-
-curl \
+ $ curl \
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
-
-
-
- <html>
- <head>
- <title>202 Accepted</title>
- </head>
- <body>
- <h1>202 Accepted</h1>
- The request is accepted for processing.<br /><br />
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
+ <html>
+ <head>
+ <title>202 Accepted</title>
+ </head>
+ <body>
+ <h1>202 Accepted</h1>
+ The request is accepted for processing.<br /><br />
- </body>
- </html>
-
-
+ </body>
+ </html>
And then read the object metadata with a HEAD on the
object path:
cURL Reading Object Metadata
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
-
-
-
- HTTP/1.1 200 OK
- X-Object-Meta-Breed: Terrier pit bull mix
- Last-Modified: Tue, 08 Nov 2011 01:26:49 GMT
- Etag: f7d40eceffdd9c2ecab226105737b2a6
- Accept-Ranges: bytes
- Content-Length: 44765
- Content-Type: image/jpeg
- X-Trans-Id: txa8bff9ad7ef844829103c1f9b8c20781
- Date: Tue, 08 Nov 2011 01:29:35 GMT
-
-
+ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg
+ HTTP/1.1 200 OK
+ X-Object-Meta-Breed: Terrier pit bull mix
+ Last-Modified: Tue, 08 Nov 2011 01:26:49 GMT
+ Etag: f7d40eceffdd9c2ecab226105737b2a6
+ Accept-Ranges: bytes
+ Content-Length: 44765
+ Content-Type: image/jpeg
+ X-Trans-Id: txa8bff9ad7ef844829103c1f9b8c20781
+ Date: Tue, 08 Nov 2011 01:29:35 GMT
@@ -1048,56 +845,40 @@ Date: Mon, 07 Nov 2011 23:32:41 GMT
in it:
cURL Create New Container for Folders
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos
+ HTTP/1.1 201 Created
Content-Length: 18
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txc78254a41b374b6ea10590d90874f769
Date: Wed, 16 Nov 2011 00:06:22 GMT
-201 Created
-
-
+201 Created
Now list the new container:
cURL Listing the New Container
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos
-
-
-
-HTTP/1.1 204 No Content
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos
+ HTTP/1.1 204 No Content
X-Container-Object-Count: 0
X-Container-Bytes-Used: 0
Accept-Ranges: bytes
X-Trans-Id: tx49112200f7934c2bab1de3ae103c368e
Content-Length: 0
-Date: Wed, 16 Nov 2011 00:06:26 GMT
-
-
+Date: Wed, 16 Nov 2011 00:06:26 GMT
Next, add an object but prefix the name with the
hierarchy desired:
cURL Upload an Object with a Prefix
-
-curl \
+ $ curl \
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos/terriers/JingleRocky.jpg
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos/terriers/JingleRocky.jpg
+ HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: f7d40eceffdd9c2ecab226105737b2a6
@@ -1106,33 +887,27 @@ X-Trans-Id: txe34fdf2704f044e3a7102256386b1cb7
Date: Wed, 16 Nov 2011 00:09:19 GMT
<html>
- <head>
- <title>201 Created</title>
- </head>
- <body>
- <h1>201 Created</h1>
- <br /><br />
+ <head>
+ <title>201 Created</title>
+ </head>
+ <body>
+ <h1>201 Created</h1>
+ <br /><br />
- </body>
-</html>
-
-
+ </body>
+</html>
Do it again with a different object and prefix:
cURL Upload a Different Object with a Different
Prefix
-
-curl \
+ $ curl \
\
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos/chihuahuas/SittingBuster.jpg
-
-
-
-HTTP/1.1 201 Created
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos/chihuahuas/SittingBuster.jpg
+ HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: e692e744c7180ee368166a24f1a2fa9b
@@ -1141,31 +916,25 @@ X-Trans-Id: txe229d03af5ea4d2ea1071def213c3f02
Date: Wed, 16 Nov 2011 00:52:25 GMT
<html>
- <head>
- <title>201 Created</title>
- </head>
- <body>
- <h1>201 Created</h1>
- <br /><br />
+ <head>
+ <title>201 Created</title>
+ </head>
+ <body>
+ <h1>201 Created</h1>
+ <br /><br />
- </body>
-</html>
-
-
+ </body>
+</html>
Now list the container, revealing the prefixes:
cURL Listing a Container with Object Prefix
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos
+ HTTP/1.1 200 OK
X-Container-Object-Count: 2
X-Container-Bytes-Used: 151868
Accept-Ranges: bytes
@@ -1175,23 +944,17 @@ X-Trans-Id: tx8544a17e8b1e4da693145fb5f2e6db43
Date: Wed, 16 Nov 2011 00:53:43 GMT
chihuahuas/SittingBuster.jpg
-terriers/JingleRocky.jpg
-
-
+terriers/JingleRocky.jpg
If you want to perform hierarchical listings, with the
prefixes in place, you can use the "path" query string
variable:
cURL Listing a Container with a Path
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos?path=terriers
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos?path=terriers
+ HTTP/1.1 200 OK
X-Container-Object-Count: 2
X-Container-Bytes-Used: 151868
Accept-Ranges: bytes
@@ -1200,23 +963,17 @@ Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx3f1b9575d4de4a7d97ba3f9ad81923cc
Date: Wed, 16 Nov 2011 00:55:12 GMT
-terriers/JingleRocky.jpg
-
-
+terriers/JingleRocky.jpg
If you wanted to see what prefixes were in place, you
can use the "delimiter" query string variable to
distinguish prefix paths from object names:
cURL Listing a Container with a Delimiter
-
-curl \
+ $ curl \
\
- https://storage.swiftdrive.com/v1/CF_xer7_343/photos?delimiter=/
-
-
-
-HTTP/1.1 200 OK
+ https://storage.swiftdrive.com/v1/CF_xer7_343/photos?delimiter=/
+ HTTP/1.1 200 OK
X-Container-Object-Count: 2
X-Container-Bytes-Used: 151868
Accept-Ranges: bytes
@@ -1226,9 +983,7 @@ X-Trans-Id: tx7222a3dd73fe44b888db4e58cc647d1e
Date: Wed, 16 Nov 2011 00:57:40 GMT
chihuahuas/
-terriers/
-
-
+terriers/
Using these in combination allows you to discover
directories within a particular path and then further