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
1 change: 1 addition & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2824,6 +2824,7 @@
"filter_queried_window_seconds" => "Integer",
"filter_tags" => "String",
"filter_related_assets" => "Boolean",
"include" => "MetricVolumesInclude",
"window_seconds" => "Integer",
"page_size" => "Integer",
"page_cursor" => "String",
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3430,6 +3430,7 @@ def overrides
"v2.metric_pagination_meta" => "MetricPaginationMeta",
"v2.metric_payload" => "MetricPayload",
"v2.metric_point" => "MetricPoint",
"v2.metric_relationships" => "MetricRelationships",
"v2.metric_resource" => "MetricResource",
"v2.metrics_aggregator" => "MetricsAggregator",
"v2.metrics_and_metric_tag_configurations" => "MetricsAndMetricTagConfigurations",
Expand Down Expand Up @@ -3462,6 +3463,9 @@ def overrides
"v2.metric_tag_configuration_update_request" => "MetricTagConfigurationUpdateRequest",
"v2.metric_type" => "MetricType",
"v2.metric_volumes" => "MetricVolumes",
"v2.metric_volumes_include" => "MetricVolumesInclude",
"v2.metric_volumes_relationship" => "MetricVolumesRelationship",
"v2.metric_volumes_relationship_data" => "MetricVolumesRelationshipData",
"v2.metric_volumes_response" => "MetricVolumesResponse",
"v2.microsoft_sentinel_destination" => "MicrosoftSentinelDestination",
"v2.microsoft_sentinel_destination_type" => "MicrosoftSentinelDestinationType",
Expand Down
7 changes: 7 additions & 0 deletions lib/datadog_api_client/v2/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ def list_tag_configurations(opts = {})
# 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 opts [Hash] the optional parameters
# @option opts [Boolean] :filter_configured Filter custom metrics that have configured tags.
Expand All @@ -681,6 +682,7 @@ def list_tag_configurations(opts = {})
# @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`.
# @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.
# @option opts [Boolean] :filter_related_assets (Preview) Filter metrics that are used in dashboards, monitors, notebooks, SLOs.
# @option opts [MetricVolumesInclude] :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`.
# @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 5,184,000 (60 days).
# @option opts [Integer] :page_size Maximum number of results returned.
# @option opts [String] :page_cursor String to query the next page of results. This key is provided with each valid response from the API in `meta.pagination.next_cursor`. Once the `meta.pagination.next_cursor` key is null, all pages have been retrieved.
Expand All @@ -700,6 +702,10 @@ def list_tag_configurations_with_http_info(opts = {})
if @api_client.config.client_side_validation && !opts[:'filter_queried_window_seconds'].nil? && opts[:'filter_queried_window_seconds'] < 0
fail ArgumentError, 'invalid value for "opts[:"filter_queried_window_seconds"]" when calling MetricsAPI.list_tag_configurations, must be greater than or equal to 0.'
end
allowable_values = ['metric_volumes', 'generated_metric_attributes']
if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include'])
fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling MetricsAPI.list_tag_configurations, must be smaller than or equal to 10000.'
end
Expand All @@ -719,6 +725,7 @@ def list_tag_configurations_with_http_info(opts = {})
query_params[:'filter[queried][window][seconds]'] = opts[:'filter_queried_window_seconds'] if !opts[:'filter_queried_window_seconds'].nil?
query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil?
query_params[:'filter[related_assets]'] = opts[:'filter_related_assets'] if !opts[:'filter_related_assets'].nil?
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
query_params[:'window[seconds]'] = opts[:'window_seconds'] if !opts[:'window_seconds'].nil?
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
Expand Down
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v2/models/metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Metric
# The metric name for this resource.
attr_accessor :id

# Relationships to related metric objects.
attr_accessor :relationships

# The metric resource type.
attr_accessor :type

Expand All @@ -34,6 +37,7 @@ class Metric
def self.attribute_map
{
:'id' => :'id',
:'relationships' => :'relationships',
:'type' => :'type'
}
end
Expand All @@ -43,6 +47,7 @@ def self.attribute_map
def self.openapi_types
{
:'id' => :'String',
:'relationships' => :'MetricRelationships',
:'type' => :'MetricType'
}
end
Expand All @@ -69,6 +74,10 @@ def initialize(attributes = {})
self.id = attributes[:'id']
end

if attributes.key?(:'relationships')
self.relationships = attributes[:'relationships']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
end
Expand Down Expand Up @@ -101,6 +110,7 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
id == o.id &&
relationships == o.relationships &&
type == o.type &&
additional_properties == o.additional_properties
end
Expand All @@ -109,7 +119,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[id, type, additional_properties].hash
[id, relationships, type, additional_properties].hash
end
end
end
105 changes: 105 additions & 0 deletions lib/datadog_api_client/v2/models/metric_relationships.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

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 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Relationships to related metric objects.
class MetricRelationships
include BaseGenericModel

# Relationship to a metric's ingested and indexed volumes.
attr_accessor :metric_volumes

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'metric_volumes' => :'metric_volumes'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'metric_volumes' => :'MetricVolumesRelationship'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricRelationships` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'metric_volumes')
self.metric_volumes = attributes[:'metric_volumes']
end
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
metric_volumes == o.metric_volumes &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[metric_volumes, additional_properties].hash
end
end
end
27 changes: 27 additions & 0 deletions lib/datadog_api_client/v2/models/metric_volumes_include.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

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 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Comma-separated list of additional data to include in the response. Allowed values are `metric_volumes`.
class MetricVolumesInclude
include BaseEnumModel

METRIC_VOLUMES = "metric_volumes".freeze
GENERATED_METRIC_ATTRIBUTES = "generated_metric_attributes".freeze
end
end
Loading
Loading