List versioned objects in a bucket

A GET request addressed to a bucket returns a list of versioned objects, limited to 1,000 at a time and returned in non-lexographical order. The StorageClass value that is returned in the response is a default value as storage class operations are not implemented in COS. This operation does not make use of operation specific headers or payload elements.

Syntax


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

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.
encoding-type string If unicode characters that are not supported by XML are used in an object name, this parameter can be set to url to properly encode the response.
max-keys string Restricts the number of objects to display in the response. Default and maximum is 1,000.
key-marker string Specifies the object from where the listing should begin, in UTF–8 binary order.
version-id-marker string Specifies the object from where the listing should begin, in UTF–8 binary order.

Sample request

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


GET /example-bucket?versions 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


<ListVersionsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01">
    <Name>example-bucket</Name>
    </Prefix>
    <KeyMarker/>
    <VersionIdMarker/>
    <MaxKeys>1000</MaxKeys>
    <IsTruncated>false</IsTruncated>
    <Version>
        <Key>my-file-1</Key>
        <VersionId>3/L4kqtJl40Nr8X8gdRQBpUMLUo</VersionId>
        <IsLatest>true</IsLatest>
         <LastModified>2016-10-12T17:50:30.000Z</LastModified>
        <ETag>"fba9dede5f27731c9771645a39863328"</ETag>
        <Size>4623462</Size>
        <StorageClass>STANDARD</StorageClass>
        <Owner>
            <ID>{access-key}</ID>
            <DisplayName>{username}</DisplayName>
        </Owner>
    </Version>
    <DeleteMarker>
        <Key>my-file-2</Key>
        <VersionId>03jpff543dhffds434rfdsFDN943fdsFkdmqnh892</VersionId>
        <IsLatest>true</IsLatest>
        <LastModified>2016-11-12T17:50:30.000Z</LastModified>
        <Owner>
            <ID>{access-key}</ID>
            <DisplayName>{username}</DisplayName>
        </Owner>
    </DeleteMarker>
    <Version>
        <Key>my-file-2</Key>
        <VersionId>QUpfdndhfd8438MNFDN93jdnJFkdmqnh893</VersionId>
        <IsLatest>false</IsLatest>
        <LastModified>2016-10-10T17:50:30.000Z</LastModified>
        <ETag>"0cbc6611f5540bd0809a388dc95a615b"</ETag>
        <Size>32452346</Size>
        <StorageClass>STANDARD</StorageClass>
        <Owner>
            <ID>{access-key}</ID>
            <DisplayName>{username}</DisplayName>
        </Owner>
    </Version>
    <DeleteMarker>
        <Key>my-file-3</Key>
        <VersionId>03jpff543dhffds434rfdsFDN943fdsFkdmqnh892</VersionId>
        <IsLatest>true</IsLatest>
        <LastModified>2009-10-15T17:50:30.000Z</LastModified>
        <Owner>
            <ID>{access-key}</ID>
            <DisplayName>{username}</DisplayName>
        </Owner>
    </DeleteMarker>
    <Version>
        <Key>my-file-3</Key>
        <VersionId>UIORUnfndfhnw89493jJFJ</VersionId>
        <IsLatest>false</IsLatest>
        <LastModified>2016-10-11T12:50:30.000Z</LastModified>
        <ETag>"d34d8aada2996fc42e6948b926513907"</ETag>
        <Size>45</Size>
        <StorageClass>STANDARD</StorageClass>
        <Owner>
            <ID>{access-key}</ID>
            <DisplayName>{username}</DisplayName>
        </Owner>
     </Version>
</ListVersionsResult>