budgets
Operations on a budgets
resource.
Overview
Name | budgets |
Type | Resource |
Id | databricks_account.billing.budgets |
Fields
Name | Datatype |
---|---|
account_id | string |
alert_configurations | array |
budget_configuration_id | string |
create_time | integer |
display_name | string |
filter | object |
update_time | integer |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | account_id, budget_id | Gets a budget configuration for an account. Both account and budget configuration are specified by ID. |
list | SELECT | account_id | Gets all budgets associated with this account. |
create | INSERT | account_id | Create a new budget configuration for an account. For full details, see |
delete | DELETE | account_id, budget_id | Deletes a budget configuration for an account. Both account and budget configuration are specified by ID. This cannot be undone. |
update | REPLACE | account_id, budget_id | Updates a budget configuration for an account. Both account and budget configuration are specified by ID. |
SELECT
examples
- budgets (list)
- budgets (get)
SELECT
account_id,
alert_configurations,
budget_configuration_id,
create_time,
display_name,
filter,
update_time
FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}';
SELECT
account_id,
alert_configurations,
budget_configuration_id,
create_time,
display_name,
filter,
update_time
FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' AND
budget_id = '{{ budget_id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new budgets
resource.
- budgets
- Manifest
/*+ create */
INSERT INTO databricks_account.billing.budgets (
account_id,
data__budget
)
SELECT
'{{ account_id }}',
'{{ budget }}'
;
- name: your_resource_model_name
props:
- name: budget
value:
account_id: 449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65
alert_configurations:
- time_period: MONTH
trigger_type: CUMULATIVE_SPENDING_EXCEEDED
quantity_type: LIST_PRICE_DOLLARS_USD
quantity_threshold: string
action_configurations:
- action_type: EMAIL_NOTIFICATION
target: string
filter:
workspace_id:
operator: IN
values:
- 0
tags:
- key: string
value:
operator: IN
values:
- string
display_name: string
REPLACE
example
Replaces a budgets
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.billing.budgets
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
budget_id = '{{ budget_id }}';
DELETE
example
Deletes a budgets
resource.
/*+ delete */
DELETE FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' AND
budget_id = '{{ budget_id }}';