|
15 | 15 | import com.datadog.api.client.v2.model.MetricEstimateResponse;
|
16 | 16 | import com.datadog.api.client.v2.model.MetricPayload;
|
17 | 17 | import com.datadog.api.client.v2.model.MetricSuggestedTagsAndAggregationsResponse;
|
| 18 | +import com.datadog.api.client.v2.model.MetricTagCardinalitiesResponse; |
18 | 19 | import com.datadog.api.client.v2.model.MetricTagConfigurationCreateRequest;
|
19 | 20 | import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypeCategory;
|
20 | 21 | import com.datadog.api.client.v2.model.MetricTagConfigurationResponse;
|
@@ -943,6 +944,152 @@ public ApiResponse<MetricEstimateResponse> estimateMetricsOutputSeriesWithHttpIn
|
943 | 944 | new GenericType<MetricEstimateResponse>() {});
|
944 | 945 | }
|
945 | 946 |
|
| 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<MetricTagCardinalitiesResponse> |
| 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<MetricTagCardinalitiesResponse> |
| 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<ApiResponse<MetricTagCardinalitiesResponse>> |
| 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 | + |
946 | 1093 | /** Manage optional parameters to listActiveMetricConfigurations. */
|
947 | 1094 | public static class ListActiveMetricConfigurationsOptionalParameters {
|
948 | 1095 | private Long windowSeconds;
|
|
0 commit comments