Skip to main content

costs

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

Overview

Namecosts
TypeResource
Idazure.dev_test_labs.costs

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
created_datetextfield from the properties object
currency_codetextfield from the properties object
end_date_timetextfield from the properties object
labNametextfield from the properties object
lab_cost_detailstextfield from the properties object
lab_cost_summarytextfield from the properties object
locationtextThe location of the resource.
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
resource_coststextfield from the properties object
start_date_timetextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
target_costtextfield from the properties object
typetextThe type of the resource.
unique_identifiertextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, resourceGroupName, subscriptionIdGet cost.
create_or_updateINSERTlabName, name, resourceGroupName, subscriptionId, data__propertiesCreate or replace an existing cost.

SELECT examples

Get cost.

SELECT
id,
name,
created_date,
currency_code,
end_date_time,
labName,
lab_cost_details,
lab_cost_summary,
location,
provisioning_state,
resourceGroupName,
resource_costs,
start_date_time,
subscriptionId,
tags,
target_cost,
type,
unique_identifier
FROM azure.dev_test_labs.vw_costs
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new costs resource.

/*+ create */
INSERT INTO azure.dev_test_labs.costs (
labName,
name,
resourceGroupName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;