Skip to content

Commit 809dcf9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 5ab0fd6 of spec repo (#4074)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b21a64f commit 809dcf9

12 files changed

Lines changed: 591 additions & 116 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70492,6 +70492,8 @@ components:
7049270492
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit"
7049370493
maxItems: 100
7049470494
type: array
70495+
tracking_mode:
70496+
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode"
7049570497
type:
7049670498
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType"
7049770499
value_limit:
@@ -70506,6 +70508,7 @@ components:
7050670508
- type
7050770509
- include
7050870510
- limit_exceeded_action
70511+
- tracking_mode
7050970512
- value_limit
7051070513
- enabled
7051170514
type: object
@@ -70520,6 +70523,16 @@ components:
7052070523
x-enum-varnames:
7052170524
- DROP_TAG
7052270525
- DROP_EVENT
70526+
ObservabilityPipelineTagCardinalityLimitProcessorOverrideType:
70527+
description: How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking.
70528+
enum:
70529+
- limit_override
70530+
- excluded
70531+
example: limit_override
70532+
type: string
70533+
x-enum-varnames:
70534+
- LIMIT_OVERRIDE
70535+
- EXCLUDED
7052370536
ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit:
7052470537
description: A cardinality override applied to a specific metric.
7052570538
properties:
@@ -70529,65 +70542,63 @@ components:
7052970542
description: The name of the metric this override applies to.
7053070543
example: "system.cpu.user"
7053170544
type: string
70532-
mode:
70533-
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode"
70545+
override_type:
70546+
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"
7053470547
per_tag_limits:
70535-
description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`.
70548+
description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`.
7053670549
items:
7053770550
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit"
7053870551
maxItems: 50
7053970552
type: array
7054070553
value_limit:
70541-
description: The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`.
70554+
description: The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`.
7054270555
example: 10000
7054370556
format: int64
7054470557
maximum: 1000000
7054570558
minimum: 0
7054670559
type: integer
7054770560
required:
7054870561
- metric_name
70549-
- mode
70562+
- override_type
7055070563
type: object
70551-
ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode:
70552-
description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely.
70553-
enum:
70554-
- tracked
70555-
- excluded
70556-
example: tracked
70557-
type: string
70558-
x-enum-varnames:
70559-
- TRACKED
70560-
- EXCLUDED
7056170564
ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit:
7056270565
description: A cardinality override for a specific tag key within a per-metric limit.
7056370566
properties:
70564-
mode:
70565-
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode"
70567+
override_type:
70568+
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"
7056670569
tag_key:
7056770570
description: The tag key this override applies to.
7056870571
example: "host"
7056970572
type: string
7057070573
value_limit:
70571-
description: The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`.
70574+
description: The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`.
7057270575
example: 5000
7057370576
format: int64
7057470577
maximum: 1000000
7057570578
minimum: 0
7057670579
type: integer
7057770580
required:
7057870581
- tag_key
70582+
- override_type
70583+
type: object
70584+
ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode:
70585+
description: Controls whether the processor uses exact or probabilistic tag tracking.
70586+
properties:
70587+
mode:
70588+
$ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode"
70589+
required:
7057970590
- mode
7058070591
type: object
70581-
ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode:
70582-
description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking.
70592+
ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode:
70593+
description: The cardinality tracking algorithm to use.
7058370594
enum:
70584-
- limit_override
70585-
- excluded
70586-
example: limit_override
70595+
- exact_fingerprint
70596+
- probabilistic
70597+
example: exact_fingerprint
7058770598
type: string
7058870599
x-enum-varnames:
70589-
- LIMIT_OVERRIDE
70590-
- EXCLUDED
70600+
- EXACT_FINGERPRINT
70601+
- PROBABILISTIC
7059170602
ObservabilityPipelineTagCardinalityLimitProcessorType:
7059270603
default: tag_cardinality_limit
7059370604
description: The processor type. The value must be `tag_cardinality_limit`.
@@ -127284,6 +127295,56 @@ paths:
127284127295
x-unstable: |-
127285127296
**Note**: This endpoint is in preview and is subject to change.
127286127297
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
127298+
get:
127299+
description: Get the custom forecast for a budget.
127300+
operationId: GetCustomForecast
127301+
parameters:
127302+
- $ref: "#/components/parameters/BudgetID"
127303+
responses:
127304+
"200":
127305+
content:
127306+
application/json:
127307+
examples:
127308+
default:
127309+
value:
127310+
data:
127311+
attributes:
127312+
budget_uid: 00000000-0000-0000-0000-000000000001
127313+
created_at: 1738258683590
127314+
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
127315+
entries:
127316+
- amount: 400
127317+
month: 202501
127318+
tag_filters:
127319+
- tag_key: service
127320+
tag_value: ec2
127321+
- amount: 450
127322+
month: 202502
127323+
tag_filters:
127324+
- tag_key: service
127325+
tag_value: ec2
127326+
updated_at: 1738258683590
127327+
updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a
127328+
id: 11111111-1111-1111-1111-111111111111
127329+
type: custom_forecast
127330+
schema:
127331+
$ref: "#/components/schemas/CustomForecastResponse"
127332+
description: OK
127333+
"400":
127334+
$ref: "#/components/responses/BadRequestResponse"
127335+
"404":
127336+
$ref: "#/components/responses/NotFoundResponse"
127337+
"429":
127338+
$ref: "#/components/responses/TooManyRequestsResponse"
127339+
security:
127340+
- apiKeyAuth: []
127341+
appKeyAuth: []
127342+
summary: Get a budget's custom forecast
127343+
tags:
127344+
- Cloud Cost Management
127345+
x-unstable: |-
127346+
**Note**: This endpoint is in preview and is subject to change.
127347+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
127287127348
/api/v2/cost/budgets:
127288127349
get:
127289127350
description: List budgets.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get a budget's custom forecast returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudCostManagementApi;
6+
import com.datadog.api.client.v2.model.CustomForecastResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getCustomForecast", true);
12+
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
13+
14+
try {
15+
CustomForecastResponse result = apiInstance.getCustomForecast("budget_id");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling CloudCostManagementApi#getCustomForecast");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ public class ApiClient {
10041004
put("v2.getCommitmentsUtilizationTimeseries", false);
10051005
put("v2.getCostAnomaly", false);
10061006
put("v2.getCostTagMetadataCurrency", false);
1007+
put("v2.getCustomForecast", false);
10071008
put("v2.listCostAnomalies", false);
10081009
put("v2.listCostTagKeySources", false);
10091010
put("v2.listCostTagMetadata", false);

src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6619,6 +6619,158 @@ public ApiResponse<CustomCostsFileGetResponse> getCustomCostsFileWithHttpInfo(St
66196619
new GenericType<CustomCostsFileGetResponse>() {});
66206620
}
66216621

6622+
/**
6623+
* Get a budget&#39;s custom forecast.
6624+
*
6625+
* <p>See {@link #getCustomForecastWithHttpInfo}.
6626+
*
6627+
* @param budgetId Budget id. (required)
6628+
* @return CustomForecastResponse
6629+
* @throws ApiException if fails to make API call
6630+
*/
6631+
public CustomForecastResponse getCustomForecast(String budgetId) throws ApiException {
6632+
return getCustomForecastWithHttpInfo(budgetId).getData();
6633+
}
6634+
6635+
/**
6636+
* Get a budget&#39;s custom forecast.
6637+
*
6638+
* <p>See {@link #getCustomForecastWithHttpInfoAsync}.
6639+
*
6640+
* @param budgetId Budget id. (required)
6641+
* @return CompletableFuture&lt;CustomForecastResponse&gt;
6642+
*/
6643+
public CompletableFuture<CustomForecastResponse> getCustomForecastAsync(String budgetId) {
6644+
return getCustomForecastWithHttpInfoAsync(budgetId)
6645+
.thenApply(
6646+
response -> {
6647+
return response.getData();
6648+
});
6649+
}
6650+
6651+
/**
6652+
* Get the custom forecast for a budget.
6653+
*
6654+
* @param budgetId Budget id. (required)
6655+
* @return ApiResponse&lt;CustomForecastResponse&gt;
6656+
* @throws ApiException if fails to make API call
6657+
* @http.response.details
6658+
* <table border="1">
6659+
* <caption>Response details</caption>
6660+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
6661+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
6662+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
6663+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
6664+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
6665+
* </table>
6666+
*/
6667+
public ApiResponse<CustomForecastResponse> getCustomForecastWithHttpInfo(String budgetId)
6668+
throws ApiException {
6669+
// Check if unstable operation is enabled
6670+
String operationId = "getCustomForecast";
6671+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
6672+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
6673+
} else {
6674+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
6675+
}
6676+
Object localVarPostBody = null;
6677+
6678+
// verify the required parameter 'budgetId' is set
6679+
if (budgetId == null) {
6680+
throw new ApiException(
6681+
400, "Missing the required parameter 'budgetId' when calling getCustomForecast");
6682+
}
6683+
// create path and map variables
6684+
String localVarPath =
6685+
"/api/v2/cost/budget/{budget_id}/custom-forecast"
6686+
.replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString()));
6687+
6688+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
6689+
6690+
Invocation.Builder builder =
6691+
apiClient.createBuilder(
6692+
"v2.CloudCostManagementApi.getCustomForecast",
6693+
localVarPath,
6694+
new ArrayList<Pair>(),
6695+
localVarHeaderParams,
6696+
new HashMap<String, String>(),
6697+
new String[] {"application/json"},
6698+
new String[] {"apiKeyAuth", "appKeyAuth"});
6699+
return apiClient.invokeAPI(
6700+
"GET",
6701+
builder,
6702+
localVarHeaderParams,
6703+
new String[] {},
6704+
localVarPostBody,
6705+
new HashMap<String, Object>(),
6706+
false,
6707+
new GenericType<CustomForecastResponse>() {});
6708+
}
6709+
6710+
/**
6711+
* Get a budget&#39;s custom forecast.
6712+
*
6713+
* <p>See {@link #getCustomForecastWithHttpInfo}.
6714+
*
6715+
* @param budgetId Budget id. (required)
6716+
* @return CompletableFuture&lt;ApiResponse&lt;CustomForecastResponse&gt;&gt;
6717+
*/
6718+
public CompletableFuture<ApiResponse<CustomForecastResponse>> getCustomForecastWithHttpInfoAsync(
6719+
String budgetId) {
6720+
// Check if unstable operation is enabled
6721+
String operationId = "getCustomForecast";
6722+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
6723+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
6724+
} else {
6725+
CompletableFuture<ApiResponse<CustomForecastResponse>> result = new CompletableFuture<>();
6726+
result.completeExceptionally(
6727+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
6728+
return result;
6729+
}
6730+
Object localVarPostBody = null;
6731+
6732+
// verify the required parameter 'budgetId' is set
6733+
if (budgetId == null) {
6734+
CompletableFuture<ApiResponse<CustomForecastResponse>> result = new CompletableFuture<>();
6735+
result.completeExceptionally(
6736+
new ApiException(
6737+
400, "Missing the required parameter 'budgetId' when calling getCustomForecast"));
6738+
return result;
6739+
}
6740+
// create path and map variables
6741+
String localVarPath =
6742+
"/api/v2/cost/budget/{budget_id}/custom-forecast"
6743+
.replaceAll("\\{" + "budget_id" + "\\}", apiClient.escapeString(budgetId.toString()));
6744+
6745+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
6746+
6747+
Invocation.Builder builder;
6748+
try {
6749+
builder =
6750+
apiClient.createBuilder(
6751+
"v2.CloudCostManagementApi.getCustomForecast",
6752+
localVarPath,
6753+
new ArrayList<Pair>(),
6754+
localVarHeaderParams,
6755+
new HashMap<String, String>(),
6756+
new String[] {"application/json"},
6757+
new String[] {"apiKeyAuth", "appKeyAuth"});
6758+
} catch (ApiException ex) {
6759+
CompletableFuture<ApiResponse<CustomForecastResponse>> result = new CompletableFuture<>();
6760+
result.completeExceptionally(ex);
6761+
return result;
6762+
}
6763+
return apiClient.invokeAPIAsync(
6764+
"GET",
6765+
builder,
6766+
localVarHeaderParams,
6767+
new String[] {},
6768+
localVarPostBody,
6769+
new HashMap<String, Object>(),
6770+
false,
6771+
new GenericType<CustomForecastResponse>() {});
6772+
}
6773+
66226774
/**
66236775
* Get a tag pipeline ruleset.
66246776
*

0 commit comments

Comments
 (0)