budgets
Creates, updates, deletes, gets or lists a budgets
resource.
Overview
Name | budgets |
Type | Resource |
Id | azure.consumption.budgets |
Fields
- vw_budgets
- budgets
Name | Datatype | Description |
---|---|---|
id | text | Resource Id. |
name | text | Resource name. |
amount | text | field from the properties object |
budgetName | text | field from the properties object |
category | text | field from the properties object |
current_spend | text | field from the properties object |
e_tag | text | field from the properties object |
filter | text | field from the properties object |
forecast_spend | text | field from the properties object |
notifications | text | field from the properties object |
scope | text | field from the properties object |
time_grain | text | field from the properties object |
time_period | text | field from the properties object |
type | text | Resource type. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id. |
name | string | Resource name. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
properties | object | The properties of the budget. |
type | string | Resource type. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | budgetName, scope | Gets the budget for the scope by budget name. |
list | SELECT | scope | Lists all budgets for the defined scope. |
create_or_update | INSERT | budgetName, scope | The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. |
delete | DELETE | budgetName, scope | The operation to delete a budget. |
SELECT
examples
Lists all budgets for the defined scope.
- vw_budgets
- budgets
SELECT
id,
name,
amount,
budgetName,
category,
current_spend,
e_tag,
filter,
forecast_spend,
notifications,
scope,
time_grain,
time_period,
type
FROM azure.consumption.vw_budgets
WHERE scope = '{{ scope }}';
SELECT
id,
name,
eTag,
properties,
type
FROM azure.consumption.budgets
WHERE scope = '{{ scope }}';
INSERT
example
Use the following StackQL query and manifest file to create a new budgets
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.consumption.budgets (
budgetName,
scope,
eTag,
properties
)
SELECT
'{{ budgetName }}',
'{{ scope }}',
'{{ eTag }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: eTag
value: string
- name: properties
value:
- name: category
value: string
- name: amount
value: number
- name: timeGrain
value: string
- name: timePeriod
value:
- name: startDate
value: string
- name: endDate
value: string
- name: filter
value:
- name: and
value:
- - name: dimensions
value:
- name: name
value: string
- name: operator
value: string
- name: values
value:
- string
- name: currentSpend
value:
- name: amount
value: number
- name: unit
value: string
- name: notifications
value: object
- name: forecastSpend
value:
- name: amount
value: number
- name: unit
value: string
DELETE
example
Deletes the specified budgets
resource.
/*+ delete */
DELETE FROM azure.consumption.budgets
WHERE budgetName = '{{ budgetName }}'
AND scope = '{{ scope }}';