Get Historical Usage Records
This API lets you get a sortable and paginated list of historical usage records for a specific time period, service identifier, and metric identifier within your organization. You need to specify a valid start and end date for your time range, with the start date always before the end date. The API has different limitations on the time range based on the aggregation period you select. For example, if you choose HOURLY aggregation, you can set a time range up to 30 days from the current date. If you prefer DAILY or MONTHLY aggregation, the time range must fall within the past 2 years from the current date.
Unique identifier (GUID) of the organization
Unique identifier of the service
Unique identifier of the metric
The name of the seller providing the usage. Default is multiple
Locale with language preference (e.g. en_US)
Beginning of the time range for which you want to retrieve usage records (yyyy-mm-dd)
The end of the time range for which you want to retrieve usage records (yyyy-mm-dd)
The frequency at which the usage records should be aggregated. Default is HOURLY
The type of aggregation to be performed on the usage records. Default is AVERAGE
Size of each page. Default = 20
The index of requested page (0-based). Default = 0
Sorting criteria for the paginated request in the format: "property(,asc|desc)". For multiple sort criteria: "sort=property1(,asc|desc)&sort=property2(,asc|desc)". Supported sorting properties are "usage_date_time, commit_quantity, usage_quantity, (overage_quantity for hourly usage)". Default is "usage_date_time,desc"
Unique identifier of the resource
Unique identifier of the project
OK
{
"metadata": {
"metric_id": "<metric ID for vRNI vCPUs Public Cloud>",
"service_definition_id": "<service definition ID for VMC-AWS>",
"display_name": "i3en US West 2",
"unit_of_measure_display_name": "Hosts",
"charge_attributes": {
"category": "HOST_USAGE"
}
},
"content": [
{
"usage_datetime": "2023-03-25T07:00:00.000Z",
"commitment": 3,
"usage": 4,
"overage": 1,
"resources": [
{
"resource_id": "res1",
"usage_quantity": 10
}
],
"projects": [
{
"project_id": "proj1",
"usage_quantity": 10,
"commit_quantity": 5
}
]
}
],
"empty": false,
"first": false,
"last": false,
"number": 0,
"number_of_elements": 0,
"pageable": {
"offset": 0,
"page_number": 0,
"page_size": 0,
"paged": false,
"sort": {
"empty": false,
"sorted": false,
"unsorted": false
},
"unpaged": false
},
"size": 0,
"sort": {
"empty": false,
"sorted": false,
"unsorted": false
},
"total_elements": 0,
"total_pages": 0
}
True if no elements in the system match given request
True if this is the first page of items
True if this is the last page of MetricUsage items
The number of HistoricalUsageRecord items in the response for given request after pagination operations. If number of items is less then size
, it will be equal to total_elements.
Max number of HistoricalUsageRecord items in the response (controlled by query parameter size
or system default)
The total number of HistoricalUsageRecord items in the system for given request.
Bad Request
{
"error_code": "string",
"error_message": "string",
"error_details": [
{
"error_code": "string",
"error_message": "string"
}
]
}
The code associated with the error
A description of the error that occurred
Additional error details for ValidationException errors
Unauthorized
Forbidden