@@ -29,6 +29,7 @@ import { MetricPayload } from "../models/MetricPayload";
2929import { MetricsAndMetricTagConfigurations } from "../models/MetricsAndMetricTagConfigurations" ;
3030import { MetricsAndMetricTagConfigurationsResponse } from "../models/MetricsAndMetricTagConfigurationsResponse" ;
3131import { MetricSuggestedTagsAndAggregationsResponse } from "../models/MetricSuggestedTagsAndAggregationsResponse" ;
32+ import { MetricTagCardinalitiesResponse } from "../models/MetricTagCardinalitiesResponse" ;
3233import { MetricTagConfigurationCreateRequest } from "../models/MetricTagConfigurationCreateRequest" ;
3334import { MetricTagConfigurationMetricTypeCategory } from "../models/MetricTagConfigurationMetricTypeCategory" ;
3435import { MetricTagConfigurationResponse } from "../models/MetricTagConfigurationResponse" ;
@@ -284,6 +285,40 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory {
284285 return requestContext ;
285286 }
286287
288+ public async getMetricTagCardinalityDetails (
289+ metricName : string ,
290+ _options ?: Configuration
291+ ) : Promise < RequestContext > {
292+ const _config = _options || this . configuration ;
293+
294+ // verify required parameter 'metricName' is not null or undefined
295+ if ( metricName === null || metricName === undefined ) {
296+ throw new RequiredError ( "metricName" , "getMetricTagCardinalityDetails" ) ;
297+ }
298+
299+ // Path Params
300+ const localVarPath =
301+ "/api/v2/metrics/{metric_name}/tag-cardinalities" . replace (
302+ "{metric_name}" ,
303+ encodeURIComponent ( String ( metricName ) )
304+ ) ;
305+
306+ // Make Request Context
307+ const requestContext = _config
308+ . getServer ( "v2.MetricsApi.getMetricTagCardinalityDetails" )
309+ . makeRequestContext ( localVarPath , HttpMethod . GET ) ;
310+ requestContext . setHeaderParam ( "Accept" , "application/json" ) ;
311+ requestContext . setHttpConfig ( _config . httpConfig ) ;
312+
313+ // Apply auth methods
314+ applySecurityAuthentication ( _config , requestContext , [
315+ "apiKeyAuth" ,
316+ "appKeyAuth" ,
317+ ] ) ;
318+
319+ return requestContext ;
320+ }
321+
287322 public async listActiveMetricConfigurations (
288323 metricName : string ,
289324 windowSeconds ?: number ,
@@ -1071,6 +1106,69 @@ export class MetricsApiResponseProcessor {
10711106 ) ;
10721107 }
10731108
1109+ /**
1110+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
1111+ * to the expected objects
1112+ *
1113+ * @params response Response returned by the server for a request to getMetricTagCardinalityDetails
1114+ * @throws ApiException if the response code was not in [200, 299]
1115+ */
1116+ public async getMetricTagCardinalityDetails (
1117+ response : ResponseContext
1118+ ) : Promise < MetricTagCardinalitiesResponse > {
1119+ const contentType = ObjectSerializer . normalizeMediaType (
1120+ response . headers [ "content-type" ]
1121+ ) ;
1122+ if ( response . httpStatusCode === 200 ) {
1123+ const body : MetricTagCardinalitiesResponse = ObjectSerializer . deserialize (
1124+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1125+ "MetricTagCardinalitiesResponse"
1126+ ) as MetricTagCardinalitiesResponse ;
1127+ return body ;
1128+ }
1129+ if (
1130+ response . httpStatusCode === 400 ||
1131+ response . httpStatusCode === 403 ||
1132+ response . httpStatusCode === 404 ||
1133+ response . httpStatusCode === 429
1134+ ) {
1135+ const bodyText = ObjectSerializer . parse (
1136+ await response . body . text ( ) ,
1137+ contentType
1138+ ) ;
1139+ let body : APIErrorResponse ;
1140+ try {
1141+ body = ObjectSerializer . deserialize (
1142+ bodyText ,
1143+ "APIErrorResponse"
1144+ ) as APIErrorResponse ;
1145+ } catch ( error ) {
1146+ logger . debug ( `Got error deserializing error: ${ error } ` ) ;
1147+ throw new ApiException < APIErrorResponse > (
1148+ response . httpStatusCode ,
1149+ bodyText
1150+ ) ;
1151+ }
1152+ throw new ApiException < APIErrorResponse > ( response . httpStatusCode , body ) ;
1153+ }
1154+
1155+ // Work around for missing responses in specification, e.g. for petstore.yaml
1156+ if ( response . httpStatusCode >= 200 && response . httpStatusCode <= 299 ) {
1157+ const body : MetricTagCardinalitiesResponse = ObjectSerializer . deserialize (
1158+ ObjectSerializer . parse ( await response . body . text ( ) , contentType ) ,
1159+ "MetricTagCardinalitiesResponse" ,
1160+ ""
1161+ ) as MetricTagCardinalitiesResponse ;
1162+ return body ;
1163+ }
1164+
1165+ const body = ( await response . body . text ( ) ) || "" ;
1166+ throw new ApiException < string > (
1167+ response . httpStatusCode ,
1168+ 'Unknown API Status Code!\nBody: "' + body + '"'
1169+ ) ;
1170+ }
1171+
10741172 /**
10751173 * Unwraps the actual response sent by the server from the response context and deserializes the response content
10761174 * to the expected objects
@@ -1772,6 +1870,14 @@ export interface MetricsApiEstimateMetricsOutputSeriesRequest {
17721870 filterTimespanH ?: number ;
17731871}
17741872
1873+ export interface MetricsApiGetMetricTagCardinalityDetailsRequest {
1874+ /**
1875+ * The name of the metric.
1876+ * @type string
1877+ */
1878+ metricName : string ;
1879+ }
1880+
17751881export interface MetricsApiListActiveMetricConfigurationsRequest {
17761882 /**
17771883 * The name of the metric.
@@ -2066,6 +2172,30 @@ export class MetricsApi {
20662172 } ) ;
20672173 }
20682174
2175+ /**
2176+ * Returns the cardinality details of tags for a specific metric.
2177+ * @param param The request object
2178+ */
2179+ public getMetricTagCardinalityDetails (
2180+ param : MetricsApiGetMetricTagCardinalityDetailsRequest ,
2181+ options ?: Configuration
2182+ ) : Promise < MetricTagCardinalitiesResponse > {
2183+ const requestContextPromise =
2184+ this . requestFactory . getMetricTagCardinalityDetails (
2185+ param . metricName ,
2186+ options
2187+ ) ;
2188+ return requestContextPromise . then ( ( requestContext ) => {
2189+ return this . configuration . httpApi
2190+ . send ( requestContext )
2191+ . then ( ( responseContext ) => {
2192+ return this . responseProcessor . getMetricTagCardinalityDetails (
2193+ responseContext
2194+ ) ;
2195+ } ) ;
2196+ } ) ;
2197+ }
2198+
20692199 /**
20702200 * List tags and aggregations that are actively queried on dashboards, notebooks, monitors, the Metrics Explorer, and using the API for a given metric name.
20712201 * @param param The request object
0 commit comments