Skip to main content

budgets

Operations on a budgets resource.

Overview

Namebudgets
TypeResource
Iddatabricks_account.billing.budgets

Fields

NameDatatype
account_idstring
alert_configurationsarray
budget_configuration_idstring
create_timeinteger
display_namestring
filterobject
update_timeinteger

Methods

NameAccessible byRequired ParamsDescription
getSELECTaccount_id, budget_idGets a budget configuration for an account. Both account and budget configuration are specified by ID.
listSELECTaccount_idGets all budgets associated with this account.
createINSERTaccount_idCreate a new budget configuration for an account. For full details, see
deleteDELETEaccount_id, budget_idDeletes a budget configuration for an account. Both account and budget configuration are specified by ID. This cannot be undone.
updateREPLACEaccount_id, budget_idUpdates a budget configuration for an account. Both account and budget configuration are specified by ID.

SELECT examples

SELECT
account_id,
alert_configurations,
budget_configuration_id,
create_time,
display_name,
filter,
update_time
FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new budgets resource.

/*+ create */
INSERT INTO databricks_account.billing.budgets (
account_id,
data__budget
)
SELECT
'{{ account_id }}',
'{{ budget }}'
;

REPLACE example

Replaces a budgets resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
REPLACE databricks_account.billing.budgets
SET field1 = '{ value1 }',
field2 = '{ value2 }', ...
WHERE account_id = '{{ account_id }}' AND
budget_id = '{{ budget_id }}';

DELETE example

Deletes a budgets resource.

/*+ delete */
DELETE FROM databricks_account.billing.budgets
WHERE account_id = '{{ account_id }}' AND
budget_id = '{{ budget_id }}';