HCP Tenant Management Help


Example: Listing the items in a folder

Here’s a sample GET request for a bucket listing that lists the objects that are in the mktg folder and, separately, the subfolders that are in the mktg folder. The request uses these query parameters:

list-type=2 — Uses version 2 of the S3 compatible API

max-keys=1000 — Lists no more than 1000 items in the response

prefix=mktg/ — Lists only items that start with mktg/

start-after=mktg/ — Starts the listing with the item that follows mktg/ by itself

delimiter=/ — Treats items that have a forward slash (/) after mktg/ as having a common prefix

Request with s3curl command line

./s3curl.pl --id=lgreen -- -k "https://finance.europe.hcp.example.com?list-type=2&max-keys=1000
     &prefix=mktg/&start-after=mktg/&delimiter=/" -H "x-hcp-pretty-print: true"

Request headers

GET /?list-type=2&max-keys=1000&prefix=mktg/&delimiter=/&start-after=mktg/ HTTP/1.1
Host: finance.europe.hcp.example.com
Date: Fri, 10 May 2019 17:19:26 +0000
Authorization: AWS bGdyZWVu:ysiVYJ/cOr78z69BuDy6fy07ryo=
x-hcp-pretty-print: true

Response headers

HTTP/1.1 200 OK
Date: Fri, 10 May 2019 17:19:26 GMT
Content-Type: application/xml;charset=UTF-8
Content-Length: 157
Connection: close
Server: HCP V8.2.0.2
Transfer-Encoding: chunked

Response body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
     <Name>finance</Name>
     <Prefix>mktg/</Prefix>
     <StartAfter>mktg/</StartAfter>
     <NextContinuationToken>1eGcxW1r/XYCxHnhbY24cK3/Jd36Hy4vZkbM=</NextContinuationToken>
     <KeyCount>1000</KeyCount>
     <MaxKeys>1000</MaxKeys>
     <Delimiter>/</Delimiter>
     <IsTruncated>true</IsTruncated>
     <Contents>
          <Key>mktg/campaign_GoGetEm_expenses.xls</Key>
          <LastModified>2019-02-13T17:44:53.000Z</LastModified>
          <ETag>"6ed7faad1e0661c03ad65a4317d4a94c"</ETag>
          <Size>94328</Size>
          <Owner>
               <ID>b9d39144-a081-4762-b0e8-b8fb51e10192</ID>
               <DisplayName>lgreen</DisplayName>
          </Owner>
          <StorageClass>STANDARD</StorageClass>
     </Contents>
     <Contents>
          <Key>mktg/campaign_LiveIt_expenses.xls</Key>
          <LastModified>2018-12-05T14:32:29.110Z</LastModified>
          <ETag>"7ad452af1e2f61b33a865c4362be5921"</ETag>
          <Size>81578</Size>
          <Owner>
               <ID>b9d39144-a081-4762-b0e8-b8fb51e10192</ID>
               <DisplayName>lgreen</DisplayName>
          </Owner>
          <StorageClass>STANDARD</StorageClass>
     </Contents>
       .
       .
       .
     <CommonPrefixes>
          <Prefix>mktg/budget_proposals/</Prefix>
            .
            .
            .
     </CommonPrefixes>
</ListBucketResult>

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.