Skip to main content

vw_budgets

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

Overview

Namevw_budgets
TypeView
Iddatabricks_account.billing.vw_budgets

Fields

The following fields are returned by this view:

NameDatatypeDescription
account_idstringDatabricks account ID used to scope the query.
budget_configuration_idstringUnique identifier for the budget configuration.
display_namestringHuman-readable name of the budget.
create_timestringTimestamp when the budget was created (ISO 8601).
update_timestringTimestamp when the budget was last updated (ISO 8601).
filter_workspace_operatorstringComparison operator applied to the workspace ID filter (e.g. IN, NOT_IN).
filter_workspace_idsarrayList of workspace IDs used in the budget filter.
filter_tagsarrayTag-based filter criteria applied to this budget.
alert_configuration_idstringUnique identifier for the alert configuration (one row per alert).
quantity_thresholdstringThreshold value that triggers the alert.
quantity_typestringUnit of the threshold quantity (e.g. LIST_PRICE_DOLLARS).
time_periodstringTime window evaluated for budget alerting (e.g. MONTH).
trigger_typestringCondition that triggers the alert (e.g. CUMULATIVE_SPENDING_EXCEEDED).
action_configurationsarrayList of actions to execute when the alert fires.

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
account_idstringDatabricks 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

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 }}'