I’m trying to put together a script that will pull chargeback reports from HCP using MAPI/REST API in automated way.
HCP GUI allows me to pull chargeback report for the whole HCP, but MAPI documentation shows how to pull chargeback reports for individual tenants or namespaces only. One of the examples provided in documentation is using /mapi/tenants/tenantname REST entry-point
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
Is there a way of generating chargeback report for the whole HCP using MAPI and if it is, what would be MAPI URL entry point?
Thank you!
I checked how HCP GUI is doing it and I found a way to pull system-level chargeback report, if anyone is interested see below:
curl -k -i -H "Accept: text/csv"
-H "Authorization: HCP bGdyZWVu:a3b9c163f6c520407ff34cfdb83ca5c6"
"https://admin.hcp.example.com:8000/cluster/chargeBack_download.action"
--data "granularity=TOTAL&startDate=01"%"2F22"%"2F2018&endDate=01"%"2F22"%"2F2018"