Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -9035,40 +9046,62 @@ 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.
nullable: true
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
Expand Down
29 changes: 28 additions & 1 deletion src/datadog_api_client/v1/model/metrics_query_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand All @@ -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,),
Expand All @@ -50,6 +69,7 @@ def openapi_types(_):

attribute_map = {
"aggr": "aggr",
"attributes": "attributes",
"display_name": "display_name",
"end": "end",
"expression": "expression",
Expand All @@ -65,6 +85,7 @@ def openapi_types(_):
}
read_only_vars = {
"aggr",
"attributes",
"display_name",
"end",
"expression",
Expand All @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down
35 changes: 34 additions & 1 deletion src/datadog_api_client/v1/model/metrics_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand All @@ -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 = {
Expand All @@ -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",
Expand All @@ -52,9 +62,12 @@ def openapi_types(_):
"message",
"query",
"res_type",
"resp_version",
"series",
"status",
"times",
"to_date",
"values",
}

def __init__(
Expand All @@ -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,
):
"""
Expand All @@ -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
Expand All @@ -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)
9 changes: 9 additions & 0 deletions src/datadog_api_client/v1/model/metrics_query_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class MetricsQueryUnit(ModelNormal):
def openapi_types(_):
return {
"family": (str,),
"id": (int,),
"name": (str,),
"plural": (str,),
"scale_factor": (float,),
Expand All @@ -28,13 +29,15 @@ def openapi_types(_):

attribute_map = {
"family": "family",
"id": "id",
"name": "name",
"plural": "plural",
"scale_factor": "scale_factor",
"short_name": "short_name",
}
read_only_vars = {
"family",
"id",
"name",
"plural",
"scale_factor",
Expand All @@ -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,
Expand All @@ -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

Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tests/v1/features/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading