Skip to content

Commit 803fc7b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 54c0c7c of spec repo (#3457)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 99d0325 commit 803fc7b

11 files changed

Lines changed: 702 additions & 7 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13185,6 +13185,20 @@ components:
1318513185
BudgetAttributes:
1318613186
description: The attributes of a budget.
1318713187
properties:
13188+
costs:
13189+
$ref: "#/components/schemas/BudgetAttributesCosts"
13190+
description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested.
13191+
costs_period_end:
13192+
description: The end of the period used to compute cost data, in milliseconds since epoch.
13193+
format: int64
13194+
type: integer
13195+
costs_period_start:
13196+
description: The start of the period used to compute cost data, in milliseconds since epoch.
13197+
format: int64
13198+
type: integer
13199+
costs_unit:
13200+
$ref: "#/components/schemas/BudgetAttributesCostsUnit"
13201+
description: The unit used for all cost values in the response.
1318813202
created_at:
1318913203
description: The timestamp when the budget was created.
1319013204
example: 1738258683590
@@ -13237,6 +13251,53 @@ components:
1323713251
example: 00000000-0a0a-0a0a-aaa0-00000000000a
1323813252
type: string
1323913253
type: object
13254+
BudgetAttributesCosts:
13255+
description: Aggregated cost data for the budget over the requested period.
13256+
properties:
13257+
actual:
13258+
description: The total actual cost. Present only when `actual=true` is requested.
13259+
format: double
13260+
nullable: true
13261+
type: number
13262+
amount:
13263+
description: The total budgeted amount over the requested period.
13264+
format: double
13265+
nullable: true
13266+
type: number
13267+
forecast:
13268+
description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested.
13269+
format: double
13270+
nullable: true
13271+
type: number
13272+
ootb_forecast:
13273+
description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested.
13274+
format: double
13275+
nullable: true
13276+
type: number
13277+
type: object
13278+
BudgetAttributesCostsUnit:
13279+
description: The unit used for all cost values in the response.
13280+
properties:
13281+
family:
13282+
description: The unit family (for example, `currency`).
13283+
type: string
13284+
id:
13285+
description: The unique identifier for the unit.
13286+
type: string
13287+
name:
13288+
description: The full name of the unit.
13289+
type: string
13290+
plural:
13291+
description: The plural form of the unit name.
13292+
type: string
13293+
scale_factor:
13294+
description: The scale factor applied to raw cost values.
13295+
format: double
13296+
type: number
13297+
short_name:
13298+
description: The abbreviated unit name.
13299+
type: string
13300+
type: object
1324013301
BudgetValidationRequest:
1324113302
description: The request object for validating a budget configuration before creating or updating it.
1324213303
example:
@@ -13402,6 +13463,9 @@ components:
1340213463
description: The budgeted amount for this entry.
1340313464
format: double
1340413465
type: number
13466+
costs:
13467+
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts"
13468+
description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested.
1340513469
month:
1340613470
description: The month this budget entry applies to, in YYYYMM format.
1340713471
format: int64
@@ -13412,6 +13476,36 @@ components:
1341213476
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems"
1341313477
type: array
1341413478
type: object
13479+
BudgetWithEntriesDataAttributesEntriesItemsCosts:
13480+
description: Cost data for a single budget entry.
13481+
properties:
13482+
actual:
13483+
description: The actual cost for this entry. Present only when `actual=true` is requested.
13484+
format: double
13485+
nullable: true
13486+
type: number
13487+
amount:
13488+
description: The budgeted amount for this entry.
13489+
format: double
13490+
nullable: true
13491+
type: number
13492+
custom_forecast:
13493+
description: |-
13494+
The custom forecast override for this entry. `null` when `forecast=true` is requested but no custom forecast has been set for this entry's month. A numeric value, including `0`, indicates an explicit custom forecast override. Omitted when `forecast=false` or the feature is not available for the organization.
13495+
format: double
13496+
nullable: true
13497+
type: number
13498+
forecast:
13499+
description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested.
13500+
format: double
13501+
nullable: true
13502+
type: number
13503+
ootb_forecast:
13504+
description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested.
13505+
format: double
13506+
nullable: true
13507+
type: number
13508+
type: object
1341513509
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems:
1341613510
description: A tag filter used to scope a budget entry to specific resource tags.
1341713511
properties:
@@ -124497,10 +124591,36 @@ paths:
124497124591
tags:
124498124592
- Cloud Cost Management
124499124593
get:
124500-
description: Get a budget
124594+
description: Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is).
124501124595
operationId: GetBudget
124502124596
parameters:
124503124597
- $ref: "#/components/parameters/BudgetID"
124598+
- description: When `true`, includes actual cost data in the response.
124599+
in: query
124600+
name: actual
124601+
required: false
124602+
schema:
124603+
type: boolean
124604+
- description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry.
124605+
in: query
124606+
name: forecast
124607+
required: false
124608+
schema:
124609+
type: boolean
124610+
- description: Start of the cost window in milliseconds since epoch. Must be used together with `end`.
124611+
in: query
124612+
name: start
124613+
required: false
124614+
schema:
124615+
format: int64
124616+
type: integer
124617+
- description: End of the cost window in milliseconds since epoch. Must be used together with `start`.
124618+
in: query
124619+
name: end
124620+
required: false
124621+
schema:
124622+
format: int64
124623+
type: integer
124504124624
responses:
124505124625
"200":
124506124626
content:
@@ -124510,11 +124630,31 @@ paths:
124510124630
value:
124511124631
data:
124512124632
attributes:
124633+
costs:
124634+
actual: 850.25
124635+
amount: 1000.0
124636+
forecast: 1100.5
124637+
ootb_forecast: 1100.5
124638+
costs_period_end: 1740873600000
124639+
costs_period_start: 1738281600000
124640+
costs_unit:
124641+
family: currency
124642+
id: "1"
124643+
name: dollar
124644+
plural: dollars
124645+
scale_factor: 1.0
124646+
short_name: $
124513124647
created_at: 1738258683590
124514124648
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
124515124649
end_month: 202502
124516124650
entries:
124517124651
- amount: 500
124652+
costs:
124653+
actual: 425.5
124654+
amount: 500.0
124655+
custom_forecast:
124656+
forecast: 550.25
124657+
ootb_forecast: 550.25
124518124658
month: 202501
124519124659
tag_filters:
124520124660
- tag_key: service
@@ -124531,6 +124671,10 @@ paths:
124531124671
schema:
124532124672
$ref: "#/components/schemas/BudgetWithEntries"
124533124673
description: OK
124674+
"400":
124675+
$ref: "#/components/responses/BadRequestResponse"
124676+
"404":
124677+
$ref: "#/components/responses/NotFoundResponse"
124534124678
"429":
124535124679
$ref: "#/components/responses/TooManyRequestsResponse"
124536124680
security:

