Show container details and list objects

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

Shows details for a specified container and lists objects, sorted by name, in the container.

Specify query parameters in the request to filter the list and return a subset of object names. Omit query parameters to return the complete list of object names that are stored in the container, up to 10,000 names. The 10,000 maximum value is configurable. To view the value for the cluster, issue a GET /info request.

Example requests and responses:

  • Show container details for and list objects in the marktwain container, and ask for a JSON response:

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

  • Show container details for and list objects in the marktwain container, and ask for an XML response:

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

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

If you use query parameters to page through a long list of objects, 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 objects.

  • 204. Success. The response body shows no objects. Either the container has no objects 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.

If the container does not exist, the 404 Not Found error code is returned.

Normal response codes: 200, 204

Error response codes: NotFound (404)

 Request

This table shows the header parameters for the show container details and list objects 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 container details and list objects request:

NameTypeDescription

{account}

​String

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

{container}

​String

The unique name for the container.

This table shows the query parameters for the show container details and list objects 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.

prefix

​String

(Optional)

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

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.

delimiter

​Char

(Optional)

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

path

​String

(Optional)

For a string value, returns the object names that are nested in the pseudo path. Equivalent to setting delimiter to / and prefix to the path with a / at the end.

 Response

This table shows the header parameters for the show container details and list objects 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.

X-Container-Object-Count

​Int

(Required)

The number of objects.

Accept-Ranges

​String

(Required)

The type of ranges that the object accepts.

X-Container-Meta-name

​String

(Required)

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

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

X-Container-Bytes-Used

​Int

(Required)

The count of bytes used in total.

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-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.3. Show container details response: HTTP and JSON

HTTP/1.1 200 OK
Content-Length: 341
X-Container-Object-Count: 2
Accept-Ranges: bytes
X-Container-Meta-Book: TomSawyer
X-Timestamp: 1389727543.65372
X-Container-Bytes-Used: 26
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx26377fe5fab74869825d1-0052d6bdff
Date: Wed, 15 Jan 2014 16:57:35 GMT
[
   {
      "hash":"451e372e48e0f6b1114fa0724aa79fa1",
      "last_modified":"2014-01-15T16:41:49.390270",
      "bytes":14,
      "name":"goodbye",
      "content_type":"application/octet-stream"
   },
   {
      "hash":"ed076287532e86365e841e92bfc50d8c",
      "last_modified":"2014-01-15T16:37:43.427570",
      "bytes":12,
      "name":"helloworld",
      "content_type":"application/octet-stream"
   }
]

 

Example 2.4. Show container details response: HTTP and XML

HTTP/1.1 200 OK
Content-Length: 500
X-Container-Object-Count: 2
Accept-Ranges: bytes
X-Container-Meta-Book: TomSawyer
X-Timestamp: 1389727543.65372
X-Container-Bytes-Used: 26
Content-Type: application/xml; charset=utf-8
X-Trans-Id: txc75ea9a6e66f47d79e0c5-0052d6be76
Date: Wed, 15 Jan 2014 16:59:35 GMT
<?xml version="1.0" encoding="UTF-8"?>
<container name="marktwain">
    <object>
        <name>goodbye</name>
        <hash>451e372e48e0f6b1114fa0724aa79fa1</hash>
        <bytes>14</bytes>
        <content_type>application/octet-stream</content_type>
        <last_modified>2014-01-15T16:41:49.390270</last_modified>
    </object>
    <object>
        <name>helloworld</name>
        <hash>ed076287532e86365e841e92bfc50d8c</hash>
        <bytes>12</bytes>
        <content_type>application/octet-stream</content_type>
        <last_modified>2014-01-15T16:37:43.427570</last_modified>
    </object>
</container>

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...