Skip to content

Commit c1eabb5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 719bfbb of spec repo
1 parent 4ec3444 commit c1eabb5

19 files changed

Lines changed: 1936 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 418 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get a Cloud Cost Management tag key returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
p api_instance.get_cost_tag_key("tag_key")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# List Cloud Cost Management tag keys returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
p api_instance.list_cost_tag_keys()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# List Cloud Cost Management tags returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
p api_instance.list_cost_tags()

features/scenarios_model_mapping.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,6 +2188,22 @@
21882188
"v2.ListCostTagDescriptions" => {
21892189
"filter_cloud" => "String",
21902190
},
2191+
"v2.ListCostTagKeys" => {
2192+
"filter_metric" => "String",
2193+
"filter_tags" => "Array<String>",
2194+
},
2195+
"v2.GetCostTagKey" => {
2196+
"tag_key" => "String",
2197+
"filter_metric" => "String",
2198+
"page_size" => "Integer",
2199+
},
2200+
"v2.ListCostTags" => {
2201+
"filter_metric" => "String",
2202+
"filter_match" => "String",
2203+
"filter_tags" => "Array<String>",
2204+
"filter_tag_keys" => "Array<String>",
2205+
"page_size" => "Integer",
2206+
},
21912207
"v2.CreateTagPipelinesRuleset" => {
21922208
"body" => "CreateRulesetRequest",
21932209
},

features/v2/cloud_cost_management.feature

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,27 @@ Feature: Cloud Cost Management
250250
And the response "data.type" is equal to "gcp_uc_config"
251251
And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC"
252252

253+
@generated @skip @team:DataDog/cloud-cost-management
254+
Scenario: Get a Cloud Cost Management tag key returns "Bad Request" response
255+
Given new "GetCostTagKey" request
256+
And request contains "tag_key" parameter from "REPLACE.ME"
257+
When the request is sent
258+
Then the response status is 400 Bad Request
259+
260+
@generated @skip @team:DataDog/cloud-cost-management
261+
Scenario: Get a Cloud Cost Management tag key returns "Not Found" response
262+
Given new "GetCostTagKey" request
263+
And request contains "tag_key" parameter from "REPLACE.ME"
264+
When the request is sent
265+
Then the response status is 404 Not Found
266+
267+
@generated @skip @team:DataDog/cloud-cost-management
268+
Scenario: Get a Cloud Cost Management tag key returns "OK" response
269+
Given new "GetCostTagKey" request
270+
And request contains "tag_key" parameter from "REPLACE.ME"
271+
When the request is sent
272+
Then the response status is 200 OK
273+
253274
@team:DataDog/cloud-cost-management
254275
Scenario: Get a budget returns "Not Found" response
255276
Given new "GetBudget" request
@@ -325,6 +346,30 @@ Feature: Cloud Cost Management
325346
When the request is sent
326347
Then the response status is 200 OK
327348

349+
@generated @skip @team:DataDog/cloud-cost-management
350+
Scenario: List Cloud Cost Management tag keys returns "Bad Request" response
351+
Given new "ListCostTagKeys" request
352+
When the request is sent
353+
Then the response status is 400 Bad Request
354+
355+
@generated @skip @team:DataDog/cloud-cost-management
356+
Scenario: List Cloud Cost Management tag keys returns "OK" response
357+
Given new "ListCostTagKeys" request
358+
When the request is sent
359+
Then the response status is 200 OK
360+
361+
@generated @skip @team:DataDog/cloud-cost-management
362+
Scenario: List Cloud Cost Management tags returns "Bad Request" response
363+
Given new "ListCostTags" request
364+
When the request is sent
365+
Then the response status is 400 Bad Request
366+
367+
@generated @skip @team:DataDog/cloud-cost-management
368+
Scenario: List Cloud Cost Management tags returns "OK" response
369+
Given new "ListCostTags" request
370+
When the request is sent
371+
Then the response status is 200 OK
372+
328373
@replay-only @team:DataDog/cloud-cost-management
329374
Scenario: List Custom Costs Files returns "OK" response
330375
Given new "ListCustomCostsFiles" request

