Skip to content

Commit 171c91f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6fc2e412 of spec repo
1 parent 52a66e5 commit 171c91f

File tree

12 files changed

+416
-4
lines changed

12 files changed

+416
-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:28:58.334886",
8-
"spec_repo_commit": "d9879085"
7+
"regenerated": "2025-07-08 18:40:10.868552",
8+
"spec_repo_commit": "6fc2e412"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-08 07:28:58.350439",
13-
"spec_repo_commit": "d9879085"
12+
"regenerated": "2025-07-08 18:40:10.961533",
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

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9727,6 +9727,34 @@ datadog\_api\_client.v2.model.metric\_suggested\_tags\_attributes module
97279727
:members:
97289728
:show-inheritance:
97299729

9730+
datadog\_api\_client.v2.model.metric\_tag\_cardinalities\_meta module
9731+
---------------------------------------------------------------------
9732+
9733+
.. automodule:: datadog_api_client.v2.model.metric_tag_cardinalities_meta
9734+
:members:
9735+
:show-inheritance:
9736+
9737+
datadog\_api\_client.v2.model.metric\_tag\_cardinalities\_response module
9738+
-------------------------------------------------------------------------
9739+
9740+
.. automodule:: datadog_api_client.v2.model.metric_tag_cardinalities_response
9741+
:members:
9742+
:show-inheritance:
9743+
9744+
datadog\_api\_client.v2.model.metric\_tag\_cardinality module
9745+
-------------------------------------------------------------
9746+
9747+
.. automodule:: datadog_api_client.v2.model.metric_tag_cardinality
9748+
:members:
9749+
:show-inheritance:
9750+
9751+
datadog\_api\_client.v2.model.metric\_tag\_cardinality\_attributes module
9752+
-------------------------------------------------------------------------
9753+
9754+
.. automodule:: datadog_api_client.v2.model.metric_tag_cardinality_attributes
9755+
:members:
9756+
:show-inheritance:
9757+
97309758
datadog\_api\_client.v2.model.metric\_tag\_configuration module
97319759
---------------------------------------------------------------
97329760

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Get tag key cardinality details returns "Success" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.metrics_api import MetricsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = MetricsApi(api_client)
11+
response = api_instance.get_metric_tag_cardinality_details(
12+
metric_name="metric_name",
13+
)
14+
15+
print(response)

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from datadog_api_client.v2.model.metric_all_tags_response import MetricAllTagsResponse
3131
from datadog_api_client.v2.model.metric_assets_response import MetricAssetsResponse
3232
from datadog_api_client.v2.model.metric_estimate_response import MetricEstimateResponse
33+
from datadog_api_client.v2.model.metric_tag_cardinalities_response import MetricTagCardinalitiesResponse
3334
from datadog_api_client.v2.model.metric_tag_configuration_response import MetricTagConfigurationResponse
3435
from datadog_api_client.v2.model.metric_tag_configuration_update_request import MetricTagConfigurationUpdateRequest
3536
from datadog_api_client.v2.model.metric_tag_configuration_create_request import MetricTagConfigurationCreateRequest
@@ -214,6 +215,29 @@ def __init__(self, api_client=None):
214215
api_client=api_client,
215216
)
216217

218+
self._get_metric_tag_cardinality_details_endpoint = _Endpoint(
219+
settings={
220+
"response_type": (MetricTagCardinalitiesResponse,),
221+
"auth": ["apiKeyAuth", "appKeyAuth"],
222+
"endpoint_path": "/api/v2/metrics/{metric_name}/tag-cardinalities",
223+
"operation_id": "get_metric_tag_cardinality_details",
224+
"http_method": "GET",
225+
"version": "v2",
226+
},
227+
params_map={
228+
"metric_name": {
229+
"required": True,
230+
"openapi_types": (str,),
231+
"attribute": "metric_name",
232+
"location": "path",
233+
},
234+
},
235+
headers_map={
236+
"accept": ["application/json"],
237+
},
238+
api_client=api_client,
239+
)
240+
217241
self._list_active_metric_configurations_endpoint = _Endpoint(
218242
settings={
219243
"response_type": (MetricSuggestedTagsAndAggregationsResponse,),
@@ -628,6 +652,23 @@ def estimate_metrics_output_series(
628652

629653
return self._estimate_metrics_output_series_endpoint.call_with_http_info(**kwargs)
630654

655+
def get_metric_tag_cardinality_details(
656+
self,
657+
metric_name: str,
658+
) -> MetricTagCardinalitiesResponse:
659+
"""Get tag key cardinality details.
660+
661+
Returns the cardinality details of tags for a specific metric.
662+
663+
:param metric_name: The name of the metric.
664+
:type metric_name: str
665+
:rtype: MetricTagCardinalitiesResponse
666+
"""
667+
kwargs: Dict[str, Any] = {}
668+
kwargs["metric_name"] = metric_name
669+
670+
return self._get_metric_tag_cardinality_details_endpoint.call_with_http_info(**kwargs)
671+
631672
def list_active_metric_configurations(
632673
self,
633674
metric_name: str,
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
class MetricTagCardinalitiesMeta(ModelNormal):
17+
@cached_property
18+
def openapi_types(_):
19+
return {
20+
"metric_name": (str,),
21+
}
22+
23+
attribute_map = {
24+
"metric_name": "metric_name",
25+
}
26+
27+
def __init__(self_, metric_name: Union[str, UnsetType] = unset, **kwargs):
28+
"""
29+
Response metadata object.
30+
31+
:param metric_name: The name of metric for which the tag cardinalities are returned.
32+
This matches the metric name provided in the request.
33+
:type metric_name: str, optional
34+
"""
35+
if metric_name is not unset:
36+
kwargs["metric_name"] = metric_name
37+
super().__init__(kwargs)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.metric_tag_cardinality import MetricTagCardinality
18+
from datadog_api_client.v2.model.metric_tag_cardinalities_meta import MetricTagCardinalitiesMeta
19+
20+
21+
class MetricTagCardinalitiesResponse(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.metric_tag_cardinality import MetricTagCardinality
25+
from datadog_api_client.v2.model.metric_tag_cardinalities_meta import MetricTagCardinalitiesMeta
26+
27+
return {
28+
"data": ([MetricTagCardinality],),
29+
"meta": (MetricTagCardinalitiesMeta,),
30+
}
31+
32+
attribute_map = {
33+
"data": "data",
34+
"meta": "meta",
35+
}
36+
37+
def __init__(
38+
self_,
39+
data: Union[List[MetricTagCardinality], UnsetType] = unset,
40+
meta: Union[MetricTagCardinalitiesMeta, UnsetType] = unset,
41+
**kwargs,
42+
):
43+
"""
44+
Response object that includes an array of objects representing the cardinality details of a metric's tags.
45+
46+
:param data: A list of tag cardinalities associated with the given metric.
47+
:type data: [MetricTagCardinality], optional
48+
49+
:param meta: Response metadata object.
50+
:type meta: MetricTagCardinalitiesMeta, optional
51+
"""
52+
if data is not unset:
53+
kwargs["data"] = data
54+
if meta is not unset:
55+
kwargs["meta"] = meta
56+
super().__init__(kwargs)

0 commit comments

Comments
 (0)