Skip to content

Commit dee73b3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6fc2e412 of spec repo
1 parent 585cfaf commit dee73b3

File tree

10 files changed

+958
-4
lines changed

10 files changed

+958
-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-07-08 07:29:01.236919",
8-
"spec_repo_commit": "d9879085"
7+
"regenerated": "2025-07-08 18:40:05.900519",
8+
"spec_repo_commit": "6fc2e412"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-08 07:29:01.320596",
13-
"spec_repo_commit": "d9879085"
12+
"regenerated": "2025-07-08 18:40:05.916801",
13+
"spec_repo_commit": "6fc2e412"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22807,6 +22807,61 @@ components:
2280722807
type: string
2280822808
type: array
2280922809
type: object
22810+
MetricTagCardinalitiesData:
22811+
description: A list of tag cardinalities associated with the given metric.
22812+
items:
22813+
$ref: '#/components/schemas/MetricTagCardinality'
22814+
type: array
22815+
MetricTagCardinalitiesMeta:
22816+
description: Response metadata object.
22817+
properties:
22818+
metric_name:
22819+
description: 'The name of metric for which the tag cardinalities are returned.
22820+
22821+
This matches the metric name provided in the request.
22822+
22823+
'
22824+
type: string
22825+
type: object
22826+
MetricTagCardinalitiesResponse:
22827+
description: 'Response object that includes an array of objects representing
22828+
the cardinality details of a metric''s tags.
22829+
22830+
'
22831+
properties:
22832+
data:
22833+
$ref: '#/components/schemas/MetricTagCardinalitiesData'
22834+
meta:
22835+
$ref: '#/components/schemas/MetricTagCardinalitiesMeta'
22836+
readOnly: true
22837+
type: object
22838+
MetricTagCardinality:
22839+
description: Object containing metadata and attributes related to a specific
22840+
tag key associated with the metric.
22841+
example:
22842+
attributes:
22843+
cardinality_delta: 25
22844+
id: http.request.latency
22845+
type: tag_cardinality
22846+
properties:
22847+
attributes:
22848+
$ref: '#/components/schemas/MetricTagCardinalityAttributes'
22849+
id:
22850+
description: The name of the tag key.
22851+
type: string
22852+
type:
22853+
default: tag_cardinality
22854+
description: This describes the endpoint action.
22855+
type: string
22856+
type: object
22857+
MetricTagCardinalityAttributes:
22858+
description: An object containing properties related to the tag key
22859+
properties:
22860+
cardinality_delta:
22861+
description: This describes the recent change in the tag keys cardinality
22862+
format: int64
22863+
type: integer
22864+
type: object
2281022865
MetricTagConfiguration:
2281122866
description: Object for a single metric tag configuration.
2281222867
example:
@@ -52849,6 +52904,50 @@ paths:
5284952904
x-permission:
5285052905
operator: OPEN
5285152906
permissions: []
52907+
/api/v2/metrics/{metric_name}/tag-cardinalities:
52908+
get:
52909+
description: Returns the cardinality details of tags for a specific metric.
52910+
operationId: GetMetricTagCardinalityDetails
52911+
parameters:
52912+
- $ref: '#/components/parameters/MetricName'
52913+
responses:
52914+
'200':
52915+
content:
52916+
application/json:
52917+
schema:
52918+
$ref: '#/components/schemas/MetricTagCardinalitiesResponse'
52919+
description: Success
52920+
'400':
52921+
content:
52922+
application/json:
52923+
schema:
52924+
$ref: '#/components/schemas/APIErrorResponse'
52925+
description: Bad Request
52926+
'403':
52927+
content:
52928+
application/json:
52929+
schema:
52930+
$ref: '#/components/schemas/APIErrorResponse'
52931+
description: Forbidden
52932+
'404':
52933+
content:
52934+
application/json:
52935+
schema:
52936+
$ref: '#/components/schemas/APIErrorResponse'
52937+
description: Not Found
52938+
'429':
52939+
content:
52940+
application/json:
52941+
schema:
52942+
$ref: '#/components/schemas/APIErrorResponse'
52943+
description: Too Many Requests
52944+
summary: Get tag key cardinality details
52945+
tags:
52946+
- Metrics
52947+
x-permission:
52948+
operator: OR
52949+
permissions:
52950+
- metrics_read
5285252951
/api/v2/metrics/{metric_name}/tags:
5285352952
delete:
5285452953
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.getMetricTagCardinalityDetails("metric_name");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling MetricsApi#getMetricTagCardinalityDetails");
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: 147 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,152 @@ public ApiResponse<MetricEstimateResponse> estimateMetricsOutputSeriesWithHttpIn
943944
new GenericType<MetricEstimateResponse>() {});
944945
}
945946