features/v2/undo.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,24 @@
14761476
"type": "safe"
14771477
}
14781478
},
1479+
"ListCostTagKeys": {
1480+
"tag": "Cloud Cost Management",
1481+
"undo": {
1482+
"type": "safe"
1483+
}
1484+
},
1485+
"GetCostTagKey": {
1486+
"tag": "Cloud Cost Management",
1487+
"undo": {
1488+
"type": "safe"
1489+
}
1490+
},
1491+
"ListCostTags": {
1492+
"tag": "Cloud Cost Management",
1493+
"undo": {
1494+
"type": "safe"
1495+
}
1496+
},
14791497
"GetActiveBillingDimensions": {
14801498
"tag": "Usage Metering",
14811499
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,11 +1988,21 @@ def overrides
19881988
"v2.cost_by_org_attributes" => "CostByOrgAttributes",
19891989
"v2.cost_by_org_response" => "CostByOrgResponse",
19901990
"v2.cost_by_org_type" => "CostByOrgType",
1991+
"v2.cost_tag" => "CostTag",
1992+
"v2.cost_tag_attributes" => "CostTagAttributes",
19911993
"v2.cost_tag_description" => "CostTagDescription",
19921994
"v2.cost_tag_description_attributes" => "CostTagDescriptionAttributes",
19931995
"v2.cost_tag_description_source" => "CostTagDescriptionSource",
19941996
"v2.cost_tag_descriptions_response" => "CostTagDescriptionsResponse",
19951997
"v2.cost_tag_description_type" => "CostTagDescriptionType",
1998+
"v2.cost_tag_key" => "CostTagKey",
1999+
"v2.cost_tag_key_attributes" => "CostTagKeyAttributes",
2000+
"v2.cost_tag_key_details" => "CostTagKeyDetails",
2001+
"v2.cost_tag_key_response" => "CostTagKeyResponse",
2002+
"v2.cost_tag_keys_response" => "CostTagKeysResponse",
2003+
"v2.cost_tag_key_type" => "CostTagKeyType",
2004+
"v2.cost_tags_response" => "CostTagsResponse",
2005+
"v2.cost_tag_type" => "CostTagType",
19962006
"v2.coverage_summary_attributes" => "CoverageSummaryAttributes",
19972007
"v2.coverage_summary_codeowner_stats" => "CoverageSummaryCodeownerStats",
19982008
"v2.coverage_summary_data" => "CoverageSummaryData",

lib/datadog_api_client/v2/api/cloud_cost_management_api.rb

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,78 @@ def get_cost_gcp_usage_cost_config_with_http_info(cloud_account_id, opts = {})
10851085
return data, status_code, headers
10861086
end
10871087

1088+
# Get a Cloud Cost Management tag key.
1089+
#
1090+
# @see #get_cost_tag_key_with_http_info
1091+
def get_cost_tag_key(tag_key, opts = {})
1092+
data, _status_code, _headers = get_cost_tag_key_with_http_info(tag_key, opts)
1093+
data
1094+
end
1095+
1096+
# Get a Cloud Cost Management tag key.
1097+
#
1098+
# Get details for a specific Cloud Cost Management tag key, including example tag values and description.
1099+
#
1100+
# @param tag_key [String] The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, `kubernetes/instance`).
1101+
# @param opts [Hash] the optional parameters
1102+
# @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics.
1103+
# @option opts [Integer] :page_size Controls the size of the internal tag value search scope. This does **not** restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000.
1104+
# @return [Array<(CostTagKeyResponse, Integer, Hash)>] CostTagKeyResponse data, response status code and response headers
1105+
def get_cost_tag_key_with_http_info(tag_key, opts = {})
1106+
1107+
if @api_client.config.debugging
1108+
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_cost_tag_key ...'
1109+
end
1110+
# verify the required parameter 'tag_key' is set
1111+
if @api_client.config.client_side_validation && tag_key.nil?
1112+
fail ArgumentError, "Missing the required parameter 'tag_key' when calling CloudCostManagementAPI.get_cost_tag_key"
1113+
end
1114+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
1115+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.get_cost_tag_key, must be smaller than or equal to 10000.'
1116+
end
1117+
# resource path
1118+
local_var_path = '/api/v2/cost/tag_keys/{tag_key}'.sub('{tag_key}', CGI.escape(tag_key.to_s).gsub('%2F', '/'))
1119+
1120+
# query parameters
1121+
query_params = opts[:query_params] || {}
1122+
query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil?
1123+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
1124+
1125+
# header parameters
1126+
header_params = opts[:header_params] || {}
1127+
# HTTP header 'Accept' (if needed)
1128+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1129+
1130+
# form parameters
1131+
form_params = opts[:form_params] || {}
1132+
1133+
# http body (model)
1134+
post_body = opts[:debug_body]
1135+
1136+
# return_type
1137+
return_type = opts[:debug_return_type] || 'CostTagKeyResponse'
1138+
1139+
# auth_names
1140+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1141+
1142+
new_options = opts.merge(
1143+
:operation => :get_cost_tag_key,
1144+
:header_params => header_params,
1145+
:query_params => query_params,
1146+
:form_params => form_params,
1147+
:body => post_body,
1148+
:auth_names => auth_names,
1149+
:return_type => return_type,
1150+
:api_version => "V2"
1151+
)
1152+
1153+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1154+
if @api_client.config.debugging
1155+
@api_client.config.logger.debug "API called: CloudCostManagementAPI#get_cost_tag_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1156+
end
1157+
return data, status_code, headers
1158+
end
1159+
10881160
# Get custom allocation rule.
10891161
#
10901162
# @see #get_custom_allocation_rule_with_http_info
@@ -1642,6 +1714,145 @@ def list_cost_tag_descriptions_with_http_info(opts = {})
16421714
return data, status_code, headers
16431715
end
16441716

1717+
# List Cloud Cost Management tag keys.
1718+
#
1719+
# @see #list_cost_tag_keys_with_http_info
1720+
def list_cost_tag_keys(opts = {})
1721+
data, _status_code, _headers = list_cost_tag_keys_with_http_info(opts)
1722+
data
1723+
end
1724+
1725+
# List Cloud Cost Management tag keys.
1726+
#
1727+
# List Cloud Cost Management tag keys.
1728+
#
1729+
# @param opts [Hash] the optional parameters
1730+
# @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics.
1731+
# @option opts [Array<String>] :filter_tags Filter to return only tag keys that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tag keys found on the same cost data, such as `is_aws_ec2_compute` and `aws_instance_type`.
1732+
# @return [Array<(CostTagKeysResponse, Integer, Hash)>] CostTagKeysResponse data, response status code and response headers
1733+
def list_cost_tag_keys_with_http_info(opts = {})
1734+
1735+
if @api_client.config.debugging
1736+
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_keys ...'
1737+
end
1738+
# resource path
1739+
local_var_path = '/api/v2/cost/tag_keys'
1740+
1741+
# query parameters
1742+
query_params = opts[:query_params] || {}
1743+
query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil?
1744+
query_params[:'filter[tags]'] = @api_client.build_collection_param(opts[:'filter_tags'], :multi) if !opts[:'filter_tags'].nil?
1745+
1746+
# header parameters
1747+
header_params = opts[:header_params] || {}
1748+
# HTTP header 'Accept' (if needed)
1749+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1750+
1751+
# form parameters
1752+
form_params = opts[:form_params] || {}
1753+
1754+
# http body (model)
1755+
post_body = opts[:debug_body]
1756+
1757+
# return_type
1758+
return_type = opts[:debug_return_type] || 'CostTagKeysResponse'
1759+
1760+
# auth_names
1761+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1762+
1763+
new_options = opts.merge(
1764+
:operation => :list_cost_tag_keys,
1765+
:header_params => header_params,
1766+
:query_params => query_params,
1767+
:form_params => form_params,
1768+
:body => post_body,
1769+
:auth_names => auth_names,
1770+
:return_type => return_type,
1771+
:api_version => "V2"
1772+
)
1773+
new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER
1774+
1775+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1776+
if @api_client.config.debugging
1777+
@api_client.config.logger.debug "API called: CloudCostManagementAPI#list_cost_tag_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1778+
end
1779+
return data, status_code, headers
1780+
end
1781+
1782+
# List Cloud Cost Management tags.
1783+
#
1784+
# @see #list_cost_tags_with_http_info
1785+
def list_cost_tags(opts = {})
1786+
data, _status_code, _headers = list_cost_tags_with_http_info(opts)
1787+
data
1788+
end
1789+
1790+
# List Cloud Cost Management tags.
1791+
#
1792+
# List Cloud Cost Management tags for a given metric.
1793+
#
1794+
# @param opts [Hash] the optional parameters
1795+
# @option opts [String] :filter_metric The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics.
1796+
# @option opts [String] :filter_match A substring used to filter the returned tags by name.
1797+
# @option opts [Array<String>] :filter_tags Filter to return only tags that appear with the given `key:value` tag values. For example, `filter[tags]=providername:aws` returns tags found on the same cost data, such as `aws_instance_type:t3.micro` and `aws_instance_type:m5.large`.
1798+
# @option opts [Array<String>] :filter_tag_keys Restrict the returned tags to those whose key matches one of the given tag keys.
1799+
# @option opts [Integer] :page_size Controls the size of the internal tag search scope. This does **not** restrict the number of tags returned in the response. Defaults to 50, maximum 10000.
1800+
# @return [Array<(CostTagsResponse, Integer, Hash)>] CostTagsResponse data, response status code and response headers
1801+
def list_cost_tags_with_http_info(opts = {})
1802+
1803+
if @api_client.config.debugging
1804+
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tags ...'
1805+
end
1806+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
1807+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.list_cost_tags, must be smaller than or equal to 10000.'
1808+
end
1809+
# resource path
1810+
local_var_path = '/api/v2/cost/tags'
1811+
1812+
# query parameters
1813+
query_params = opts[:query_params] || {}
1814+
query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil?
1815+
query_params[:'filter[match]'] = opts[:'filter_match'] if !opts[:'filter_match'].nil?
1816+
query_params[:'filter[tags]'] = @api_client.build_collection_param(opts[:'filter_tags'], :multi) if !opts[:'filter_tags'].nil?
1817+
query_params[:'filter[tag_keys]'] = @api_client.build_collection_param(opts[:'filter_tag_keys'], :multi) if !opts[:'filter_tag_keys'].nil?
1818+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
1819+
1820+
# header parameters
1821+
header_params = opts[:header_params] || {}
1822+
# HTTP header 'Accept' (if needed)
1823+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1824+
1825+
# form parameters
1826+
form_params = opts[:form_params] || {}
1827+
1828+
# http body (model)
1829+
post_body = opts[:debug_body]
1830+
1831+
# return_type
1832+
return_type = opts[:debug_return_type] || 'CostTagsResponse'
1833+
1834+
# auth_names
1835+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1836+
1837+
new_options = opts.merge(
1838+
:operation => :list_cost_tags,
1839+
:header_params => header_params,
1840+
:query_params => query_params,
1841+
:form_params => form_params,
1842+
:body => post_body,
1843+
:auth_names => auth_names,
1844+
:return_type => return_type,
1845+
:api_version => "V2"
1846+
)
1847+
new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER
1848+
1849+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1850+
if @api_client.config.debugging
1851+
@api_client.config.logger.debug "API called: CloudCostManagementAPI#list_cost_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1852+
end
1853+
return data, status_code, headers
1854+
end
1855+
16451856
# List custom allocation rules.
16461857
#
16471858
# @see #list_custom_allocation_rules_with_http_info

0 commit comments

Comments
 (0)