Skip to content

Commit 6f21bdc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add new param to api/v2/metrics (#3049)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 51d32f9 commit 6f21bdc

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88653,6 +88653,26 @@ paths:
8865388653
required: false
8865488654
schema:
8865588655
type: boolean
88656+
- description: 'The number of seconds of look back (from now) used by the `filter[queried]`
88657+
filter logic.
88658+
88659+
Must be sent with `filter[queried]` and is only applied when `filter[queried]=true`.
88660+
88661+
If `filter[queried]=false`, this parameter is ignored and default queried-window
88662+
behavior applies.
88663+
88664+
If `filter[queried]` is not provided, sending this parameter returns a 400.
88665+
88666+
For example: `GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=7776000`.'
88667+
example: 7776000
88668+
in: query
88669+
name: filter[queried][window][seconds]
88670+
required: false
88671+
schema:
88672+
format: int64
88673+
maximum: 15552000
88674+
minimum: 0
88675+
type: integer
8865688676
- description: 'Filter metrics that have been submitted with the given tags.
8865788677
Supports boolean and wildcard expressions.
8865888678

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,7 @@
27282728
"filter_metric_type" => "MetricTagConfigurationMetricTypeCategory",
27292729
"filter_include_percentiles" => "Boolean",
27302730
"filter_queried" => "Boolean",
2731+
"filter_queried_window_seconds" => "Integer",
27312732
"filter_tags" => "String",
27322733
"filter_related_assets" => "Boolean",
27332734
"window_seconds" => "Integer",

lib/datadog_api_client/v2/api/metrics_api.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ def list_tag_configurations(opts = {})
678678
# @option opts [MetricTagConfigurationMetricTypeCategory] :filter_metric_type Filter metrics by metric type.
679679
# @option opts [Boolean] :filter_include_percentiles Filter distributions with additional percentile aggregations enabled or disabled.
680680
# @option opts [Boolean] :filter_queried (Preview) Filter custom metrics that have or have not been queried in the specified window[seconds]. If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
681+
# @option opts [Integer] :filter_queried_window_seconds The number of seconds of look back (from now) used by the `filter[queried]` filter logic. Must be sent with `filter[queried]` and is only applied when `filter[queried]=true`. If `filter[queried]=false`, this parameter is ignored and default queried-window behavior applies. If `filter[queried]` is not provided, sending this parameter returns a 400. For example: `GET /api/v2/metrics?filter[queried]=true&filter[queried][window][seconds]=7776000`.
681682
# @option opts [String] :filter_tags Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. Can only be combined with the filter[queried] filter.
682683
# @option opts [Boolean] :filter_related_assets (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
683684
# @option opts [Integer] :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 2,592,000 (30 days).
@@ -693,6 +694,12 @@ def list_tag_configurations_with_http_info(opts = {})
693694
if @api_client.config.client_side_validation && opts[:'filter_metric_type'] && !allowable_values.include?(opts[:'filter_metric_type'])
694695
fail ArgumentError, "invalid value for \"filter_metric_type\", must be one of #{allowable_values}"
695696
end
697+
if @api_client.config.client_side_validation && !opts[:'filter_queried_window_seconds'].nil? && opts[:'filter_queried_window_seconds'] > 15552000
698+
fail ArgumentError, 'invalid value for "opts[:"filter_queried_window_seconds"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 15552000.'
699+
end
700+
if @api_client.config.client_side_validation && !opts[:'filter_queried_window_seconds'].nil? && opts[:'filter_queried_window_seconds'] < 0
701+
fail ArgumentError, 'invalid value for "opts[:"filter_queried_window_seconds"]" when calling MetricsAPI.list_tag_configurations, must be greater than or equal to 0.'
702+
end
696703
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
697704
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 10000.'
698705
end
@@ -709,6 +716,7 @@ def list_tag_configurations_with_http_info(opts = {})
709716
query_params[:'filter[metric_type]'] = opts[:'filter_metric_type'] if !opts[:'filter_metric_type'].nil?
710717
query_params[:'filter[include_percentiles]'] = opts[:'filter_include_percentiles'] if !opts[:'filter_include_percentiles'].nil?
711718
query_params[:'filter[queried]'] = opts[:'filter_queried'] if !opts[:'filter_queried'].nil?
719+
query_params[:'filter[queried][window][seconds]'] = opts[:'filter_queried_window_seconds'] if !opts[:'filter_queried_window_seconds'].nil?
712720
query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil?
713721
query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil?
714722
query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil?

0 commit comments

Comments
 (0)