ListObjects

Returns some or all (up to 1,000) of the objects in a bucket.

You can use the request parameters as selection criteria to return a subset of objects in a bucket. A 200 OK response should contain valid XML. Be sure to design your application to parse the contents of the response and handle this appropriately.

You must have List ACL to be able to call this action.

The following operations are related to ListObjects:

Request Syntax

1GET /?delimiter=Delimiter&encoding-type=EncodingType&marker=Marker&max-keys=MaxKeys&prefix=Prefix HTTP/1.1
2Host: <BUCKET>.s3.tebi.io

The request uses the following URI parameters:

  • <BUCKET>: Name of the bucket containing the objects. Required.

  • delimiter: Character used to group keys. Only forward slash / is supported by Tebi as a delimiter.

  • encoding-type: Requests Tebi to encode the object keys in the response and specifies the encoding method to use. Valid Values: url.

  • marker: Specifies the key to start with when listing objects in a bucket.

  • max-keys: Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.

  • prefix: Limits the response to keys that begin with the specified prefix.

The request does not have a request body.

Response Syntax

 1HTTP/1.1 200
 2Content-Type: application/xml
 3Content-Length: ContentLength
 4
 5<?xml version="1.0" encoding="UTF-8"?>
 6<ListBucketResult>
 7    <IsTruncated>boolean</IsTruncated>
 8    <Marker>string</Marker>
 9    <NextMarker>string</NextMarker>
10    <Contents>
11        <ETag>string</ETag>
12        <Key>string</Key>
13        <LastModified>timestamp</LastModified>
14        <Owner>
15            <DisplayName>string</DisplayName>
16            <ID>string</ID>
17        </Owner>
18        <Size>integer</Size>
19        <StorageClass>string</StorageClass>
20    </Contents>
21    ...
22    <Name>string</Name>
23    <Prefix>string</Prefix>
24    <Delimiter>string</Delimiter>
25    <MaxKeys>integer</MaxKeys>
26    <EncodingType>string</EncodingType>
27    <CommonPrefixes>
28        <Prefix>string</Prefix>
29    </CommonPrefixes>
30    ...
31</ListBucketResult>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service:

  • ListBucketResult: Root level tag for the ListBucketResult parameters.

  • CommonPrefixes: All keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns. A response can contain CommonPrefixes only if you specify a delimiter. CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by the delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.

  • Contents: Metadata about each object returned.

  • Delimiter: Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value. Only forward slash / is supported by Tebi as a delimiter.

  • EncodingType: Encoding type used by Tebi to encode object keys in the response. Valid Values: url.

  • IsTruncated: Flag that indicates whether Tebi returned all of the results that satisfied the search criteria.

  • Marker: Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request.

  • MaxKeys: Maximum number of keys returned in the response body.

  • Name: Bucket name.

  • NextMarker: When the response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as a marker in the subsequent request to get the next set of objects. Tebi lists objects in alphabetical order. Note: This element is returned only if you have the delimiter request parameter specified. If the response does not include the NextMarker and it is truncated, you can use the value of the last key in the response as the marker in the subsequent request to get the next set of object keys.

  • Prefix: Keys that begin with the indicated prefix.

See Also

Refer here for more information.