GET Bucket (List Objects)

Returns a list of objects in a bucket. To use this operation, you must have READ permission to the bucket that you specify.

By default, the number of objects in the list returned by the GET Bucket operation is limited to 1000, but you can change this default with the max-keys parameter. You can use other parameters to specify objects to include and to filter out objects that you do not want to include in the list.

Use the GET Service operation to obtain the list of buckets that you own.

Request syntax

GET / HTTP/1.1
Host: BucketName.rs2.StorageService.com
Date: date
Authorization: signatureValue

Request parameters

The GET Bucket operation can use the following optional parameters:

Request headers

You can use the following request headers with the GET Bucket (List Objects) operation:
Authorization, Content-Length, Content-Type, Date, and Host.

The Authorization, Date, and Host headers are required; the others are optional.
For more information, see Request Headers.

Response headers

Response headers in a GET Bucket (List Objects) operation may include: Content-Length, Connection, Date, ETag, and Server.

For more information, see Response Headers.

Response elements

The GET Bucket (List Objects) operation can return the following items (item datatypes in parentheses):

Examples

Request sample

This sample gets the objects in the backup bucket:

GET / HTTP/1.1
Host: backup.demo.cloud.it
Date: Thu, 16 Jun 2011 15:11:47 GMT
Authorization: AWS pat:6nYhPMw6boadLgjywjSIyhfwRIA=
Response sample

The response sample shows a single object:

<?xml version="1.0" encoding="UTF-8"?>
  <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Name>backup</Name>
    <Prefix></Prefix>
    <Marker></Marker>
    <MaxKeys>1000</MaxKeys>
    <Delimiter>/</Delimiter>
    <IsTruncated>false</IsTruncated>
   <Contents>
     <Key>support-20110614.md5</Key>
     <LastModified>2011-06-14T05:08:57.000Z</LastModified>
     <ETag>&quot;8aad2888fd4fafaeabb643ccdaa77872&quot;</ETag>
     <Size>155</Size>
     <Owner>
       <ID>3452783832C94517345278000000004000000120</ID>
       <DisplayName>Patrick</DisplayName>
     </Owner>
     <StorageClass>STANDARD</StorageClass>
   </Contents>
</ListBucketResult>
Request sample with max_keys parameter
GET /confpat?max-keys=4 HTTP/1.1
Host: demo.cloud.it
Accept: */*
Authorization: AWS pat:0YPPNCCa9yAbKOFdlLD/ixMLayg=
Date: Tue, 28 Jun 2011 09:27:15 GMT
Connection: close 
Response sample with max_keys parameter
HTTP/1.1 200 OK
Date: Tue, 28 Jun 2011 09:27:15 GMT
Server: RestServer/1.0
Content-Length: 1499
Content-Type: application/xml
Cache-Control: no-cache
Connection: close 

<?xml version="1.0" encoding="UTF-8"?>
  <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Name>confpat</Name>
    <Prefix></Prefix>
    <Marker></Marker>
    <MaxKeys>4</MaxKeys>
    <IsTruncated>true</IsTruncated>
   <Contents>
     <Key>DS_Store</Key>
     <LastModified>2011-06-26T23:45:35.000Z</LastModified>
     <ETag>>&quot;02674163a1999de7c3fe664ae6f3085e&quot;</ETag>
     <Size>12292</Size>
     <Owner>
       <ID>3452783832C94517345278000000004000000120</ID>
       <DisplayName>pat</DisplayName>
     </Owner>
     <StorageClass>STANDARD</StorageClass>
   </Contents>
   <Contents>
     <Key>Aziende/cluster.sh</Key>
     <LastModified>2011-05-20T14:33:37.000Z</LastModified>
     <ETag>&quot;45ecf8f5ebc7740b034c40e0412250ec&quot;</ETag>
     <Size>74</Size>
     <Owner>
       <ID>3452783832C94517345278000000004000000120</ID>
       <DisplayName>pat</DisplayName>
     </Owner>
     <StorageClass>STANDARD</StorageClass>
   </Contents> 
</ListBucketResult>