Skip to content
Open
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
59 changes: 58 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38523,6 +38523,8 @@ components:
properties:
id:
$ref: '#/components/schemas/MetricName'
relationships:
$ref: '#/components/schemas/MetricRelationships'
type:
$ref: '#/components/schemas/MetricType'
type: object
Expand Down Expand Up @@ -39298,6 +39300,12 @@ components:
format: double
type: number
type: object
MetricRelationships:
description: Relationships to related metric objects.
properties:
metric_volumes:
$ref: '#/components/schemas/MetricVolumesRelationship'
type: object
MetricResource:
description: Metric resource.
example:
Expand Down Expand Up @@ -39741,6 +39749,33 @@ components:
oneOf:
- $ref: '#/components/schemas/MetricDistinctVolume'
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
MetricVolumesInclude:
description: Comma-separated list of additional data to include in the response.
Allowed values are `metric_volumes`.
enum:
- metric_volumes
- generated_metric_attributes
type: string
x-enum-varnames:
- METRIC_VOLUMES
- GENERATED_METRIC_ATTRIBUTES
MetricVolumesRelationship:
description: Relationship to a metric's ingested and indexed volumes.
properties:
data:
$ref: '#/components/schemas/MetricVolumesRelationshipData'
type: object
MetricVolumesRelationshipData:
description: Relationship data for a metric's ingested and indexed volumes.
properties:
id:
$ref: '#/components/schemas/MetricName'
type:
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
required:
- type
- id
type: object
MetricVolumesResponse:
description: Response object which includes a single metric's volume.
properties:
Expand Down Expand Up @@ -39787,6 +39822,12 @@ components:
items:
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
type: array
included:
description: Array of included metric volume objects. Only present when
`include=metric_volumes` is requested.
items:
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
type: array
links:
$ref: '#/components/schemas/MetricsListResponseLinks'
meta:
Expand Down Expand Up @@ -91450,7 +91491,13 @@ paths:
`next_cursor` value from the response as the new `page[cursor]` value.

Once the `meta.pagination.next_cursor` value is null, all pages have been
retrieved.'
retrieved.

Use the `include` query parameter to fetch additional data with the response.
When `include=metric_volumes` is specified, the response includes volume data
for each custom metric in the `included` array, with a corresponding `relationships`
link on each metric in `data`. Volume data is only returned for custom metrics.
All volume values represent a 1-hour timeframe.'
operationId: ListTagConfigurations
parameters:
- description: Filter custom metrics that have configured tags.
Expand Down Expand Up @@ -91532,6 +91579,16 @@ paths:
required: false
schema:
type: boolean
- description: 'Comma-separated list of additional data to include in the response.
Allowed values: `metric_volumes`. When `metric_volumes` is specified, the
response includes volume data for each custom metric in the `included` array,
with a corresponding `relationships` link on each metric in `data`.'
example: metric_volumes
in: query
name: include
required: false
schema:
$ref: '#/components/schemas/MetricVolumesInclude'
- description: 'The number of seconds of look back (from now) to apply to a
filter[tag] or filter[queried] query.

Expand Down
28 changes: 28 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17126,6 +17126,13 @@ datadog\_api\_client.v2.model.metric\_point module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_relationships module
----------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.metric_relationships
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_resource module
-----------------------------------------------------

Expand Down Expand Up @@ -17308,6 +17315,27 @@ datadog\_api\_client.v2.model.metric\_volumes module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_volumes\_include module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.metric_volumes_include
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_volumes\_relationship module
------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.metric_volumes_relationship
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_volumes\_relationship\_data module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.metric_volumes_relationship_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.metric\_volumes\_response module
--------------------------------------------------------------

