chargebackReport

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

The chargebackReport data type describes the chargebackReport resource for tenants and namespaces. You use this resource to generate chargeback reports for tenants and namespaces.

A chargeback report contains historical statistics about a tenant or namespace, broken out either by hour or by day. You can also generate chargeback reports that contain a single set of statistics for a given time period, such as a specific month.

Chargeback reports can serve as input to billing systems that need to determine charges for capacity and bandwidth usage at the tenant or namespace level. Because a chargeback report can cover a specified time period, you can create applications that generate these reports at regular intervals and feed those reports to your billing system.

Tip: After a tenant or namespace is deleted, you can no longer generate chargeback reports for it. Therefore, to ensure that you don’t lose usage statistics, you should take this fact into consideration when setting the regular interval at which to generate these reports.

Chargeback reports are also a good source of information for system analysis, enabling you to adjust storage and bandwidth allocations based on usage patterns.

Chargeback reports are available only for HCP tenants and namespaces. You cannot generate a chargeback report for the default tenant or namespace.

A chargeback report for a namespace contains statistics only for that namespace. A chargeback report for a tenant contains aggregated namespace statistics. For example, the number of read operations for a tenant during a given reporting interval is the total of the numbers of read operations that occurred in all the namespaces owned by that tenant during that reporting interval.

You can use a system-level user account to request a tenant chargeback report regardless of whether the tenant has granted system-level users administrative access to itself. To generate a namespace chargeback report using a system-level user account, system-level users must have administrative access to the owning tenant.

When generating a chargeback report, you use query parameters on the resource URL in the GET request to specify the reporting interval and the time period you want the report to cover. HCP keeps chargeback statistics for 180 days. As a result, chargeback reports cannot report statistics from more that 180 days in the past.

Note: If you upgraded HCP less than 180 days ago from a release that does not support chargeback reports, the earliest available statistics are from the time the upgrade was completed.

The response to a chargebackReport GET request can be formatted as XML, JSON, or CSV.

Query parameters

You use query parameters appended to the request URL to specify the time period and reporting interval for a chargeback report. These parameters are all optional. Default values are used for any you omit.

Parameter type Parameter name Accepted values Notes
Time period start=start-time

Use the ISO 8601 format

If you specify both a start time and an end time, the start time must be earlier than the end time.

  • With a reporting interval of hour or total, if you specify a start time that is not on an hour break, the first reporting interval in the report is the hour that includes the specified start time. For example, if you specify a start time of 9:45:00, the first reporting interval in the report starts at 9:00:00.
  • With a reporting interval of day, if you specify a start time that is not on a day break, the first reporting interval in the report is the day that includes the specified start time. For example, if you specify a start time of 9:45:00 on October 6th, the first reporting interval in the report starts at 00:00:00 on October 6th.
  • If you specify a start time that is earlier than the time of the earliest available chargeback statistics or if you omit the start parameter, the first reporting interval in the report is the interval that includes the earliest available statistics.
end=end-time

Use the ISO 8601 format

If you specify both a start time and an end time, the start time must be earlier than the end time.

  • With a reporting interval of hour or total, the last reporting interval in the report is the hour that includes the specified end time. For example, if you specify an end time of 9:00:00, the last reporting interval in the report ends at 9:59:59.
  • With a reporting interval of day, the last reporting interval in the report is the day that includes the specified end time. For example, if you specify an end time of 00:00:00 on October 6th, the last reporting interval in the report ends at 23:59:59 on October 6th.
  • If you specify an end time that is later than the current time or if you omit the end parameter, the last reporting interval in the report is the interval that includes the current time. The point-in-time statistics reported for this interval are the statistics at the current time. The dynamic statistics are the statistics accumulated so far for the interval.
Reporting interval granularity
hour
The reporting interval is one hour.
day
The reporting interval is one day.
total
The reporting interval is the time period defined by the start and end times for the report. In this case, the report contains a single set of chargeback statistics.

The default is total.

These values are not case sensitive.

The statistics reported for the current reporting interval, if included in the chargeback report, may not reflect some reads and writes that have already occurred during the current hour. After the hour is past, however, the statistics for that hour are complete.

Query parameter examples

To get hourly statistics for the entire day of February 18, 2017:

start=2017-02-18T00:00:00-0500&end=2017-02-18T23:59:59-0500
    &granularity=hour

To get daily statistics for the week starting February 19, 2017:

start=2017-02-19T00:00:00-0500&end=2017-02-25T23:59:59-0500
    &granularity=day

To get a single set of statistics for the entire month of February 2017:

start=2017-02-01T00:00:00-0500&end=2017-02-29T23:59:59-0500
    &granularity=total

To get hourly statistics for the current day from 8:00 a.m. up to the current time, where the current day is February 22, 2017:

start=2017-02-22T08:00:00-0500&granularity=hour

Properties

The table below describes the property included in the chargebackReport data type.

Property name Data type Description Notes
chargebackData

chargeback

Data

Specifies statistics that describe the usage of a given namespace or of all the namespaces owned by a given tenant. The response body includes one instance of this property for each reporting interval in the time period specified by the query parameters in the GET request for the chargebackReport resource.