From e0e443e89f50f71d416b6f2678e22be2383ca227 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Fri, 12 Dec 2014 16:10:35 -0600 Subject: [PATCH] Adds pseudo-hierarchical folders info to End User Guide With the moving of the Object Storage API content from a long-form dev guide to a specification, some topics needed To be added to the End User Guide. Change-Id: Ic1616a970355707a48997e5b006e68164fa731f9 Partial-bug: 1392382 --- doc/user-guide/section_cli_swift_howto.xml | 1 + ...section_object-api-pseudo-hier-folders.xml | 80 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 doc/user-guide/section_object-api-pseudo-hier-folders.xml diff --git a/doc/user-guide/section_cli_swift_howto.xml b/doc/user-guide/section_cli_swift_howto.xml index 2e471e6abb..6e9c720489 100644 --- a/doc/user-guide/section_cli_swift_howto.xml +++ b/doc/user-guide/section_cli_swift_howto.xml @@ -134,4 +134,5 @@ X-Timestamp: 1392684036.33306 + diff --git a/doc/user-guide/section_object-api-pseudo-hier-folders.xml b/doc/user-guide/section_object-api-pseudo-hier-folders.xml new file mode 100644 index 0000000000..fef2d9fa90 --- /dev/null +++ b/doc/user-guide/section_object-api-pseudo-hier-folders.xml @@ -0,0 +1,80 @@ + + %openstack; ]> +
+ 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 example shows + 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. The container name is not + displayed in the example, but 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. + $ curl -X GET -i -H "X-Auth-Token: $token" $publicurl/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. To use delimiter with + pseudo-directories, you must use the parameter slash (/). + $ curl -X GET -i -H "X-Auth-Token: $token" $publicurl/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. 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. + $ curl -X GET -i -H "X-Auth-Token: $token" $publicurl/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: + $ curl -X GET -i -H "X-Auth-Token: $token" $publicurl/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 + +