Skip to main content

budgets

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

Overview

Namebudgets
TypeResource
Iddatabricks_account.billing.budgets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstring
budget_configuration_idstringDatabricks budget configuration ID.
display_namestringHuman-readable name of budget configuration. Max Length: 128
alert_configurationsarrayAlerts to configure when this budget is in a triggered state. Budgets must have exactly one alert configuration.
create_timeintegerCreation time of this budget configuration.
filterobjectConfigured 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_timeintegerUpdate time of this budget configuration.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
budgets_getselectaccount_id, budget_idGets a budget configuration for an account. Both account and budget configuration are specified by ID.
budgets_listselectaccount_idpage_tokenGets all budgets associated with this account.
budgets_createinsertaccount_id, budgetCreate a new budget configuration for an account. For full details, see
budgets_updatereplaceaccount_id, budget_id, budgetUpdates a budget configuration for an account. Both account and budget configuration are specified by
budgets_deletedeleteaccount_id, budget_idDeletes 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.

NameDatatypeDescription
account_idstring
budget_idstringThe Databricks budget configuration ID.
page_tokenstringA 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

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
;

INSERT examples

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
;

REPLACE examples

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

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
;