Skip to content

Commit ba53459

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2ee70e91 of spec repo
1 parent b9a29dc commit ba53459

File tree

10 files changed

+957
-4
lines changed

10 files changed

+957
-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-06-23 18:01:49.215543",
8-
"spec_repo_commit": "9a201ac7"
7+
"regenerated": "2025-06-23 19:57:02.078668",
8+
"spec_repo_commit": "2ee70e91"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-23 18:01:49.231296",
13-
"spec_repo_commit": "9a201ac7"
12+
"regenerated": "2025-06-23 19:57:02.095307",
13+
"spec_repo_commit": "2ee70e91"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22492,6 +22492,61 @@ components:
2249222492
type: string
2249322493
type: array
2249422494
type: object
22495+
MetricTagCardinalitiesData:
22496+
description: A list of tag cardinalities associated with the given metric.
22497+
items:
22498+
$ref: '#/components/schemas/MetricTagCardinality'
22499+
type: array
22500+
MetricTagCardinalitiesMeta:
22501+
description: Response metadata object.
22502+
properties:
22503+
metric_name:
22504+
description: 'The name of metric for which the tag cardinalities are returned.
22505+
22506+
This matches the metric name provided in the request.
22507+
22508+
'
22509+
type: string
22510+
type: object
22511+
MetricTagCardinalitiesResponse:
22512+
description: 'Response object that includes an array of objects representing
22513+
the cardinality details of a metric''s tags.
22514+
22515+
'
22516+
properties:
22517+
data:
22518+
$ref: '#/components/schemas/MetricTagCardinalitiesData'
22519+
meta:
22520+
$ref: '#/components/schemas/MetricTagCardinalitiesMeta'
22521+
readOnly: true
22522+
type: object
22523+
MetricTagCardinality:
22524+
description: Object containing metadata and attributes related to a specific
22525+
tag key associated with the metric.
22526+
example:
22527+
attributes:
22528+
cardinality_delta: 25
22529+
id: http.request.latency
22530+
type: get-tag-cardinalities
22531+
properties:
22532+
attributes:
22533+
$ref: '#/components/schemas/MetricTagCardinalityAttributes'
22534+
id:
22535+
description: The name of the tag key.
22536+
type: string
22537+
type:
22538+
default: get-tag-cardinalities
22539+
description: This describes the endpoint action.
22540+
type: string
22541+
type: object
22542+
MetricTagCardinalityAttributes:
22543+
description: An object containing properties related to the tag key
22544+
properties:
22545+
cardinality_delta:
22546+
description: This describes the recent change in the tag keys cardinality
22547+
format: int64
22548+
type: integer
22549+
type: object
2249522550
MetricTagConfiguration:
2249622551
description: Object for a single metric tag configuration.
2249722552
example:
@@ -51863,6 +51918,50 @@ paths:
5186351918
x-permission:
5186451919
operator: OPEN
5186551920
permissions: []
51921+
/api/v2/metrics/{metric_name}/tag-cardinalities:
51922+
get:
51923+
description: Returns the cardinality details of tags for a specific metric.
51924+
operationId: GetTagKeyCardinalityDetails
51925+
parameters:
51926+
- $ref: '#/components/parameters/MetricName'
51927+
responses:
51928+
'200':
51929+
content:
51930+
application/json:
51931+
schema:
51932+
$ref: '#/components/schemas/MetricTagCardinalitiesResponse'
51933+
description: Success
51934+
'400':
51935+
content:
51936+
application/json:
51937+
schema:
51938+
$ref: '#/components/schemas/APIErrorResponse'
51939+
description: Bad Request
51940+
'403':
51941+
content:
51942+
application/json:
51943+
schema:
51944+
$ref: '#/components/schemas/APIErrorResponse'
51945+
description: Forbidden
51946+
'404':
51947+
content:
51948+
application/json:
51949+
schema:
51950+
$ref: '#/components/schemas/APIErrorResponse'
51951+
description: Not Found
51952+
'429':
51953+
content:
51954+
application/json:
51955+
schema:
51956+
$ref: '#/components/schemas/APIErrorResponse'
51957+
description: Too Many Requests
51958+
summary: Get tag key cardinality details
51959+
tags:
51960+
- Metrics
51961+
x-permission:
51962+
operator: OR
51963+
permissions:
51964+
- metrics_read
5186651965
/api/v2/metrics/{metric_name}/tags:
5186751966
delete:
5186851967
description: 'Deletes a metric''s tag configuration. Can only be used with application
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get tag key cardinality details returns "Success" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.MetricsApi;
6+
import com.datadog.api.client.v2.model.MetricTagCardinalitiesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
MetricsApi apiInstance = new MetricsApi(defaultClient);
12+
13+
try {
14+
MetricTagCardinalitiesResponse result =
15+
apiInstance.getTagKeyCardinalityDetails("metric_name");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling MetricsApi#getTagKeyCardinalityDetails");
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/v2/api/MetricsApi.java

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.datadog.api.client.v2.model.MetricEstimateResponse;
1616
import com.datadog.api.client.v2.model.MetricPayload;
1717
import com.datadog.api.client.v2.model.MetricSuggestedTagsAndAggregationsResponse;
18+
import com.datadog.api.client.v2.model.MetricTagCardinalitiesResponse;
1819
import com.datadog.api.client.v2.model.MetricTagConfigurationCreateRequest;
1920
import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypeCategory;
2021
import com.datadog.api.client.v2.model.MetricTagConfigurationResponse;
@@ -943,6 +944,151 @@ public ApiResponse<MetricEstimateResponse> estimateMetricsOutputSeriesWithHttpIn
943944
new GenericType<MetricEstimateResponse>() {});
944945
}
945946

