vw_budgets
Creates, updates, deletes, gets or lists a vw_budgets resource.
Overview
| Name | vw_budgets |
| Type | View |
| Id | databricks_account.billing.vw_budgets |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID used to scope the query. |
budget_configuration_id | string | Unique identifier for the budget configuration. |
display_name | string | Human-readable name of the budget. |
create_time | string | Timestamp when the budget was created (ISO 8601). |
update_time | string | Timestamp when the budget was last updated (ISO 8601). |
filter_workspace_operator | string | Comparison operator applied to the workspace ID filter (e.g. IN, NOT_IN). |
filter_workspace_ids | array | List of workspace IDs used in the budget filter. |
filter_tags | array | Tag-based filter criteria applied to this budget. |
alert_configuration_id | string | Unique identifier for the alert configuration (one row per alert). |
quantity_threshold | string | Threshold value that triggers the alert. |
quantity_type | string | Unit of the threshold quantity (e.g. LIST_PRICE_DOLLARS). |
time_period | string | Time window evaluated for budget alerting (e.g. MONTH). |
trigger_type | string | Condition that triggers the alert (e.g. CUMULATIVE_SPENDING_EXCEEDED). |
action_configurations | array | List of actions to execute when the alert fires. |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
account_id | string | Databricks account ID used to scope the query. |
SELECT Examples
SELECT
account_id,
budget_configuration_id,
display_name,
create_time,
update_time,
filter_workspace_operator,
filter_workspace_ids,
filter_tags,
alert_configuration_id,
quantity_threshold,
quantity_type,
time_period,
trigger_type,
action_configurations
FROM databricks_account.billing.vw_budgets
WHERE account_id = '{{ account_id }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
b.account_id,
b.budget_configuration_id,
b.display_name,
b.create_time,
b.update_time,
JSON_EXTRACT(b.filter, '$.workspace_id.operator') AS filter_workspace_operator,
JSON_EXTRACT(b.filter, '$.workspace_id.values') AS filter_workspace_ids,
JSON_EXTRACT(b.filter, '$.tags') AS filter_tags,
JSON_EXTRACT(ac.value, '$.alert_configuration_id') AS alert_configuration_id,
JSON_EXTRACT(ac.value, '$.quantity_threshold') AS quantity_threshold,
JSON_EXTRACT(ac.value, '$.quantity_type') AS quantity_type,
JSON_EXTRACT(ac.value, '$.time_period') AS time_period,
JSON_EXTRACT(ac.value, '$.trigger_type') AS trigger_type,
JSON_EXTRACT(ac.value, '$.action_configurations') AS action_configurations
FROM databricks_account.billing.budgets b,
JSON_EACH(b.alert_configurations) ac
WHERE account_id = '{{ account_id }}'
SELECT
b.account_id,
b.budget_configuration_id,
b.display_name,
b.create_time,
b.update_time,
b.filter->'workspace_id'->>'operator' AS filter_workspace_operator,
b.filter->'workspace_id'->'values' AS filter_workspace_ids,
b.filter->'tags' AS filter_tags,
ac.value->>'alert_configuration_id' AS alert_configuration_id,
ac.value->>'quantity_threshold' AS quantity_threshold,
ac.value->>'quantity_type' AS quantity_type,
ac.value->>'time_period' AS time_period,
ac.value->>'trigger_type' AS trigger_type,
ac.value->'action_configurations' AS action_configurations
FROM databricks_account.billing.budgets b,
jsonb_array_elements(b.alert_configurations::jsonb) AS ac
WHERE account_id = '{{ account_id }}'