List objects in a given bucket (v2)

A GET request addressed to a bucket with the query parameter list-type=2 returns a list of objects, limited to 1,000 at a time, returned in non-lexigraphical order and allows for additional flexibility in listing. The StorageClass value that is returned in the response is a default value as storage class operations are not implemented in the system. This operation does not make use of operation specific headers or payload elements.

Syntax


GET https://{endpoint}/{bucket-name}?list-type=2 # path style
GET https://{bucket-name}.{endpoint}?list-type=2 # virtual host style

Optional request header

Table 1. Request header
Name Description Required
Mirror-Destination

This header is applicable for listing of buckets in a protected mirror.

The Mirror-Destination header specifies from which vault of the mirror to read. By default, if no explicit vault is specified, then the listing request will attempt to read from both vaults and provide a listing response that combines the list of objects on each component vault to the mirror excluding duplicates (object resides on both vaults in the mirror). If the Mirror-Destination header is specified and includes a valid Vault Identifier, the data returned will be from the Vault with the ID that matches what was provided in the header. The Mirror-Destination header is applicable only to protected mirrors, and the header is ignored otherwise. A failure to read from the specified vault will result in an error back to the HTTP client.

Type
String
Default
None
Constraints
{Valid Vault Identifier}
No

Optional query parameters

Name Type Description
prefix string Constrains response to object names beginning with prefix.
delimiter string Groups objects between the prefix and the delimiter.
max-keys string Restricts the number of objects to display in the response. Default and maximum is 1,000.
continuation-token string If the total number of objects exceeds the value of max-keys, a NextContinuationToken is returned. Passing the value of the NextContinuationToken in a subsequent listing request continues listing from that point.
fetch-owner string Owner information is not passed by default. If owner information is needed, this value must be set to true.
\start-after string Sets the starting point o list objects in lexigraphical order. Ignored if continuation-token is also present.

Sample request

This request lists the objects inside the “example” bucket.


GET /example-bucket?list-type=2 HTTP/1.1
Content-Type: text/plain
Host: 67.228.254.193
X-Amz-Date: 20160822T225156Z
Authorization: {authorization-string}

Sample response


HTTP/1.1 200 OK
Date: Wed, 24 Aug 2016 17:36:24 GMT
X-Clv-Request-Id: 9f39ff2e-55d1-461b-a6f1-2d0b75138861
Accept-Ranges: bytes
Server: Cleversafe/3.9.0.115
X-Clv-S3-Version: 2.5
x-amz-request-id: 9f39ff2e-55d1-461b-a6f1-2d0b75138861
Content-Type: application/xml
Content-Length: 909


<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>apiary</Name>
  <Prefix/>
  
  <MaxKeys>1000</MaxKeys>
  <KeyCount>205</KeyCount>
  <IsTruncated>false</IsTruncated>
  <Contents>
    <Key>drone-bee</Key>
    <LastModified>2016-08-25T17:38:38.549Z</LastModified>
    <ETag>"0cbc6611f5540bd0809a388dc95a615b"</ETag>
    <ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm>
    <ChecksumType>FULL_OBJECT</ChecksumType>
    <Size>4</Size>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>soldier-bee</Key>
    <LastModified>2016-08-25T17:49:06.006Z</LastModified>
    <ETag>"37d4c94839ee181a2224d6242176c4b5"</ETag>
    <ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm>
    <ChecksumType>FULL_OBJECT</ChecksumType>
    <Size>11</Size>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>worker-bee</Key>
    <LastModified>2016-08-25T17:46:53.288Z</LastModified>
    <ETag>"d34d8aada2996fc42e6948b926513907"</ETag>
    <ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm>
    <ChecksumType>FULL_OBJECT</ChecksumType>
    <Size>467</Size>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    ...
  </Contents>
  ...
</ListBucketResult>

<Name>bucket</Name>
    <Prefix/>
    <KeyCount>205</KeyCount>
    <MaxKeys>1000</MaxKeys>
    <IsTruncated>false</IsTruncated>
    <Contents>
        <Key>my-image.jpg</Key>
        <LastModified>2009-10-12T17:50:30.000Z</LastModified>
        <ETag>"fba9dede5f27731c9771645a39863325"</ETag>
        <ChecksumAlgorithm>CRC64NVME</ChecksumAlgorithm>
        <ChecksumType>FULL_OBJECT</ChecksumType>
        <Size>434234</Size>
        <StorageClass>STANDARD</StorageClass>
    </Contents>
    <Contents>
       ...
    </Contents>
    ...
</ListBucketResult>