Skip to content

Commit 61ae4b7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2ee70e91 of spec repo
1 parent 61119e2 commit 61ae4b7

File tree

12 files changed

+664
-4
lines changed

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-06-23 18:01:51.061954",
8-
"spec_repo_commit": "9a201ac7"
7+
"regenerated": "2025-06-23 19:57:15.625851",
8+
"spec_repo_commit": "2ee70e91"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-23 18:01:51.078390",
13-
"spec_repo_commit": "9a201ac7"
12+
"regenerated": "2025-06-23 19:57:15.641868",
13+
"spec_repo_commit": "2ee70e91"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22492,6 +22492,61 @@ components:
2249222492
type: string
2249322493
type: array
2249422494
type: object
22495+
MetricTagCardinalitiesData:
22496+
description: A list of tag cardinalities associated with the given metric.
22497+
items:
22498+
$ref: '#/components/schemas/MetricTagCardinality'
22499+
type: array
22500+
MetricTagCardinalitiesMeta:
22501+
description: Response metadata object.
22502+
properties:
22503+
metric_name:
22504+
description: 'The name of metric for which the tag cardinalities are returned.
22505+
22506+
This matches the metric name provided in the request.
22507+
22508+
'
22509+
type: string
22510+
type: object
22511+
MetricTagCardinalitiesResponse:
22512+
description: 'Response object that includes an array of objects representing
22513+
the cardinality details of a metric''s tags.
22514+
22515+
'
22516+
properties:
22517+
data:
22518+
$ref: '#/components/schemas/MetricTagCardinalitiesData'
22519+
meta:
22520+
$ref: '#/components/schemas/MetricTagCardinalitiesMeta'
22521+
readOnly: true
22522+
type: object
22523+
MetricTagCardinality:
22524+
description: Object containing metadata and attributes related to a specific
22525+
tag key associated with the metric.
22526+
example:
22527+
attributes:
22528+
cardinality_delta: 25
22529+
id: http.request.latency
22530+
type: get-tag-cardinalities
22531+
properties:
22532+
attributes:
22533+
$ref: '#/components/schemas/MetricTagCardinalityAttributes'
22534+
id:
22535+
description: The name of the tag key.
22536+
type: string
22537+
type:
22538+
default: get-tag-cardinalities
22539+
description: This describes the endpoint action.
22540+
type: string
22541+
type: object
22542+
MetricTagCardinalityAttributes:
22543+
description: An object containing properties related to the tag key
22544+
properties:
22545+
cardinality_delta:
22546+
description: This describes the recent change in the tag keys cardinality
22547+
format: int64
22548+
type: integer
22549+
type: object
2249522550
MetricTagConfiguration:
2249622551
description: Object for a single metric tag configuration.
2249722552
example:
@@ -51863,6 +51918,50 @@ paths:
5186351918
x-permission:
5186451919
operator: OPEN
5186551920
permissions: []
51921+
/api/v2/metrics/{metric_name}/tag-cardinalities:
51922+
get:
51923+
description: Returns the cardinality details of tags for a specific metric.
51924+
operationId: GetTagKeyCardinalityDetails
51925+
parameters:
51926+
- $ref: '#/components/parameters/MetricName'
51927+
responses:
51928+
'200':
51929+
content:
51930+
application/json:
51931+
schema:
51932+
$ref: '#/components/schemas/MetricTagCardinalitiesResponse'
51933+
description: Success
51934+
'400':
51935+
content:
51936+
application/json:
51937+
schema:
51938+
$ref: '#/components/schemas/APIErrorResponse'
51939+
description: Bad Request
51940+
'403':
51941+
content:
51942+
application/json:
51943+
schema:
51944+
$ref: '#/components/schemas/APIErrorResponse'
51945+
description: Forbidden
51946+
'404':
51947+
content:
51948+
application/json:
51949+
schema:
51950+
$ref: '#/components/schemas/APIErrorResponse'
51951+
description: Not Found
51952+
'429':
51953+
content:
51954+
application/json:
51955+
schema:
51956+
$ref: '#/components/schemas/APIErrorResponse'
51957+
description: Too Many Requests
51958+
summary: Get tag key cardinality details
51959+
tags:
51960+
- Metrics
51961+
x-permission:
51962+
operator: OR
51963+
permissions:
51964+
- metrics_read
5186651965
/api/v2/metrics/{metric_name}/tags:
5186751966
delete:
5186851967
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_tag_key_cardinality_details("metric_name")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,9 @@
19991999
"filter_pct" => "Boolean",
20002000
"filter_timespan_h" => "Integer",
20012001
},
2002+
"v2.GetTagKeyCardinalityDetails" => {
2003+
"metric_name" => "String",
2004+
},
20022005
"v2.DeleteTagConfiguration" => {
20032006
"metric_name" => "String",
20042007
},

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 "GetTagKeyCardinalityDetails" 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 "GetTagKeyCardinalityDetails" 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 "GetTagKeyCardinalityDetails" 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
@@ -1773,6 +1773,12 @@
17731773
"type": "safe"
17741774
}
17751775
},
1776+
"GetTagKeyCardinalityDetails": {
1777+
"tag": "Metrics",
1778+
"undo": {
1779+
"type": "safe"
1780+
}
1781+
},
17761782
"DeleteTagConfiguration": {
17771783
"tag": "Metrics",
17781784
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,10 @@ def overrides
22862286
"v2.metric_suggested_tags_and_aggregations" => "MetricSuggestedTagsAndAggregations",
22872287
"v2.metric_suggested_tags_and_aggregations_response" => "MetricSuggestedTagsAndAggregationsResponse",
22882288
"v2.metric_suggested_tags_attributes" => "MetricSuggestedTagsAttributes",
2289+
"v2.metric_tag_cardinalities_meta" => "MetricTagCardinalitiesMeta",
2290+
"v2.metric_tag_cardinalities_response" => "MetricTagCardinalitiesResponse",
2291+
"v2.metric_tag_cardinality" => "MetricTagCardinality",
2292+
"v2.metric_tag_cardinality_attributes" => "MetricTagCardinalityAttributes",
22892293
"v2.metric_tag_configuration" => "MetricTagConfiguration",
22902294
"v2.metric_tag_configuration_attributes" => "MetricTagConfigurationAttributes",
22912295
"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_tag_key_cardinality_details_with_http_info
401+
def get_tag_key_cardinality_details(metric_name, opts = {})
402+
data, _status_code, _headers = get_tag_key_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_tag_key_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_tag_key_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_tag_key_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_tag_key_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_tag_key_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+
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)