usage_aggregates
Creates, updates, deletes, gets or lists a usage_aggregates resource.
Overview
| Name | usage_aggregates |
| Type | Resource |
| Id | azure_extras.commerce.usage_aggregates |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Unique Id for the usage aggregate. |
name | string | Name of the usage aggregate. |
infoFields | object | Key-value pairs of instance details (legacy format). |
instanceData | string | Key-value pairs of instance details represented as a string. |
meterCategory | string | Category of the consumed resource. |
meterId | string | Unique ID for the resource that was consumed (aka ResourceID). |
meterName | string | Friendly name of the resource being consumed. |
meterRegion | string | Region of the meterId used for billing purposes. |
meterSubCategory | string | Sub-category of the consumed resource. |
quantity | number | The amount of the resource consumption that occurred in this time frame. |
subscriptionId | string | The subscription identifier for the Azure user. |
type | string | Type of the resource being returned. |
unit | string | The unit in which the usage for this resource is being counted, e.g. Hours, GB. |
usageEndTime | string (date-time) | UTC end time for the usage bucket to which this usage aggregate belongs. |
usageStartTime | string (date-time) | UTC start time for the usage bucket to which this usage aggregate belongs. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | subscription_id, reportedStartTime, reportedEndTime | showDetails, aggregationGranularity, continuationToken | Query aggregated Azure subscription consumption data for a date range. .. seealso:: - https://docs.microsoft.com/rest/api/commerce/usageaggregates |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
reportedEndTime | string (date-time) | The end of the time range to retrieve data for. Required. |
reportedStartTime | string (date-time) | The start of the time range to retrieve data for. Required. |
subscription_id | string | |
aggregationGranularity | string | Daily (default) returns the data in daily granularity, Hourly returns the data in hourly granularity. Known values are: "Daily" and "Hourly". Default value is "Daily". |
continuationToken | string | Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. Default value is None. |
showDetails | boolean | True returns usage data in instance-level detail, false causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime). Default value is None. |
SELECT examples
- list
Query aggregated Azure subscription consumption data for a date range. .. seealso:: - https://docs.microsoft.com/rest/api/commerce/usageaggregates
SELECT
id,
name,
infoFields,
instanceData,
meterCategory,
meterId,
meterName,
meterRegion,
meterSubCategory,
quantity,
subscriptionId,
type,
unit,
usageEndTime,
usageStartTime
FROM azure_extras.commerce.usage_aggregates
WHERE subscription_id = '{{ subscription_id }}' -- required
AND reportedStartTime = '{{ reportedStartTime }}' -- required
AND reportedEndTime = '{{ reportedEndTime }}' -- required
AND showDetails = '{{ showDetails }}'
AND aggregationGranularity = '{{ aggregationGranularity }}'
AND continuationToken = '{{ continuationToken }}'
;