• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (Swift)
  4. Operations on Containers
  5. Show Container Details and List Objects
  6. Request

Request

Method

Table 1 Method description

Method

URI

Description

GET

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

Shows metadata of a specified container and lists objects, sorted by name in ascending order, in the container.

{account} indicates the name of an account.

{container} indicates the name of a container.

This operation does not involve a request body.

Example Request

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"

Request Headers

Request URI parameters

Parameter

Type

Description

{account}

String

(Required)

Unique name of the account. In the current version, it indicates the unique ID of the account.

{container}

String

(Required)

Unique name of the container.

For details about container naming rules, see Naming Rules.

Request header parameters

Parameter

Type

Description

X-Auth-Token

String

(Required)

Authentication token.

Accept

String

(Optional)

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

Request Query Parameters

Table 5-2 describes the query parameters of "Show Container Details and List Objects":

Table 2 Request query parameters

Parameter

Type

Description

limit

Int

(Optional)

Limits the number of objects in a query result. The value ranges from 0 to 10000. If the value is larger than 10000, an error is reported. The default value is 10000.

marker

String

(Optional)

Returns object names that are greater than the specified marker.

end_marker

String

(Optional)

Returns object names that are smaller than the specified marker.

format

String

(Optional)

Sets the format of the returned object list. The valid values are plain (default), json, and xml. Its function is the same as Accept.

prefix

String

(Optional)

Returns objects that have the specified prefix.

delimiter

Char

(Optional)

Returns the object names that are nested in the container.

path

String

(Optional)

Returns the object names that are nested in the specified path. Equivalent to setting delimiter to / and prefix to the path with a slash (/) at the end.

NOTE:

OBS (compatible with OpenStack Swift) does not have the following issue that exists in OpenStack Swift: If the first character of an object is set to the delimiter parameter, the expected result cannot be correctly returned.

Example:

bucket01 contains the following object:

obj0

If the delimiter=o parameter is used in the query, OBS (compatible with OpenStack Swift) returns the following information:

o

OpenStack Swift, however, returns the following information (which is incorrect, equivalent to a failure to impalement the function):

obj0

NOTE:

In terms of setting the path parameter, OBS (compatible with OpenStack Swift) does not have the following issue that exists in OpenStack Swift: When the path parameter is used, subdirectories cannot be shown. The specific difference is as follows:

Same prerequisites:

The following objects exist in a container:

o/1

o/2

o/subdir1/1

If the same request is sent to OpenStack Swift and OBS (compatible with OpenStack Swift), the results are different as follows:

OpenStack Swift

The result is as follows:

o/1

o/2

(Lack of o/subdir1/1)

OBS

The result is as follows:

o/1

o/2

o/subdir1/1