Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 145 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12570,6 +12570,20 @@ components:
BudgetAttributes:
description: The attributes of a budget.
properties:
costs:
$ref: "#/components/schemas/BudgetAttributesCosts"
description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested.
costs_period_end:
description: The end of the period used to compute cost data, in milliseconds since epoch.
format: int64
type: integer
costs_period_start:
description: The start of the period used to compute cost data, in milliseconds since epoch.
format: int64
type: integer
costs_unit:
$ref: "#/components/schemas/BudgetAttributesCostsUnit"
description: The unit used for all cost values in the response.
created_at:
description: The timestamp when the budget was created.
example: 1738258683590
Expand Down Expand Up @@ -12622,6 +12636,53 @@ components:
example: 00000000-0a0a-0a0a-aaa0-00000000000a
type: string
type: object
BudgetAttributesCosts:
description: Aggregated cost data for the budget over the requested period.
properties:
actual:
description: The total actual cost. Present only when `actual=true` is requested.
format: double
nullable: true
type: number
amount:
description: The total budgeted amount over the requested period.
format: double
nullable: true
type: number
forecast:
description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested.
format: double
nullable: true
type: number
ootb_forecast:
description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested.
format: double
nullable: true
type: number
type: object
BudgetAttributesCostsUnit:
description: The unit used for all cost values in the response.
properties:
family:
description: The unit family (for example, `currency`).
type: string
id:
description: The unique identifier for the unit.
type: string
name:
description: The full name of the unit.
type: string
plural:
description: The plural form of the unit name.
type: string
scale_factor:
description: The scale factor applied to raw cost values.
format: double
type: number
short_name:
description: The abbreviated unit name.
type: string
type: object
BudgetValidationRequest:
description: The request object for validating a budget configuration before creating or updating it.
example:
Expand Down Expand Up @@ -12787,6 +12848,9 @@ components:
description: The budgeted amount for this entry.
format: double
type: number
costs:
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts"
description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested.
month:
description: The month this budget entry applies to, in YYYYMM format.
format: int64
Expand All @@ -12797,6 +12861,36 @@ components:
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems"
type: array
type: object
BudgetWithEntriesDataAttributesEntriesItemsCosts:
description: Cost data for a single budget entry.
properties:
actual:
description: The actual cost for this entry. Present only when `actual=true` is requested.
format: double
nullable: true
type: number
amount:
description: The budgeted amount for this entry.
format: double
nullable: true
type: number
custom_forecast:
description: |-
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.
format: double
nullable: true
type: number
forecast:
description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested.
format: double
nullable: true
type: number
ootb_forecast:
description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested.
format: double
nullable: true
type: number
type: object
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems:
description: A tag filter used to scope a budget entry to specific resource tags.
properties:
Expand Down Expand Up @@ -116220,10 +116314,36 @@ paths:
tags:
- Cloud Cost Management
get:
description: Get a budget
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).
operationId: GetBudget
parameters:
- $ref: "#/components/parameters/BudgetID"
- description: When `true`, includes actual cost data in the response.
in: query
name: actual
required: false
schema:
type: boolean
- description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry.
in: query
name: forecast
required: false
schema:
type: boolean
- description: Start of the cost window in milliseconds since epoch. Must be used together with `end`.
in: query
name: start
required: false
schema:
format: int64
type: integer
- description: End of the cost window in milliseconds since epoch. Must be used together with `start`.
in: query
name: end
required: false
schema:
format: int64
type: integer
responses:
"200":
content:
Expand All @@ -116233,11 +116353,31 @@ paths:
value:
data:
attributes:
costs:
actual: 850.25
amount: 1000.0
forecast: 1100.5
ootb_forecast: 1100.5
costs_period_end: 1740873600000
costs_period_start: 1738281600000
costs_unit:
family: currency
id: "1"
name: dollar
plural: dollars
scale_factor: 1.0
short_name: $
created_at: 1738258683590
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
end_month: 202502
entries:
- amount: 500
costs:
actual: 425.5
amount: 500.0
custom_forecast:
forecast: 550.25
ootb_forecast: 550.25
month: 202501
tag_filters:
- tag_key: service
Expand All @@ -116254,6 +116394,10 @@ paths:
schema:
$ref: "#/components/schemas/BudgetWithEntries"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
Expand Down
17 changes: 17 additions & 0 deletions examples/v2/cloud-cost-management/UpsertBudget.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.BudgetAttributes;
import com.datadog.api.client.v2.model.BudgetAttributesCosts;
import com.datadog.api.client.v2.model.BudgetAttributesCostsUnit;
import com.datadog.api.client.v2.model.BudgetWithEntries;
import com.datadog.api.client.v2.model.BudgetWithEntriesData;
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItems;
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsCosts;
import com.datadog.api.client.v2.model.BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems;
import java.util.Collections;

Expand All @@ -21,12 +24,26 @@ public static void main(String[] args) {
new BudgetWithEntriesData()
.attributes(
new BudgetAttributes()
.costs(
new BudgetAttributesCosts()
.actual(null)
.amount(null)
.forecast(null)
.ootbForecast(null))
.costsUnit(new BudgetAttributesCostsUnit())
.createdAt(1738258683590L)
.createdBy("00000000-0a0a-0a0a-aaa0-00000000000a")
.endMonth(202502L)
.entries(
Collections.singletonList(
new BudgetWithEntriesDataAttributesEntriesItems()
.costs(
new BudgetWithEntriesDataAttributesEntriesItemsCosts()
.actual(null)
.amount(null)
.customForecast(null)
.forecast(null)
.ootbForecast(null))
.tagFilters(
Collections.singletonList(
new BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems()))))
Expand Down
Loading
Loading