Skip to content
Merged
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
101 changes: 101 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19897,6 +19897,45 @@ components:
x-enum-varnames:
- "TRUE"
- "FALSE"
CostTagMetadataMonth:
description: A month that has Cloud Cost Management tag metadata available for a given provider.
properties:
id:
description: The month, in `YYYY-MM` format.
example: "2026-04"
type: string
type:
$ref: "#/components/schemas/CostTagMetadataMonthType"
required:
- id
- type
type: object
CostTagMetadataMonthType:
default: cost_tag_metadata_month
description: Type of the Cloud Cost Management tag metadata month resource.
enum:
- cost_tag_metadata_month
example: cost_tag_metadata_month
type: string
x-enum-varnames:
- COST_TAG_METADATA_MONTH
CostTagMetadataMonthsResponse:
description: List of months that have Cloud Cost Management tag metadata for the requested provider, ordered most-recent first and capped at 36 months.
example:
data:
- id: "2026-04"
type: cost_tag_metadata_month
- id: "2026-03"
type: cost_tag_metadata_month
properties:
data:
description: List of months that have tag metadata available.
items:
$ref: "#/components/schemas/CostTagMetadataMonth"
type: array
required:
- data
type: object
CostTagType:
default: cost_tag
description: Type of the Cloud Cost Management tag resource.
Expand Down Expand Up @@ -111135,6 +111174,68 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cost/tag_metadata/months:
get:
description: |-
List months that have Cloud Cost Management tag metadata for a given provider,
ordered most-recent first. The response is capped at 36 months.
operationId: ListCostTagMetadataMonths
parameters:
- description: |-
Provider to scope the query to. Use the value of the `providername` tag in CCM
(for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`).
For costs uploaded through the Custom Costs API, use `custom`.
Values are case-sensitive.
example: aws
in: query
name: filter[provider]
required: true
schema:
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- id: "2026-04"
type: cost_tag_metadata_month
- id: "2026-03"
type: cost_tag_metadata_month
schema:
$ref: "#/components/schemas/CostTagMetadataMonthsResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Bad Request
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cloud_cost_management_read
summary: List Cloud Cost Management tag metadata months
tags:
- Cloud Cost Management
"x-permission":
operator: OR
permissions:
- cloud_cost_management_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/cost/tag_metadata/orchestrators:
get:
description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List Cloud Cost Management tag metadata months returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_cost_tag_metadata_months".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_cost_tag_metadata_months("filter[provider]")
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,9 @@
"filter_month" => "String",
"filter_provider" => "String",
},
"v2.ListCostTagMetadataMonths" => {
"filter_provider" => "String",
},
"v2.ListCostTagMetadataOrchestrators" => {
"filter_month" => "String",
"filter_provider" => "String",
Expand Down
16 changes: 16 additions & 0 deletions features/v2/cloud_cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,22 @@ Feature: Cloud Cost Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-cost-management
Scenario: List Cloud Cost Management tag metadata months returns "Bad Request" response
Given operation "ListCostTagMetadataMonths" enabled
And new "ListCostTagMetadataMonths" request
And request contains "filter[provider]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-cost-management
Scenario: List Cloud Cost Management tag metadata months returns "OK" response
Given operation "ListCostTagMetadataMonths" enabled
And new "ListCostTagMetadataMonths" request
And request contains "filter[provider]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-cost-management
Scenario: List Cloud Cost Management tag sources returns "Bad Request" response
Given operation "ListCostTagKeySources" enabled
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,12 @@
"type": "safe"
}
},
"ListCostTagMetadataMonths": {
"tag": "Cloud Cost Management",
"undo": {
"type": "safe"
}
},
"ListCostTagMetadataOrchestrators": {
"tag": "Cloud Cost Management",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def initialize
"v2.list_cost_tag_key_sources": false,
"v2.list_cost_tag_metadata": false,
"v2.list_cost_tag_metadata_metrics": false,
"v2.list_cost_tag_metadata_months": false,
"v2.list_cost_tag_metadata_orchestrators": false,
"v2.search_cost_recommendations": false,
"v2.create_dashboard_secure_embed": false,
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,9 @@ def overrides
"v2.cost_tag_keys_response" => "CostTagKeysResponse",
"v2.cost_tag_key_type" => "CostTagKeyType",
"v2.cost_tag_metadata_daily_filter" => "CostTagMetadataDailyFilter",
"v2.cost_tag_metadata_month" => "CostTagMetadataMonth",
"v2.cost_tag_metadata_months_response" => "CostTagMetadataMonthsResponse",
"v2.cost_tag_metadata_month_type" => "CostTagMetadataMonthType",
"v2.cost_tags_response" => "CostTagsResponse",
"v2.cost_tag_type" => "CostTagType",
"v2.coverage_summary_attributes" => "CoverageSummaryAttributes",
Expand Down
73 changes: 73 additions & 0 deletions lib/datadog_api_client/v2/api/cloud_cost_management_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3039,6 +3039,79 @@ def list_cost_tag_metadata_metrics_with_http_info(filter_month, opts = {})
return data, status_code, headers
end

# List Cloud Cost Management tag metadata months.
#
# @see #list_cost_tag_metadata_months_with_http_info
def list_cost_tag_metadata_months(filter_provider, opts = {})
data, _status_code, _headers = list_cost_tag_metadata_months_with_http_info(filter_provider, opts)
data
end

# List Cloud Cost Management tag metadata months.
#
# List months that have Cloud Cost Management tag metadata for a given provider,
# ordered most-recent first. The response is capped at 36 months.
#
# @param filter_provider [String] Provider to scope the query to. Use the value of the `providername` tag in CCM (for example, `aws`, `azure`, `gcp`, `Oracle`, `Confluent Cloud`, `Snowflake`). For costs uploaded through the Custom Costs API, use `custom`. Values are case-sensitive.
# @param opts [Hash] the optional parameters
# @return [Array<(CostTagMetadataMonthsResponse, Integer, Hash)>] CostTagMetadataMonthsResponse data, response status code and response headers
def list_cost_tag_metadata_months_with_http_info(filter_provider, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_metadata_months".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_metadata_months")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_metadata_months"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_metadata_months ...'
end
# verify the required parameter 'filter_provider' is set
if @api_client.config.client_side_validation && filter_provider.nil?
fail ArgumentError, "Missing the required parameter 'filter_provider' when calling CloudCostManagementAPI.list_cost_tag_metadata_months"
end
# resource path
local_var_path = '/api/v2/cost/tag_metadata/months'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'filter[provider]'] = filter_provider

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'CostTagMetadataMonthsResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :list_cost_tag_metadata_months,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: CloudCostManagementAPI#list_cost_tag_metadata_months\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# List Cloud Cost Management orchestrators.
#
# @see #list_cost_tag_metadata_orchestrators_with_http_info
Expand Down
Loading
Loading