Skip to main content

usage_aggregates

Creates, updates, deletes, gets or lists a usage_aggregates resource.

Overview

Nameusage_aggregates
TypeResource
Idazure_extras.commerce.usage_aggregates

Fields

The following fields are returned by SELECT queries:

Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters.

NameDatatypeDescription
idstringUnique Id for the usage aggregate.
namestringName of the usage aggregate.
propertiesobjectUsage data.
typestringType of the resource being returned.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectreportedStartTime, reportedEndTime, subscriptionIdshowDetails, aggregationGranularity, continuationTokenQuery aggregated Azure subscription consumption data for a date range.

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.

NameDatatypeDescription
reportedEndTimestring (date-time)The end of the time range to retrieve data for.
reportedStartTimestring (date-time)The start of the time range to retrieve data for.
subscriptionIdstringIt uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
aggregationGranularitystringDaily (default) returns the data in daily granularity, Hourly returns the data in hourly granularity.
continuationTokenstringUsed 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.
showDetailsbooleanTrue 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).

SELECT examples

Query aggregated Azure subscription consumption data for a date range.

SELECT
id,
name,
properties,
type
FROM azure_extras.commerce.usage_aggregates
WHERE reportedStartTime = '{{ reportedStartTime }}' -- required
AND reportedEndTime = '{{ reportedEndTime }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND showDetails = '{{ showDetails }}'
AND aggregationGranularity = '{{ aggregationGranularity }}'
AND continuationToken = '{{ continuationToken }}'
;