This section documents the ReST operations that can be performed on containers. All operations are valid HTTP request methods and will resemble this format:


GET operations against a storage container name are performed to retrieve a list of objects stored in the container. Additionally, there are a number of optional query parameters that can be used to refine the list results.

A request with no query parameters will return the full list of object names stored in the container, up to 10,000 names. Optionally specifying the query parameters will filter the full list and return a subset of objects.

Query Parameters

limit

For an integer value n , limits the number of results to at most n values.

marker

Given a string value x , return object names greater in value than the specified marker.

prefix

For a string value x , causes the results to be limited to object names beginning with the substring x .

format

Specify either json or xml to return the respective serialized response.

path

For a string value x , return the object names nested in the pseudo path (assuming preconditions are met - see below).

delimiter

For a character c , return all the object names nested in the container (without the need for the directory marker objects).


A list of objects is returned in the response body, one object name per line. A 204 (No Content) HTTP return code will be passed back if the container is empty or does not exist for the specified account. If an incorrect account is specified, the HTTP return code will be 404 (Not Found).


If a format=xml or format=json argument is appended to the storage account URL, the service will serve extended object information serialized in the chosen format. Other than the ?format=xml|json param, it will return the same status/errors codes. The sample responses below are formatted for readability.





The system will return a maximum of 10,000 object names per request. To retrieve subsequent object names, another request must be made with a 'marker' parameter. The marker indicates where the last list left off and the system will return object 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, a 'limit' parameter may be given.

If the number of object names returned equals the limit given (or 10,000 if no limit is given), it can be assumed there are more object names to be listed. If the container name list is exactly divisible by the limit, the last request will simply have no content.


You can simulate a hierarchical structure in OpenStack Object Storage by following a few guidelines. Object names must contain the forward slash character / as a path element separator and also create directory marker objects; then they will be able to traverse this nested structure with the new path query parameter. This can best be illustrated by example:

Note

For the purposes of this example, the container where the objects reside is called backups. All objects in this example start with a prefix of photos and should NOT be confused with the container name. In the example, the full URI of the me.jpg file would be https://storage.swiftdrive.com/v1/CF_xer7_343/backups/photos/me.jpg


By combining this path query parameter with the format query parameter, users will be able to easily distinguish between virtual folders/directories by Content-Type and build interfaces that allow traversal of the pseudo-nested structure.

You can also use a delimiter parameter to represent a nested directory hierarchy without the need for the directory marker objects. You can use any single character as a delimiter. The listings can return virtual directories - they are virtual in that they don't actually represent real objects. like the directory markers, though, they will have a content-type of application/directory and be in a subdir section of json and xml results.

If you have the following objects—photos/photo1, photos/photo2, movieobject, videos/movieobj4—in a container, your delimiter parameter query using slash (/) would give you photos, movieobject, videos.

GET /v1/acct/container?delimiter=/
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb