Skip to main content

costs

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

Overview

Namecosts
TypeResource
Idazure.dev_test_labs.costs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
locationstringThe location of the resource.
propertiesobjectThe properties of the resource.
tagsobjectThe tags of the resource.
typestringThe type of the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, labName, name$expand, api-versionGet cost.
create_or_updateinsertsubscriptionId, resourceGroupName, labName, name, data__propertiesapi-versionCreate 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.

NameDatatypeDescription
labNamestringThe name of the lab.
namestringThe name of the cost.
resourceGroupNamestringThe name of the resource group.
subscriptionIdstringThe subscription ID.
$expandstringSpecify the $expand query. Example: 'properties($expand=labCostDetails)'
api-versionstringClient API version.

SELECT examples

Get cost.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.costs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND labName = '{{ labName }}' -- required
AND name = '{{ name }}' -- required
AND $expand = '{{ $expand }}'
AND api-version = '{{ api-version }}'
;

INSERT examples

Create or replace an existing cost.

INSERT INTO azure.dev_test_labs.costs (
data__location,
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
labName,
name,
api-version
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}' /* required */,
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ labName }}',
'{{ name }}',
'{{ api-version }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;