Show account details and list containers

 
MethodURIDescription
GET/v1/{account}​{?limit,​marker,​end_marker,​format,​prefix,​delimiter}

Shows details for a specified account and lists containers, sorted by name, in the account.

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.

This operation does not accept a request body.

Example requests and responses:

  • Show account details and list containers, and ask for a JSON response:

    curl -i $publicURL?format=json -X GET -H "X-Auth-Token: $token"

    See the example response below.

  • List containers and ask for an XML response: curl -i $publicURL?format=xml -X GET -H "X-Auth-Token: $token"

    See the example response below.

For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.

The response body returns a list of containers. The default response (text/plain) returns one container per line.

If you use query parameters to page through a long list of containers, you have reached the end of the list if the number of items in the returned list is less than the request limit value. The list contains more items if the number of items in the returned list equals the limit value.

If the request succeeds, the operation returns one of these status codes:

  • 200. Success. The response body lists the containers.

  • 204. Success. The response body shows no containers. Either the account has no containers or you are paging through a long list of names by using the marker, limit, or end_marker query parameters, and you have reached the end of the list.

Normal response codes: 200, 204

 Request

This table shows the header parameters for the show account details and list containers request:

NameTypeDescription

X-Auth-Token

​String

(Required)

Authentication token.

X-Newest

​Boolean

(Optional)

If set to True, Object Storage queries all replicas to return the most recent one. If you omit 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.

Accept

​String

(Optional)

Instead of using the format query parameter, set this header to application/json, application/xml, or text/xml.

This table shows the URI parameters for the show account details and list containers request:

NameTypeDescription

{account}

​String

The unique name for the account. An account is also known as the project or tenant.

This table shows the query parameters for the show account details and list containers request:

NameTypeDescription

limit

​Int

(Optional)

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

marker

​String

(Optional)

For a string value x, returns container names that are greater in value than the specified marker.

end_marker

​String

(Optional)

For a string value x, returns container names that are less in value than the specified marker.

format

​String

(Optional)

The response format. Valid values are json, xml, or plain. The default is plain.

If you append the format=xml or format=json query parameter to the storage account URL, the response shows extended container information serialized in the specified format.

If you append the format=plain query parameter, the response lists the container names separated by newlines.

prefix

​String

(Optional)

Prefix value. Object names in the response begin with this value.

delimiter

​Char

(Optional)

Delimiter value, which returns the object names that are nested in the container.

 Response

This table shows the header parameters for the show account details and list containers response:

NameTypeDescription

Content-Length

​String

(Required)

The length of the response body that contains the list of names. If the operation fails, this value is the length of the error text in the response body.

Content-Type

​String

(Required)

The MIME type of the list of names. If the operation fails, this value is the MIME type of the error text in the response body.

X-Account-Object-Count

​Int

(Required)

The number of objects in the account.

X-Account-Bytes-Used

​Int

(Required)

The total number of bytes that are stored in Object Storage for the account.

X-Account-Container-Count

​Int

(Required)

The number of containers.

X-Account-Meta-name

​String

(Optional)

The custom account metadata item, where {name} is the name of the metadata item.

One X-Account-Meta-{name} response header appears for each metadata item (for each {name}).

X-Account-Meta-Temp-URL-Key

​String

(Optional)

The secret key value for temporary URLs. If not set, this header is not returned by this operation.

X-Account-Meta-Temp-URL-Key-2

​String

(Optional)

A second secret key value for temporary URLs. If not set, this header is not returned by this operation.

X-Trans-Id

​Uuid

(Required)

A unique transaction identifier for this request. Your service provider might need this value if you report a problem.

Date

​Datetime

(Required)

The transaction date and time.

 

Example 2.1. List containers response: HTTP and JSON

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
[
   {
      "count":0,
      "bytes":0,
      "name":"janeausten"
   },
   {
      "count":1,
      "bytes":14,
      "name":"marktwain"
   }
]

 

Example 2.2. List containers response: HTTP and XML

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>

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...