Skip to content

Commit 045ffb5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6fc2e412 of spec repo
1 parent d8d376f commit 045ffb5

12 files changed

+664
-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.6",
7-
"regenerated": "2025-07-08 07:29:02.458919",
8-
"spec_repo_commit": "d9879085"
7+
"regenerated": "2025-07-08 18:40:12.304249",
8+
"spec_repo_commit": "6fc2e412"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-08 07:29:02.475424",
13-
"spec_repo_commit": "d9879085"
12+
"regenerated": "2025-07-08 18:40:12.320433",
13+
"spec_repo_commit": "6fc2e412"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22807,6 +22807,61 @@ components:
2280722807
type: string
2280822808
type: array
2280922809
type: object
22810+
MetricTagCardinalitiesData:
22811+
description: A list of tag cardinalities associated with the given metric.
22812+
items:
22813+
$ref: '#/components/schemas/MetricTagCardinality'
22814+
type: array
22815+
MetricTagCardinalitiesMeta:
22816+
description: Response metadata object.
22817+
properties:
22818+
metric_name:
22819+
description: 'The name of metric for which the tag cardinalities are returned.
22820+
22821+
This matches the metric name provided in the request.
22822+
22823+
'
22824+
type: string
22825+
type: object
22826+
MetricTagCardinalitiesResponse:
22827+
description: 'Response object that includes an array of objects representing
22828+
the cardinality details of a metric''s tags.
22829+
22830+
'
22831+
properties:
22832+
data:
22833+
$ref: '#/components/schemas/MetricTagCardinalitiesData'
22834+
meta:
22835+
$ref: '#/components/schemas/MetricTagCardinalitiesMeta'
22836+
readOnly: true
22837+
type: object
22838+
MetricTagCardinality:
22839+
description: Object containing metadata and attributes related to a specific
22840+
tag key associated with the metric.
22841+
example:
22842+
attributes:
22843+
cardinality_delta: 25
22844+
id: http.request.latency
22845+
type: tag_cardinality
22846+
properties:
22847+
attributes:
22848+
$ref: '#/components/schemas/MetricTagCardinalityAttributes'
22849+
id:
22850+
description: The name of the tag key.
22851+
type: string
22852+
type:
22853+
default: tag_cardinality
22854+
description: This describes the endpoint action.
22855+
type: string
22856+
type: object
22857+
MetricTagCardinalityAttributes:
22858+
description: An object containing properties related to the tag key
22859+
properties:
22860+
cardinality_delta:
22861+
description: This describes the recent change in the tag keys cardinality
22862+
format: int64
22863+
type: integer
22864+
type: object
2281022865
MetricTagConfiguration:
2281122866
description: Object for a single metric tag configuration.
2281222867
example:
@@ -52849,6 +52904,50 @@ paths:
5284952904
x-permission:
5285052905
operator: OPEN
5285152906
permissions: []
52907+
/api/v2/metrics/{metric_name}/tag-cardinalities:
52908+
get:
52909+
description: Returns the cardinality details of tags for a specific metric.
52910+
operationId: GetMetricTagCardinalityDetails
52911+
parameters:
52912+
- $ref: '#/components/parameters/MetricName'
52913+
responses:
52914+
'200':
52915+
content:
52916+
application/json:
52917+
schema:
52918+
$ref: '#/components/schemas/MetricTagCardinalitiesResponse'
52919+
description: Success
52920+
'400':
52921+
content:
52922+
application/json:
52923+
schema:
52924+
$ref: '#/components/schemas/APIErrorResponse'
52925+
description: Bad Request
52926+
'403':
52927+
content:
52928+
application/json:
52929+
schema:
52930+
$ref: '#/components/schemas/APIErrorResponse'
52931+
description: Forbidden
52932+
'404':
52933+
content:
52934+
application/json:
52935+
schema:
52936+
$ref: '#/components/schemas/APIErrorResponse'
52937+
description: Not Found
52938+
'429':
52939+
content:
52940+
application/json:
52941+
schema:
52942+
$ref: '#/components/schemas/APIErrorResponse'
52943+
description: Too Many Requests
52944+
summary: Get tag key cardinality details
52945+
tags:
52946+
- Metrics
52947+
x-permission:
52948+
operator: OR
52949+
permissions:
52950+
- metrics_read
5285252951
/api/v2/metrics/{metric_name}/tags:
5285352952
delete:
5285452953
description: 'Deletes a metric''s tag configuration. Can only be used with application
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get tag key cardinality details returns "Success" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::MetricsAPI.new
5+
p api_instance.get_metric_tag_cardinality_details("metric_name")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,9 @@
20302030
"filter_pct" => "Boolean",
20312031
"filter_timespan_h" => "Integer",
20322032
},
2033+
"v2.GetMetricTagCardinalityDetails" => {
2034+
"metric_name" => "String",
2035+
},
20332036
"v2.DeleteTagConfiguration" => {
20342037
"metric_name" => "String",
20352038
},

