Skip to content

Commit 9ff6445

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update v2 metrics list endpoint filter by metric type to use metric type category (#2179)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7a03c80 commit 9ff6445

10 files changed

+77
-15
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": "2024-09-26 19:34:36.904910",
8-
"spec_repo_commit": "83debf9e"
7+
"regenerated": "2024-09-30 13:56:55.970273",
8+
"spec_repo_commit": "eb66b1cf"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-26 19:34:36.918924",
13-
"spec_repo_commit": "83debf9e"
12+
"regenerated": "2024-09-30 13:56:55.986106",
13+
"spec_repo_commit": "eb66b1cf"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13939,8 +13939,8 @@ components:
1393913939
- time: sum, space: sum
1394013940

1394113941

13942-
Can only be applied to metrics that have a `metric_type` of `count`, `rate`,
13943-
or `gauge`.'
13942+
Can only be applied to non_distribution metrics that have a `metric_type`
13943+
of `count`, `rate`, or `gauge`.'
1394413944
example:
1394513945
- space: sum
1394613946
time: sum
@@ -14548,6 +14548,17 @@ components:
1454814548
required:
1454914549
- data
1455014550
type: object
14551+
MetricTagConfigurationMetricTypeCategory:
14552+
default: distribution
14553+
description: The metric's type category.
14554+
enum:
14555+
- non_distribution
14556+
- distribution
14557+
example: distribution
14558+
type: string
14559+
x-enum-varnames:
14560+
- NON_DISTRIBUTION
14561+
- DISTRIBUTION
1455114562
MetricTagConfigurationMetricTypes:
1455214563
default: gauge
1455314564
description: The metric's type.
@@ -32405,7 +32416,7 @@ paths:
3240532416
name: filter[metric_type]
3240632417
required: false
3240732418
schema:
32408-
$ref: '#/components/schemas/MetricTagConfigurationMetricTypes'
32419+
$ref: '#/components/schemas/MetricTagConfigurationMetricTypeCategory'
3240932420
- description: 'Filter distributions with additional percentile
3241032421

3241132422
aggregations enabled or disabled.'

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6248,6 +6248,13 @@ datadog\_api\_client.v2.model.metric\_tag\_configuration\_create\_request module
62486248
:members:
62496249
:show-inheritance:
62506250

6251+
datadog\_api\_client.v2.model.metric\_tag\_configuration\_metric\_type\_category module
6252+
---------------------------------------------------------------------------------------
6253+
6254+
.. automodule:: datadog_api_client.v2.model.metric_tag_configuration_metric_type_category
6255+
:members:
6256+
:show-inheritance:
6257+
62516258
datadog\_api\_client.v2.model.metric\_tag\_configuration\_metric\_types module
62526259
------------------------------------------------------------------------------
62536260

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from datadog_api_client.v2.model.metrics_and_metric_tag_configurations_response import (
1515
MetricsAndMetricTagConfigurationsResponse,
1616
)
17-
from datadog_api_client.v2.model.metric_tag_configuration_metric_types import MetricTagConfigurationMetricTypes
17+
from datadog_api_client.v2.model.metric_tag_configuration_metric_type_category import (
18+
MetricTagConfigurationMetricTypeCategory,
19+
)
1820
from datadog_api_client.v2.model.metric_bulk_tag_config_response import MetricBulkTagConfigResponse
1921
from datadog_api_client.v2.model.metric_bulk_tag_config_delete_request import MetricBulkTagConfigDeleteRequest
2022
from datadog_api_client.v2.model.metric_bulk_tag_config_create_request import MetricBulkTagConfigCreateRequest
@@ -303,7 +305,7 @@ def __init__(self, api_client=None):
303305
"location": "query",
304306
},
305307
"filter_metric_type": {
306-
"openapi_types": (MetricTagConfigurationMetricTypes,),
308+
"openapi_types": (MetricTagConfigurationMetricTypeCategory,),
307309
"attribute": "filter[metric_type]",
308310
"location": "query",
309311
},
@@ -667,7 +669,7 @@ def list_tag_configurations(
667669
*,
668670
filter_configured: Union[bool, UnsetType] = unset,
669671
filter_tags_configured: Union[str, UnsetType] = unset,
670-
filter_metric_type: Union[MetricTagConfigurationMetricTypes, UnsetType] = unset,
672+
filter_metric_type: Union[MetricTagConfigurationMetricTypeCategory, UnsetType] = unset,
671673
filter_include_percentiles: Union[bool, UnsetType] = unset,
672674
filter_queried: Union[bool, UnsetType] = unset,
673675
filter_tags: Union[str, UnsetType] = unset,
@@ -682,7 +684,7 @@ def list_tag_configurations(
682684
:param filter_tags_configured: Filter tag configurations by configured tags.
683685
:type filter_tags_configured: str, optional
684686
:param filter_metric_type: Filter metrics by metric type.
685-
:type filter_metric_type: MetricTagConfigurationMetricTypes, optional
687+
:type filter_metric_type: MetricTagConfigurationMetricTypeCategory, optional
686688
:param filter_include_percentiles: Filter distributions with additional percentile
687689
aggregations enabled or disabled.
688690
:type filter_include_percentiles: bool, optional

src/datadog_api_client/v2/model/metric_custom_aggregations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MetricCustomAggregations(ModelSimple):
2727
* time: sum, space: avg
2828
* time: sum, space: sum
2929
30-
Can only be applied to metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
30+
Can only be applied to non_distribution metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
3131
3232
3333
:type value: [MetricCustomAggregation]

src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
* time: sum, space: avg
7575
* time: sum, space: sum
7676
77-
Can only be applied to metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
77+
Can only be applied to non_distribution metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
7878
:type aggregations: MetricCustomAggregations, optional
7979
8080
:param created_at: Timestamp when the tag configuration was created.

src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
* time: sum, space: avg
6767
* time: sum, space: sum
6868
69-
Can only be applied to metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
69+
Can only be applied to non_distribution metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
7070
:type aggregations: MetricCustomAggregations, optional
7171
7272
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class MetricTagConfigurationMetricTypeCategory(ModelSimple):
16+
"""
17+
The metric's type category.
18+
19+
:param value: If omitted defaults to "distribution". Must be one of ["non_distribution", "distribution"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"non_distribution",
25+
"distribution",
26+
}
27+
NON_DISTRIBUTION: ClassVar["MetricTagConfigurationMetricTypeCategory"]
28+
DISTRIBUTION: ClassVar["MetricTagConfigurationMetricTypeCategory"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
MetricTagConfigurationMetricTypeCategory.NON_DISTRIBUTION = MetricTagConfigurationMetricTypeCategory("non_distribution")
38+
MetricTagConfigurationMetricTypeCategory.DISTRIBUTION = MetricTagConfigurationMetricTypeCategory("distribution")

src/datadog_api_client/v2/model/metric_tag_configuration_update_attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
* time: sum, space: avg
6363
* time: sum, space: sum
6464
65-
Can only be applied to metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
65+
Can only be applied to non_distribution metrics that have a ``metric_type`` of ``count`` , ``rate`` , or ``gauge``.
6666
:type aggregations: MetricCustomAggregations, optional
6767
6868
:param exclude_tags_mode: When set to true, the configuration will exclude the configured tags and include any other submitted tags.

src/datadog_api_client/v2/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,9 @@
10631063
)
10641064
from datadog_api_client.v2.model.metric_tag_configuration_create_data import MetricTagConfigurationCreateData
10651065
from datadog_api_client.v2.model.metric_tag_configuration_create_request import MetricTagConfigurationCreateRequest
1066+
from datadog_api_client.v2.model.metric_tag_configuration_metric_type_category import (
1067+
MetricTagConfigurationMetricTypeCategory,
1068+
)
10661069
from datadog_api_client.v2.model.metric_tag_configuration_metric_types import MetricTagConfigurationMetricTypes
10671070
from datadog_api_client.v2.model.metric_tag_configuration_response import MetricTagConfigurationResponse
10681071
from datadog_api_client.v2.model.metric_tag_configuration_type import MetricTagConfigurationType
@@ -2849,6 +2852,7 @@
28492852
"MetricTagConfigurationCreateAttributes",
28502853
"MetricTagConfigurationCreateData",
28512854
"MetricTagConfigurationCreateRequest",
2855+
"MetricTagConfigurationMetricTypeCategory",
28522856
"MetricTagConfigurationMetricTypes",
28532857
"MetricTagConfigurationResponse",
28542858
"MetricTagConfigurationType",

0 commit comments

Comments
 (0)