Example: Listing the buckets you own

Here’s a sample GET request that returns a list of the buckets owned by user lgreen in the context of the europe tenant.

Request with s3curl command line

./s3curl.pl --id=lgreen -- -k "https://europe.hcp.example.com"
     -H "x-hcp-pretty-print: true"

Request headers

GET / HTTP/1.1
Host: europe.hcp.example.com
Date: Fri, 07 February 2020 17:19:26 +0000
Authorization: AWS bGdyZWVu:Gek+OrFpyg06Bufgg+TW6kH5ISA=
x-hcp-pretty-print: true

Response headers

HTTP/1.1 200 OK
Date: Fri, 07 February 2020 17:19:26 GMT
Content-Type: application/xml;charset=UTF-8
Transfer-Encoding: chunked

Response body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
     <Owner>
          <ID>b9d39144-a081-4762-b0e8-b8fb51e10192</ID>
          <DisplayName>lgreen</DisplayName>
     </Owner>
     <Buckets>
          <Bucket>
               <Name>finance</Name>
               <CreationDate>2019-03-18T12:59:11.898Z</CreationDate>
          </Bucket>
          <Bucket>
               <Name>human-resources</Name>
               <CreationDate>2019-03-18T19:46:03.856Z</CreationDate>
          </Bucket>
     </Buckets>
</ListAllMyBucketsResult>

© 2015, 2020 Hitachi Vantara LLC. All rights reserved.