diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6f90e72c3b..129263163a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -8919,6 +8919,11 @@ components: nullable: true readOnly: true type: string + attributes: + additionalProperties: {} + description: Additional read-only attributes returned for the series. + readOnly: true + type: object display_name: description: Display name of the metric. example: system.cpu.idle @@ -9024,6 +9029,12 @@ components: example: time_series readOnly: true type: string + resp_version: + description: Version of the response format. + example: 1 + format: int64 + readOnly: true + type: integer series: description: List of timeseries queried. items: @@ -9035,11 +9046,27 @@ components: example: ok readOnly: true type: string + times: + description: |- + Legacy field, always returned as an empty list. Timestamps are returned + in the `pointlist` of each entry of `series`. + items: + description: An unused legacy timestamp. + readOnly: true + type: array to_date: description: End of requested time window, milliseconds since Unix epoch. format: int64 readOnly: true type: integer + values: + description: |- + Legacy field, always returned as an empty list. Timeseries values are + returned in the `pointlist` of each entry of `series`. + items: + description: An unused legacy value. + readOnly: true + type: array type: object MetricsQueryUnit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -9047,28 +9074,34 @@ components: properties: family: description: Unit family, allows for conversion between units of the same family, for scaling. - example: time + example: percentage readOnly: true type: string + id: + description: Unit identifier. + example: 17 + format: int64 + readOnly: true + type: integer name: description: Unit name - example: minute + example: percent readOnly: true type: string plural: description: Plural form of the unit name. - example: minutes + example: percent readOnly: true type: string scale_factor: description: Factor for scaling between units of the same family. - example: 60.0 + example: 1.0 format: double readOnly: true type: number short_name: description: Abbreviation of the unit. - example: min + example: "%" readOnly: true type: string type: object diff --git a/src/datadog_api_client/v1/model/metrics_query_metadata.py b/src/datadog_api_client/v1/model/metrics_query_metadata.py index 2c059ae34f..5fe5a28fd7 100644 --- a/src/datadog_api_client/v1/model/metrics_query_metadata.py +++ b/src/datadog_api_client/v1/model/metrics_query_metadata.py @@ -3,14 +3,17 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import Any, Dict, List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + date, + datetime, none_type, unset, UnsetType, + UUID, ) @@ -34,6 +37,22 @@ def openapi_types(_): return { "aggr": (str, none_type), + "attributes": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), "display_name": (str,), "end": (int,), "expression": (str,), @@ -50,6 +69,7 @@ def openapi_types(_): attribute_map = { "aggr": "aggr", + "attributes": "attributes", "display_name": "display_name", "end": "end", "expression": "expression", @@ -65,6 +85,7 @@ def openapi_types(_): } read_only_vars = { "aggr", + "attributes", "display_name", "end", "expression", @@ -82,6 +103,7 @@ def openapi_types(_): def __init__( self_, aggr: Union[str, none_type, UnsetType] = unset, + attributes: Union[Dict[str, Any], UnsetType] = unset, display_name: Union[str, UnsetType] = unset, end: Union[int, UnsetType] = unset, expression: Union[str, UnsetType] = unset, @@ -102,6 +124,9 @@ def __init__( :param aggr: Aggregation type. :type aggr: str, none_type, optional + :param attributes: Additional read-only attributes returned for the series. + :type attributes: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + :param display_name: Display name of the metric. :type display_name: str, optional @@ -143,6 +168,8 @@ def __init__( """ if aggr is not unset: kwargs["aggr"] = aggr + if attributes is not unset: + kwargs["attributes"] = attributes if display_name is not unset: kwargs["display_name"] = display_name if end is not unset: diff --git a/src/datadog_api_client/v1/model/metrics_query_response.py b/src/datadog_api_client/v1/model/metrics_query_response.py index b8007c6a2f..174d3aaf8d 100644 --- a/src/datadog_api_client/v1/model/metrics_query_response.py +++ b/src/datadog_api_client/v1/model/metrics_query_response.py @@ -3,13 +3,17 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import Any, List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + date, + datetime, + none_type, unset, UnsetType, + UUID, ) @@ -29,9 +33,12 @@ def openapi_types(_): "message": (str,), "query": (str,), "res_type": (str,), + "resp_version": (int,), "series": ([MetricsQueryMetadata],), "status": (str,), + "times": ([bool, date, datetime, dict, float, int, list, str, UUID, none_type],), "to_date": (int,), + "values": ([bool, date, datetime, dict, float, int, list, str, UUID, none_type],), } attribute_map = { @@ -41,9 +48,12 @@ def openapi_types(_): "message": "message", "query": "query", "res_type": "res_type", + "resp_version": "resp_version", "series": "series", "status": "status", + "times": "times", "to_date": "to_date", + "values": "values", } read_only_vars = { "error", @@ -52,9 +62,12 @@ def openapi_types(_): "message", "query", "res_type", + "resp_version", "series", "status", + "times", "to_date", + "values", } def __init__( @@ -65,9 +78,12 @@ def __init__( message: Union[str, UnsetType] = unset, query: Union[str, UnsetType] = unset, res_type: Union[str, UnsetType] = unset, + resp_version: Union[int, UnsetType] = unset, series: Union[List[MetricsQueryMetadata], UnsetType] = unset, status: Union[str, UnsetType] = unset, + times: Union[List[Any], UnsetType] = unset, to_date: Union[int, UnsetType] = unset, + values: Union[List[Any], UnsetType] = unset, **kwargs, ): """ @@ -91,14 +107,25 @@ def __init__( :param res_type: Type of response. :type res_type: str, optional + :param resp_version: Version of the response format. + :type resp_version: int, optional + :param series: List of timeseries queried. :type series: [MetricsQueryMetadata], optional :param status: Status of the query. :type status: str, optional + :param times: Legacy field, always returned as an empty list. Timestamps are returned + in the ``pointlist`` of each entry of ``series``. + :type times: [bool, date, datetime, dict, float, int, list, str, UUID, none_type], optional + :param to_date: End of requested time window, milliseconds since Unix epoch. :type to_date: int, optional + + :param values: Legacy field, always returned as an empty list. Timeseries values are + returned in the ``pointlist`` of each entry of ``series``. + :type values: [bool, date, datetime, dict, float, int, list, str, UUID, none_type], optional """ if error is not unset: kwargs["error"] = error @@ -112,10 +139,16 @@ def __init__( kwargs["query"] = query if res_type is not unset: kwargs["res_type"] = res_type + if resp_version is not unset: + kwargs["resp_version"] = resp_version if series is not unset: kwargs["series"] = series if status is not unset: kwargs["status"] = status + if times is not unset: + kwargs["times"] = times if to_date is not unset: kwargs["to_date"] = to_date + if values is not unset: + kwargs["values"] = values super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/metrics_query_unit.py b/src/datadog_api_client/v1/model/metrics_query_unit.py index 7bd169e601..c10fdda118 100644 --- a/src/datadog_api_client/v1/model/metrics_query_unit.py +++ b/src/datadog_api_client/v1/model/metrics_query_unit.py @@ -20,6 +20,7 @@ class MetricsQueryUnit(ModelNormal): def openapi_types(_): return { "family": (str,), + "id": (int,), "name": (str,), "plural": (str,), "scale_factor": (float,), @@ -28,6 +29,7 @@ def openapi_types(_): attribute_map = { "family": "family", + "id": "id", "name": "name", "plural": "plural", "scale_factor": "scale_factor", @@ -35,6 +37,7 @@ def openapi_types(_): } read_only_vars = { "family", + "id", "name", "plural", "scale_factor", @@ -44,6 +47,7 @@ def openapi_types(_): def __init__( self_, family: Union[str, UnsetType] = unset, + id: Union[int, UnsetType] = unset, name: Union[str, UnsetType] = unset, plural: Union[str, UnsetType] = unset, scale_factor: Union[float, UnsetType] = unset, @@ -56,6 +60,9 @@ def __init__( :param family: Unit family, allows for conversion between units of the same family, for scaling. :type family: str, optional + :param id: Unit identifier. + :type id: int, optional + :param name: Unit name :type name: str, optional @@ -70,6 +77,8 @@ def __init__( """ if family is not unset: kwargs["family"] = family + if id is not unset: + kwargs["id"] = id if name is not unset: kwargs["name"] = name if plural is not unset: diff --git a/tests/v1/features/metrics.feature b/tests/v1/features/metrics.feature index 9362bd0d26..fa9d3fcfcb 100644 --- a/tests/v1/features/metrics.feature +++ b/tests/v1/features/metrics.feature @@ -93,6 +93,7 @@ Feature: Metrics When the request is sent Then the response status is 200 OK And the response "status" is equal to "ok" + And the response "resp_version" is equal to 1 And the response "query" is equal to "system.cpu.idle{*}" @generated @skip @team:ddoghq/metrics-experience @team:ddoghq/metrics-index @team:ddoghq/metrics-intake @team:ddoghq/timeseries-query