HCP System Management Help
Here’s a sample GET request that generates a chargeback report for the tenant named Finance, which has two namespaces, Accounts-Payable and Accounts-Receivable. The report covers the one hour starting from 1:00 p.m. on March 26, 2014. The report is written in CSV format to a file named FinanceStats-2014-03-26-1300.txt. The request is made using a tenant-level user account that includes the administrator role.
Request with cURL command line
curl -k -i -H "Accept: text/csv"
-H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
"https://finance.hcp.example.com:9090/mapi/tenants/finance/
chargebackReport?start=2014-03-26T13:00:00-0400
&end=2014-03-26T13:59:59-0400&granularity=hour" >
> FinanceStats-2014-03-26-1300.txt
Request in Python using PycURL
import pycurl
filehandle = open("FinanceStats-2014-13-26-1300.txt", 'wb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Accept: text/csv",
"Authorization: HCP \
bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"])
curl.setopt(pycurl.URL,
"https://finance.hcp.example.com:9090/mapi/tenants/finance/" +
"chargebackReport?start=2014-03-26T13:00:00-0400" +
"&end=2014-03-26T13:59:59-0400&granularity=hour")
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 /mapi/tenants/finance/chargebackReport?start=2014-03-26T13:00:00-0400&end=2014-03-26T13:59:59-0400&granularity=hour HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6
Accept: text/csv
Response headers
HTTP/1.1 200 OK
Content-Type: text/csv
X-HCP-SoftwareVersion: 7.0.0.16
Content-Length: 565
Response body
systemName,tenantName,namespaceName,startTime,endTime,objectCount,
ingestedVolume,storageCapacityUsed,bytesIn,bytesOut,reads,writes,deletes,deleted,
valid
hcp.example.com,Finance,Accounts-Payable,2014-03-26T13:11:13-0400,
2014-03-26T13:59:59-0400,349,427316,885932,0,2531,2,0,0,false,false
hcp.example.com,Finance,Accounts-Receivable,2014-03-26T13:53:15-0400,
2014-03-26T13:59:59-0400,2575,34173401,73624501,26652,67241,3,1,0,false,true
hcp.example.com,Finance,,2014-03-26T13:08:10-0400,2014-03-26T13:59:59-0400,
2924,34600717,74510433,26652,69772,5,1,0,false,true
Trademarks and Legal Disclaimer
© 2017 Hitachi Vantara Corporation. All rights reserved.