Skip to content

Commit f8212b5

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit e6216ca6 of spec repo (#975)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent d5b034b commit f8212b5

15 files changed

+651
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.2",
7-
"regenerated": "2022-05-13 13:23:05.641059",
8-
"spec_repo_commit": "a8ff8116"
7+
"regenerated": "2022-05-16 16:35:09.506917",
8+
"spec_repo_commit": "e6216ca6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-05-13 13:23:05.656443",
13-
"spec_repo_commit": "a8ff8116"
12+
"regenerated": "2022-05-16 16:35:09.518757",
13+
"spec_repo_commit": "e6216ca6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3987,6 +3987,63 @@ components:
39873987
type: string
39883988
x-enum-varnames:
39893989
- DISTINCT_METRIC_VOLUMES
3990+
MetricEstimate:
3991+
description: Object for a metric cardinality estimate.
3992+
properties:
3993+
attributes:
3994+
$ref: '#/components/schemas/MetricEstimateAttributes'
3995+
id:
3996+
$ref: '#/components/schemas/MetricName'
3997+
type:
3998+
$ref: '#/components/schemas/MetricEstimateResourceType'
3999+
type: object
4000+
MetricEstimateAttributes:
4001+
description: Object containing the definition of a metric estimate attribute.
4002+
properties:
4003+
estimate_type:
4004+
$ref: '#/components/schemas/MetricEstimateType'
4005+
estimated_at:
4006+
description: Timestamp when the cardinality estimate was requested.
4007+
example: '2022-04-27T09:48:37.463835Z'
4008+
format: date-time
4009+
type: string
4010+
estimated_output_series:
4011+
description: Estimated cardinality of the metric based on the queried configuration.
4012+
example: 50
4013+
format: int64
4014+
type: integer
4015+
type: object
4016+
MetricEstimateResourceType:
4017+
default: metric_cardinality_estimate
4018+
description: The metric estimate resource type.
4019+
enum:
4020+
- metric_cardinality_estimate
4021+
example: metric_cardinality_estimate
4022+
type: string
4023+
x-enum-varnames:
4024+
- METRIC_CARDINALITY_ESTIMATE
4025+
MetricEstimateResponse:
4026+
description: Response object that includes metric cardinality estimates.
4027+
properties:
4028+
data:
4029+
$ref: '#/components/schemas/MetricEstimate'
4030+
type: object
4031+
MetricEstimateType:
4032+
default: count_or_gauge
4033+
description: Estimate type based on the queried configuration. By default, `count_or_gauge`
4034+
is returned. `distribution` is returned for distribution metrics without percentiles
4035+
enabled. Lastly, `percentile` is returned if `filter[pct]=true` is queried
4036+
with a distribution metric.
4037+
enum:
4038+
- count_or_gauge
4039+
- distribution
4040+
- percentile
4041+
example: distribution
4042+
type: string
4043+
x-enum-varnames:
4044+
- COUNT_OR_GAUGE
4045+
- DISTRIBUTION
4046+
- PERCENTILE
39904047
MetricIngestedIndexedVolume:
39914048
description: Object for a single metric's ingested and indexed volume.
39924049
properties:
@@ -9533,6 +9590,106 @@ paths:
95339590
x-menu-order: 6
95349591
x-undo:
95359592
type: safe
9593+
/api/v2/metrics/{metric_name}/estimate:
9594+
get:
9595+
description: Returns a cardinality estimate for a metric with a given tag, percentile,
9596+
and number of aggregations configuration.
9597+
operationId: EstimateMetricsOutputSeries
9598+
parameters:
9599+
- $ref: '#/components/parameters/MetricName'
9600+
- description: Filtered tag groups that the metric is configured to query with.
9601+
example: app,host
9602+
in: query
9603+
name: filter[groups]
9604+
required: false
9605+
schema:
9606+
type: string
9607+
- description: The number of hours of look back (from now) to estimate cardinality
9608+
with.
9609+
example: 49
9610+
in: query
9611+
name: filter[hours_ago]
9612+
required: false
9613+
schema:
9614+
type: integer
9615+
- description: The number of aggregations that a `count`, `rate`, or `gauge`
9616+
metric is configured to use. Max number of aggregation combos is 9.
9617+
example: 1
9618+
in: query
9619+
name: filter[num_aggregations]
9620+
required: false
9621+
schema:
9622+
type: integer
9623+
- description: A boolean, for distribution metrics only, to estimate cardinality
9624+
if the metric includes additional percentile aggregators.
9625+
example: true
9626+
in: query
9627+
name: filter[pct]
9628+
required: false
9629+
schema:
9630+
type: boolean
9631+
- description: A window, in hours, from the look back to estimate cardinality
9632+
with.
9633+
example: 6
9634+
in: query
9635+
name: filter[timespan_h]
9636+
required: false
9637+
schema:
9638+
type: integer
9639+
responses:
9640+
'200':
9641+
content:
9642+
application/json:
9643+
schema:
9644+
$ref: '#/components/schemas/MetricEstimateResponse'
9645+
description: Success
9646+
'400':
9647+
content:
9648+
application/json:
9649+
schema:
9650+
$ref: '#/components/schemas/APIErrorResponse'
9651+
description: API error response.
9652+
'403':
9653+
content:
9654+
application/json:
9655+
schema:
9656+
$ref: '#/components/schemas/APIErrorResponse'
9657+
description: API error response.
9658+
'404':
9659+
content:
9660+
application/json:
9661+
schema:
9662+
$ref: '#/components/schemas/APIErrorResponse'
9663+
description: API error response.
9664+
'429':
9665+
content:
9666+
application/json:
9667+
schema:
9668+
$ref: '#/components/schemas/APIErrorResponse'
9669+
description: Too Many Requests
9670+
security:
9671+
- apiKeyAuth: []
9672+
appKeyAuth: []
9673+
- AuthZ: []
9674+
summary: Estimate Output Series - Public v2 API
9675+
tags:
9676+
- Metrics
9677+
x-dd-ownership:
9678+
notification_configuration:
9679+
manual_escalation_policy: '[Points Aggregation] Primary'
9680+
prod_high_urgency: '@pagerduty-Points-Aggregation @slack-points-aggr-ops'
9681+
prod_low_urgency: '@slack-points-aggr-ops'
9682+
slack_support_channel: '#points-aggregation'
9683+
staging_high_urgency: '@slack-points-aggr-stg-ops'
9684+
staging_low_urgency: '@slack-points-aggr-stg-ops'
9685+
team: points-aggregation
9686+
team_escalation: '[Points Aggregation] Primary'
9687+
x-menu-order: 10
9688+
x-permission:
9689+
operator: OPEN
9690+
permissions: []
9691+
x-undo:
9692+
type: safe
95369693
/api/v2/metrics/{metric_name}/tags:
95379694
delete:
95389695
description: 'Deletes a metric''s tag configuration. Can only be used with application

docs/datadog_api_client.v2.model.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,46 @@ metric\_distinct\_volume\_type
19931993
:undoc-members:
19941994
:show-inheritance:
19951995

1996+
metric\_estimate
1997+
----------------
1998+
1999+
.. automodule:: datadog_api_client.v2.model.metric_estimate
2000+
:members:
2001+
:undoc-members:
2002+
:show-inheritance:
2003+
2004+
metric\_estimate\_attributes
2005+
----------------------------
2006+
2007+
.. automodule:: datadog_api_client.v2.model.metric_estimate_attributes
2008+
:members:
2009+
:undoc-members:
2010+
:show-inheritance:
2011+
2012+
metric\_estimate\_resource\_type
2013+
--------------------------------
2014+
2015+
.. automodule:: datadog_api_client.v2.model.metric_estimate_resource_type
2016+
:members:
2017+
:undoc-members:
2018+
:show-inheritance:
2019+
2020+
metric\_estimate\_response
2021+
--------------------------
2022+
2023+
.. automodule:: datadog_api_client.v2.model.metric_estimate_response
2024+
:members:
2025+
:undoc-members:
2026+
:show-inheritance:
2027+
2028+
metric\_estimate\_type
2029+
----------------------
2030+
2031+
.. automodule:: datadog_api_client.v2.model.metric_estimate_type
2032+
:members:
2033+
:undoc-members:
2034+
:show-inheritance:
2035+
19962036
metric\_ingested\_indexed\_volume
19972037
---------------------------------
19982038

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Estimate Output Series - Public v2 API returns "Success" response
3+
"""
4+
5+
from datadog_api_client.v2 import ApiClient, Configuration
6+
from datadog_api_client.v2.api.metrics_api import MetricsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = MetricsApi(api_client)
11+
response = api_instance.estimate_metrics_output_series(
12+
metric_name="system.cpu.idle",
13+
filter_groups="app,host",
14+
filter_num_aggregations=4,
15+
)
16+
17+
print(response)

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)