usage_details
Creates, updates, deletes, gets or lists a usage_details resource.
Overview
| Name | usage_details |
| Type | Resource |
| Id | azure.consumption.usage_details |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
etag | string | The etag for the resource. |
kind | string | Specifies the kind of usage details. Required. Known values are: "legacy" and "modern". |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | scope | $expand, $filter, $skiptoken, $top, metric | Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify customers once a date for retirement has been determined.For Learn more,see Generate Cost Details Report - Create Operation. |
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 |
|---|---|---|
scope | string | The fully qualified Azure Resource manager identifier of the resource. Required. |
$expand | string | May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, these fields are not included when listing usage details. Default value is None. |
$filter | string | May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. Default value is None. |
$skiptoken | string | Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. Default value is None. |
$top | integer | May be used to limit the number of results to the most recent N usageDetails. Default value is None. |
metric | string | Allows to select different type of cost/usage records. Known values are: "actualcost", "amortizedcost", and "usage". Default value is None. |
SELECT examples
- list
Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify customers once a date for retirement has been determined.For Learn more,see Generate Cost Details Report - Create Operation.
SELECT
id,
name,
etag,
kind,
systemData,
tags,
type
FROM azure.consumption.usage_details
WHERE scope = '{{ scope }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $skiptoken = '{{ $skiptoken }}'
AND $top = '{{ $top }}'
AND metric = '{{ metric }}'
;