Skip to main content

budget_spend_statuses

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

Overview​

Namebudget_spend_statuses
TypeResource
Iddatabricks_account.billing.budget_spend_statuses

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe resource name of this budget spend status, of the form ``accounts/{account_id}/budget-spend-statuses/{budget_id}``.
â–¶alert_spend_statusesarrayThe calling user's spend against each blocking threshold on this budget, one entry per scope type and time period. A blocking threshold is a threshold that, once reached, blocks further requests through Unity Gateway.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, budget_id, account_hostGet the calling user's live spend against the blocking thresholds of a single Unity Gateway budget.
listselectaccount_id, account_hostfilter, page_size, page_tokenList the calling user's live spend against the blocking thresholds across the account's Unity Gateway

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.

NameDatatypeDescription
account_hoststringThe Databricks account console host. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws), or set explicitly with DATABRICKS_ACCOUNT_HOST (bare host, no scheme). (default: accounts.cloud.databricks.com, x-stackQL-envVar: DATABRICKS_ACCOUNT_HOST, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"accounts.cloud.databricks.com","azure":"accounts.azuredatabricks.net","gcp":"accounts.gcp.databricks.com"}})
account_idstringThe account_id segment of the parent resource name (accounts/{account_id}). The parent account whose budget spend statuses to list, of the form accounts/{account_id}.
budget_idstringThe budget_id segment of the name resource name (accounts/{account_id}/budget-spend-statuses/{budget_id}). The resource name of the budget spend status to read, of the form accounts/{account_id}/budget-spend-statuses/{budget_id}. A budget_id that isn't a valid UUID fails with INVALID_PARAMETER_VALUE.
filterstringA filter expression that narrows the returned budgets by workspace. Only workspace_id is supported, in lower case with numeric workspace IDs, for example workspace_id = 123 or workspace_id IN (123, 456). Matches budgets that apply to any of the listed workspaces, including budgets that apply to all workspaces. Any other expression, such as an empty IN () list, fails with INVALID_PARAMETER_VALUE. If empty, returns every budget in the account that has a blocking threshold.
page_sizeintegerThe maximum number of spend statuses to return per page. If unspecified or 0, at most 100 are returned. The maximum value is 100; values above 100 are coerced to 100. Negative values fail with INVALID_PARAMETER_VALUE. The server may return fewer results than requested, including zero, even when more pages remain; page until next_page_token is absent.
page_tokenstringA page token from a previous ListBudgetSpendStatuses response, used to fetch the next page. Requests the first page if absent. All other request parameters except page_size must match the request that returned the token; otherwise the request fails with INVALID_PARAMETER_VALUE.

SELECT examples​

Get the calling user's live spend against the blocking thresholds of a single Unity Gateway budget.

SELECT
name,
alert_spend_statuses
FROM databricks_account.billing.budget_spend_statuses
WHERE account_id = '{{ account_id }}' -- required
AND budget_id = '{{ budget_id }}' -- required
AND account_host = '{{ account_host }}' -- required
;