budgets
Creates, updates, deletes, gets or lists a budgets resource.
Overview
| Name | budgets |
| Type | Resource |
| Id | databricks_account.billing.budgets |
Fields
The following fields are returned by SELECT queries:
- budgets_get
- budgets_list
| Name | Datatype | Description |
|---|---|---|
account_id | string | |
budget_configuration_id | string | Databricks budget configuration ID. |
display_name | string | Human-readable name of budget configuration. Max Length: 128 |
alert_configurations | array | Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. |
create_time | integer | Creation time of this budget configuration. |
filter | object | Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget. Leave empty to include all usage for this account. All provided filters must be matched for usage to be included. |
update_time | integer | Update time of this budget configuration. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | |
budget_configuration_id | string | Databricks budget configuration ID. |
display_name | string | Human-readable name of budget configuration. Max Length: 128 |
alert_configurations | array | Alerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration. |
create_time | integer | Creation time of this budget configuration. |
filter | object | Configured filters for this budget. These are applied to your account's usage to limit the scope of what is considered for this budget. Leave empty to include all usage for this account. All provided filters must be matched for usage to be included. |
update_time | integer | Update time of this budget configuration. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
budgets_get | select | account_id, budget_id | Gets a budget configuration for an account. Both account and budget configuration are specified by ID. | |
budgets_list | select | account_id | page_token | Gets all budgets associated with this account. |
budgets_create | insert | account_id, budget | Create a new budget configuration for an account. For full details, see | |
budgets_update | replace | account_id, budget_id, budget | Updates a budget configuration for an account. Both account and budget configuration are specified by | |
budgets_delete | delete | account_id, budget_id | Deletes a budget configuration for an account. Both account and budget configuration are specified by |
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 |
|---|---|---|
account_id | string | |
budget_id | string | The Databricks budget configuration ID. |
page_token | string | A page token received from a previous get all budget configurations call. This token can be used to retrieve the subsequent page. Requests first page if absent. |
SELECT examples
- budgets_get
- budgets_list
Gets a budget configuration for an account. Both account and budget configuration are specified by ID.
SELECT
account_id,
budget_configuration_id,
display_name,
alert_configurations,
create_time,
filter,
update_time
FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' -- required
AND budget_id = '{{ budget_id }}' -- required
;
Gets all budgets associated with this account.
SELECT
account_id,
budget_configuration_id,
display_name,
alert_configurations,
create_time,
filter,
update_time
FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' -- required
AND page_token = '{{ page_token }}'
;
INSERT examples
- budgets_create
- Manifest
Create a new budget configuration for an account. For full details, see
INSERT INTO databricks_account.billing.budgets (
budget,
account_id
)
SELECT
'{{ budget }}' /* required */,
'{{ account_id }}'
RETURNING
budget
;
# Description fields are for documentation purposes
- name: budgets
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the budgets resource.
- name: budget
description: |
Properties of the new budget configuration.
value:
account_id: "{{ account_id }}"
alert_configurations:
- action_configurations: "{{ action_configurations }}"
quantity_threshold: "{{ quantity_threshold }}"
quantity_type: "{{ quantity_type }}"
time_period: "{{ time_period }}"
trigger_type: "{{ trigger_type }}"
display_name: "{{ display_name }}"
filter:
tags:
- key: "{{ key }}"
value:
operator: "{{ operator }}"
values:
- "{{ values }}"
workspace_id:
operator: "{{ operator }}"
values:
- {{ values }}
REPLACE examples
- budgets_update
Updates a budget configuration for an account. Both account and budget configuration are specified by
REPLACE databricks_account.billing.budgets
SET
budget = '{{ budget }}'
WHERE
account_id = '{{ account_id }}' --required
AND budget_id = '{{ budget_id }}' --required
AND budget = '{{ budget }}' --required
RETURNING
budget;
DELETE examples
- budgets_delete
Deletes a budget configuration for an account. Both account and budget configuration are specified by
DELETE FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' --required
AND budget_id = '{{ budget_id }}' --required
;