diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..fa34225 Binary files /dev/null and b/.DS_Store differ diff --git a/openstack-object-storage-dev/bk_os-objectstorage-devguide.xml b/openstack-object-storage-dev/bk_os-objectstorage-devguide.xml index 479e169..4dc1bbd 100644 --- a/openstack-object-storage-dev/bk_os-objectstorage-devguide.xml +++ b/openstack-object-storage-dev/bk_os-objectstorage-devguide.xml @@ -1,30 +1,6 @@ - - - - - - GET'> - HEAD'> - PUT'> - POST'> - DELETE'> - - - - - - '> - - - - - - '> +POST'> ]> - - - + + + diff --git a/openstack-object-storage-dev/ch_object-api-concepts.xml b/openstack-object-storage-dev/ch_object-api-concepts.xml new file mode 100644 index 0000000..9be7b0f --- /dev/null +++ b/openstack-object-storage-dev/ch_object-api-concepts.xml @@ -0,0 +1,24 @@ + + + Object Storage API concepts and features + For an introduction to OpenStack Object Storage, see Object Storage in the OpenStack Cloud + Administrator Guide. + + + + + + + + + + + + + + diff --git a/openstack-object-storage-dev/ch_object-api-examples.xml b/openstack-object-storage-dev/ch_object-api-examples.xml new file mode 100644 index 0000000..75e780b --- /dev/null +++ b/openstack-object-storage-dev/ch_object-api-examples.xml @@ -0,0 +1,893 @@ + + +GET'> +HEAD'> +PUT'> +POST'> +DELETE'> +]> + + + Object Storage API examples + This section introduces the cURL command language and + demonstrates how to use cURL commands to make Object Storage + API calls. + +
+ Authenticate + The following examples show you how to authenticate with + the Identity Service or Tempauth. +
+ Authenticate with the Identity Service + This section provides a overview of the + authentication process. For request and response + details, see Authenticate in the OpenStack + Identity Service API v2.0 + Reference. + + To authentication with the Identity + Service + + Send your credentials and a tenant ID or + tenant name to the Identity Service. + The response includes an authentication + token and service catalog. + + + Select the service catalog entry where + type is + object-store. Use the + publicURL endpoint, + which contains a URL with the full path to the + Object Storage account. The URL has the + format, + https://hostname/v1/account. + + +
+
+ Authenticate with Tempauth + + To authenticate with Tempauth + + Supply your user name and API access key in + headers, as follows: + + + X-Auth-User + header. Specify your Object Storage + user name. + + + + X-Auth-Key header. + Specify your access key.. + + + The following example shows a sample + request: + GET /v1/auth HTTP/1.1 +Host: swift.yourcloud.com +X-Auth-User: jdoe +X-Auth-Key: jdoepassword + + + When authentication succeeds, you receive a + 204 + No Content status code. + Any + 2nn + response indicates success. + The X-Auth-Token response + header contains the authentication token. The + X-Storage-Url response + header contains a URL that includes a full + path to the Object Storage account. The URL + has the format, + https://hostname/v1/account. + The following example shows a sample + response: + HTTP/1.1 204 No Content +Date: Mon, 12 Nov 2010 15:32:21 +Server: Apache +X-Storage-Url: https://swift.yourcloud.com/v1/AUTH_123456789_12345 +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb +Content-Length: 0 +Content-Type: text/plain; charset=UTF-8 + + +
+
+
+ Account services +
+ Determine storage usage + You can send a &HEAD; request to the storage service + to determine how much data you have stored in the + system and the number of containers that you are + using. + Use the -X switch to specify the HTTP + method. Use the -i switch to send the + HTTP response headers to terminal output + (stdout). + Also, you must include the authentication token in + the X-Auth-Token header. + # curl –X HEAD -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + The X-Account-Container-Count + response header shows the number of containers in this + storage account. The + X-Account-Bytes-Used response + header shows the total bytes stored for the entire + account. +
+
+ List containers + To list containers and return the output in JSON + format: + # curl -i http://23.253.72.207:8080/v1/$account?format=json \ + -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 127 +Accept-Ranges: bytes +X-Timestamp: 1389453423.35964 +X-Account-Bytes-Used: 0 +X-Account-Container-Count: 3 +Content-Type: application/json; charset=utf-8 +X-Account-Object-Count: 0 +X-Trans-Id: tx903fa2ee82ea4709bc1a1-0052d301b1 +Date: Sun, 12 Jan 2014 20:57:21 GMT + [ + { + "count":0, + "bytes":0, + "name":"diane" + }, + { + "count":0, + "bytes":0, + "name":"joe" + }, + { + "count":0, + "bytes":0, + "name":"sarah" + } +] + To list containers and return the output in XML + format: + # curl -i http://23.253.72.207:8080/v1/$account?format=xml \ + -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 324 +Accept-Ranges: bytes +X-Timestamp: 1389453423.35964 +X-Account-Bytes-Used: 0 +X-Account-Container-Count: 3 +Content-Type: application/xml; charset=utf-8 +X-Account-Object-Count: 0 +X-Trans-Id: txfa1780ad82394ae289994-0052d302ee +Date: Sun, 12 Jan 2014 21:02:38 GMT + +
+
+
+ Container services +
+ Special metadata: container ACLs + A particularly important metadata element for + containers is X-Container-Read, which establishes the + ACL permissions on who can read objects in the + container. Prior to being set, the ACL logic default + to only be accessible to someone with a valid + X-Auth-Token for the account in question. Doing a + simple listing of a container shows us the absence of + X-Container-Read in this default situation: + + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + Now set the X-Container-Read + header. For a full explanation of valid values, see + + http://swift.openstack.org/misc.html#acls. + Enable read access and listing access to + anybody: + # curl –X &PUT; -i \ +-H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ +-H "X-Container-Read: .r:*,.rlistings" \ +https://storage.swiftdrive.com/v1/CF_xer7_343/jerryHTTP/1.1 202 Accepted +Content-Length: 58 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: txf2befb56b1854a50995f710f2db48089 +Date: Tue, 15 Nov 2011 03:33:16 GMT + +202 Accepted + +The request is accepted for processing. + To see the metadata change, do a listing + again: + # curl –X GET -i \ +-H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ +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 + The side effect of giving anybody read access is + that any object in the container is now accessible + from a browser simply by entering the X-Storage-URL + used throughout the session and append the object + name. For example: + https://storage.swiftdrive.com/v1/CF_xer7_343/jerry/cereal.jpg + would be the URL of an object named "cereal.jpg" in + the container "jerry" that has been made publicly + accessible using this method. +
+
+ Create a container + So, you take the X-Auth-Token obtained from the + authentication operation, pass it as a header value, + execute the operation against the URL obtained from + the authentication operation, and force the GET verb + with the -X switch. What you get back tells you there + aren't any containers. + Next, let's create a container and then do the + listing again: + # curl –X &PUT; -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + Append the container name to the URL and force the + &PUT; verb. That creates a container, which you see + when you do a listing: + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + Accept-Ranges: bytes + Content-Length: 7 + Content-Type: text/plain; charset=utf-8 + X-Trans-Id: txaedd6b080626453399c9f5febbddb73b + Date: Mon, 07 Nov 2011 17:44:23 GMT + george + You may have noticed the account metadata that comes + back from the listing call. As you'd guess, it'll tell + you how many objects you have, how much space you are + using, and how many containers you are using. +
+
+ Page through large lists of containers + For a list of five container names, if you specify a + limit of two, two items are + returned. You can assume there are more names to list, + so make another request with a + marker of the last item + returned. + For example, assume the following list of container + names: + apples +bananas +kiwis +oranges +pears + + To page through large lists of + containers + + Use a limit of + two: + GET /<api version>/<account>?limit=2 +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + apples +bananas + Because two container names are returned, + there are more names to list. + + + Make another request with a + marker parameter + set to the name of the last item + returned: + GET /<api version>/<account>?limit=2&marker=bananas +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + kiwis +oranges + Again, two items are returned, and there + might be more. + + + Make another request with a + marker of the last + item returned: + GET /<api version>/<account>?limit=2&marker=oranges +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + + pears + You now receive a one-item response, which + is fewer than the limit + number of names. This indicates that this is + the end of the list. + + + Use the end_marker parameter to + limit the result set to object names that are + less than the end_marker + parameter value: + GET /<api version>/<account>/?end_marker=oranges +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + apples +bananas +kiwis + + +
+
+ Get, copy, and delete objects + Now, retrieve an object that you previously + uploaded. First, remove the local copy: + # 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 + # 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 + Be sure not to use -i switch here because you want + the raw data, which you pipe to a file: + # curl –X GET \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg > JingleRocky.jpg +$ 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 + Next, Object Storage provides a facility to copy + objects from one container to another entirely on the + server side. To do this, you do a &PUT; with the + destination container and new object name while + passing a special X-Copy-From header and a + Content-Length of zero: + # curl –X &PUT; -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + -H "X-Copy-From: /dogs/JingleRocky.jpg" \ + -H "Content-Length: 0" \ + 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 +X-Copied-From: dogs/JingleRocky.jpg +Last-Modified: Mon, 07 Nov 2011 23:23:53 GMT +X-Trans-Id: tx244cd14df1b94d8c91ec5dcf8c5f9da4 +Date: Mon, 07 Nov 2011 23:23:54 GMT + +<html> + <head> + <title>201 Created</title> + </head> + <body> + <h1>201 Created</h1> + <br /><br /> + + </body> +</html> + You can then confirm the new location of the object. + To do this, you do a GET with the destination + container to see the listing of the object: + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 +Content-Length: 16 +Content-Type: text/plain; charset=utf-8 +X-Trans-Id: tx46986b4a09b34790924fd43842b2b0dd +Date: Mon, 07 Nov 2011 23:24:05 GMT + +JingleRocky.jpg + To delete an object from its container, simply use + the DELETE verb: + # curl –X DELETE -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + Confirming the deletion by doing a container + listing: + + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 +
+
+ Page through large lists of objects + For a list of five object names, if you specify a + limit of two, two items are + returned. You can assume there are more names to list, + so make another request with a + marker of the last item + returned. + For example, assume the following list of + objects: + gala +grannysmith +honeycrisp +jonagold +reddelicious + + To page through large lists of objects + + Use a limit of + two: + GET /<api version>/<account>/<container>?limit=2 +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + gala +grannysmith + Because two object names are returned, there + are more names to list. + + + Make another request with a + marker parameter + set to the name of the last item + returned: + GET /<api version>/<account>/<container>?limit=2&marker=grannysmith +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + honeycrisp +jonagold + Again, two items are returned, and there + might be more. + + + Make another request with a + marker of the last + item returned: + GET /<api version>/<account>/<container>?limit=2&marker=jonagold +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + reddelicious + The list contains one name, which is fewer + than the limit number + of names. This indicates that this is the end + of the list. + + + Use the end_marker parameter to + limit the result set to object names that are + less than the end_marker + parameter value: + GET /<api version>/<account>/<container>?end_marker=jonagold +Host: storage.swiftdrive.com +X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb + gala +grannysmith +honeycrisp + + +
+
+ Get container metadata and delete + containers + You can get at container metadata directly simply by + appending the name of the container to a HEAD + request: + # curl –X HEAD -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + 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 –X DELETE -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + Then let's confirm the delete by listing the + containers again: + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 +Accept-Ranges: bytes +Content-Length: 24 +Content-Type: text/plain; charset=utf-8 +X-Trans-Id: tx2475741852b849ce9403e382fe3f8015 +Date: Mon, 07 Nov 2011 20:43:08 GMT + +cosmo +dogs +elaine +jerry +
+
+
+ Object services +
+ Create objects + Enough with containers already, let's start to + upload some objects. Suppose you had a local directory + full of dog pictures: + # 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 + To put one of them in a container called "dogs" with + cURL, you'd do this: + + # curl –X &PUT; -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + -T JingleRocky.jpg \ + 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 +Last-Modified: Mon, 07 Nov 2011 22:51:29 GMT +X-Trans-Id: txd131cc897c78403daf5fad010d4d7152 +Date: Mon, 07 Nov 2011 22:51:30 GMT + +<html> + <head> + <title>201 Created</title> + </head> + <body> + <h1>201 Created</h1> + <br /><br /> + + + + </body> +</html> + The name of the object comes from whatever you + append to the URL path beyond the container name. The + -T switch lets you name a file to push with the + operation as the request body. Confirm the upload by + checking the container again: + + # curl –X GET -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 +Accept-Ranges: bytes +Content-Length: 16 +Content-Type: text/plain; charset=utf-8 +X-Trans-Id: tx83be89d4e1a34eacbfeebcdfc7a7f2e7 +Date: Mon, 07 Nov 2011 22:56:25 GMT + +JingleRocky.jpg + Notice that the container metadata now reflects the + number of objects and the bytes match what you saw + when you did the directory listing. After uploading + the other two similarly, you get a full object + listing: + # curl –X GET -i -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" 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 +Accept-Ranges: bytes +Content-Length: 53 +Content-Type: text/plain; charset=utf-8 +X-Trans-Id: txae17dfa78da64117aaf07585a1b02115 +Date: Mon, 07 Nov 2011 23:00:56 GMT + +JingleRocky.jpg +RockyAndBuster.jpg +SittingBuster.jpg +
+
+ Create static large objects + Creation of a static large object is done in several + steps. First, divide the content into pieces and + upload each piece into a segment object. Then, create + a manifest object. In this example, you place the + segment objects into the "segments" container and the + manifest object into the "images" container. You are + not required to do this, but using a dedicated + container for segment objects is convenient. + Assuming you have already divided the image into + three files, you can upload them. You have removed + non-essential response headers so you can see the + important details. + # curl –X &PUT; -i -H "X-Auth-Token: 12345" -T ./piece1 https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-one +HTTP/1.1 201 Created +Content-Length: 4000000 +Etag: f7365c1419b4f349592c00bd0cfb9b9a + # curl –X &PUT; -i -H "X-Auth-Token: 12345" -T ./piece2 https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-two +HTTP/1.1 201 Created +Content-Length: 2000000 +Etag: ad81e97b10e870613aecb5ced52adbaa + # curl –X &PUT; -i -H "X-Auth-Token: 12345" -T ./piece3 https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-three +HTTP/1.1 201 Created +Content-Length: 1000 +Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3 + At this stage, you can create the manifest listing. + Notice that the size and ETag are copied from the + previous uploads. Create a file called + manifest.json with the following + content: + + [ + { + "path": "segments/terrier-jpg-one", + "etag": "f7365c1419b4f349592c00bd0cfb9b9a", + "size_bytes": 4000000 + }, + { + "path": "segments/terrier-jpg-two", + "etag": "ad81e97b10e870613aecb5ced52adbaa", + "size_bytes": 2000000 + }, + "path": "segments/terrier-jpg-three", + "etag": "00b046c9d74c3e8f93b320c5e5fdc2c3", + "size_bytes": 1000 + { + } + ] + The final operation is to upload this content into a + manifest object. To indicate that this is a manifest + object, you need to specify the + ?multipart-manifest=put query + string. + # curl –X &PUT; -i -H "X-Auth-Token: 12345" -T ./manifest.json https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg?multipart-manifest=put + Now, examine the static large object. Notice that + the size is the total size of all the segments. + # curl –X HEAD -i -H "X-Auth-Token: 12345" https://storage.swiftdrive.com/v1/CF_xer7_343/images/terrier-jpg +HTTP/1.1 200 OK +Content-Length: 6001000 +Etag: "0c922c37f915efb1c9b97e6328b3e660" + +
+
+ Object metadata + Objects can have whatever metadata keys/values you + choose. Simply POST an HTTP Header to the object in + the form of X-Object-Meta-<key>: <value>. Like + this: + # curl –X POST -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + -H "X-Object-Meta-Breed: Terrier pit bull mix"" \ + 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> + And then read the object metadata with a HEAD on the + object path: + # curl –X HEAD -i \ + -H "X-Auth-Token: fc81aaa6-98a1-9ab0-94ba-aba9a89aa9ae" \ + 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 + +
+
+ + +
diff --git a/openstack-object-storage-dev/ch_object-api-operations.xml b/openstack-object-storage-dev/ch_object-api-operations.xml new file mode 100644 index 0000000..4b038ee --- /dev/null +++ b/openstack-object-storage-dev/ch_object-api-operations.xml @@ -0,0 +1,93 @@ + + + Object Storage API operations + Manages the accounts, containers, and objects in the Object + Storage system. + For a complete description of HTTP 1.1 header definitions, see + Header Field Definitions. +
+ Environment variables required to run examples + To run the cURL command examples for the Object Storage API + requests, set these environment variables: + + + publicURL. The public URL that is the + HTTP endpoint from where you can access Object Storage. It + includes the Object Storage API version number and your + account name. For example, + https://23.253.72.207/v1/my_account. + + + token. The authentication token for + Object Storage. + + + To obtain these values, run the swift stat + -v command. + As shown in this example, the public URL appears in the + StorageURL field, and the token appears in + the Auth Token field: + StorageURL: https://23.253.72.207/v1/my_account +Auth Token: {token} +Account: my_account +Containers: 2 +Objects: 3 +Bytes: 47 +Meta Book: MobyDick +X-Timestamp: 1389453423.35964 +X-Trans-Id: txee55498935404a2caad89-0052dd3b77 +Content-Type: text/plain; charset=utf-8 +Accept-Ranges: bytes +
+
+ Accounts + Lists containers for a specified account. Creates, updates, + and deletes account metadata. Shows account metadata. + + + + + + + +
+
+ Containers + Lists objects in a specified container. Creates, shows + details for, and deletes containers. Creates, updates, shows, + and deletes container metadata. + + + + + + + + + +
+
+ Objects + Creates, replaces, shows details for, and deletes objects. + Copies objects with another object with a new or different name. + Updates object metadata. + + + + + + + + + + +
+
diff --git a/openstack-object-storage-dev/ch_object-api-storage-services.xml b/openstack-object-storage-dev/ch_object-api-storage-services.xml deleted file mode 100644 index 07e83a8..0000000 --- a/openstack-object-storage-dev/ch_object-api-storage-services.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - -COPY'> -GET'> -HEAD'> -PUT'> -POST'> -DELETE'> - - - - - -'> - - - - - -'> -]> - - API Operations for Storage Services - Use the ReST API to interact with the storage component of - OpenStack Object Storage. All requests are directed to the host - and URL described in the X-Storage-Url HTTP header - obtained during successful authentication. - Review the following requirements for using storage - services: - - - Container names cannot exceed 256 bytes and cannot contain - the / character. - - - Object names cannot exceed 1024 bytes, and have no - character restrictions. - - - Object and container names must be UTF-8 encoded and then - URL-encoded to interact with the ReST API. - - - The - following sections describe the actions that you can perform in - the storage system. - - - . Actions that - you can perform at the account level of the storage system. - - - - . Actions that - you can perform on containers. - - - . How to - use your swift account to create a static website. - - - . Actions that - you can perform on objects. - - - - - - - diff --git a/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml b/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml deleted file mode 100644 index d33f112..0000000 --- a/openstack-object-storage-dev/ch_object-api-troubleshooting-examples.xml +++ /dev/null @@ -1,993 +0,0 @@ - - - - - - - - -GET'> -HEAD'> -PUT'> -POST'> -DELETE'> - - - - - -'> - - - - - -'> -]> - - Troubleshooting and Examples - This section introduces a command-line utility, cURL, and - demonstrates interacting with the ReST interfaces through that - utility. -
- Using cURL - cURL is a command-line tool which is available on most - UNIX®-like environments and Mac OS X® and can be - downloaded for Windows®. For more information on cURL, - visit http://curl.haxx.se/. - cURL allows you to transmit and receive HTTP requests - and responses from the command-line or from within a shell - script. This makes it possible to work with the ReST API - directly without using one of the client APIs. - The following cURL command-line options will be - used - - cURL Command-Line Options - - - - Specify the HTTP method to request (&HEAD;, - &GET;, etc.) - - - - - - Dump HTTP response headers to stdout. - - - - - - Specify an HTTP header in the - request. - - - -
-
- Authentication - To use the ReST API, you must obtain a authorization - token, which you pass to each request in the - X-Auth-Token header. The following - example demonstrates how to use cURL to obtain the - authorization token and the URL of the storage - system. - - cURL Authenticate - $ curl \ - \ - \ - 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 - - The storage URL and authentication token are returned in - the headers of the response. After authentication, you can - use cURL to perform &HEAD;, &GET;, &DELETE;, &POST; and - &PUT; requests on the storage service. -
-
- Determining Storage Usage - A &HEAD; request can be sent to the storage service to - determine how much data you have stored in the system and - the number of containers you are using. Use the - -X switch to specify the correct HTTP - method and the -i to dump the HTTP response - headers to terminal output (stdout). - - cURL Get Storage Space - $ curl \ - \ - 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 - - The HTTP request must include a header to specify the - authentication token. The HTTP headers in the response - indicate the number of containers in this storage account - and the total bytes stored for the entire account. -
-
- Listing and Creating Containers - The simplest operation for Object Storage is to simply - list the containers you have, which when you don't have - any containers yet isn't terribly exciting: - - cURL List Storage Container - $ curl \ - \ - 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 - - So, you take the X-Auth-Token obtained from the - authentication operation, pass it as a header value, - execute the operation against the URL obtained from the - authentication operation, and force the GET verb with the - -X switch. What you get back tells you there aren't any - containers. - Next, let's create a container and then do the listing - again: - - cURL Create Storage Container - $ curl \ - \ - 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 - - Append the container name to the URL and force the PUT - verb. That creates a container, which we can now see when - we do a listing: - - cURL List Storage Container After a - Creation - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 7 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: txaedd6b080626453399c9f5febbddb73b -Date: Mon, 07 Nov 2011 17:44:23 GMT - -george - - You may have noticed the account metadata that comes - back from the listing call. As you'd guess, it'll tell you - how many objects you have, how much space you are using, - and how many containers you are using. -
-
- Paging Lists of Containers - If you have a large number of containers, it is - sometimes more convenient to page through them than - getting some big long list of them. If I create more - containers and then do a regular listing, here's what it - looks like with five containers: - - cURL List Storage Container (long list) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 31 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: txb28795cc25b04f0dbce408dfa5a3cfc9 -Date: Mon, 07 Nov 2011 19:03:06 GMT - -cosmo -dogs -elaine -george -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 \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 11 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx940ee02c1a65451e96a2a2532e3a7ce7 -Date: Mon, 07 Nov 2011 19:05:30 GMT - -cosmo -dogs - - Not surprisingly, I only get two containers. To get the - next page, you tell the system which item you last saw - with the "marker=" specifier: - - cURL List Storage Container with Paging (later - pages) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 14 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx2a69f7ec38c34078a185c5875a4c0e34 -Date: Mon, 07 Nov 2011 19:15:00 GMT - -elaine -george - - Notice that I had to use \& so that my bash shell - didn't try to interpret the & as wanting to run - something in its own thread. With that in place, you get - the next page of items that appear after the - marker. -
-
- Serialized Output - In other situations, like if you are working on a - language binding on top of the REST API, you might want - more structured data back from the method calls. By - appending a "format=" and then choosing either json or - xml, you can get that structured data back you've been - dreaming about. - - cURL List Storage Container (JSON output) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 187 -Content-Type: application/json; charset=utf-8 -X-Trans-Id: txd408573a51d2423c848cba191fbede9b -Date: Mon, 07 Nov 2011 19:17:33 GMT - -[{"name":"cosmo", "count":0,"bytes":0}, -{"name":"dogs","count":0,"bytes":0}, -{"name":"elaine","count":0,"bytes":0}, -{"name":"george","count":0,"bytes":0}, -{"name":"jerry","count":0,"bytes":0}] - - - cURL List Storage Container (XML output) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 479 -Content-Type: application/xml; charset=utf-8 -X-Trans-Id: tx5e5685a15d0b406799b6a425b1150e4c -Date: Mon, 07 Nov 2011 19:17:38 GMT - -<?xml version="1.0" encoding="UTF-8"?> -<account name="AUTH_a23f73d2-abfb-4656-af94-32ddec35dab8"> -<container><name>cosmo</name><count>0</count><bytes>0</bytes></container> -<container><name>dogs</name><count>0</count><bytes>0</bytes></container> -<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> - - The remainder of the examples in this document will use - the standard, non-serialized output but all operations - accept the format argument. You might notice that when you - use one of the formats, you get more information about the - containers. That's the per-container metadata, which is - covered in the next section. -
- -
- Container Metadata and Deleting Containers - You can get at container metadata directly simply by - appending the name of the container to a HEAD - request: - - cURL List Container Metadata - $ curl \ - \ - 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 - - 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 \ - \ - 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 - - Then let's confirm the delete by listing the containers - again: - - cURL List Containers After a Delete - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 24 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx2475741852b849ce9403e382fe3f8015 -Date: Mon, 07 Nov 2011 20:43:08 GMT - -cosmo -dogs -elaine -jerry - -
-
- Special Metadata: Container ACLs - A particularly important metadata element for containers - is X-Container-Read, which establishes the ACL permissions - on who can read objects in the container. Prior to being - set, the ACL logic default to only be accessible to - someone with a valid X-Auth-Token for the account in - question. Doing a simple listing of a container shows us - the absence of X-Container-Read in this default - situation: - - cURL List Container Showing Lack of ACL - $ curl \ - \ - 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 - - Now we'll set the X-Container-Read. For a full - explanation of valid values, see: - http://swift.openstack.org/misc.html#acls but for our - simple needs, we'll enable read access and listing access - to anybody: - - cURL Setting an ACL on a Container - $ curl \ - \ - \ - 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 -Date: Tue, 15 Nov 2011 03:33:16 GMT - -202 Accepted - -The request is accepted for processing. - - To see the metadata change, do a listing again: - - cURL List Container Showing with an ACL - $ curl \ - \ - 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 - - The side effect of giving anybody read access is that - any object in the container is now accessible from a - browser simply by entering the X-Storage-URL used - throughout the session and append the object name. For - example: - https://storage.swiftdrive.com/v1/CF_xer7_343/jerry/cereal.jpg - would be the URL of an object named "cereal.jpg" in the - container "jerry" that has been made publicly accessible - using this method. -
-
- Creating Objects - Enough with containers already, let's start to upload - some objects. Suppose you had a local directory full of - dog pictures: - - Sample File Listing - $ 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 - - 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 \ - \ - \ - 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 -Last-Modified: Mon, 07 Nov 2011 22:51:29 GMT -X-Trans-Id: txd131cc897c78403daf5fad010d4d7152 -Date: Mon, 07 Nov 2011 22:51:30 GMT - -<html> - <head> - <title>201 Created</title> - </head> - <body> - <h1>201 Created</h1> - <br /><br /> - - - - </body> -</html> - - The object gets named from whatever we append to the URL - path beyond the container name and the -T switch lets us - name a file to push with the operation as the request - body. We can confirm the upload by checking the container - again: - - cURL List Container Showing Newly Uploaded - Object - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 16 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx83be89d4e1a34eacbfeebcdfc7a7f2e7 -Date: Mon, 07 Nov 2011 22:56:25 GMT - -JingleRocky.jpg - - Notice that the container metadata now reflects the - number of objects and the bytes match what we saw when we - did the directory listing. After uploading the other two - similarly, we get a full object listing: - - cURL List Container Showing Multiple Newly Uploaded - Objects - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 53 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: txae17dfa78da64117aaf07585a1b02115 -Date: Mon, 07 Nov 2011 23:00:56 GMT - -JingleRocky.jpg -RockyAndBuster.jpg -SittingBuster.jpg - -
-
- Creating Static Large Objects - Creation of a static large object is done in several - steps. First we divide the content into pieces and upload - each piece into a segment object. Then we create a - manifest object. In this example, we will place the - segment objects into the "segments" container and the - manifest object into the "images" container. We are not - required to do this, but using a dedicated container for - segment objects is convenient. - Assuming we've already divided our image into three - files, let's upload them. We have removed non-essential - response headers so you can see the important - details. - - Uploading first segment - $ curl - https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-one - HTTP/1.1 201 Created -Content-Length: 4000000 -Etag: f7365c1419b4f349592c00bd0cfb9b9a - - - Uploading second segment - $ curl - https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-two - HTTP/1.1 201 Created -Content-Length: 2000000 -Etag: ad81e97b10e870613aecb5ced52adbaa - - - Uploading final segment - $ curl - https://storage.swiftdrive.com/v1/CF_xer7_343/segments/terrier-jpg-three - HTTP/1.1 201 Created -Content-Length: 1000 -Etag: 00b046c9d74c3e8f93b320c5e5fdc2c3 - - At this stage we are ready to create the manifest - listing. Notice that the size and ETag are copied from - uploads above. Lets use an editor to create a file called - manifest.json with the following - content: - - Manifest List Example - [ - { - "path": "segments/terrier-jpg-one", - "etag": "f7365c1419b4f349592c00bd0cfb9b9a", - "size_bytes": 4000000 - }, - { - "path": "segments/terrier-jpg-two", - "etag": "ad81e97b10e870613aecb5ced52adbaa", - "size_bytes": 2000000 - }, - "path": "segments/terrier-jpg-three", - "etag": "00b046c9d74c3e8f93b320c5e5fdc2c3", - "size_bytes": 1000 - { - } - ] - - The final operation is to upload this content into a - manifest object. To indicate that this is a manifest - object, you need to specify the - ?multipart-manifest=put query - string. - - Uploading manifest object - $ 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 -Content-Length: 6001000 -Etag: "0c922c37f915efb1c9b97e6328b3e660" - -
-
- Paging Lists of Objects - Exactly like listing containers, objects can be listed - in pages at a time using markers to denote pages. From the - previous example with 3 objects in the container "dogs", - the list can be paged with the "limit" query string - variable: - - cURL List Objects (first page) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 35 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx5e00fa9fa895423198bc814cb0c6162d -Date: Tue, 15 Nov 2011 03:53:51 GMT - -JingleRocky.jpg -RockyAndBuster.jpg - - And the second page fetched with: - - cURL List Objects with Paging (later pages) - $ curl \ - \ - 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 -Accept-Ranges: bytes -Content-Length: 18 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: txe1287a7179dc4dfd98610850a0fff157 -Date: Tue, 15 Nov 2011 03:54:21 GMT - -SittingBuster.jpg - -
-
- Retrieve, Copy, and Delete Objects - Now we'll retrieve an object previously uploaded. First, - we'll remove the local copy: - - Removing Local Copies - $ 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 -$ 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 - - 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 \ - \ - https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg > JingleRocky.jpg - $ 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 - - Next, Object Storage provides a facility to copy objects - from one container to another entirely on the server side. - To do this, you do a PUT with the destination container - and new object name while passing a special X-Copy-From - header and a Content-Length of zero: - - cURL Server-side Copy an Object - $ curl \ - \ - \ - \ - 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 -X-Copied-From: dogs/JingleRocky.jpg -Last-Modified: Mon, 07 Nov 2011 23:23:53 GMT -X-Trans-Id: tx244cd14df1b94d8c91ec5dcf8c5f9da4 -Date: Mon, 07 Nov 2011 23:23:54 GMT - -<html> - <head> - <title>201 Created</title> - </head> - <body> - <h1>201 Created</h1> - <br /><br /> - - - - </body> -</html> - - You can then confirm the new location of the object. To - do this, you do a GET with the destination container to - see the listing of the object: - - cURL Confirming the Server-side Copy an - Object - $ curl \ - \ - 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 -Content-Length: 16 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx46986b4a09b34790924fd43842b2b0dd -Date: Mon, 07 Nov 2011 23:24:05 GMT - -JingleRocky.jpg - - To delete an object from its container, simply use the - DELETE verb: - - cURL Delete an Object - $ curl \ - \ - 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 - - Confirming the deletion by doing a container - listing: - - cURL Confirming the Delete an Object - $ curl \ - \ - 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 - -
-
- Object Metadata - Objects can have whatever metadata keys/values you - choose. Simply POST an HTTP Header to the object in the - form of X-Object-Meta-<key>: <value>. Like - this: - - cURL Set Object Metadata - $ 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 /> - - - - </body> - </html> - - And then read the object metadata with a HEAD on the - object path: - - cURL Reading Object Metadata - $ 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 - -
-
- Pseudo-Hierarchical Folders/Directories - For the last section, we come to the most confusing - concept in Object Storage. In most storage systems, you - have the ability to create custom hierarchies of files so - that you can better organize them. On its surface, Object - Storage only gives you one level of hierarchy in the form - of containers. However, it turns out that you can get - creative with naming your objects to give yourself the - same effect as having hierarchical containers. - Let's start with a fresh container without any objects - in it: - - cURL Create New Container for Folders - $ curl \ - \ - 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 - - Now list the new container: - - cURL Listing the New Container - $ curl \ - \ - 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 - - Next, add an object but prefix the name with the - hierarchy desired: - - cURL Upload an Object with a Prefix - $ curl \ - \ - \ - 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 -Last-Modified: Wed, 16 Nov 2011 00:09:18 GMT -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 /> - - - - </body> -</html> - - Do it again with a different object and prefix: - - cURL Upload a Different Object with a Different - Prefix - $ curl \ - \ - \ - 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 -Last-Modified: Wed, 16 Nov 2011 00:52:25 GMT -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 /> - - - - </body> -</html> - - Now list the container, revealing the prefixes: - - cURL Listing a Container with Object Prefix - $ curl \ - \ - 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 -Content-Length: 54 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx8544a17e8b1e4da693145fb5f2e6db43 -Date: Wed, 16 Nov 2011 00:53:43 GMT - -chihuahuas/SittingBuster.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 \ - \ - 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 -Content-Length: 25 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx3f1b9575d4de4a7d97ba3f9ad81923cc -Date: Wed, 16 Nov 2011 00:55:12 GMT - -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 \ - \ - 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 -Content-Length: 22 -Content-Type: text/plain; charset=utf-8 -X-Trans-Id: tx7222a3dd73fe44b888db4e58cc647d1e -Date: Wed, 16 Nov 2011 00:57:40 GMT - -chihuahuas/ -terriers/ - - Using these in combination allows you to discover - directories within a particular path and then further - drill down based on the results. -
- -
diff --git a/openstack-object-storage-dev/src/docbkx/object-api-language-bindings.xml b/openstack-object-storage-dev/object-api-language-bindings.xml similarity index 100% rename from openstack-object-storage-dev/src/docbkx/object-api-language-bindings.xml rename to openstack-object-storage-dev/object-api-language-bindings.xml diff --git a/openstack-object-storage-dev/samples/bulk-delete-request.xml b/openstack-object-storage-dev/samples/bulk-delete-request.xml new file mode 100644 index 0000000..2c4362f --- /dev/null +++ b/openstack-object-storage-dev/samples/bulk-delete-request.xml @@ -0,0 +1,11 @@ + + + 2 + 4 + + + /v1/12345678912345/mycontainer + 409 Conflict + + + diff --git a/openstack-object-storage-dev/samples/bulk-delete-response.xml b/openstack-object-storage-dev/samples/bulk-delete-response.xml new file mode 100644 index 0000000..2c4362f --- /dev/null +++ b/openstack-object-storage-dev/samples/bulk-delete-response.xml @@ -0,0 +1,11 @@ + + + 2 + 4 + + + /v1/12345678912345/mycontainer + 409 Conflict + + + diff --git a/openstack-object-storage-dev/samples/container-get-details-resp.xml b/openstack-object-storage-dev/samples/container-get-details-resp.xml index 86464d6..0f39d54 100644 --- a/openstack-object-storage-dev/samples/container-get-details-resp.xml +++ b/openstack-object-storage-dev/samples/container-get-details-resp.xml @@ -1,13 +1,19 @@ - + + - test_container_1 - 2 - 78 + diane + 0 + 0 - test_container_2 - 1 - 17 + joe + 0 + 0 + + + sarah + 0 + 0 \ No newline at end of file diff --git a/openstack-object-storage-dev/samples/get_containers_details_resp.xml b/openstack-object-storage-dev/samples/get_containers_details_resp.xml new file mode 100644 index 0000000..6ab06cb --- /dev/null +++ b/openstack-object-storage-dev/samples/get_containers_details_resp.xml @@ -0,0 +1,13 @@ + + + + test_container_1 + 2 + 78 + + + test_container_2 + 1 + 17 + + diff --git a/openstack-object-storage-dev/samples/object-delete-at-req.txt b/openstack-object-storage-dev/samples/object-delete-at-req.txt index 5237d1a..d1ef754 100644 --- a/openstack-object-storage-dev/samples/object-delete-at-req.txt +++ b/openstack-object-storage-dev/samples/object-delete-at-req.txt @@ -1,5 +1 @@ -PUT //// HTTP/1.1 -Host: storage.clouddrive.com -X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb -Content-Type: image/jpeg -X-Delete-At: 1339429105 \ No newline at end of file +curl -i $publicURL/marktwain/goodbye -X PUT -H "X-Auth-Token: $token" -H "X-Delete-At: 1390581073" -H "Content-Length: 14" -H "Content-Type: application/octet-stream" \ No newline at end of file diff --git a/openstack-object-storage-dev/samples/server-post-req.xml b/openstack-object-storage-dev/samples/server-post-req.xml new file mode 100644 index 0000000..5482815 --- /dev/null +++ b/openstack-object-storage-dev/samples/server-post-req.xml @@ -0,0 +1,25 @@ + + + + API Test Server XML + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + 0ef47ac7-6797-4e01-8a47-ed26ec3aaa56 + 00000000-0000-0000-0000-000000000000 + 11111111-1111-1111-1111-111111111111 + + diff --git a/openstack-object-storage-dev/samples/server-post-resp.xml b/openstack-object-storage-dev/samples/server-post-resp.xml new file mode 100644 index 0000000..57c3f8e --- /dev/null +++ b/openstack-object-storage-dev/samples/server-post-resp.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/openstack-object-storage-dev/section_browser_bypass.xml b/openstack-object-storage-dev/section_browser_bypass.xml new file mode 100644 index 0000000..3bff56d --- /dev/null +++ b/openstack-object-storage-dev/section_browser_bypass.xml @@ -0,0 +1,28 @@ + +
+ Override browser default behavior + To override the default behavior for a browser, use the + Content-Disposition header to specify + the override behavior and assign this header to an object. For + example, this header might specify that the browser use a + download program to save this file rather than show the file, + which is the default. + + Override browser default behavior request: HTTP + This example assigns an attachment type to the + Content-Disposition header. This + attachment type indicates that the file is to be + downloaded as goodbye.txt: + # curl -i $publicURL/marktwain/goodbye -X POST -H "X-Auth-Token: $token" -H "Content-Length: 14" -H "Content-Type: application/octet-stream" -H "Content-Disposition: attachment; filename=goodbye.txt" + HTTP/1.1 202 Accepted +Content-Length: 76 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: txa9b5e57d7f354d7ea9f57-0052e17e13 +Date: Thu, 23 Jan 2014 20:39:47 GMT + +<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html> + +
diff --git a/openstack-object-storage-dev/section_cors_headers.xml b/openstack-object-storage-dev/section_cors_headers.xml new file mode 100644 index 0000000..9fa96c0 --- /dev/null +++ b/openstack-object-storage-dev/section_cors_headers.xml @@ -0,0 +1,47 @@ + +
+ Assign CORS headers to requests + Cross-Origin Resource Sharing (CORS) is a specification that + defines how browsers and servers communicate across origins by + using HTTP headers, such as those assigned by Object Storage + API requests. The Object + Storage API supports these headers. For more information, see www.w3.org/TR/access-control/. + + + Access-Control-Allow-Credentials + + + Access-Control-Allow-Methods + + + Access-Control-Allow-Origin + + + Access-Control-Expose-Headers + + + Access-Control-Max-Age + + + Access-Control-Request-Headers + + + Access-Control-Request-Method + + + Origin + + + You can assign these headers to only objects. + + Assign CORS header request: HTTP + This example assigns the file origin to the Origin header, which + ensures that the file originated from a reputable source: + + +
diff --git a/openstack-object-storage-dev/section_curl_how_curl_works.xml b/openstack-object-storage-dev/section_curl_how_curl_works.xml new file mode 100644 index 0000000..b3989fb --- /dev/null +++ b/openstack-object-storage-dev/section_curl_how_curl_works.xml @@ -0,0 +1,210 @@ + + + + + + + + +GET'> +PUT'> +POST'> +DELETE'> + + + + + +'> + + + + + +'> +]> +
+ How cURL commands work + cURL is a command-line tool that you can use to interact + with REST interfaces. cURL lets you to + transmit and receive HTTP requests and + responses from the command line or a shell script, which + enables you to work with the API directly. It is available for + Linux distributions, Mac OS X, and Windows. For information + about cURL, see http://curl.haxx.se/. + To use XML requests and responses, see . + To run the cURL request examples shown in this guide, copy + each example from the HTML version of this guide directly to + the command line or a script. + This example cURL command shows account details and lists + containers in the account. + # curl -i $publicURL?format=json \ + -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 96 +X-Account-Object-Count: 1 +X-Timestamp: 1389453423.35964 +X-Account-Meta-Subject: Literature +X-Account-Bytes-Used: 14 +X-Account-Container-Count: 2 +Content-Type: application/json; charset=utf-8 +Accept-Ranges: bytes +X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365 +Date: Fri, 17 Jan 2014 15:59:33 GMT + + The response, in JSON + format, is: + [ + { + "count":0, + "bytes":0, + "name":"janeausten" + }, + { + "count":1, + "bytes":14, + "name":"marktwain" + } +] + + The carriage returns in the cURL request examples are + escaped with a backslash (\) character. + The escape character allows continuation of the command + across multiple lines. However, do not include the escape + character in the JSON or XML request body within the cURL + command. + + The cURL examples in this guide use the following + command-line options: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
cURL command-line options
OptionDescription
+ + + Sends the specified data in a &POST; request + to the HTTP server. Use this option to send a + JSON or XML request body to the server. +
+ + + Specifies an extra HTTP header in the + request. You can specify any number of extra + headers. Precede each header with the + option. +
+ + + Includes the HTTP header in the + output. +
+ + + Silent or quiet mode. Does not show progress + or error messages. Makes cURL mute. +
+ + + Transfers the specified local file to the + remote URL. +
+ + + Specifies the request method to use when + communicating with the HTTP server. The + specified request is used instead of the + default method, which is &GET;. +
+ + json.tool + For commands that return a response, you can append the + following code to the command to call the json.tool to + pretty-print output: + | python -m json.tool + To use the json.tool, import the json module. For + information about the json.tool, see json — JSON encoder and decoder. + If you run a Python version older than 2.6, import the + simplejson module and use the simplejson.tool. For + information about the simple.json tool, see simplejson — JSON encoder and decoder. + If you do not want to pretty-print JSON output, omit + this code. + +
+ XML requests and responses + To request an XML response, append the format=xml + query parameter to the request. + If the request requires a request body, specify it in + XML format. + This example cURL command shows account information and + list containers in the account, and asks for the response in XML: + # curl -i $publicURL?format=xml \ + -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 262 +X-Account-Object-Count: 1 +X-Timestamp: 1389453423.35964 +X-Account-Meta-Subject: Literature +X-Account-Bytes-Used: 14 +X-Account-Container-Count: 2 +Content-Type: application/xml; charset=utf-8 +Accept-Ranges: bytes +X-Trans-Id: tx69f60bc9f7634a01988e6-0052d9544b +Date: Fri, 17 Jan 2014 16:03:23 GMT +<?xml version="1.0" encoding="UTF-8"?> +<account name="my_account"> + <container> + <name>janeausten</name> + <count>0</count> + <bytes>0</bytes> + </container> + <container> + <name>marktwain</name> + <count>1</count> + <bytes>14</bytes> + </container> +</account +
+
diff --git a/openstack-object-storage-dev/section_expire_objects.xml b/openstack-object-storage-dev/section_expire_objects.xml new file mode 100644 index 0000000..2c8ae12 --- /dev/null +++ b/openstack-object-storage-dev/section_expire_objects.xml @@ -0,0 +1,59 @@ + + +PUT'> +POST'> +]> +
+ Schedule objects for deletion + Scheduling an object for deletion is helpful for objects + that you do not want to permanently store, such as log files, + recurring full backups of a dataset, or documents or images + that become outdated at a specified future time. + To schedule an object for deletion, include one of these + headers with the &PUT; or &POST; request on the object: + + + X-Delete-After + Takes an integer number of seconds and calculates + the amount of time from now that you want the object + to be deleted. The proxy server that receives the + request converts this header into an + X-Delete-At header and + calculates the deletion time by using its current time + plus the value given in seconds. + + + X-Delete-At + Requires a UNIX Epoch timestamp, in integer form. + For example, 1348691905 represents + Wed, 26 Sep 2012 20:38:25 GMT. + By setting the header to a specific Epoch time, you + indicate when you want the object to expire, not be + served, and be deleted completely from the object + store. + + + Use the &POST; method to assign expiration + headers to existing objects that you want expire. + + Delete object at request: HTTP + In the example, the X-Delete-At header is + assigned a UNIX Epoch timestamp in integer form for + Mon, 11 Jun 2012 15:38:25 GMT. Use http://www.epochconverter.com/ for example + timestamps and a batch converter. + # curl -i $publicURL/marktwain/goodbye -X PUT -H "X-Auth-Token: $token" -H "X-Delete-At: 1390581073" -H "Content-Length: 14" -H "Content-Type: application/octet-stream" + + + Delete object after request: HTTP + In this example, the X-Delete-After header + is assigned a value in seconds, equivalent to 10 days. + After this time, the object expires. + + +
diff --git a/openstack-object-storage-dev/section_file_compression.xml b/openstack-object-storage-dev/section_file_compression.xml new file mode 100644 index 0000000..5fa384c --- /dev/null +++ b/openstack-object-storage-dev/section_file_compression.xml @@ -0,0 +1,17 @@ + +
+ Compress files + Use the Content-Encoding header to + compress a file without losing the identity of the underlying + media type of the file, such as a video. + + Content-Encoding header request: HTTP + This example assigns an attachment type to the + Content-Encoding header that + indicates how the file is downloaded: + + +
diff --git a/openstack-object-storage-dev/section_large_object_creation.xml b/openstack-object-storage-dev/section_large_object_creation.xml new file mode 100644 index 0000000..4b66443 --- /dev/null +++ b/openstack-object-storage-dev/section_large_object_creation.xml @@ -0,0 +1,372 @@ + + + + + + +COPY'> +GET'> +HEAD'> +PUT'> +POST'> +DELETE'> +]> +
+ Large objects + By default, the content of an object cannot be greater than + 5 GB. However, you can use segment objects and manifest + objects to store more content. +
+ Segment objects + You can divide your content into segments, and upload + each segment into its own segment object. Segment objects + do not have any special features. You create, update, + download, and delete segment objects just as you would + normal objects. +
+
+ Manifest objects + A manifest object points to segment objects. When you + download a manifest object, Object Storage concatenates + the contents of the segment objects and returns this in + the response body of the request. + This behavior extends to the response headers returned + by &GET; and &HEAD; requests. The + Content-Length response header + value is the total size of all segment objects. Object + Storage calculates the ETag response + header value by taking the ETag value + of each segment, concatenating them together, and + returning the MD5 checksum of the result. + + If you make a © request by using a manifest + object as the source, the new object is a normal, and + not a segment, object. If the total size of the source + segment objects exceeds 5 GB, the © request + fails. However, you can make a duplicate of the + manifest object and this new object can be larger than + 5 GB. + + The manifest object types are: + + + Static large + objects. The manifest object + content is an ordered list of the names of the + segment objects in JSON format. + + + Dynamic large + objects. The manifest object has no + content. + However, it has + X-Object-Manifest metadata + header. The value of this header is + <container>/<prefix>, + where <container> is the + name of the container where the segment objects + are stored, and <prefix> is + a string that all segment objects have in + common. + + + While both types of manifest objects have similar + behavior, the following table describes their + differences: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Static and dynamic large objects
Object typeEnd-to-end integrityUpload orderRemoval or addition of segment objectsSegment object size and numberSegment object container nameManifest Object MetadataMaking a copy of the manifest object
Static large objectAssured. The list of segments includes the MD5 + checksum (ETag) of each segment. You cannot + upload the manifest object if the ETag in the + list differs from the segment object already + uploaded. If a segment is somehow lost, an + attempt to download the manifest object will + result in an error.The segment objects must be uploaded before + the manifest object.You cannot add or remove segment objects from + the manifest. However, you can create a + completely new manifest object of the same + name with a different manifest list.Segment objects must be at least 1MB in size + (by default). The final segment object can be + any size. At most 1000 segments are supported + (by default).The manifest list includes the container name + of each object, i.e., segment objects may be + in different containers.The object has + X-Static-Large-Object set to + true. You do not set this + metadata directly. Instead the system sets it + when you &PUT; a static manifest object.
Dynamic large objectNot guaranteed. The eventual consistency model + means that although you may have uploaded a + segment object, it may not appear in the + container listing until later. If you download + the manifest before it appears in the + container, it will not form part of the + content returned in response to a &GET; + request.You can upload manifest and segment objects in + any order. You are recommended to upload the + manifest object after the segments in case a + premature download of the manifest occurs. + However, this is not enforced.You can upload new segment objects or remove + existing segments. The names must simply match + the <prefix> supplied in + X-Object-Manifest.Segment objects can be of any size.All segment objects must be in the same + containerThe X-Object-Manifest value is + the <container>/<prefix> + indicating where the segment objects are + located. You supply this request header in the + &PUT; operationThe © operation does not create a + manifest object. To duplicate a manifest + object, use the &GET; operation to read the + value of X-Object-Manifest and + use this value in the + X-Object-Manifest request + header in a &PUT; operation. This creates a + new manifest object that shares the same set + of segment objects as the original manifest + object.
+
+ Dynamic large objects + You must segment objects that are larger than 5 GB + before you can upload them. You then upload the + segment objects like you would any other object and + create a dynamic large manifest object. The manifest + object tells Object Storage how to find the segment + objects that comprise the large object. The segments + remain individually addressable, but retrieving the + manifest object streams all the segments concatenated. + There is no limit to the number of segments that can + be a part of a single large object. + To ensure the download works correctly, you must + upload all the object segments to the same container + and ensure that each object name is prefixed in such a + way that it sorts in the order in which it should be + concatenated. You also create and upload a manifest + file. The manifest file is a zero-byte file with the + extra X-Object-Manifest: + <container>/<prefix> header, where + <container> is the container the object segments + are in and <prefix> is the common prefix for all + the segments. The container and common prefix must be + UTF-8 encoded and URL-encoded in the X-Object-Manifest + header. + It is best to upload all the segments first and then + create or update the manifest. With this method, the + full object will not be available for downloading + until the upload is complete. Also, you can upload a + new set of segments to a second location and then + update the manifest to point to this new location. + During the upload of the new segments, the original + manifest will still be available to download the first + set of segments. + + Upload segment of large object request: + HTTP + + + + Upload segment of large object response: + HTTP + s + + No response body is returned. A status code of 2xx + (between 200 and 299, inclusive) indicates a + successful write; status 411 (Length Required) denotes + a missing Content-Length or + Content-Type header in the request. + If the MD5 checksum of the data written to the storage + system does NOT match the (optionally) supplied ETag + value, a 422 (Unprocessable Entity) response is + returned. + You can continue uploading segments like this + example shows, prior to uploading the manifest. + + Upload next segment of large object request: + HTTP + + + + Upload next segment of large object response: + HTTP + w + + Next, upload the manifest you created that indicates + the container the object segments reside within. Note + that uploading additional segments after the manifest + is created will cause the concatenated object to be + that much larger but you do not need to recreate the + manifest file for subsequent additional + segments. + + Upload manifest request: HTTP + + + + Upload manifest response: HTTP + + + The response's Content-Type for a &GET; or &HEAD; on + the manifest will be the same as the Content-Type set + during the PUT request that created the manifest. You + can easily change the Content-Type by reissuing the + &PUT; request. +
+
+ Static large objects + + To create a static large object + + Divide your content into pieces and create + (upload) a segment object to contain each + piece. You must record the ETag + response header returned by the&PUT; + operation. Alternatively, you can calculate + the MD5 checksum of the segment prior to + uploading and include this in the + ETag request header. This + ensures that the upload cannot corrupt your + data. + + + List the name of each segment object along + with its size and MD5 checksum in order. + Create a manifest object. You indicate that + this is a manifest object by including the + ?multipart-manifest=put query + string at the end of the manifest object + name. + + + The body of the &PUT; request on the manifest object + comprises a json list, where each element contains the + following: + + + path - this is the container + and object name in the following format: + <container-name>/<object-name> + + + etag - this is the MD5 checksum + of the content of the segment object. This + must match the ETag of that + object. + + + size_bytes - this is the size + of the segment object. This must match the + Content-Length of that + object + + + + Static large object manifest list + This is an example containing three segment + objects. In this example, you can use several + containers and the object names do not have to + conform to a specific pattern, in contrast to + dynamic large objects. + + + The Content-Length request header must + contain the length of the json content. Not the length + of the segment objects. However, after the &PUT; + operation completes, the Content-Length + metadata is set to the total length of all the object + segments. A similar situation applies to the + ETag. If used in the &PUT; operation, + it must contain the MD5 checksum of the json content. + The ETag metadata value is then set to be + the MD5 checksum of the concatenated ETag + values of the object segments. You may also set the + Content-Type request header and + custom object metadata. + When the &PUT; operation sees the + ?multipart-manifest=put query string, + it reads the request body and verifies that each + segment object exists and that the sizes and ETags + match. If there is a mismatch, the &PUT;operation will + fail. + If everything matches, the manifest object is + created. The X-Static-Large-Object + metadata is set to true indicating that + this is a static object manifest. + Normally when you perform a &GET; operation on the + manifest object, the response body contains the + concatenated content of the segment objects. To + download the manifest list, use the query string + ?multipart-manifest=get. The + resulting list will not be identically formatted as + the manifest you originally used in the &PUT; + operation. + If you use the &DELETE; operation on a manifest + object, the manifest object is deleted. The segment + objects are not affected. However, if you add the + query parameter + ?multipart-manifest=delete, the + segment objects are deleted and if all are + successfully deleted, the manifest object is also + deleted. + To change the manifest, use a &PUT; operation with + the ?multipart-manifest=put query string. + This will create a new manifest + object. You may also update the object metadata in the + usual way. +
+
+
diff --git a/openstack-object-storage-dev/section_object-api-create-website.xml b/openstack-object-storage-dev/section_object-api-create-website.xml index c992927..3e9d264 100644 --- a/openstack-object-storage-dev/section_object-api-create-website.xml +++ b/openstack-object-storage-dev/section_object-api-create-website.xml @@ -31,7 +31,7 @@ format="SVG" scale="60"/> xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="Create_Static_Website-dle4000"> - Create Static Website + Create static website You can use your swift account to create a static website. This mode is normally only active for anonymous requests. To use it with authenticated requests, set the header @@ -100,9 +100,10 @@ format="SVG" scale="60"/> You can create and set custom error pages for visitors to your website; currently, only 401 (Unauthorized) and 404 (Not Found) errors are supported. To do this, set the - metadata header, X-Container-Meta-Web-Error. + metadata header, + X-Container-Meta-Web-Error. Error pages are served with the <status> code - prepended to the name of the error page you set. For + pre-pended to the name of the error page you set. For instance, if you set X-Container-Meta-Web-Error to error.html, 401 errors will display the diff --git a/openstack-object-storage-dev/section_object-api-dochistory.xml b/openstack-object-storage-dev/section_object-api-dochistory.xml index a551e92..5a2a6a0 100644 --- a/openstack-object-storage-dev/section_object-api-dochistory.xml +++ b/openstack-object-storage-dev/section_object-api-dochistory.xml @@ -29,7 +29,7 @@ format="SVG" scale="60"/> xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="doc_history"> - Document Change History + Document change history This version of the document replaces and obsoletes all previous versions. The following table describes the latest changes: diff --git a/openstack-object-storage-dev/section_object-api-storage-container-svc.xml b/openstack-object-storage-dev/section_object-api-storage-container-svc.xml index 03d6aae..eccabee 100644 --- a/openstack-object-storage-dev/section_object-api-storage-container-svc.xml +++ b/openstack-object-storage-dev/section_object-api-storage-container-svc.xml @@ -31,8 +31,21 @@ format="SVG" scale="60"/> xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="storage-container-services"> - Storage Container Services - You can perform the following operations for + Storage container services + Lists objects, creates and delete containers, and gets, creates, updates, or deletes container + metadata. + + + + + + + + + + + - Although you cannot nest directories in OpenStack - Object Storage, you can simulate a hierarchical - structure within a single container by adding forward - slash characters (/) in the object - name. To navigate the pseudo-directory structure, you - may use the delimiter query parameter. - See the below examples for an illustration. - - In the example below, the objects reside in a - container called backups. Within that - container, the objects are organized in a - pseudo-directory called photos. Keep - in mind that the container name is not displayed - in the example, but that it is a part of the - object URLs. For instance, the URL of the picture - me.jpg is - https://storage.swiftdrive.com/v1/CF_xer7_343/backups/photos/me.jpg. - - - - List Pseudo-Hierarchical Folders/Directories - Request - To display a list of all the objects in the - storage container, use &GET; without a - delimiter or prefix. - GET /v1/AccountString/backups - The system returns status code 2xx (between 200 - and 299, inclusive) and the requested list of the - objects. - photos/animals/cats/persian.jpg -photos/animals/cats/siamese.jpg -photos/animals/dogs/corgi.jpg -photos/animals/dogs/poodle.jpg -photos/animals/dogs/terrier.jpg -photos/me.jpg -photos/plants/fern.jpg -photos/plants/rose.jpg - - Use - the delimiter parameter to limit the displayed - results. Any character may be used as a delimiter. - However, to use delimiter with - pseudo-directories, use the parameter slash - (/). - GET /v1/AccountString/backups?delimiter=/ - The system returns status code 2xx (between 200 - and 299, inclusive) and the requested matching - objects. Because we use the slash, only the - pseudo-directory photos/ displays. Keep - in mind that the returned values from a slash - delimiter query are not real objects. - They have a content-type of - application/directory and are in - the subdir section of json and xml - results. - photos/ - Use the prefix parameter with the - delimiter parameter to view the - objects inside a pseudo-directory, including - further nested pseudo-directories. - GET /v1/AccountString/backups?prefix=photos/&delimiter=/ - The system returns status code 2xx (between 200 - and 299, inclusive) and the objects and - pseudo-directories within the top level - pseudo-directory. - photos/animals/ -photos/me.jpg -photos/plants/ - You can create an unlimited number of nested - pseudo-directories. To navigate through them, use - a longer prefix parameter coupled - with the delimiter parameter. In the - sample output below, there is a pseudo-directory - called dogs within the - pseudo-directory animals. In order to - navigate directly to the files contained within - dogs, enter the below command. - GET /v1/AccountString/backups?prefix=photos/animals/dogs/&delimiter=/ - The system returns status code 2xx (between 200 - and 299, inclusive) and the objects and - pseudo-directories within the nested pseudo-directory. - - photos/animals/dogs/corgi.jpg -photos/animals/dogs/poodle.jpg -photos/animals/dogs/terrier.jpg - - +
Create Container @@ -489,11 +337,11 @@ photos/animals/dogs/terrier.jpg View Container Metadata HTTP Response - + --> -
+ diff --git a/openstack-object-storage-dev/section_object-api-storage-object-svc.xml b/openstack-object-storage-dev/section_object-api-storage-object-svc.xml index 9d8b8c9..e6e273b 100644 --- a/openstack-object-storage-dev/section_object-api-storage-object-svc.xml +++ b/openstack-object-storage-dev/section_object-api-storage-object-svc.xml @@ -16,7 +16,9 @@ xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="storage-object-services"> - Storage Object Services + Storage object services + Creates, updates, gets details for, and deletes objects. + Gets and updates object metadata. An object represents the data and metadata for the files stored in the system. Through the ReST interface, you can include metadata for an object by adding custom HTTP headers @@ -27,7 +29,19 @@ Then, you can download the segments as a single concatenated object. You can use HTTP requests to work with the segments and manifests directly. - + + + + + + + + + + + + By - setting the header to a specific Epoch time, you indicate - when you want the object to expire, not be served, and be - deleted completely from the storage system.
- The X-Delete-After header takes an integer - number of seconds and calculates the amount of time from - now that you want the object to be deleted. The proxy - server that receives the request converts this header into - an X-Delete-At header and calculates the - deletion time using its current time plus the value given - in seconds. - For existing objects that you want to assign expiration - headers to, use the &POST; operation. - - Delete Object at HTTP Request - In the example, the X-Delete-At header - is assigned with a Unix Epoch timestamp in integer - form for Mon, 11 Jun 2012 15:38:25 GMT. Use http://www.epochconverter.com/ for example - timestamps and a batch converter. - - - - Delete Object after HTTP Request - In - this example, the X-Delete-After header - is assigned a value in seconds, equivalent to 10 days. - After this time, the object expires. - - - - - -
- - Object Versioning - Object versioning allows you to store multiple versions - of your content to recover from unintended overwrites. It - provides an easy method to implement version control which - can be used on any type of content. It is strongly - recommended that you put non-current objects in a - container apart from where the current versions exist. - Once you enable Object Versioning on a container (such as - a "current version" container), &PUT;s to existing objects - in that container copy the prior object to a separate - "non-current version" container. Each of the non-current - versions of an object has a time stamp appended to it, so - you know when it was created. - To enable object versioning, your cloud provider has to - set allow_versions to TRUE in - their container config. Then, create a container where - your non-current versions will be written. Next, set the - metadata X-Versions-Location header on the - container that holds the current versions of your objects. - Set the metadata header to point to the new non-current - version container you created. The name of the container - must be UTF-8 encoded and then URL-encoded before putting - into the X-Versions-Location header. This is - where your non-current versions will be stored. Once this - is done, each object in your current-version container - will have Object Versioning enabled; changes to the - objects automatically create non-current versions in the - separate container. - Nothing is written to the non-current version container - when you initially &PUT; an object into the - current-version container. Only when you make edits to the - objects via &PUT; will you create non-current versions. - These non-current versions are labeled according to the - schema below. - - Naming Schema: Non-current versions - are assigned the name - <length><object_name>/<timestamp>, where - length is the 3-character zero-padded hexadecimal - character length of the <object_name> and - <timestamp> is when the it was initially created as - a current version. - Any return status in the 2xx range, such as 202 - (Accepted), denotes success. Status codes in the 4xx or - 5xx range denote failure. You should retry your request if - you receive an error. Please note, however, that if you - have specified a container that does not exist as your - non-current version container, a status of 412 - (Precondition Failed) returns when you edit the versioned - object. If you receive this error, check that the - container exists. - A &GET; to a versioned object returns the current - version of the object without having to do any request - redirects or metadata lookups. - A &POST; to a versioned object only updates the object's - metadata; it does not create a new version of the object. - In other words, new versions are only created when the - content of the object changes. - A &DELETE; to a versioned object removes the current - version of the object and replaces it with the next-most - current version, moving it from the non-current container - to the current. This next-most current version carries - with it any metadata last set on it. If want to completely - remove an object and you have five total versions of it, - you must &DELETE; it five times. - - A large-object manifest file cannot be versioned, - but it may point to versioned segments. - - To turn off Object Versioning on your current version - container, remove its X-Versions-Location - metadata by sending an empty key value. - - Object Versioning with cURL - Make sure a version-storing container exists, - creating it if necessary (this example names it - "versions"). Then create a container with the - X-Versions-Location header. In this - example, this container is named "current". You can - also add the X-Versions-Location header - to an existing container. In this example, the name of - the container is “versions”; the location for the - current version is the container "current". - Create a container named versions. - $ curl -i -XPUT -H "X-Auth-Token: <token>" http://<storage_url>/versions - Create a container named current with the - X-Versions-Location header that - references "versions". - $ curl -i -XPUT -H "X-Auth-Token: <token>" \ - -H "X-Versions-Location: versions" http://<storage_url>/current - Create an object (the first version): - $ curl -i -XPUT --data-binary 1 -H "X-Auth-Token: <token>" \ - http://<storage_url>/current/myobject - Now create a new version of that object: - $ curl -i -XPUT --data-binary 2 -H "X-Auth-Token: <token>" \ - http://<storage_url>/current/myobject - See a listing of the older versions of the - object: - $ curl -i -H "X-Auth-Token: <token>" \ - http://<storage_url>/versions?prefix=008myobject/ - Now delete the current version of the object and see - that the older version is gone: - $ curl -i -XDELETE -H "X-Auth-Token: <token>" \ - http://<storage_url>/current/myobject - $ curl -i -H "X-Auth-Token: <token>" \ - http://<storage_url>/versions?prefix=008myobject/ - -
-
+
--> + + + + + + + diff --git a/openstack-object-storage-dev/section_object-api-storage_account_svc.xml b/openstack-object-storage-dev/section_object-api-storage_account_svc.xml index 2a93f73..dd1b228 100644 --- a/openstack-object-storage-dev/section_object-api-storage_account_svc.xml +++ b/openstack-object-storage-dev/section_object-api-storage_account_svc.xml @@ -1,325 +1,19 @@ - - - - - - -COPY'> -GET'> -HEAD'> -PUT'> -POST'> -DELETE'> - - - - - -'> - - - - - -'> -]>
- Storage Account Services - Perform the following operations at the account level of the - URL: - - - - Verb - URI - Description - - - - - &GET; - /account - Lists containers. - - - &HEAD; - /account - Gets account metadata. - - - &POST; - /account - Creates or updates account - metadata. - - - &POST; - /account - Deletes account metadata. - - - - - - Optional headers for HEAD and GET - - X-Newest - - Set the optional X-newest header to - True in HEAD and GET requests to have - Object Storage return the latest version of the account. - If set to True, Object Storage queries all - replicas to return the most recent one. Without this header, - Object Storage responds faster after it finds one valid replica. - Because setting this header to True is more - expensive for the back end, use it only when it is - absolutely needed. - - - - - For example, the URL for the requests end with the OpenStack - Object Storage account string, as follows: - - Storage Account Services HTTP Request - - -
- List Containers - &GET; operations against the X-Storage-Url - for an account are performed to list storage containers - sorted by name. The sort order for the name is based on a - binary comparison, a single built-in collating - sequence that compares string data by using the SQLite - memcmp() function, regardless of text encoding. The - following list describes the optional query parameters - that are supported with this request. - - Query Parameters - - limit - - For an integer value - n - , limits the number of - results to - n - values. - - - - marker - - Given a string value - x - , return container names - greater in value than the specified - marker. - - - - end_marker - - Given a string value - x - , return container names less - in value than the specified marker. - - - - format - - Specify either json or - xml to return the respective - serialized response. - - - - At this time, a prefix query parameter is - not supported at the account level. - - List Containers HTTP Request - - - A list of containers is returned in the response body, - one container per line. The HTTP response's status code - will be 2xx (between 200 and 299, inclusive). - - List Containers HTTP Response - - -
- Serialized List Output - If a format=xml or - format=json argument is appended to - the storage account URL, the service serves extended - container information serialized in the chosen format. - The sample responses are formatted for readability. - The following HTTP request asks for a JSON response, - so the response returns an HTTP header and a JSON - response. - - Get Containers Details HTTP and JSON - Request - - - - Get Containers Details HTTP and JSON - Response - - - - The following HTTP request asks for an XML response, - so the response returns an HTTP header and an XML - response. - - Containers Details HTTP and XML Request - - - - Containers Details HTTP and XML - Response - - - -
-
- Controlling a Large List of Containers - The system returns a maximum of 10,000 container - names per request. To retrieve subsequent container - names, another request must be made with the 'marker' - parameter. The marker indicates where the last list - left off; the system returns container names greater - than this marker, up to 10,000 again. Note that the - ‘marker’ value should be URL-encoded prior to sending - the HTTP request. - If 10,000 is larger than desired, use the 'limit' - parameter. - If the number of container names returned equals the - limit given (or 10,000 if no limit is given), you may - assume there are more container names. - - List Large Number of Containers - For example, let's use a listing of five - container names: - apples -bananas -kiwis -oranges -pears - We'll use a limit of two to show how things - work: - - apples -bananas - Because we received two items back, we can - assume there are more container names to list, so - we make another request with a marker of the last - item returned: - - kiwis -oranges - Again, two items are returned; there might be - more: - - pears - With this one-item response we received less - than the limit number of container names, - indicating that this is the end of the - list. - By using end_marker we can limit - the result set to container names less than the - given value. - - apples -bananas -kiwis - -
-
-
- Get Account Metadata - &HEAD; operations against an account are performed to - retrieve the number of containers and the total bytes - stored in OpenStack Object Storage for the account. This - information is returned in two custom headers, - X-Account-Container-Count and - X-Account-Bytes-Used. Since the storage - system is designed to store large amounts of data, care - should be taken when representing the total bytes response - as an integer; when possible, convert it to a 64-bit - unsigned integer if your platform supports that primitive - type. - - Get Account Metadata HTTP Request - - - The HTTP return code will be 2xx (between 200 and 299, - inclusive) if the request succeeds. A 401 (Unauthorized) - will be returned for an invalid account or access - key. - - Get Account Metadata HTTP Response - - -
-
- Create or Update Account Metadata - You can associate custom metadata headers with the - account level URI. These headers must take the format - X-Account-Meta-*. - To create or update an account metadata header use the - &POST; query. Subsequent requests for the same key/value - pair overwrite the previous value. - - Update Account Metadata HTTP Request - - - No response body is returned. A status code of 2xx - (between 200 and 299, inclusive) indicates success. - - Update Account Metadata HTTP Response - - - To confirm your metadata changes, perform a &HEAD; - request on the account. Do not send the metadata in your - &HEAD; request. - - View Account Metadata HTTP Request - - - - View Account Metadata HTTP Response - - -
-
- Delete Account Metadata - To delete a metadata header, send an empty value for - that particular header, such as for the - X-Account-Meta-Book header. - If the tool you use to communicate with Object Storage, - such as older versions of cURL, does not support empty - headers, send the - X-Remove-Account-Meta-name: - arbitrary value header. For - example, X-Remove-Account-Meta-Book: x. The - arbitrary value is - ignored. - - Delete Account Metadata HTTP Request - - No response body is returned. A status code from 200 - to 299 indicates success. - -
+ Storage account services + Lists containers and gets, creates, updates, or deletes + account metadata. You can perform these actions at the account + level of the storage system. + + + + + + + +
diff --git a/openstack-object-storage-dev/section_object_api_archive_auto_extract.xml b/openstack-object-storage-dev/section_object_api_archive_auto_extract.xml new file mode 100644 index 0000000..3ebdd9c --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_archive_auto_extract.xml @@ -0,0 +1,96 @@ + + +PUT'> +]> +
+ Auto-extract archive files + Use the auto-extract archive feature to upload a tar(1) + archive file. + The Object Storage system extracts files from the archive + file and creates an object. +
+ Auto-extract archive PUT request + To upload an archive file, you make a &PUT; request. Add + the + extract-archive=format + query parameter to indicate that you are uploading a + tar(1) archive file instead of normal content. + Valid values for the format + variable are tar, + tar.gz, or + tar.bz2. + The path you specify in the &PUT; request is a prefix + for the resulting object names. For example, if the first + object in the tar(1) archive is + /home/file1.txt, a path of + /v1/12345678912345/mybackup/castor/ + results in an object name of + castor/home/file1.txt in the + mybackup container in the + 12345678912345 account. + In the &PUT; request, you can specify the path + for: + + + An account + + + A specific container + + + A specific object prefix + + +
+
+ Create an archive for auto-extract + You must use the tar(1) utility to create the tar(1) + archive file. + You can upload only regular files and you cannot upload + other items, such as empty directories, symbolic links, + and so on. + You must UTF-8-encode the member names. + The archive auto-extract feature supports these + formats: + + + The POSIX.1-1988 (ustar) format. + + + The GNU tar format, including longname and + longlink extensions and the sparse + extension. + + + The POSIX.1-2001 (pax) format. + You can compress the archive by using gzip(1) or + bzip2(1). + Use the extract-archive + query parameter to specify the format. Specify + tar, + tar.gz, or + tar.bz2 as the + format. + + +
+
+ Auto-extract archive response: JSON + When the request is processed by the system, you are in + effect performing multiple sub-operations. Even if all + sub-operations fail, the operation will return a 201 + Created status. You must examine the response body to + determine which members failed to result in an object + creation. You can use the Accept request header to + indicate the format of the response body as follows: - + text/plain. Plain text. This is the default if the Accept + header is not specified. - application/json. Format as + JSON - application/xml or text/xml. Format as XML See + (xref to Response Body for Bulk Operations) for more + information. +
+
diff --git a/openstack-object-storage-dev/section_object_api_authentication.xml b/openstack-object-storage-dev/section_object_api_authentication.xml new file mode 100644 index 0000000..3c52012 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_authentication.xml @@ -0,0 +1,96 @@ + +
+ Authentication + The owner of an Object + Storage account controls access to that account and its + containers and objects. An owner is the user who has the + admin role for that tenant. The tenant + is also known as the project or account. As the account owner, + you can modify account metadata and create, modify, and delete + containers and objects. + To identify yourself as the account owner, include an + authentication token in the X-Auth-Token + header in the API request. + Depending on the token value in the + X-Auth-Token header, one of the + following actions occur: + + + X-Auth-Token contains the token + for the account owner. + The request is permitted and has full access to make + changes to the account. + + + The X-Auth-Tokenheader is omitted + or it contains a token for a non-owner or a token that + is not valid. + The request fails with a 401 + Unauthorized or + 403 + Forbiddenresponse. + You have no access to accounts or containers, unless + an access control list (ACL) explicitly grants + access. + The account owner can grant account and container + access to users through access control lists (ACLs). + For more information about ACLs, see . + + + The following table describes the authentication services + that you can use with Object Storage: + + + + Authentication service + Description + + + + + + OpenStack Identity Service + (Keystone) + The Object Storage account name is the same + as the tenant ID.For information + about the Identity Service, see . + + + + + Tempauth middleware + Object Storage includes this middleware. + User and account management is performed in + the Object Storage system itself. + For information about Tempauth, see . + + + + + swauth (in GitHub) or other custom + middleware + This custom middleware is modeled on + Tempauth, so usage is typically similar to + Tempauth.Specifically, you use + the X-Auth-Token header to + pass an authentication token to an API + request. + + + + + Authentication tokens expire after a time period that the + authentication service defines. When a token expires, use of + the token causes requests to fail with a + 401 + Unauthorized response. To continue, you + must obtain a new token. +
diff --git a/openstack-object-storage-dev/section_object_api_bulk.xml b/openstack-object-storage-dev/section_object_api_bulk.xml new file mode 100644 index 0000000..e026912 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_bulk.xml @@ -0,0 +1,94 @@ + + +PUT'> +]> +
+ Bulk operations +
+ Bulk Delete + With bulk delete you can delete up to 10,000 + (configurable) objects or containers in one request. The + objects to be deleted are listed in the body of a DELETE + operation. The ?bulk-delete query parameter is used to + indicate that you are performing a bulk delete operation + instead of a normal delete. Bulk Delete Request Body + ------------------------------- To indicate that you are + performing a bulk delete operation, add the ?bulk-delete + query parameter to the path. The path should be the + account (e.g., /v1/12345678912345) containing the objects + and containers. The Content-Type request header must be + set to text/plain. The request body comprises a list of + object or container names, seperated by a newline + character. In addition: - The names must be UFT-8 encoded + and then URL-encoded. - To indicate an object, specify the + container and object name as follows: + {container-name}/{object-name} - To indicate a container, + specify the container name as follows: {container-name} - + A container must be empty. If it contains objects, the + container will not be deleted. - At most 10,000 + (configurable) items can be in the list Bulk Delete + Response -------------------------- When the request is + processed by the system, you are in effect performing + multiple sub-operations. Even if all sub-operations fail, + the operation will return a 200 status. You must examine + the response body to determine which members failed to + result in an object deletion. You can use the Accept + request header to indicate the format of the response body + as follows: - text/plain. Plain text. This is the default + if the Accept header is not specified. - application/json. + Format as JSON - application/xml or text/xml. Format as + XML. See (xref to Response Body for Bulk Operations) for + more information. Response Body for Bulk Operations + =========================== Some bulk operations such as + Bulk Delete and Archive Auto Extraction perform multiple + sub-operations. While some of the operations may succeed, + other may fail. To indicate which sub-operations have + succeeded and failed, the bulk operation returns a + response body containing more details. + + You can use the Accept request header to indicate the + format of the response body. The response body contains + the following information: + - The number of files actually deleted or created + (depending on context) - The number of not found objects + (for Bulk Delete only) - Errors. This is a list of object + name and associated error status for the objects that + failed to create or delete. The format depends on the + Accept header. + The following example shows a text/plain response body + where there are no failures. This example is from the + Archive Auto Extraction operation. + Number Files Created: 10 + Errors: + The following example shows a text/plain response where + there are some failures. In this example, the Object + Storage system has been configured to reject certain + character strings so the 400 Bad Request error occurs for + objects using the restricted strings. + Number Files Created: 8 +Errors: +/v1/12345678912345/mycontainer/home/xx%3Cyy, 400 Bad Request +/v1/12345678912345/mycontainer/../image.gif, 400 Bad Request + + This is the same failure response in application/json + format. This example output has been reformatted with + whitespace to make it clearer -- the actual response has + no such whitespace. + { +"Number Files Created": 1, +"Errors": [ +["/v1/12345678912345/mycontainer/home/xx%3Cyy", "400 Bad Request"], +["/v1/12345678912345/mycontainer/../image.gif", "400 Bad Request"] +] +} + The following example shows an example response to a + Bulk Delete request in application/xml format. In this + example, the mycontainer container is not empty so cannot + be deleted. + +
+
diff --git a/openstack-object-storage-dev/section_object_api_large_lists.xml b/openstack-object-storage-dev/section_object_api_large_lists.xml new file mode 100644 index 0000000..3233f50 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_large_lists.xml @@ -0,0 +1,58 @@ + + + + + +]> +
+ Page through large lists of containers or objects + If you have a large number of containers or objects, you can + use the marker, + limit, and + end_marker parameters to control + how many items are returned in a list and where the list + starts or ends. + + + marker + parameter. When you request a list of + containers or objects, Object Storage returns a + maximum of 10,000 names for each request. To get + subsequent names, you must make another request with + the marker parameter. Set the + marker parameter to the name of + the last item returned in the previous list. You must + URL-encode the marker value + before you send the HTTP request. Object Storage + returns a maximum of 10,000 names again. + + + limit + parameter. To return fewer than 10,000 + names, use the limit parameter. + If the number of names returned equals the specified + limit (or 10,000 if you + omit the limit parameter), you + can assume there are more names to list. If the number + of names in the list is exactly divisible by the + limit value, the last + request has no content. + + + end_marker + parameter. Limits the result set to + names that are less than the + end_marker parameter value. + You must URL-encode the + end_marker value before you + send the HTTP request. + + + For examples of how to page through large lists, see . +
diff --git a/openstack-object-storage-dev/section_object_api_overview.xml b/openstack-object-storage-dev/section_object_api_overview.xml new file mode 100644 index 0000000..67e5cb3 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_overview.xml @@ -0,0 +1,223 @@ + + +PUT'> +]> +
+ Object Storage API overview + OpenStack Object Storage is an object-based storage system + that stores content and metadata as objects. You create, + modify, and get objects and metadata by using the Object + Storage API, which is implemented as a set of Representational + State Transfer (REST) web services. + You use the HTTPS (SSL) protocol to interact with Object + Storage, and you use standard HTTP calls to perform API + operations. You can also use language-specific APIs, which use + the ReSTful API, that make it easier for you to integrate into + your applications. + To assert your right to access and change data in an + account, you identify yourself to Object Storage by using an + authentication token. To get a token, you present your + credentials to an authentication service. The authentication + service returns a token and the URL for the account. Depending + on which authentication service that you use, the URL for the + account appears in: + + + OpenStack Identity + Service. The URL is defined in the + service catalog. + + + Tempauth. The URL + is provided in the X-Storage-Url + response header. + + + In both cases, the URL is the full URL and includes the + account resource. For information about authentication, see + . + The Object Storage API supports the standard, non-serialized + response format, which is the default, and both JSON and XML + serialized response formats. See . + The Object Storage system organizes data in a hierarchy, as + follows: + + + Account. Represents + the top-level of the hierarchy. + Your service provider creates your account and you + own all resources in that account. The account defines + a namespace for containers. A container might have the + same name in two different accounts. + In the OpenStack environment, + account is synonymous with + a project or tenant. + + + Container. Defines + a namespace for objects. An object with the same name + in two different containers represents two different + objects. You can create any number of containers + within an account. + In addition to containing objects, you can also use + the container to control access to objects by using an + Access Control List (ACL). You cannot store an ACL + with individual objects. + In addition, you configure and control many other + features, such as object versioning, at the container + level. See . + + + Object. Stores data + content, such as documents, images, and so on. You can + also store custom metadata with an object. + With the Object Storage API, you can: + + + Store an unlimited number of objects. Each + object can be as large as 5 GBs. + + + Upload and store objects of any siz with + large object creation. See . + + + Use cross-origin resource sharing to manage + object security. See . + + + Compress files. See . + + + Override browser behavior for an object. See + . + + + Schedule objects for deletion. See . + + + + + The account, container, and object hierarchy affects the way + you interact with the Object Storage API. + Specifically, the resource path reflects this structure and + has this format: + /v1/{account}/{container}/{object} + For example, for the flowers/rose.jpg + object in the images container in the + 12345678912345 account, the resource + path is: + /v1/12345678912345/images/flowers/rose.jpg + Notice that the object name contains the + / character. This slash does not + indicate that Object Storage has a sub-hierarchy called + flowers because containers do not store + objects in actual sub-folders. However, the inclusion of + / or a similar convention inside object + names enables you to create pseudo-hierarchical folders and + directories. See . + For example, if the endpoint for Object Storage is + objects.mycloud.com, the returned URL + is + https://objects.mycloud.com/v1/12345678912345. + To access a container, append the container name to the + resource path. + To access an object, append the container and the object + name to the path. + If you have a large number of containers or objects, you can + user query parameters to page through large lists of + containers or objects. Use the marker, + limit, and + end_marker query parameters to + control how many items are returned in a list and where the + list starts or ends. See . + Object Storage HTTP requests have the following default + constraints: + + + + Item + Maximum value + Notes + + + + + Number of HTTP headers + 90 + + + + Length of HTTP headers + 4096 bytes + + + + Length per HTTP request line + 8192 bytes + + + + Length of HTTP request + 5 GBs + + + + Length of container names + 256 bytes + Cannot contain the / + character. + + + Length of object names + 1024 bytes + By default, there are no character + restrictions. + + + + You must UTF-8-encode and then URL-encode container and + object names before you call the API binding. If you use an + API binding that performs the URL-encoding for you, do not + URL-encode the names before you call the API binding. + Otherwise, you double-encode these names. Check the length + restrictions against the URL-encoded string. + These sections describe the operations that you can perform + with the Object Storage API: + + + . Use to + perform account-level tasks. + Lists containers for a specified account. Creates, + updates, and deletes account metadata. Shows account + metadata. + + + . Use to + perform container-level tasks. + Lists objects in a specified container. Creates, + shows details for, and deletes containers. Creates, + updates, shows, and deletes container metadata. + + + . Use to + perform object-level tasks. + Creates, replaces, shows details for, and deletes + objects. Copies objects with another object with a new + or different name. Updates object metadata. + + +
diff --git a/openstack-object-storage-dev/section_object_api_pseudo_hier_folders.xml b/openstack-object-storage-dev/section_object_api_pseudo_hier_folders.xml new file mode 100644 index 0000000..e730ce0 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_pseudo_hier_folders.xml @@ -0,0 +1,94 @@ + + +GET'> +HEAD'> +PUT'> +POST'> +DELETE'> +]> +
+ Pseudo-hierarchical folders and directories + + Although you cannot nest directories in OpenStack Object + Storage, you can simulate a hierarchical structure within a + single container by adding forward slash characters + (/) in the object name. To navigate the + pseudo-directory structure, you can use the + delimiter query parameter. this examples show + you how to use pseudo-hierarchical folders and + directories. + + In this example, the objects reside in a container + called backups. Within that container, the + objects are organized in a pseudo-directory called + photos. Keep in mind that the container + name is not displayed in the example, but that it is a + part of the object URLs. For instance, the URL of the + picture me.jpg is + https://storage.swiftdrive.com/v1/CF_xer7_343/backups/photos/me.jpg. + + + List pseudo-hierarchical folders request: HTTP + To display a list of all the objects in the storage + container, use &GET; without a delimiter or + prefix. + GET /v1/AccountString/backups + The system returns status code 2xx (between 200 and 299, + inclusive) and the requested list of the objects. + photos/animals/cats/persian.jpg +photos/animals/cats/siamese.jpg +photos/animals/dogs/corgi.jpg +photos/animals/dogs/poodle.jpg +photos/animals/dogs/terrier.jpg +photos/me.jpg +photos/plants/fern.jpg +photos/plants/rose.jpg + + Use + the delimiter parameter to limit the displayed results. + You can use any character as a delimiter. However, to use + delimiter with pseudo-directories, use + the parameter slash (/). + GET /v1/AccountString/backups?delimiter=/ + The system returns status code 2xx (between 200 and 299, + inclusive) and the requested matching objects. Because you + use the slash, only the pseudo-directory + photos/ displays. Keep in mind that the + returned values from a slash delimiter query + are not real objects. They have a content-type of + application/directory and are in + the subdir section of json and xml + results. + photos/ + Use the prefix and delimiter + parameters to view the objects inside a pseudo-directory, + including further nested pseudo-directories. + GET /v1/AccountString/backups?prefix=photos/&delimiter=/ + The system returns status code 2xx (between 200 and 299, + inclusive) and the objects and pseudo-directories within + the top level pseudo-directory. + photos/animals/ +photos/me.jpg +photos/plants/ + You can create an unlimited number of nested + pseudo-directories. To navigate through them, use a longer + prefix parameter coupled with the + delimiter parameter. In this sample + output, there is a pseudo-directory called + dogs within the pseudo-directory + animals. To navigate directly to the + files contained within dogs, enter the + following command: + GET /v1/AccountString/backups?prefix=photos/animals/dogs/&delimiter=/ + The system returns status code 2nn (between 200 and 299, + inclusive) and the objects and pseudo-directories within + the nested pseudo-directory. + photos/animals/dogs/corgi.jpg +photos/animals/dogs/poodle.jpg +photos/animals/dogs/terrier.jpg + +
diff --git a/openstack-object-storage-dev/section_object_api_response_formats.xml b/openstack-object-storage-dev/section_object_api_response_formats.xml new file mode 100644 index 0000000..3944560 --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_response_formats.xml @@ -0,0 +1,125 @@ + + +GET'> +]> +
+ Serialized response formats + The Object Storage API supports the standard, non-serialized + response format, which is the default, and both JSON and XML + data serialization response formats. + + To run the cURL command examples, you must export environment + variables. + + To define the response format, use one of these + methods: + + + format=format + query parameter + + Append this parameter to the URL for a &GET; + request, where format + is json or xml. + + + + + Accept + request header + + Include this header in the &GET; request. The + valid header values are: + + + text/plain. Plain text + response format. The default. + + + application/json. JSON data + serialization response format. + + + application/xml. XML data + serialization response format. + + + + + + + JSON example with format query parameter + For example, this request uses the + format query parameter to ask + for a JSON response: + # curl -i $publicURL?format=json -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 96 +X-Account-Object-Count: 1 +X-Timestamp: 1389453423.35964 +X-Account-Meta-Subject: Literature +X-Account-Bytes-Used: 14 +X-Account-Container-Count: 2 +Content-Type: application/json; charset=utf-8 +Accept-Ranges: bytes +X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365 +Date: Fri, 17 Jan 2014 15:59:33 GMT + Object Storage lists container names with additional + information in JSON format: + [ + { + "count":0, + "bytes":0, + "name":"janeausten" + }, + { + "count":1, + "bytes":14, + "name":"marktwain" + } +] + + + XML example with Accept header + This request uses the Accept request + header to ask for an XML response: + # curl -i $publicURL -X GET -H "X-Auth-Token: $token" -H "Accept: application/xml; charset=utf-8" + HTTP/1.1 200 OK +Content-Length: 263 +X-Account-Object-Count: 3 +X-Account-Meta-Book: MobyDick +X-Timestamp: 1389453423.35964 +X-Account-Bytes-Used: 47 +X-Account-Container-Count: 2 +Content-Type: application/xml; charset=utf-8 +Accept-Ranges: bytes +X-Trans-Id: txf0b4c9727c3e491694019-0052e03420 +Date: Wed, 22 Jan 2014 21:12:00 GMT + Object Storage lists container names with additional + information in XML format: + <?xml version="1.0" encoding="UTF-8"?> +<account name="AUTH_73f0aa26640f4971864919d0eb0f0880"> + <container> + <name>janeausten</name> + <count>2</count> + <bytes>33</bytes> + </container> + <container> + <name>marktwain</name> + <count>1</count> + <bytes>14</bytes> + </container> +</account> + The remainder of the examples in this guide use + standard, non-serialized responses. However, all &GET; + requests that perform list operations accept the + format query parameter or + Accept request header. + +
diff --git a/openstack-object-storage-dev/section_object_api_versioning.xml b/openstack-object-storage-dev/section_object_api_versioning.xml new file mode 100644 index 0000000..5d13d3d --- /dev/null +++ b/openstack-object-storage-dev/section_object_api_versioning.xml @@ -0,0 +1,184 @@ + + + + + + +COPY'> +GET'> +HEAD'> +PUT'> +POST'> +DELETE'> +]> +
+ Object versioning + You can store multiple versions of your content so that you + can recover from unintended overwrites. Object versioning is + an easy way to implement version control, which you can use + with any type of content. + + You cannot version a large-object manifest file, but the + large-object manifest file can point to versioned + segments. + + It is strongly recommended that you put non-current objects + in a different container than the container where current + object versions reside. + + To enable and use object versioning + + To enable object versioning, ask your cloud provider + to set the option to + TRUE in the container + configuration file. + + + Create an archive container to + store older versions of objects. + Create the archive + container: + # curl -i $publicURL/archive -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" + HTTP/1.1 201 Created +Content-Length: 0 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: tx46f8c29050834d88b8d7e-0052e1859d +Date: Thu, 23 Jan 2014 21:11:57 GMT + + + Create a current container to + store current versions of objects. + Include the X-Versions-Location + header. This header defines the container that holds + the non-current versions of your objects. You must + UTF-8-encode and then URL-encode the container name + before you include it in the + X-Versions-Location header. This + header enables object versioning for all objects in + the current container. Changes to + objects in the current container + automatically create non-current versions in the + archive container. + Create the current + container: + # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Versions-Location: archive" + HTTP/1.1 201 Created +Content-Length: 0 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: txb91810fb717347d09eec8-0052e18997 +Date: Thu, 23 Jan 2014 21:28:55 GMT + + + Create the first version of an object in the + current container: + # curl -i $publicURL/current/my_object --data-binary 1 -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" + HTTP/1.1 201 Created +Last-Modified: Thu, 23 Jan 2014 21:31:22 GMT +Content-Length: 0 +Etag: d41d8cd98f00b204e9800998ecf8427e +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: tx5992d536a4bd4fec973aa-0052e18a2a +Date: Thu, 23 Jan 2014 21:31:22 GMT + Nothing is written to the non-current version + container when you initially &PUT; an object in the + current container. However, + subsequent &PUT; requests that edit an object trigger + the creation of a version of that object in the + archive container. + These non-current versions are named as + follows: + <length><object_name><timestamp> + Where length is the 3-character, zero-padded + hexadecimal character length of the object, + <object_name> is the object name, and + <timestamp> is the time when the object was + initially created as a current version. + + + Create a second version of the object in the + current container: + # curl -i $publicURL/current/my_object --data-binary 2 -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" + HTTP/1.1 201 Created +Last-Modified: Thu, 23 Jan 2014 21:41:32 GMT +Content-Length: 0 +Etag: d41d8cd98f00b204e9800998ecf8427e +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: tx468287ce4fc94eada96ec-0052e18c8c +Date: Thu, 23 Jan 2014 21:41:32 GMT + + + Issue a &GET; request to a versioned object to get + the current version of the object. You do not have to + do any request redirects or metadata lookups. + List older versions of the object in the + archive container: + # curl -i $publicURL/archive?prefix=009my_object -X GET -H "X-Auth-Token: $token" + HTTP/1.1 200 OK +Content-Length: 30 +X-Container-Object-Count: 1 +Accept-Ranges: bytes +X-Timestamp: 1390513280.79684 +X-Container-Bytes-Used: 0 +Content-Type: text/plain; charset=utf-8 +X-Trans-Id: tx9a441884997542d3a5868-0052e18d8e +Date: Thu, 23 Jan 2014 21:45:50 GMT + +009my_object/1390512682.92052 + + A &POST; request to a versioned object updates + only the metadata for the object and does not + create a new version of the object. New versions + are created only when the content of the object + changes. + + + + Issue a &DELETE; request to a versioned object to + remove the current version of the object and replace + it with the next-most current version in the + non-current container. + # curl -i $publicURL/current/my_object -X DELETE -H "X-Auth-Token: $token" + HTTP/1.1 204 No Content +Content-Length: 0 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: tx006d944e02494e229b8ee-0052e18edd +Date: Thu, 23 Jan 2014 21:51:25 GMT + List objects in the archive + container to show that the archived object was moved + back to the current + container: + # curl -i $publicURL/archive?prefix=009my_object -X GET -H "X-Auth-Token: $token" + HTTP/1.1 204 No Content +Content-Length: 0 +X-Container-Object-Count: 0 +Accept-Ranges: bytes +X-Timestamp: 1390513280.79684 +X-Container-Bytes-Used: 0 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: tx044f2a05f56f4997af737-0052e18eed +Date: Thu, 23 Jan 2014 21:51:41 GMT + This next-most current version carries with it any + metadata last set on it. If want to completely remove + an object and you have five versions of it, you must + &DELETE; it five times. + + + To disable object versioning for the + current container, remove its + X-Versions-Location metadata + header by sending an empty key value. + # curl -i $publicURL/current -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Versions-Location: " + HTTP/1.1 202 Accepted +Content-Length: 76 +Content-Type: text/html; charset=UTF-8 +X-Trans-Id: txe2476de217134549996d0-0052e19038 +Date: Thu, 23 Jan 2014 21:57:12 GMT + +<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html> + + +