budgets
Creates, updates, deletes, gets or lists a budgets resource.
Overview
| Name | budgets | 
| Type | Resource | 
| Id | datadog.cloud_costs.budgets | 
Fields
The following fields are returned by SELECT queries:
- get_budget
- list_budgets
| Name | Datatype | Description | 
|---|---|---|
| id | string | The BudgetWithEntriesDataid. (example: 00000000-0a0a-0a0a-aaa0-00000000000a) | 
| attributes | object | The attributes of a budget. | 
| type | string | The type of the object, must be budget. | 
| Name | Datatype | Description | 
|---|---|---|
| id | string | The id of the budget. | 
| attributes | object | The attributes of a budget. | 
| type | string | The type of the object, must be budget. | 
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description | 
|---|---|---|---|---|
| get_budget | select | budget_id,region | Get a budget. | |
| list_budgets | select | region | List budgets. | |
| upsert_budget | replace | region | Create a new budget or update an existing one. | |
| delete_budget | delete | budget_id,region | Delete a budget. | 
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.
| Name | Datatype | Description | 
|---|---|---|
| budget_id | string | Budget id. | 
| region | string | (default: datadoghq.com) | 
SELECT examples
- get_budget
- list_budgets
Get a budget.
SELECT
id,
attributes,
type
FROM datadog.cloud_costs.budgets
WHERE budget_id = '{{ budget_id }}' -- required
AND region = '{{ region }}' -- required
;
List budgets.
SELECT
id,
attributes,
type
FROM datadog.cloud_costs.budgets
WHERE region = '{{ region }}' -- required
;
REPLACE examples
- upsert_budget
Create a new budget or update an existing one.
REPLACE datadog.cloud_costs.budgets
SET 
data__data = '{{ data }}'
WHERE 
region = '{{ region }}' --required
RETURNING
data;
DELETE examples
- delete_budget
Delete a budget.
DELETE FROM datadog.cloud_costs.budgets
WHERE budget_id = '{{ budget_id }}' --required
AND region = '{{ region }}' --required
;