HCP System Management Help


Example: Listing annotations for an object

Here’s a sample HTTP GET request that lists the annotations 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=custom-metadata-info

Request in Python using PycURL

import pycurl
filehandle = open("Q1_2012.ppt.custom-metadata.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=custom-metadata-info")
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=custom-metadata-info HTTP/1.1
Host: finance.europe.hcp.example.com
Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d

Response headers

HTTP/1.1 200 OK
X-HCP-ServicedBySystem: hcp.example.com
X-HCP-Time: 1352389820
X-HCP-SoftwareVersion: 7.0.0.16
Content-Type: text/xml
Content-Length: 822

Response body

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<annotations>
     <annotation>
         <name>report_data</name>
         <hash>SHA-256 F8C7D88D139D14D115BA5300CD352338B8A1D344...</hash>
         <changeTimeMilliseconds>1352322387000.00</changeTimeMilliseconds>
         <changeTimeString>2012-11-07T16:06:27-0500</changeTimeString>
         <size>35643</size>
         <contentType>text/xml</contentType>
     </annotation>
     <annotation>
         <name>default</name>
         <hash>SHA-256 F8C7D88D139D14D115BA5300CD352338B8A1D344...</hash>
         <changeTimeMilliseconds>1352386457000.00</changeTimeMilliseconds>
         <changeTimeString>2012-11-08T09:54:17-0500</changeTimeString>
         <size>908</size>
         <contentType>tex/xml</contentType>
     </annotation>
</annotations>

© 2017 Hitachi Vantara Corporation. All rights reserved.