Skip to content

Commit 37d4bfc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI definition for CCM ListCostTagDescriptions (#4060)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3866146 commit 37d4bfc

11 files changed

Lines changed: 974 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15600,6 +15600,98 @@ components:
1560015600
type: string
1560115601
x-enum-varnames:
1560215602
- COST_BY_ORG
15603+
CostTagDescription:
15604+
description: A Cloud Cost Management tag key description, either cross-cloud or scoped to a single cloud provider.
15605+
properties:
15606+
attributes:
15607+
$ref: "#/components/schemas/CostTagDescriptionAttributes"
15608+
id:
15609+
description: Stable identifier of the tag description. Equals the tag key when the description is the cross-cloud default; encodes both the cloud and the tag key when the description is cloud-specific.
15610+
example: account_id
15611+
type: string
15612+
type:
15613+
$ref: "#/components/schemas/CostTagDescriptionType"
15614+
required:
15615+
- attributes
15616+
- id
15617+
- type
15618+
type: object
15619+
CostTagDescriptionAttributes:
15620+
description: Human-readable description and metadata attached to a Cloud Cost Management tag key, optionally scoped to a single cloud provider.
15621+
properties:
15622+
cloud:
15623+
description: Cloud provider this description applies to (for example, `aws`). Empty when the description is the cross-cloud default for the tag key.
15624+
example: aws
15625+
type: string
15626+
created_at:
15627+
description: Timestamp when the description was created, in RFC 3339 format.
15628+
example: "2026-01-01T12:00:00Z"
15629+
type: string
15630+
description:
15631+
description: The human-readable description for the tag key.
15632+
example: AWS account that owns this cost.
15633+
type: string
15634+
source:
15635+
$ref: "#/components/schemas/CostTagDescriptionSource"
15636+
tag_key:
15637+
description: The tag key this description applies to.
15638+
example: account_id
15639+
type: string
15640+
updated_at:
15641+
description: Timestamp when the description was last updated, in RFC 3339 format.
15642+
example: "2026-01-01T12:00:00Z"
15643+
type: string
15644+
required:
15645+
- cloud
15646+
- created_at
15647+
- description
15648+
- source
15649+
- tag_key
15650+
- updated_at
15651+
type: object
15652+
CostTagDescriptionSource:
15653+
description: Origin of the description. `human` indicates the description was written by a user, `ai_generated` was produced by AI, and `datadog` is a default supplied by Datadog.
15654+
enum:
15655+
- human
15656+
- ai_generated
15657+
- datadog
15658+
example: human
15659+
type: string
15660+
x-enum-varnames:
15661+
- HUMAN
15662+
- AI_GENERATED
15663+
- DATADOG
15664+
CostTagDescriptionType:
15665+
default: cost_tag_description
15666+
description: Type of the Cloud Cost Management tag description resource.
15667+
enum:
15668+
- cost_tag_description
15669+
example: cost_tag_description
15670+
type: string
15671+
x-enum-varnames:
15672+
- COST_TAG_DESCRIPTION
15673+
CostTagDescriptionsResponse:
15674+
description: List of Cloud Cost Management tag key descriptions for the organization, optionally filtered to a single cloud provider.
15675+
example:
15676+
data:
15677+
- attributes:
15678+
cloud: aws
15679+
created_at: "2026-01-01T12:00:00Z"
15680+
description: AWS account that owns this cost.
15681+
source: human
15682+
tag_key: account_id
15683+
updated_at: "2026-01-01T12:00:00Z"
15684+
id: account_id
15685+
type: cost_tag_description
15686+
properties:
15687+
data:
15688+
description: List of tag key descriptions.
15689+
items:
15690+
$ref: "#/components/schemas/CostTagDescription"
15691+
type: array
15692+
required:
15693+
- data
15694+
type: object
1560315695
CoverageSummaryAttributes:
1560415696
description: Attributes object for code coverage summary response.
1560515697
properties:
@@ -96749,6 +96841,57 @@ paths:
9674996841
operator: OR
9675096842
permissions:
9675196843
- cloud_cost_management_read
96844+
/api/v2/cost/tag_descriptions:
96845+
get:
96846+
description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned.
96847+
operationId: ListCostTagDescriptions
96848+
parameters:
96849+
- description: Filter descriptions to a specific cloud provider (for example, `aws`). Omit to return descriptions across all clouds.
96850+
in: query
96851+
name: filter[cloud]
96852+
required: false
96853+
schema:
96854+
type: string
96855+
responses:
96856+
"200":
96857+
content:
96858+
application/json:
96859+
examples:
96860+
default:
96861+
value:
96862+
data:
96863+
- attributes:
96864+
cloud: aws
96865+
created_at: "2026-01-01T12:00:00Z"
96866+
description: AWS account that owns this cost.
96867+
source: human
96868+
tag_key: account_id
96869+
updated_at: "2026-01-01T12:00:00Z"
96870+
id: account_id
96871+
type: cost_tag_description
96872+
schema:
96873+
$ref: "#/components/schemas/CostTagDescriptionsResponse"
96874+
description: OK
96875+
"403":
96876+
content:
96877+
application/json:
96878+
schema:
96879+
$ref: "#/components/schemas/APIErrorResponse"
96880+
description: Forbidden
96881+
"429":
96882+
$ref: "#/components/responses/TooManyRequestsResponse"
96883+
security:
96884+
- apiKeyAuth: []
96885+
appKeyAuth: []
96886+
- AuthZ:
96887+
- cloud_cost_management_read
96888+
summary: List Cloud Cost Management tag descriptions
96889+
tags:
96890+
- Cloud Cost Management
96891+
"x-permission":
96892+
operator: OR
96893+
permissions:
96894+
- cloud_cost_management_read
9675296895
/api/v2/cost_by_tag/active_billing_dimensions:
9675396896
get:
9675496897
description: |-

api/datadogV2/api_cloud_cost_management.go

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,111 @@ func (a *CloudCostManagementApi) ListCostOCIConfigs(ctx _context.Context) (OCICo
18351835
return localVarReturnValue, localVarHTTPResponse, nil
18361836
}
18371837

1838+
// ListCostTagDescriptionsOptionalParameters holds optional parameters for ListCostTagDescriptions.
1839+
type ListCostTagDescriptionsOptionalParameters struct {
1840+
FilterCloud *string
1841+
}
1842+
1843+
// NewListCostTagDescriptionsOptionalParameters creates an empty struct for parameters.
1844+
func NewListCostTagDescriptionsOptionalParameters() *ListCostTagDescriptionsOptionalParameters {
1845+
this := ListCostTagDescriptionsOptionalParameters{}
1846+
return &this
1847+
}
1848+
1849+
// WithFilterCloud sets the corresponding parameter name and returns the struct.
1850+
func (r *ListCostTagDescriptionsOptionalParameters) WithFilterCloud(filterCloud string) *ListCostTagDescriptionsOptionalParameters {
1851+
r.FilterCloud = &filterCloud
1852+
return r
1853+
}
1854+
1855+
// ListCostTagDescriptions List Cloud Cost Management tag descriptions.
1856+
// List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned.
1857+
func (a *CloudCostManagementApi) ListCostTagDescriptions(ctx _context.Context, o ...ListCostTagDescriptionsOptionalParameters) (CostTagDescriptionsResponse, *_nethttp.Response, error) {
1858+
var (
1859+
localVarHTTPMethod = _nethttp.MethodGet
1860+
localVarPostBody interface{}
1861+
localVarReturnValue CostTagDescriptionsResponse
1862+
optionalParams ListCostTagDescriptionsOptionalParameters
1863+
)
1864+
1865+
if len(o) > 1 {
1866+
return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCostTagDescriptionsOptionalParameters is allowed")
1867+
}
1868+
if len(o) == 1 {
1869+
optionalParams = o[0]
1870+
}
1871+
1872+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListCostTagDescriptions")
1873+
if err != nil {
1874+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1875+
}
1876+
1877+
localVarPath := localBasePath + "/api/v2/cost/tag_descriptions"
1878+
1879+
localVarHeaderParams := make(map[string]string)
1880+
localVarQueryParams := _neturl.Values{}
1881+
localVarFormParams := _neturl.Values{}
1882+
if optionalParams.FilterCloud != nil {
1883+
localVarQueryParams.Add("filter[cloud]", datadog.ParameterToString(*optionalParams.FilterCloud, ""))
1884+
}
1885+
localVarHeaderParams["Accept"] = "application/json"
1886+
1887+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1888+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1889+
if err != nil {
1890+
return localVarReturnValue, nil, err
1891+
}
1892+
} else {
1893+
datadog.SetAuthKeys(
1894+
ctx,
1895+
&localVarHeaderParams,
1896+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1897+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1898+
)
1899+
}
1900+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1901+
if err != nil {
1902+
return localVarReturnValue, nil, err
1903+
}
1904+
1905+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1906+
if err != nil || localVarHTTPResponse == nil {
1907+
return localVarReturnValue, localVarHTTPResponse, err
1908+
}
1909+
1910+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1911+
if err != nil {
1912+
return localVarReturnValue, localVarHTTPResponse, err
1913+
}
1914+
1915+
if localVarHTTPResponse.StatusCode >= 300 {
1916+
newErr := datadog.GenericOpenAPIError{
1917+
ErrorBody: localVarBody,
1918+
ErrorMessage: localVarHTTPResponse.Status,
1919+
}
1920+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
1921+
var v APIErrorResponse
1922+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1923+
if err != nil {
1924+
return localVarReturnValue, localVarHTTPResponse, newErr
1925+
}
1926+
newErr.ErrorModel = v
1927+
}
1928+
return localVarReturnValue, localVarHTTPResponse, newErr
1929+
}
1930+
1931+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1932+
if err != nil {
1933+
newErr := datadog.GenericOpenAPIError{
1934+
ErrorBody: localVarBody,
1935+
ErrorMessage: err.Error(),
1936+
}
1937+
return localVarReturnValue, localVarHTTPResponse, newErr
1938+
}
1939+
1940+
return localVarReturnValue, localVarHTTPResponse, nil
1941+
}
1942+
18381943
// ListCustomAllocationRules List custom allocation rules.
18391944
// List all custom allocation rules - Retrieve a list of all custom allocation rules for the organization
18401945
func (a *CloudCostManagementApi) ListCustomAllocationRules(ctx _context.Context) (ArbitraryRuleResponseArray, *_nethttp.Response, error) {

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
// - [CloudCostManagementApi.ListCostAzureUCConfigs]
200200
// - [CloudCostManagementApi.ListCostGCPUsageCostConfigs]
201201
// - [CloudCostManagementApi.ListCostOCIConfigs]
202+
// - [CloudCostManagementApi.ListCostTagDescriptions]
202203
// - [CloudCostManagementApi.ListCustomAllocationRules]
203204
// - [CloudCostManagementApi.ListCustomAllocationRulesStatus]
204205
// - [CloudCostManagementApi.ListCustomCostsFiles]

0 commit comments

Comments
 (0)