Get system chargeback report

Content Platform for Cloud Scale Management API Reference

Version
2.5.x
Audience
anonymous
Part Number
MK-HCPCS007-08

The method chargeback/system/get_report lets a user with system-level permission generate a chargeback report on storage usage for any or all buckets defined in the system.

HTTP request syntax (URI)

POST https://host_ip:9099/mapi/v1/chargeback/system/get_report

Request structure

The request structure is:

{
  "userName": "name",
  "startDateTime": "yyyy-mm-ddThh.mm.ssZ",
  "endDateTime": "yyyy-mm-ddThh.mm.ssZ",
  "granularity": "granularity",
  "bucketList": ["string"],
  "header": true|false,
  "reportedFields": [
    "field"
  ]
}

Response structure

The response is a stream in comma-separated value (CSV) format.

Parameter

Required

Type

Description

userName No String Report bucket usage by the specified display name. Either a user name or a bucket list is required.
startDateTime No Date-Time The starting UTC date and time for the report, in the format yyyy-mm-ddThh.mm.ssZ. Truncated to the beginning of the specified hour.
endDateTime No Date-Time The ending UTC date and time for the report, in the format yyyy-mm-ddThh.mm.ssZ. Truncated to the beginning of the specified hour. The default is the current hour.
granularity No Enum The granularity of detail in the report:
  • HOURLY: Report hourly data
  • DAILY (default): Report daily data
  • MONTHLY: Report monthly data
bucketList No String A list of buckets to include in the report. Either a user name or a bucket list is required. The default is all buckets in the specified scope. Limited to the number of buckets allowed per user.
header No Boolean If true, include column headers as the first line of the response. If false, omit the column headers. The default is false.
reportedFields No String A comma-separated list of available fields to include in the report:
  • BUCKET_OWNER: bucket owner
  • BUCKET_NAME: bucket name
  • STORAGE_CLASS: storage class (STANDARD)
  • CAPACITY_IN_BYTE_HOURS: capacity in byte-hours
  • CAPACITY_IN_GB_MONTHS: capacity in gigabyte-months
  • TOTAL_OBJECTS: object count
  • WRITES: total writes
  • DELETES: total deletionss
  • WRITTEN_MB: bytes written
  • DELETED_MB: bytes deleted

The default is to return all fields.

Return codes

Status code

HTTP name

Description

200 OK The request was executed successfully.
401 Unauthorized Access was denied because credentials are not valid.
405 Method Not Allowed The specified HTTP method is not allowed for administrative data. Resend using POST.

Examples

The following example returns a daily report for all buckets owned by the user Jimmy for a specific date range in November 2020.

Request example:

POST https://10.10.24.195:9099/mapi/v1/chargeback/system/get_report

JSON request:

{
  "userName": "Jimmy",
  "startDateTime": "2020-11-02T00:00Z",
  "endDateTime": "2020-11-04T00:00Z",
  "granularity": "DAILY",
  "header": true
}

Response:

Bucket Capacity Report for user: Jimmy@example.org; Requested by: admin; Reporting period: 2020-11-02T00:00Z - 2020-11-04T00:00Z; Granularity: daily; System name: hcpcs.company.com
YYYY-MM-DD,Bucket Owner,Bucket Name,Storage Class,Byte-Hour,GB-Month,Total Objects,Writes,Deletes,Written MB,Deleted MB
2020-11-02,Jimmy@example.org,bucket2,Standard,202970940,0,4,28,0,193,0
2020-11-02,Jimmy@example.org,bucket1,Standard,103229940,0,-11916,11927,11917,86,11
2020-11-03,Jimmy@example.org,bucket1,Standard,112383590,0,72,74,0,32,0
2020-11-04,Jimmy@example.org,bucket1,Standard,229915961,0,21,1121,0,3,0