Skip to content

Commit 74964e9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add budgeting endpoints (#2532)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 8e48eeb commit 74964e9

30 files changed

+1241
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-29 18:57:43.853175",
8-
"spec_repo_commit": "d1252b21"
7+
"regenerated": "2025-04-30 13:01:34.246044",
8+
"spec_repo_commit": "ca363d75"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-29 18:57:43.868755",
13-
"spec_repo_commit": "d1252b21"
12+
"regenerated": "2025-04-30 13:01:34.261200",
13+
"spec_repo_commit": "ca363d75"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ components:
186186
required: true
187187
schema:
188188
type: string
189+
BudgetID:
190+
description: Budget id.
191+
in: path
192+
name: budget_id
193+
required: true
194+
schema:
195+
type: string
189196
CaseIDPathParameter:
190197
description: Case's UUID or key
191198
example: f98a5a5b-e0ff-45d4-b2f5-afe6e74de504
@@ -4720,6 +4727,135 @@ components:
47204727
data:
47214728
$ref: '#/components/schemas/BillingDimensionsMappingBody'
47224729
type: object
4730+
Budget:
4731+
description: A budget.
4732+
properties:
4733+
attributes:
4734+
$ref: '#/components/schemas/BudgetAttributes'
4735+
id:
4736+
description: The id of the budget.
4737+
type: string
4738+
type:
4739+
description: The type of the object, must be `budget`.
4740+
type: string
4741+
type: object
4742+
BudgetArray:
4743+
description: An array of budgets.
4744+
example:
4745+
data:
4746+
- attributes:
4747+
created_at: 1741011342772
4748+
created_by: user1
4749+
end_month: 202502
4750+
metrics_query: aws.cost.amortized{service:ec2} by {service}
4751+
name: my budget
4752+
org_id: 123
4753+
start_month: 202501
4754+
total_amount: 1000
4755+
updated_at: 1741011342772
4756+
updated_by: user2
4757+
id: 00000000-0a0a-0a0a-aaa0-00000000000a
4758+
type: budget
4759+
properties:
4760+
data:
4761+
description: The `BudgetArray` `data`.
4762+
items:
4763+
$ref: '#/components/schemas/Budget'
4764+
type: array
4765+
type: object
4766+
BudgetAttributes:
4767+
description: The attributes of a budget.
4768+
properties:
4769+
created_at:
4770+
description: The timestamp when the budget was created.
4771+
example: 1738258683590
4772+
format: int64
4773+
type: integer
4774+
created_by:
4775+
description: The id of the user that created the budget.
4776+
example: 00000000-0a0a-0a0a-aaa0-00000000000a
4777+
type: string
4778+
end_month:
4779+
description: The month when the budget ends.
4780+
example: 202502
4781+
format: int64
4782+
type: integer
4783+
entries:
4784+
description: The entries of the budget.
4785+
items:
4786+
$ref: '#/components/schemas/BudgetEntry'
4787+
type: array
4788+
metrics_query:
4789+
description: The cost query used to track against the budget.
4790+
example: aws.cost.amortized{service:ec2} by {service}
4791+
type: string
4792+
name:
4793+
description: The name of the budget.
4794+
example: my budget
4795+
type: string
4796+
org_id:
4797+
description: The id of the org the budget belongs to.
4798+
example: 123
4799+
format: int64
4800+
type: integer
4801+
start_month:
4802+
description: The month when the budget starts.
4803+
example: 202501
4804+
format: int64
4805+
type: integer
4806+
total_amount:
4807+
description: The sum of all budget entries' amounts.
4808+
example: 1000
4809+
format: double
4810+
type: number
4811+
updated_at:
4812+
description: The timestamp when the budget was last updated.
4813+
example: 1738258683590
4814+
format: int64
4815+
type: integer
4816+
updated_by:
4817+
description: The id of the user that created the budget.
4818+
example: 00000000-0a0a-0a0a-aaa0-00000000000a
4819+
type: string
4820+
type: object
4821+
BudgetEntry:
4822+
description: The entry of a budget.
4823+
properties:
4824+
amount:
4825+
description: The `amount` of the budget entry.
4826+
example: 500
4827+
format: double
4828+
type: number
4829+
month:
4830+
description: The `month` of the budget entry.
4831+
example: 202501
4832+
format: int64
4833+
type: integer
4834+
tag_filters:
4835+
description: The `tag_filters` of the budget entry.
4836+
items:
4837+
$ref: '#/components/schemas/TagFilter'
4838+
type: array
4839+
type: object
4840+
BudgetWithEntries:
4841+
description: The definition of the `BudgetWithEntries` object.
4842+
properties:
4843+
data:
4844+
$ref: '#/components/schemas/BudgetWithEntriesData'
4845+
type: object
4846+
BudgetWithEntriesData:
4847+
description: A budget and all its entries.
4848+
properties:
4849+
attributes:
4850+
$ref: '#/components/schemas/BudgetAttributes'
4851+
id:
4852+
description: The `BudgetWithEntriesData` `id`.
4853+
example: 00000000-0a0a-0a0a-aaa0-00000000000a
4854+
type: string
4855+
type:
4856+
description: The type of the object, must be `budget`.
4857+
type: string
4858+
type: object
47234859
BulkMuteFindingsRequest:
47244860
description: The new bulk mute finding request.
47254861
properties:
@@ -36898,6 +37034,18 @@ components:
3689837034
format: double
3689937035
type: number
3690037036
type: object
37037+
TagFilter:
37038+
description: Tag filter for the budget's entries.
37039+
properties:
37040+
tag_key:
37041+
description: The key of the tag.
37042+
example: service
37043+
type: string
37044+
tag_value:
37045+
description: The value of the tag.
37046+
example: ec2
37047+
type: string
37048+
type: object
3690137049
TagsEventAttribute:
3690237050
description: Array of tags associated with your event.
3690337051
example:
@@ -43463,6 +43611,105 @@ paths:
4346343611
operator: OR
4346443612
permissions:
4346543613
- cloud_cost_management_write
43614+
/api/v2/cost/budget:
43615+
put:
43616+
description: Create a new budget or update an existing one.
43617+
operationId: UpsertBudget
43618+
requestBody:
43619+
content:
43620+
application/json:
43621+
schema:
43622+
$ref: '#/components/schemas/BudgetWithEntries'
43623+
required: true
43624+
responses:
43625+
'200':
43626+
content:
43627+
application/json:
43628+
schema:
43629+
$ref: '#/components/schemas/BudgetWithEntries'
43630+
description: OK
43631+
'400':
43632+
$ref: '#/components/responses/BadRequestResponse'
43633+
'404':
43634+
$ref: '#/components/responses/NotFoundResponse'
43635+
'429':
43636+
$ref: '#/components/responses/TooManyRequestsResponse'
43637+
security:
43638+
- apiKeyAuth: []
43639+
appKeyAuth: []
43640+
- AuthZ:
43641+
- cloud_cost_management_write
43642+
summary: Create or update a budget
43643+
tags:
43644+
- Cloud Cost Management
43645+
/api/v2/cost/budget/{budget_id}:
43646+
delete:
43647+
description: Delete a budget.
43648+
operationId: DeleteBudget
43649+
parameters:
43650+
- $ref: '#/components/parameters/BudgetID'
43651+
responses:
43652+
'204':
43653+
description: No Content
43654+
'400':
43655+
$ref: '#/components/responses/BadRequestResponse'
43656+
'429':
43657+
$ref: '#/components/responses/TooManyRequestsResponse'
43658+
security:
43659+
- apiKeyAuth: []
43660+
appKeyAuth: []
43661+
- AuthZ:
43662+
- cloud_cost_management_write
43663+
summary: Delete a budget
43664+
tags:
43665+
- Cloud Cost Management
43666+
get:
43667+
description: Get a budget.
43668+
operationId: GetBudget
43669+
parameters:
43670+
- $ref: '#/components/parameters/BudgetID'
43671+
responses:
43672+
'200':
43673+
content:
43674+
application/json:
43675+
schema:
43676+
$ref: '#/components/schemas/BudgetWithEntries'
43677+
description: OK
43678+
'400':
43679+
$ref: '#/components/responses/BadRequestResponse'
43680+
'404':
43681+
$ref: '#/components/responses/NotFoundResponse'
43682+
'429':
43683+
$ref: '#/components/responses/TooManyRequestsResponse'
43684+
security:
43685+
- apiKeyAuth: []
43686+
appKeyAuth: []
43687+
- AuthZ:
43688+
- cloud_cost_management_read
43689+
summary: Get a budget
43690+
tags:
43691+
- Cloud Cost Management
43692+
/api/v2/cost/budgets:
43693+
get:
43694+
description: List budgets.
43695+
operationId: ListBudgets
43696+
responses:
43697+
'200':
43698+
content:
43699+
application/json:
43700+
schema:
43701+
$ref: '#/components/schemas/BudgetArray'
43702+
description: OK
43703+
'429':
43704+
$ref: '#/components/responses/TooManyRequestsResponse'
43705+
security:
43706+
- apiKeyAuth: []
43707+
appKeyAuth: []
43708+
- AuthZ:
43709+
- cloud_cost_management_read
43710+
summary: List budgets
43711+
tags:
43712+
- Cloud Cost Management
4346643713
/api/v2/cost/custom_costs:
4346743714
get:
4346843715
description: List the Custom Costs files.

docs/datadog_api_client.v2.model.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,48 @@ datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_response module
17961796
:members:
17971797
:show-inheritance:
17981798

1799+
datadog\_api\_client.v2.model.budget module
1800+
-------------------------------------------
1801+
1802+
.. automodule:: datadog_api_client.v2.model.budget
1803+
:members:
1804+
:show-inheritance:
1805+
1806+
datadog\_api\_client.v2.model.budget\_array module
1807+
--------------------------------------------------
1808+
1809+
.. automodule:: datadog_api_client.v2.model.budget_array
1810+
:members:
1811+
:show-inheritance:
1812+
1813+
datadog\_api\_client.v2.model.budget\_attributes module
1814+
-------------------------------------------------------
1815+
1816+
.. automodule:: datadog_api_client.v2.model.budget_attributes
1817+
:members:
1818+
:show-inheritance:
1819+
1820+
datadog\_api\_client.v2.model.budget\_entry module
1821+
--------------------------------------------------
1822+
1823+
.. automodule:: datadog_api_client.v2.model.budget_entry
1824+
:members:
1825+
:show-inheritance:
1826+
1827+
datadog\_api\_client.v2.model.budget\_with\_entries module
1828+
----------------------------------------------------------
1829+
1830+
.. automodule:: datadog_api_client.v2.model.budget_with_entries
1831+
:members:
1832+
:show-inheritance:
1833+
1834+
datadog\_api\_client.v2.model.budget\_with\_entries\_data module
1835+
----------------------------------------------------------------
1836+
1837+
.. automodule:: datadog_api_client.v2.model.budget_with_entries_data
1838+
:members:
1839+
:show-inheritance:
1840+
17991841
datadog\_api\_client.v2.model.bulk\_mute\_findings\_request module
18001842
------------------------------------------------------------------
18011843

@@ -16020,6 +16062,13 @@ datadog\_api\_client.v2.model.step\_display\_bounds module
1602016062
:members:
1602116063
:show-inheritance:
1602216064

16065+
datadog\_api\_client.v2.model.tag\_filter module
16066+
------------------------------------------------
16067+
16068+
.. automodule:: datadog_api_client.v2.model.tag_filter
16069+
:members:
16070+
:show-inheritance:
16071+
1602316072
datadog\_api\_client.v2.model.tags\_event\_attribute module
1602416073
-----------------------------------------------------------
1602516074

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Delete a budget returns "No Content" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = CloudCostManagementApi(api_client)
11+
api_instance.delete_budget(
12+
budget_id="budget_id",
13+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Get a budget returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = CloudCostManagementApi(api_client)
11+
response = api_instance.get_budget(
12+
budget_id="budget_id",
13+
)
14+
15+
print(response)

0 commit comments

Comments
 (0)