947+
/**
948+
* Get tag key cardinality details.
949+
*
950+
* <p>See {@link #getMetricTagCardinalityDetailsWithHttpInfo}.
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 getMetricTagCardinalityDetails(String metricName)
957+
throws ApiException {
958+
return getMetricTagCardinalityDetailsWithHttpInfo(metricName).getData();
959+
}
960+
961+
/**
962+
* Get tag key cardinality details.
963+
*
964+
* <p>See {@link #getMetricTagCardinalityDetailsWithHttpInfoAsync}.
965+
*
966+
* @param metricName The name of the metric. (required)
967+
* @return CompletableFuture&lt;MetricTagCardinalitiesResponse&gt;
968+
*/
969+
public CompletableFuture<MetricTagCardinalitiesResponse> getMetricTagCardinalityDetailsAsync(
970+
String metricName) {
971+
return getMetricTagCardinalityDetailsWithHttpInfoAsync(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> getMetricTagCardinalityDetailsWithHttpInfo(
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"
1004+
+ " getMetricTagCardinalityDetails");
1005+
}
1006+
// create path and map variables
1007+
String localVarPath =
1008+
"/api/v2/metrics/{metric_name}/tag-cardinalities"
1009+
.replaceAll(
1010+
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
1011+
1012+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1013+
1014+
Invocation.Builder builder =
1015+
apiClient.createBuilder(
1016+
"v2.MetricsApi.getMetricTagCardinalityDetails",
1017+
localVarPath,
1018+
new ArrayList<Pair>(),
1019+
localVarHeaderParams,
1020+
new HashMap<String, String>(),
1021+
new String[] {"application/json"},
1022+
new String[] {"apiKeyAuth", "appKeyAuth"});
1023+
return apiClient.invokeAPI(
1024+
"GET",
1025+
builder,
1026+
localVarHeaderParams,
1027+
new String[] {},
1028+
localVarPostBody,
1029+
new HashMap<String, Object>(),
1030+
false,
1031+
new GenericType<MetricTagCardinalitiesResponse>() {});
1032+
}
1033+
1034+
/**
1035+
* Get tag key cardinality details.
1036+
*
1037+
* <p>See {@link #getMetricTagCardinalityDetailsWithHttpInfo}.
1038+
*
1039+
* @param metricName The name of the metric. (required)
1040+
* @return CompletableFuture&lt;ApiResponse&lt;MetricTagCardinalitiesResponse&gt;&gt;
1041+
*/
1042+
public CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>>
1043+
getMetricTagCardinalityDetailsWithHttpInfoAsync(String metricName) {
1044+
Object localVarPostBody = null;
1045+
1046+
// verify the required parameter 'metricName' is set
1047+
if (metricName == null) {
1048+
CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>> result =
1049+
new CompletableFuture<>();
1050+
result.completeExceptionally(
1051+
new ApiException(
1052+
400,
1053+
"Missing the required parameter 'metricName' when calling"
1054+
+ " getMetricTagCardinalityDetails"));
1055+
return result;
1056+
}
1057+
// create path and map variables
1058+
String localVarPath =
1059+
"/api/v2/metrics/{metric_name}/tag-cardinalities"
1060+
.replaceAll(
1061+
"\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString()));
1062+
1063+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1064+
1065+
Invocation.Builder builder;
1066+
try {
1067+
builder =
1068+
apiClient.createBuilder(
1069+
"v2.MetricsApi.getMetricTagCardinalityDetails",
1070+
localVarPath,
1071+
new ArrayList<Pair>(),
1072+
localVarHeaderParams,
1073+
new HashMap<String, String>(),
1074+
new String[] {"application/json"},
1075+
new String[] {"apiKeyAuth", "appKeyAuth"});
1076+
} catch (ApiException ex) {
1077+
CompletableFuture<ApiResponse<MetricTagCardinalitiesResponse>> result =
1078+
new CompletableFuture<>();
1079+
result.completeExceptionally(ex);
1080+
return result;
1081+
}
1082+
return apiClient.invokeAPIAsync(
1083+
"GET",
1084+
builder,
1085+
localVarHeaderParams,
1086+
new String[] {},
1087+
localVarPostBody,
1088+
new HashMap<String, Object>(),
1089+
false,
1090+
new GenericType<MetricTagCardinalitiesResponse>() {});
1091+
}
1092+
9461093
/** Manage optional parameters to listActiveMetricConfigurations. */
9471094
public static class ListActiveMetricConfigurationsOptionalParameters {
9481095
private Long windowSeconds;

0 commit comments

Comments
 (0)