vw_budget_alert_actions
Creates, updates, deletes, gets or lists a vw_budget_alert_actions resource.
Overview
| Name | vw_budget_alert_actions |
| Type | View |
| Id | databricks_account.billing.vw_budget_alert_actions |
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. |
alert_configuration_id | string | Unique identifier for the alert configuration this action belongs to. |
quantity_threshold | string | Threshold value that triggers the parent alert. |
action_configuration_id | string | Unique identifier for this action configuration (one row per action). |
action_type | string | Type of action to perform when the alert fires (e.g. EMAIL_NOTIFICATION). |
action_target | string | Target for the action, such as an email address or webhook URL. |
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,
alert_configuration_id,
quantity_threshold,
action_configuration_id,
action_type,
action_target
FROM databricks_account.billing.vw_budget_alert_actions
WHERE account_id = '{{ account_id }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
b.account_id,
b.budget_configuration_id,
b.display_name,
JSON_EXTRACT(ac.value, '$.alert_configuration_id') AS alert_configuration_id,
JSON_EXTRACT(ac.value, '$.quantity_threshold') AS quantity_threshold,
JSON_EXTRACT(act.value, '$.action_configuration_id') AS action_configuration_id,
JSON_EXTRACT(act.value, '$.action_type') AS action_type,
JSON_EXTRACT(act.value, '$.target') AS action_target
FROM databricks_account.billing.budgets b,
JSON_EACH(b.alert_configurations) ac,
JSON_EACH(JSON_EXTRACT(ac.value, '$.action_configurations')) act
WHERE account_id = '{{ account_id }}'
SELECT
b.account_id,
b.budget_configuration_id,
b.display_name,
ac.value->>'alert_configuration_id' AS alert_configuration_id,
ac.value->>'quantity_threshold' AS quantity_threshold,
act.value->>'action_configuration_id' AS action_configuration_id,
act.value->>'action_type' AS action_type,
act.value->>'target' AS action_target
FROM databricks_account.billing.budgets b,
jsonb_array_elements(b.alert_configurations::jsonb) AS ac,
jsonb_array_elements((ac.value->'action_configurations')::jsonb) AS act
WHERE account_id = '{{ account_id }}'