Expand Down
19 changes: 19 additions & 0 deletions src/datadog_api_client/v2/api/metrics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from datadog_api_client.v2.model.metric_tag_configuration_metric_type_category import (
MetricTagConfigurationMetricTypeCategory,
)
from datadog_api_client.v2.model.metric_volumes_include import MetricVolumesInclude
from datadog_api_client.v2.model.metrics_and_metric_tag_configurations import MetricsAndMetricTagConfigurations
from datadog_api_client.v2.model.metric_bulk_tag_config_response import MetricBulkTagConfigResponse
from datadog_api_client.v2.model.metric_bulk_tag_config_delete_request import MetricBulkTagConfigDeleteRequest
Expand Down Expand Up @@ -366,6 +367,11 @@ def __init__(self, api_client=None):
"attribute": "filter[related_assets]",
"location": "query",
},
"include": {
"openapi_types": (MetricVolumesInclude,),
"attribute": "include",
"location": "query",
},
"window_seconds": {
"openapi_types": (int,),
"attribute": "window[seconds]",
Expand Down Expand Up @@ -782,6 +788,7 @@ def list_tag_configurations(
filter_queried_window_seconds: Union[int, UnsetType] = unset,
filter_tags: Union[str, UnsetType] = unset,
filter_related_assets: Union[bool, UnsetType] = unset,
include: Union[MetricVolumesInclude, UnsetType] = unset,
window_seconds: Union[int, UnsetType] = unset,
page_size: Union[int, UnsetType] = unset,
page_cursor: Union[str, UnsetType] = unset,
Expand All @@ -792,6 +799,7 @@ def list_tag_configurations(
Optionally, paginate by using the ``page[cursor]`` and/or ``page[size]`` query parameters.
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.
Once the ``meta.pagination.next_cursor`` value is null, all pages have been retrieved.
Use the ``include`` query parameter to fetch additional data with the response. When ``include=metric_volumes`` is specified, the response includes volume data for each custom metric in the ``included`` array, with a corresponding ``relationships`` link on each metric in ``data``. Volume data is only returned for custom metrics. All volume values represent a 1-hour timeframe.

:param filter_configured: Filter custom metrics that have configured tags.
:type filter_configured: bool, optional
Expand All @@ -816,6 +824,8 @@ def list_tag_configurations(
:type filter_tags: str, optional
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
:type filter_related_assets: bool, optional
:param include: Comma-separated list of additional data to include in the response. Allowed values: ``metric_volumes``. When ``metric_volumes`` is specified, the response includes volume data for each custom metric in the ``included`` array, with a corresponding ``relationships`` link on each metric in ``data``.
:type include: MetricVolumesInclude, optional
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query.
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
:type window_seconds: int, optional
Expand Down Expand Up @@ -852,6 +862,9 @@ def list_tag_configurations(
if filter_related_assets is not unset:
kwargs["filter_related_assets"] = filter_related_assets

if include is not unset:
kwargs["include"] = include

if window_seconds is not unset:
kwargs["window_seconds"] = window_seconds

Expand All @@ -874,6 +887,7 @@ def list_tag_configurations_with_pagination(
filter_queried_window_seconds: Union[int, UnsetType] = unset,
filter_tags: Union[str, UnsetType] = unset,
filter_related_assets: Union[bool, UnsetType] = unset,
include: Union[MetricVolumesInclude, UnsetType] = unset,
window_seconds: Union[int, UnsetType] = unset,
page_size: Union[int, UnsetType] = unset,
page_cursor: Union[str, UnsetType] = unset,
Expand Down Expand Up @@ -905,6 +919,8 @@ def list_tag_configurations_with_pagination(
:type filter_tags: str, optional
:param filter_related_assets: (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
:type filter_related_assets: bool, optional
:param include: Comma-separated list of additional data to include in the response. Allowed values: ``metric_volumes``. When ``metric_volumes`` is specified, the response includes volume data for each custom metric in the ``included`` array, with a corresponding ``relationships`` link on each metric in ``data``.
:type include: MetricVolumesInclude, optional
:param window_seconds: The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query.
Default value is 3600 (1 hour), maximum value is 5,184,000 (60 days).
:type window_seconds: int, optional
Expand Down Expand Up @@ -943,6 +959,9 @@ def list_tag_configurations_with_pagination(
if filter_related_assets is not unset:
kwargs["filter_related_assets"] = filter_related_assets

if include is not unset:
kwargs["include"] = include

if window_seconds is not unset:
kwargs["window_seconds"] = window_seconds

Expand Down
17 changes: 16 additions & 1 deletion src/datadog_api_client/v2/model/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,51 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.metric_relationships import MetricRelationships
from datadog_api_client.v2.model.metric_type import MetricType


class Metric(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.metric_relationships import MetricRelationships
from datadog_api_client.v2.model.metric_type import MetricType

return {
"id": (str,),
"relationships": (MetricRelationships,),
"type": (MetricType,),
}

attribute_map = {
"id": "id",
"relationships": "relationships",
"type": "type",
}

def __init__(self_, id: Union[str, UnsetType] = unset, type: Union[MetricType, UnsetType] = unset, **kwargs):
def __init__(
self_,
id: Union[str, UnsetType] = unset,
relationships: Union[MetricRelationships, UnsetType] = unset,
type: Union[MetricType, UnsetType] = unset,
**kwargs,
):
"""
Object for a single metric tag configuration.

:param id: The metric name for this resource.
:type id: str, optional

:param relationships: Relationships to related metric objects.
:type relationships: MetricRelationships, optional

:param type: The metric resource type.
:type type: MetricType, optional
"""
if id is not unset:
kwargs["id"] = id
if relationships is not unset:
kwargs["relationships"] = relationships
if type is not unset:
kwargs["type"] = type
super().__init__(kwargs)
42 changes: 42 additions & 0 deletions src/datadog_api_client/v2/model/metric_relationships.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.metric_volumes_relationship import MetricVolumesRelationship


class MetricRelationships(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.metric_volumes_relationship import MetricVolumesRelationship

return {
"metric_volumes": (MetricVolumesRelationship,),
}

attribute_map = {
"metric_volumes": "metric_volumes",
}

def __init__(self_, metric_volumes: Union[MetricVolumesRelationship, UnsetType] = unset, **kwargs):
"""
Relationships to related metric objects.

:param metric_volumes: Relationship to a metric's ingested and indexed volumes.
:type metric_volumes: MetricVolumesRelationship, optional
"""
if metric_volumes is not unset:
kwargs["metric_volumes"] = metric_volumes
super().__init__(kwargs)
38 changes: 38 additions & 0 deletions src/datadog_api_client/v2/model/metric_volumes_include.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class MetricVolumesInclude(ModelSimple):
"""
Comma-separated list of additional data to include in the response. Allowed values are `metric_volumes`.

:param value: Must be one of ["metric_volumes", "generated_metric_attributes"].
:type value: str
"""

allowed_values = {
"metric_volumes",
"generated_metric_attributes",
}
METRIC_VOLUMES: ClassVar["MetricVolumesInclude"]
GENERATED_METRIC_ATTRIBUTES: ClassVar["MetricVolumesInclude"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


MetricVolumesInclude.METRIC_VOLUMES = MetricVolumesInclude("metric_volumes")
MetricVolumesInclude.GENERATED_METRIC_ATTRIBUTES = MetricVolumesInclude("generated_metric_attributes")
Loading
Loading