Skip to content

Commit 4053601

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit eb891a2 of spec repo
1 parent 9fc28ba commit 4053601

12 files changed

Lines changed: 410 additions & 2 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38523,6 +38523,8 @@ components:
3852338523
properties:
3852438524
id:
3852538525
$ref: '#/components/schemas/MetricName'
38526+
relationships:
38527+
$ref: '#/components/schemas/MetricRelationships'
3852638528
type:
3852738529
$ref: '#/components/schemas/MetricType'
3852838530
type: object
@@ -39298,6 +39300,12 @@ components:
3929839300
format: double
3929939301
type: number
3930039302
type: object
39303+
MetricRelationships:
39304+
description: Relationships to related metric objects.
39305+
properties:
39306+
metric_volumes:
39307+
$ref: '#/components/schemas/MetricVolumesRelationship'
39308+
type: object
3930139309
MetricResource:
3930239310
description: Metric resource.
3930339311
example:
@@ -39741,13 +39749,55 @@ components:
3974139749
oneOf:
3974239750
- $ref: '#/components/schemas/MetricDistinctVolume'
3974339751
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
39752+
MetricVolumesInclude:
39753+
description: Relationship data to include in the response.
39754+
enum:
39755+
- metric_volumes
39756+
type: string
39757+
x-enum-varnames:
39758+
- METRIC_VOLUMES
39759+
MetricVolumesRelationship:
39760+
description: Relationship to a metric's ingested and indexed volumes.
39761+
properties:
39762+
data:
39763+
$ref: '#/components/schemas/MetricVolumesRelationshipData'
39764+
type: object
39765+
MetricVolumesRelationshipData:
39766+
description: Relationship data for a metric's ingested and indexed volumes.
39767+
properties:
39768+
id:
39769+
$ref: '#/components/schemas/MetricName'
39770+
type:
39771+
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
39772+
required:
39773+
- type
39774+
- id
39775+
type: object
3974439776
MetricVolumesResponse:
3974539777
description: Response object which includes a single metric's volume.
3974639778
properties:
3974739779
data:
3974839780
$ref: '#/components/schemas/MetricVolumes'
3974939781
readOnly: true
3975039782
type: object
39783+
MetricVolumesSort:
39784+
description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
39785+
order.
39786+
39787+
Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,
39788+
39789+
`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.'
39790+
enum:
39791+
- metric_volumes.indexed_volume
39792+
- -metric_volumes.indexed_volume
39793+
- metric_volumes.ingested_volume
39794+
- -metric_volumes.ingested_volume
39795+
type: string
39796+
x-enum-varnames:
39797+
- METRIC_VOLUMES_INDEXED_VOLUME
39798+
- NOT_METRIC_VOLUMES_INDEXED_VOLUME
39799+
- METRIC_VOLUMES_INGESTED_VOLUME
39800+
- NOT_METRIC_VOLUMES_INGESTED_VOLUME
3975139801
MetricsAggregator:
3975239802
default: avg
3975339803
description: The type of aggregation that can be performed on metrics-based
@@ -39787,6 +39837,12 @@ components:
3978739837
items:
3978839838
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
3978939839
type: array
39840+
included:
39841+
description: Array of included metric volume objects. Only present when
39842+
`include=metric_volumes` is requested.
39843+
items:
39844+
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
39845+
type: array
3979039846
links:
3979139847
$ref: '#/components/schemas/MetricsListResponseLinks'
3979239848
meta:
@@ -91450,7 +91506,10 @@ paths:
9145091506
`next_cursor` value from the response as the new `page[cursor]` value.
9145191507

9145291508
Once the `meta.pagination.next_cursor` value is null, all pages have been
91453-
retrieved.'
91509+
retrieved.
91510+
91511+
Use `include=metric_volumes` to fetch indexed and ingested volume data for
91512+
each metric, and `sort` to order results by volume.'
9145491513
operationId: ListTagConfigurations
9145591514
parameters:
9145691515
- description: Filter custom metrics that have configured tags.
@@ -91532,6 +91591,28 @@ paths:
9153291591
required: false
9153391592
schema:
9153491593
type: boolean
91594+
- description: Relationship data to include in the response. Use `metric_volumes`
91595+
to include indexed and ingested volumes.
91596+
example: metric_volumes
91597+
in: query
91598+
name: include
91599+
required: false
91600+
schema:
91601+
$ref: '#/components/schemas/MetricVolumesInclude'
91602+
- description: 'Sort metrics by ingested or indexed volume. Use `-` for descending
91603+
order.
91604+
91605+
Supported values: `metric_volumes.indexed_volume`, `-metric_volumes.indexed_volume`,
91606+
91607+
`metric_volumes.ingested_volume`, `-metric_volumes.ingested_volume`.
91608+
91609+
Only supported when `include=metric_volumes` is provided.'
91610+
example: -metric_volumes.indexed_volume
91611+
in: query
91612+
name: sort
91613+
required: false
91614+
schema:
91615+
$ref: '#/components/schemas/MetricVolumesSort'
9153591616
- description: 'The number of seconds of look back (from now) to apply to a
9153691617
filter[tag] or filter[queried] query.
9153791618

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17126,6 +17126,13 @@ datadog\_api\_client.v2.model.metric\_point module
1712617126
:members:
1712717127
:show-inheritance:
1712817128

17129+
datadog\_api\_client.v2.model.metric\_relationships module
17130+
----------------------------------------------------------
17131+
17132+
.. automodule:: datadog_api_client.v2.model.metric_relationships
17133+
:members:
17134+
:show-inheritance:
17135+
1712917136
datadog\_api\_client.v2.model.metric\_resource module
1713017137
-----------------------------------------------------
1713117138

@@ -17308,13 +17315,41 @@ datadog\_api\_client.v2.model.metric\_volumes module
1730817315
:members:
1730917316
:show-inheritance:
1731017317

17318+
datadog\_api\_client.v2.model.metric\_volumes\_include module
17319+
-------------------------------------------------------------
17320+
17321+
.. automodule:: datadog_api_client.v2.model.metric_volumes_include
17322+
:members:
17323+
:show-inheritance:
17324+
17325+
datadog\_api\_client.v2.model.metric\_volumes\_relationship module
17326+
------------------------------------------------------------------
17327+
17328+
.. automodule:: datadog_api_client.v2.model.metric_volumes_relationship
17329+
:members:
17330+
:show-inheritance:
17331+
17332+
datadog\_api\_client.v2.model.metric\_volumes\_relationship\_data module
17333+
------------------------------------------------------------------------
17334+
17335+
.. automodule:: datadog_api_client.v2.model.metric_volumes_relationship_data
17336+
:members:
17337+
:show-inheritance:
17338+
1731117339
datadog\_api\_client.v2.model.metric\_volumes\_response module
1731217340
--------------------------------------------------------------
1731317341

1731417342
.. automodule:: datadog_api_client.v2.model.metric_volumes_response
1731517343
:members:
1731617344
:show-inheritance:
1731717345

17346+
datadog\_api\_client.v2.model.metric\_volumes\_sort module
17347+
----------------------------------------------------------
17348+
17349+
.. automodule:: datadog_api_client.v2.model.metric_volumes_sort
17350+
:members:
17351+
:show-inheritance:
17352+
1731817353
datadog\_api\_client.v2.model.metrics\_aggregator module
1731917354
--------------------------------------------------------
1732017355

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from datadog_api_client.v2.model.metric_tag_configuration_metric_type_category import (
2121
MetricTagConfigurationMetricTypeCategory,
2222
)
23+
from datadog_api_client.v2.model.metric_volumes_include import MetricVolumesInclude
24+
from datadog_api_client.v2.model.metric_volumes_sort import MetricVolumesSort
2325
from datadog_api_client.v2.model.metrics_and_metric_tag_configurations import MetricsAndMetricTagConfigurations
2426
from datadog_api_client.v2.model.metric_bulk_tag_config_response import MetricBulkTagConfigResponse
2527
from datadog_api_client.v2.model.metric_bulk_tag_config_delete_request import MetricBulkTagConfigDeleteRequest
@@ -366,6 +368,16 @@ def __init__(self, api_client=None):
366368
"attribute": "filter[related_assets]",
367369
"location": "query",
368370
},
371+
"include": {
372+
"openapi_types": (MetricVolumesInclude,),
373+
"attribute": "include",
374+
"location": "query",
375+
},
376+
"sort": {
377+
"openapi_types": (MetricVolumesSort,),
378+
"attribute": "sort",
379+
"location": "query",
380+
},
369381
"window_seconds": {
370382
"openapi_types": (int,),
371383
"attribute": "window[seconds]",
@@ -782,6 +794,8 @@ def list_tag_configurations(
782794
filter_queried_window_seconds: Union[int, UnsetType] = unset,
783795
filter_tags: Union[str, UnsetType] = unset,
784796
filter_related_assets: Union[bool, UnsetType] = unset,
797+
include: Union[MetricVolumesInclude, UnsetType] = unset,
798+
sort: Union[MetricVolumesSort, UnsetType] = unset,
785799
window_seconds: Union[int, UnsetType] = unset,
786800
page_size: Union[int, UnsetType] = unset,
787801
page_cursor: Union[str, UnsetType] = unset,
@@ -792,6 +806,7 @@ def list_tag_configurations(
792806
Optionally, paginate by using the ``page[cursor]`` and/or ``page[size]`` query parameters.
793807
To fetch the first page, pass in a query parameter with either a valid ``page[size]`` or an empty cursor like ``page[cursor]=``. To fetch the next page, pass in the ``next_cursor`` value from the response as the new ``page[cursor]`` value.
794808
Once the ``meta.pagination.next_cursor`` value is null, all pages have been retrieved.
809+
Use ``include=metric_volumes`` to fetch indexed and ingested volume data for each metric, and ``sort`` to order results by volume.
795810
796811
:param filter_configured: Filter custom metrics that have configured tags.
797812
:type filter_configured: bool, optional
@@ -816,6 +831,13 @@ def list_tag_configurations(
816831
:type filter_tags: str, optional
817832
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
818833
:type filter_related_assets: bool, optional
834+
:param include: Relationship data to include in the response. Use ``metric_volumes`` to include indexed and ingested volumes.
835+
:type include: MetricVolumesInclude, optional
836+
:param sort: Sort metrics by ingested or indexed volume. Use ``-`` for descending order.
837+
Supported values: ``metric_volumes.indexed_volume`` , ``-metric_volumes.indexed_volume`` ,
838+
``metric_volumes.ingested_volume`` , ``-metric_volumes.ingested_volume``.
839+
Only supported when ``include=metric_volumes`` is provided.
840+
:type sort: MetricVolumesSort, optional
819841
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query.
820842
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
821843
:type window_seconds: int, optional
@@ -852,6 +874,12 @@ def list_tag_configurations(
852874
if filter_related_assets is not unset:
853875
kwargs["filter_related_assets"] = filter_related_assets
854876

877+
if include is not unset:
878+
kwargs["include"] = include
879+
880+
if sort is not unset:
881+
kwargs["sort"] = sort
882+
855883
if window_seconds is not unset:
856884
kwargs["window_seconds"] = window_seconds
857885

@@ -874,6 +902,8 @@ def list_tag_configurations_with_pagination(
874902
filter_queried_window_seconds: Union[int, UnsetType] = unset,
875903
filter_tags: Union[str, UnsetType] = unset,
876904
filter_related_assets: Union[bool, UnsetType] = unset,
905+
include: Union[MetricVolumesInclude, UnsetType] = unset,
906+
sort: Union[MetricVolumesSort, UnsetType] = unset,
877907
window_seconds: Union[int, UnsetType] = unset,
878908
page_size: Union[int, UnsetType] = unset,
879909
page_cursor: Union[str, UnsetType] = unset,
@@ -905,6 +935,13 @@ def list_tag_configurations_with_pagination(
905935
:type filter_tags: str, optional
906936
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
907937
:type filter_related_assets: bool, optional
938+
:param include: Relationship data to include in the response. Use ``metric_volumes`` to include indexed and ingested volumes.
939+
:type include: MetricVolumesInclude, optional
940+
:param sort: Sort metrics by ingested or indexed volume. Use ``-`` for descending order.
941+
Supported values: ``metric_volumes.indexed_volume`` , ``-metric_volumes.indexed_volume`` ,
942+
``metric_volumes.ingested_volume`` , ``-metric_volumes.ingested_volume``.
943+
Only supported when ``include=metric_volumes`` is provided.
944+
:type sort: MetricVolumesSort, optional
908945
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query.
909946
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
910947
:type window_seconds: int, optional
@@ -943,6 +980,12 @@ def list_tag_configurations_with_pagination(
943980
if filter_related_assets is not unset:
944981
kwargs["filter_related_assets"] = filter_related_assets
945982

983+
if include is not unset:
984+
kwargs["include"] = include
985+
986+
if sort is not unset:
987+
kwargs["sort"] = sort
988+
946989
if window_seconds is not unset:
947990
kwargs["window_seconds"] = window_seconds
948991

src/datadog_api_client/v2/model/metric.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,51 @@
1414

1515

1616
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.metric_relationships import MetricRelationships
1718
from datadog_api_client.v2.model.metric_type import MetricType
1819

1920

2021
class Metric(ModelNormal):
2122
@cached_property
2223
def openapi_types(_):
24+
from datadog_api_client.v2.model.metric_relationships import MetricRelationships
2325
from datadog_api_client.v2.model.metric_type import MetricType
2426

2527
return {
2628
"id": (str,),
29+
"relationships": (MetricRelationships,),
2730
"type": (MetricType,),
2831
}
2932

3033
attribute_map = {
3134
"id": "id",
35+
"relationships": "relationships",
3236
"type": "type",
3337
}
3438

35-
def __init__(self_, id: Union[str, UnsetType] = unset, type: Union[MetricType, UnsetType] = unset, **kwargs):
39+
def __init__(
40+
self_,
41+
id: Union[str, UnsetType] = unset,
42+
relationships: Union[MetricRelationships, UnsetType] = unset,
43+
type: Union[MetricType, UnsetType] = unset,
44+
**kwargs,
45+
):
3646
"""
3747
Object for a single metric tag configuration.
3848
3949
:param id: The metric name for this resource.
4050
:type id: str, optional
4151
52+
:param relationships: Relationships to related metric objects.
53+
:type relationships: MetricRelationships, optional
54+
4255
:param type: The metric resource type.
4356
:type type: MetricType, optional
4457
"""
4558
if id is not unset:
4659
kwargs["id"] = id
60+
if relationships is not unset:
61+
kwargs["relationships"] = relationships
4762
if type is not unset:
4863
kwargs["type"] = type
4964
super().__init__(kwargs)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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, 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_volumes_relationship import MetricVolumesRelationship
18+
19+
20+
class MetricRelationships(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.metric_volumes_relationship import MetricVolumesRelationship
24+
25+
return {
26+
"metric_volumes": (MetricVolumesRelationship,),
27+
}
28+
29+
attribute_map = {
30+
"metric_volumes": "metric_volumes",
31+
}
32+
33+
def __init__(self_, metric_volumes: Union[MetricVolumesRelationship, UnsetType] = unset, **kwargs):
34+
"""
35+
Relationships to related metric objects.
36+
37+
:param metric_volumes: Relationship to a metric's ingested and indexed volumes.
38+
:type metric_volumes: MetricVolumesRelationship, optional
39+
"""
40+
if metric_volumes is not unset:
41+
kwargs["metric_volumes"] = metric_volumes
42+
super().__init__(kwargs)

0 commit comments

Comments
 (0)