costs
Creates, updates, deletes, gets or lists a costs resource.
Overview
| Name | costs |
| Type | Resource |
| Id | azure.dev_test_labs.costs |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
createdDate | string (date-time) | The creation date of the cost. |
currencyCode | string | The currency code of the cost. |
endDateTime | string (date-time) | The end time of the cost data. |
labCostDetails | array | The lab cost details component of the cost data. |
labCostSummary | object | The lab cost summary component of the cost data. |
location | string | The location of the resource. |
provisioningState | string | The provisioning status of the resource. |
resourceCosts | array | The resource cost component of the cost data. |
startDateTime | string (date-time) | The start time of the cost data. |
tags | object | The tags of the resource. |
targetCost | object | The target cost properties. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, lab_name, name, subscription_id | $expand | Get cost. |
create_or_update | insert | resource_group_name, lab_name, name, subscription_id | Create or replace an existing cost. | |
create_or_update | replace | resource_group_name, lab_name, name, subscription_id | Create or replace an existing cost. |
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 |
|---|---|---|
lab_name | string | The name of the lab. Required. |
name | string | The name of the cost. Required. |
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
$expand | string | Specify the $expand query. Example: 'properties($expand=labCostDetails)'. Default value is None. |
SELECT examples
- get
Get cost.
SELECT
id,
name,
createdDate,
currencyCode,
endDateTime,
labCostDetails,
labCostSummary,
location,
provisioningState,
resourceCosts,
startDateTime,
tags,
targetCost,
type,
uniqueIdentifier
FROM azure.dev_test_labs.costs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
INSERT examples
- create_or_update
- Manifest
Create or replace an existing cost.
INSERT INTO azure.dev_test_labs.costs (
location,
tags,
properties,
resource_group_name,
lab_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: costs
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the costs resource.
- name: lab_name
value: "{{ lab_name }}"
description: Required parameter for the costs resource.
- name: name
value: "{{ name }}"
description: Required parameter for the costs resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the costs resource.
- name: location
value: "{{ location }}"
description: |
The location of the resource.
- name: tags
value: "{{ tags }}"
description: |
The tags of the resource.
- name: properties
value:
targetCost:
status: "{{ status }}"
target: {{ target }}
costThresholds:
- thresholdId: "{{ thresholdId }}"
percentageThreshold:
thresholdValue: {{ thresholdValue }}
displayOnChart: "{{ displayOnChart }}"
sendNotificationWhenExceeded: "{{ sendNotificationWhenExceeded }}"
notificationSent: "{{ notificationSent }}"
cycleStartDateTime: "{{ cycleStartDateTime }}"
cycleEndDateTime: "{{ cycleEndDateTime }}"
cycleType: "{{ cycleType }}"
currencyCode: "{{ currencyCode }}"
startDateTime: "{{ startDateTime }}"
endDateTime: "{{ endDateTime }}"
createdDate: "{{ createdDate }}"
REPLACE examples
- create_or_update
Create or replace an existing cost.
REPLACE azure.dev_test_labs.costs
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;