Example: Retrieving an ACL for an object

Here’s a sample HTTP GET request that retrieves the ACL for an object named Q1_2012.ppt in the quarterly_rpts directory.

Request with curl command line

curl -k -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d"
    "https://finance.europe.hcp.example.com/rest/quarterly_rpts/Q1_2012.ppt
    ?type=acl" > Q1_2012.ppt.acl.xml

Request in Python using PycURL

import pycurl
filehandle = open("Q1_2012.ppt.acl.xml", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP
  bXl1c2Vy:3f3c6784e97531774380db177774ac8d"])
curl.setopt(pycurl.URL, "https://finance.europe.hcp.example.com \
  /rest/quarterly_rpts/Q1_2012.ppt?type=acl")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.WRITEFUNCTION, filehandle.write)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()

 

Request headers

GET /rest/quarterly_rpts/Q1_2012.ppt?type=acl HTTP/1.1
Host: finance.europe.hcp.example.com
Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d

Response headers

HTTP/1.1 200 OK
X-HCP-Time: 1335016427
X-HCP-SoftwareVersion: 7.0.0.16
Content-Type: application/xml
Content-Length: 263
X-HCP-ServicedBySystem: hcp.example.com

Response body

<accessControlList>
    <grant>
         <grantee>
             <name>all_users</name>
             <type>group</type>
         </grantee>
         <permissions>
             <permission>READ</permission>
         </permissions>
    </grant>
</accessControlList>

Trademarks and Legal Disclaimer

© 2017 Hitachi Data Systems Corporation. All rights reserved.