features/v2/metrics.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,30 @@ Feature: Metrics
152152
Then the response status is 200 Success
153153
And the response "data[0].type" is equal to "manage_tags"
154154

155+
@generated @skip @team:DataDog/metrics-experience
156+
Scenario: Get tag key cardinality details returns "Bad Request" response
157+
Given a valid "appKeyAuth" key in the system
158+
And new "GetMetricTagCardinalityDetails" request
159+
And request contains "metric_name" parameter from "REPLACE.ME"
160+
When the request is sent
161+
Then the response status is 400 Bad Request
162+
163+
@generated @skip @team:DataDog/metrics-experience
164+
Scenario: Get tag key cardinality details returns "Not Found" response
165+
Given a valid "appKeyAuth" key in the system
166+
And new "GetMetricTagCardinalityDetails" request
167+
And request contains "metric_name" parameter from "REPLACE.ME"
168+
When the request is sent
169+
Then the response status is 404 Not Found
170+
171+
@generated @skip @team:DataDog/metrics-experience
172+
Scenario: Get tag key cardinality details returns "Success" response
173+
Given a valid "appKeyAuth" key in the system
174+
And new "GetMetricTagCardinalityDetails" request
175+
And request contains "metric_name" parameter from "REPLACE.ME"
176+
When the request is sent
177+
Then the response status is 200 Success
178+
155179
@generated @skip @team:DataDog/metrics-experience
156180
Scenario: List active tags and aggregations returns "Bad Request" response
157181
Given a valid "appKeyAuth" key in the system

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,12 @@
18271827
"type": "safe"
18281828
}
18291829
},
1830+
"GetMetricTagCardinalityDetails": {
1831+
"tag": "Metrics",
1832+
"undo": {
1833+
"type": "safe"
1834+
}
1835+
},
18301836
"DeleteTagConfiguration": {
18311837
"tag": "Metrics",
18321838
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,10 @@ def overrides
23182318
"v2.metric_suggested_tags_and_aggregations" => "MetricSuggestedTagsAndAggregations",
23192319
"v2.metric_suggested_tags_and_aggregations_response" => "MetricSuggestedTagsAndAggregationsResponse",
23202320
"v2.metric_suggested_tags_attributes" => "MetricSuggestedTagsAttributes",
2321+
"v2.metric_tag_cardinalities_meta" => "MetricTagCardinalitiesMeta",
2322+
"v2.metric_tag_cardinalities_response" => "MetricTagCardinalitiesResponse",
2323+
"v2.metric_tag_cardinality" => "MetricTagCardinality",
2324+
"v2.metric_tag_cardinality_attributes" => "MetricTagCardinalityAttributes",
23212325
"v2.metric_tag_configuration" => "MetricTagConfiguration",
23222326
"v2.metric_tag_configuration_attributes" => "MetricTagConfigurationAttributes",
23232327
"v2.metric_tag_configuration_create_attributes" => "MetricTagConfigurationCreateAttributes",

lib/datadog_api_client/v2/api/metrics_api.rb

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,71 @@ def estimate_metrics_output_series_with_http_info(metric_name, opts = {})
395395
return data, status_code, headers
396396
end
397397

398+
# Get tag key cardinality details.
399+
#
400+
# @see #get_metric_tag_cardinality_details_with_http_info
401+
def get_metric_tag_cardinality_details(metric_name, opts = {})
402+
data, _status_code, _headers = get_metric_tag_cardinality_details_with_http_info(metric_name, opts)
403+
data
404+
end
405+
406+
# Get tag key cardinality details.
407+
#
408+
# Returns the cardinality details of tags for a specific metric.
409+
#
410+
# @param metric_name [String] The name of the metric.
411+
# @param opts [Hash] the optional parameters
412+
# @return [Array<(MetricTagCardinalitiesResponse, Integer, Hash)>] MetricTagCardinalitiesResponse data, response status code and response headers
413+
def get_metric_tag_cardinality_details_with_http_info(metric_name, opts = {})
414+
415+
if @api_client.config.debugging
416+
@api_client.config.logger.debug 'Calling API: MetricsAPI.get_metric_tag_cardinality_details ...'
417+
end
418+
# verify the required parameter 'metric_name' is set
419+
if @api_client.config.client_side_validation && metric_name.nil?
420+
fail ArgumentError, "Missing the required parameter 'metric_name' when calling MetricsAPI.get_metric_tag_cardinality_details"
421+
end
422+
# resource path
423+
local_var_path = '/api/v2/metrics/{metric_name}/tag-cardinalities'.sub('{metric_name}', CGI.escape(metric_name.to_s).gsub('%2F', '/'))
424+
425+
# query parameters
426+
query_params = opts[:query_params] || {}
427+
428+
# header parameters
429+
header_params = opts[:header_params] || {}
430+
# HTTP header 'Accept' (if needed)
431+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
432+
433+
# form parameters
434+
form_params = opts[:form_params] || {}
435+
436+
# http body (model)
437+
post_body = opts[:debug_body]
438+
439+
# return_type
440+
return_type = opts[:debug_return_type] || 'MetricTagCardinalitiesResponse'
441+
442+
# auth_names
443+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
444+
445+
new_options = opts.merge(
446+
:operation => :get_metric_tag_cardinality_details,
447+
:header_params => header_params,
448+
:query_params => query_params,
449+
:form_params => form_params,
450+
:body => post_body,
451+
:auth_names => auth_names,
452+
:return_type => return_type,
453+
:api_version => "V2"
454+
)
455+
456+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
457+
if @api_client.config.debugging
458+
@api_client.config.logger.debug "API called: MetricsAPI#get_metric_tag_cardinality_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459+
end
460+
return data, status_code, headers
461+
end
462+
398463
# List active tags and aggregations.
399464
#
400465
# @see #list_active_metric_configurations_with_http_info
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Response metadata object.
21+
class MetricTagCardinalitiesMeta
22+
include BaseGenericModel
23+
24+
# The name of metric for which the tag cardinalities are returned.
25+
# This matches the metric name provided in the request.
26+
#
27+
attr_accessor :metric_name
28+
29+
attr_accessor :additional_properties
30+
31+
# Attribute mapping from ruby-style variable name to JSON key.
32+
# @!visibility private
33+
def self.attribute_map
34+
{
35+
:'metric_name' => :'metric_name'
36+
}
37+
end
38+
39+
# Attribute type mapping.
40+
# @!visibility private
41+
def self.openapi_types
42+
{
43+
:'metric_name' => :'String'
44+
}
45+
end
46+
47+
# Initializes the object
48+
# @param attributes [Hash] Model attributes in the form of hash
49+
# @!visibility private
50+
def initialize(attributes = {})
51+
if (!attributes.is_a?(Hash))
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MetricTagCardinalitiesMeta` initialize method"
53+
end
54+
55+
self.additional_properties = {}
56+
# check to see if the attribute exists and convert string to symbol for hash key
57+
attributes = attributes.each_with_object({}) { |(k, v), h|
58+
if (!self.class.attribute_map.key?(k.to_sym))
59+
self.additional_properties[k.to_sym] = v
60+
else
61+
h[k.to_sym] = v
62+
end
63+
}
64+
65+
if attributes.key?(:'metric_name')
66+
self.metric_name = attributes[:'metric_name']
67+
end
68+
end
69+
70+
# Returns the object in the form of hash, with additionalProperties support.
71+
# @return [Hash] Returns the object in the form of hash
72+
# @!visibility private
73+
def to_hash
74+
hash = {}
75+
self.class.attribute_map.each_pair do |attr, param|
76+
value = self.send(attr)
77+
if value.nil?
78+
is_nullable = self.class.openapi_nullable.include?(attr)
79+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
80+
end
81+
82+
hash[param] = _to_hash(value)
83+
end
84+
self.additional_properties.each_pair do |attr, value|
85+
hash[attr] = value
86+
end
87+
hash
88+
end
89+
90+
# Checks equality by comparing each attribute.
91+
# @param o [Object] Object to be compared
92+
# @!visibility private
93+
def ==(o)
94+
return true if self.equal?(o)
95+
self.class == o.class &&
96+
metric_name == o.metric_name &&
97+
additional_properties == o.additional_properties
98+
end
99+
100+
# Calculates hash code according to all attributes.
101+
# @return [Integer] Hash code
102+
# @!visibility private
103+
def hash
104+
[metric_name, additional_properties].hash
105+
end
106+
end
107+
end

0 commit comments

Comments
 (0)