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
12 changes: 11 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116096,12 +116096,22 @@ paths:
/api/v2/metrics/{metric_name}/volumes:
get:
description: |-
View distinct metrics volumes for the given metric name.
View hourly average metric volumes for the given metric name over the look back period.

Custom metrics generated in-app from other products will return `null` for ingested volumes.
operationId: ListVolumesByMetricName
parameters:
- $ref: "#/components/parameters/MetricName"
- description: |-
The number of seconds of look back (from now).
Default value is 3,600 (1 hour), maximum value is 2,592,000 (1 month).
example: 7200
in: query
name: window[seconds]
required: false
schema:
format: int64
type: integer
responses:
"200":
content:
Expand Down
15 changes: 14 additions & 1 deletion src/datadog_api_client/v2/api/metrics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ def __init__(self, api_client=None):
"attribute": "metric_name",
"location": "path",
},
"window_seconds": {
"openapi_types": (int,),
"attribute": "window[seconds]",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
Expand Down Expand Up @@ -1012,20 +1017,28 @@ def list_tags_by_metric_name(
def list_volumes_by_metric_name(
self,
metric_name: str,
*,
window_seconds: Union[int, UnsetType] = unset,
) -> MetricVolumesResponse:
"""List distinct metric volumes by metric name.

View distinct metrics volumes for the given metric name.
View hourly average metric volumes for the given metric name over the look back period.

Custom metrics generated in-app from other products will return ``null`` for ingested volumes.

:param metric_name: The name of the metric.
:type metric_name: str
:param window_seconds: The number of seconds of look back (from now).
Default value is 3,600 (1 hour), maximum value is 2,592,000 (1 month).
:type window_seconds: int, optional
:rtype: MetricVolumesResponse
"""
kwargs: Dict[str, Any] = {}
kwargs["metric_name"] = metric_name

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

return self._list_volumes_by_metric_name_endpoint.call_with_http_info(**kwargs)

def query_scalar_data(
Expand Down
Loading