examples/v2/cloud-cost-management/UpsertBudget.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@
66
body = DatadogAPIClient::V2::BudgetWithEntries.new({
77
data: DatadogAPIClient::V2::BudgetWithEntriesData.new({
88
attributes: DatadogAPIClient::V2::BudgetAttributes.new({
9+
costs: DatadogAPIClient::V2::BudgetAttributesCosts.new({
10+
actual: nil,
11+
amount: nil,
12+
forecast: nil,
13+
ootb_forecast: nil,
14+
}),
15+
costs_unit: DatadogAPIClient::V2::BudgetAttributesCostsUnit.new({}),
916
created_at: 1738258683590,
1017
created_by: "00000000-0a0a-0a0a-aaa0-00000000000a",
1118
end_month: 202502,
1219
entries: [
1320
DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems.new({
21+
costs: DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsCosts.new({
22+
actual: nil,
23+
amount: nil,
24+
custom_forecast: nil,
25+
forecast: nil,
26+
ootb_forecast: nil,
27+
}),
1428
tag_filters: [
1529
DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.new({}),
1630
],

features/scenarios_model_mapping.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,10 @@
27102710
},
27112711
"v2.GetBudget" => {
27122712
"budget_id" => "String",
2713+
"actual" => "Boolean",
2714+
"forecast" => "Boolean",
2715+
"start" => "Integer",
2716+
"_end" => "Integer",
27132717
},
27142718
"v2.DeleteCustomForecast" => {
27152719
"budget_id" => "String",

features/v2/cloud_cost_management.feature

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ Feature: Cloud Cost Management
9494
@generated @skip @team:DataDog/cloud-cost-management
9595
Scenario: Create or update a budget returns "Bad Request" response
9696
Given new "UpsertBudget" request
97-
And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
97+
And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
9898
When the request is sent
9999
Then the response status is 400 Bad Request
100100

101101
@generated @skip @team:DataDog/cloud-cost-management
102102
Scenario: Create or update a budget returns "Not Found" response
103103
Given new "UpsertBudget" request
104-
And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
104+
And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
105105
When the request is sent
106106
Then the response status is 404 Not Found
107107

108108
@generated @skip @team:DataDog/cloud-cost-management
109109
Scenario: Create or update a budget returns "OK" response
110110
Given new "UpsertBudget" request
111-
And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
111+
And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}}
112112
When the request is sent
113113
Then the response status is 200 OK
114114

@@ -384,6 +384,20 @@ Feature: Cloud Cost Management
384384
And the response "data.type" is equal to "ruleset"
385385
And the response "data.attributes.name" is equal to "EVP Cost Tags"
386386

387+
@generated @skip @team:DataDog/cloud-cost-management
388+
Scenario: Get budget returns "Bad Request" response
389+
Given new "GetBudget" request
390+
And request contains "budget_id" parameter from "REPLACE.ME"
391+
When the request is sent
392+
Then the response status is 400 Bad Request
393+
394+
@generated @skip @team:DataDog/cloud-cost-management
395+
Scenario: Get budget returns "Not Found" response
396+
Given new "GetBudget" request
397+
And request contains "budget_id" parameter from "REPLACE.ME"
398+
When the request is sent
399+
Then the response status is 404 Not Found
400+
387401
@generated @skip @team:DataDog/cloud-cost-management
388402
Scenario: Get budget returns "OK" response
389403
Given new "GetBudget" request

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,8 @@ def overrides
17821782
"v2.budget" => "Budget",
17831783
"v2.budget_array" => "BudgetArray",
17841784
"v2.budget_attributes" => "BudgetAttributes",
1785+
"v2.budget_attributes_costs" => "BudgetAttributesCosts",
1786+
"v2.budget_attributes_costs_unit" => "BudgetAttributesCostsUnit",
17851787
"v2.budget_validation_request" => "BudgetValidationRequest",
17861788
"v2.budget_validation_request_data" => "BudgetValidationRequestData",
17871789
"v2.budget_validation_response" => "BudgetValidationResponse",
@@ -1792,6 +1794,7 @@ def overrides
17921794
"v2.budget_with_entries_data" => "BudgetWithEntriesData",
17931795
"v2.budget_with_entries_data_attributes" => "BudgetWithEntriesDataAttributes",
17941796
"v2.budget_with_entries_data_attributes_entries_items" => "BudgetWithEntriesDataAttributesEntriesItems",
1797+
"v2.budget_with_entries_data_attributes_entries_items_costs" => "BudgetWithEntriesDataAttributesEntriesItemsCosts",
17951798
"v2.budget_with_entries_data_attributes_entries_items_tag_filters_items" => "BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems",
17961799
"v2.budget_with_entries_data_type" => "BudgetWithEntriesDataType",
17971800
"v2.bulk_delete_apps_datastore_items_request" => "BulkDeleteAppsDatastoreItemsRequest",

lib/datadog_api_client/v2/api/cloud_cost_management_api.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,10 +1038,14 @@ def get_budget(budget_id, opts = {})
10381038

10391039
# Get budget.
10401040
#
1041-
# Get a budget
1041+
# Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is).
10421042
#
10431043
# @param budget_id [String] Budget id.
10441044
# @param opts [Hash] the optional parameters
1045+
# @option opts [Boolean] :actual When `true`, includes actual cost data in the response.
1046+
# @option opts [Boolean] :forecast When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry.
1047+
# @option opts [Integer] :start Start of the cost window in milliseconds since epoch. Must be used together with `end`.
1048+
# @option opts [Integer] :_end End of the cost window in milliseconds since epoch. Must be used together with `start`.
10451049
# @return [Array<(BudgetWithEntries, Integer, Hash)>] BudgetWithEntries data, response status code and response headers
10461050
def get_budget_with_http_info(budget_id, opts = {})
10471051

@@ -1057,6 +1061,10 @@ def get_budget_with_http_info(budget_id, opts = {})
10571061

10581062
# query parameters
10591063
query_params = opts[:query_params] || {}
1064+
query_params[:'actual'] = opts[:'actual'] if !opts[:'actual'].nil?
1065+
query_params[:'forecast'] = opts[:'forecast'] if !opts[:'forecast'].nil?
1066+
query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
1067+
query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
10601068

10611069
# header parameters
10621070
header_params = opts[:header_params] || {}

0 commit comments

Comments
 (0)