cost_details_reports
Creates, updates, deletes, gets or lists a cost_details_reports
resource.
Overview
Name | cost_details_reports |
Type | Resource |
Id | azure.cost_management.cost_details_reports |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The id of the long running operation. |
name | string | The name of the long running operation. |
error | object | The details of the error. |
manifest | object | The manifest of the report generated by the operation. |
status | string | The status of the cost details operation |
type | string | The type of the long running operation. |
validTill | string | The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_operation_results | SELECT | operationId, scope | Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header. |
create_operation | INSERT | scope | This API is the replacement for all previously release Usage Details APIs. Request to generate a cost details report for the provided date range, billing period (Only enterprise customers) or Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202 with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll to get the result of the report generation. The 'Retry-After' provides the duration to wait before polling for the generated report. A call to poll the report operation will provide a 202 response with a 'Location' header if the operation is still in progress. Once the report generation operation completes, the polling endpoint will provide a 200 response along with details on the report blob(s) that are available for download. The details on the file(s) available for download will be available in the polling response body. To Understand cost details (formerly known as usage details) fields found in files ,see https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/understand-usage-details-fields |
SELECT
examples
Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header.
SELECT
id,
name,
error,
manifest,
status,
type,
validTill
FROM azure.cost_management.cost_details_reports
WHERE operationId = '{{ operationId }}'
AND scope = '{{ scope }}';
INSERT
example
Use the following StackQL query and manifest file to create a new cost_details_reports
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.cost_management.cost_details_reports (
scope,
metric,
timePeriod,
billingPeriod,
invoiceId
)
SELECT
'{{ scope }}',
'{{ metric }}',
'{{ timePeriod }}',
'{{ billingPeriod }}',
'{{ invoiceId }}'
;
- name: your_resource_model_name
props:
- name: metric
value: string
- name: timePeriod
value:
- name: start
value: string
- name: end
value: string
- name: billingPeriod
value: string
- name: invoiceId
value: string