947+
/**
948+
* Get tag key cardinality details.
949+
*
950+
* <p>See {@link #getTagKeyCardinalityDetailsWithHttpInfo}.
951+
*
952+
* @param metricName The name of the metric. (required)
953+
* @return MetricTagCardinalitiesResponse
954+
* @throws ApiException if fails to make API call
955+
*/
956+
public MetricTagCardinalitiesResponse getTagKeyCardinalityDetails(String metricName)
957+
throws ApiException {
958+
return getTagKeyCardinalityDetailsWithHttpInfo(metricName).getData();
959+
}
960+
961+
/**
962+
* Get tag key cardinality details.
963+
*
964+
* <p>See {@link #getTagKeyCardinalityDetailsWithHttpInfoAsync}.
965+
*
966+
* @param metricName The name of the metric. (required)
967+
* @return CompletableFuture&lt;MetricTagCardinalitiesResponse&gt;
968+
*/
969+
public CompletableFuture<MetricTagCardinalitiesResponse> getTagKeyCardinalityDetailsAsync(
970+
String metricName) {
971+
return getTagKeyCardinalityDetailsWithHttpInfoAsync(metricName)
972+
.thenApply(
973+
response -> {
974+
return response.getData();
975+
});
976+
}
977+
978+
/**
979+
* Returns the cardinality details of tags for a specific metric.
980+
*
981+
* @param metricName The name of the metric. (required)
982+
* @return ApiResponse&lt;MetricTagCardinalitiesResponse&gt;
983+
* @throws ApiException if fails to make API call
984+
* @http.response.details
985+
* <table border="1">
986+
* <caption>Response details</caption>
987+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
988+
* <tr><td> 200 </td><td> Success </td><td> - </td></tr>
989+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
990+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
991+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
992+
* <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
993+
* </table>
994+
*/
995+
public ApiResponse<MetricTagCardinalitiesResponse> getTagKeyCardinalityDetailsWithHttpInfo(
996+
String metricName) throws ApiException {
997+
Object localVarPostBody = null;
998+
999+
// verify the required parameter 'metricName' is set
1000+
if (metricName == null) {
1001+
throw new ApiException(
1002+
400,
1003+
"Missing the required parameter 'metricName' when calling getTagKeyCardinalityDetails");
1004+
}
1005+
// create path and map variables
1006+
String localVarPath =
1007+
"/api/v2/metrics/{metric_name}/tag-cardinalities"
1008+
.replaceAll(
1009+
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
1010+
1011+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1012+
1013+
Invocation.Builder builder =
1014+
apiClient.createBuilder(
1015+
"v2.MetricsApi.getTagKeyCardinalityDetails",
1016+
localVarPath,
1017+
new ArrayList<Pair>(),
1018+
localVarHeaderParams,
1019+
new HashMap<String, String>(),
1020+
new String[] {"application/json"},
1021+
new String[] {"apiKeyAuth", "appKeyAuth"});
1022+
return apiClient.invokeAPI(
1023+
"GET",
1024+
builder,
1025+
localVarHeaderParams,
1026+
new String[] {},
1027+
localVarPostBody,
1028+
new HashMap<String, Object>(),
1029+
false,
1030+
new GenericType<MetricTagCardinalitiesResponse>() {});
1031+
}
1032+
1033+
/**
1034+
* Get tag key cardinality details.
1035+
*
1036+
* <p>See {@link #getTagKeyCardinalityDetailsWithHttpInfo}.
1037+
*
1038+
* @param metricName The name of the metric. (required)
1039+
* @return CompletableFuture&lt;ApiResponse&lt;MetricTagCardinalitiesResponse&gt;&gt;
1040+
*/
1041+
public CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>>
1042+
getTagKeyCardinalityDetailsWithHttpInfoAsync(String metricName) {
1043+
Object localVarPostBody = null;
1044+
1045+
// verify the required parameter 'metricName' is set
1046+
if (metricName == null) {
1047+
CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>> result =
1048+
new CompletableFuture<>();
1049+
result.completeExceptionally(
1050+
new ApiException(
1051+
400,
1052+
"Missing the required parameter 'metricName' when calling"
1053+
+ " getTagKeyCardinalityDetails"));
1054+
return result;
1055+
}
1056+
// create path and map variables
1057+
String localVarPath =
1058+
"/api/v2/metrics/{metric_name}/tag-cardinalities"
1059+
.replaceAll(
1060+
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
1061+
1062+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1063+
1064+
Invocation.Builder builder;
1065+
try {
1066+
builder =
1067+
apiClient.createBuilder(
1068+
"v2.MetricsApi.getTagKeyCardinalityDetails",
1069+
localVarPath,
1070+
new ArrayList<Pair>(),
1071+
localVarHeaderParams,
1072+
new HashMap<String, String>(),
1073+
new String[] {"application/json"},
1074+
new String[] {"apiKeyAuth", "appKeyAuth"});
1075+
} catch (ApiException ex) {
1076+
CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>> result =
1077+
new CompletableFuture<>();
1078+
result.completeExceptionally(ex);
1079+
return result;
1080+
}
1081+
return apiClient.invokeAPIAsync(
1082+
"GET",
1083+
builder,
1084+
localVarHeaderParams,
1085+
new String[] {},
1086+
localVarPostBody,
1087+
new HashMap<String, Object>(),
1088+
false,
1089+
new GenericType<MetricTagCardinalitiesResponse>() {});
1090+
}
1091+
9461092
/** Manage optional parameters to listActiveMetricConfigurations. */
9471093
public static class ListActiveMetricConfigurationsOptionalParameters {
9481094
private Long windowSeconds;

0 commit comments

Comments
 (0)