Skip to content

Commit f419b98

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

10 files changed

Lines changed: 1145 additions & 0 deletions

File tree

.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: |-
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List Cloud Cost Management tag descriptions returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudCostManagementApi;
6+
import com.datadog.api.client.v2.model.CostTagDescriptionsResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);
12+
13+
try {
14+
CostTagDescriptionsResponse result = apiInstance.listCostTagDescriptions();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling CloudCostManagementApi#listCostTagDescriptions");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}

src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.datadog.api.client.v2.model.BudgetValidationRequest;
2121
import com.datadog.api.client.v2.model.BudgetValidationResponse;
2222
import com.datadog.api.client.v2.model.BudgetWithEntries;
23+
import com.datadog.api.client.v2.model.CostTagDescriptionsResponse;
2324
import com.datadog.api.client.v2.model.CreateRulesetRequest;
2425
import com.datadog.api.client.v2.model.CustomCostsFileGetResponse;
2526
import com.datadog.api.client.v2.model.CustomCostsFileLineItem;
@@ -3211,6 +3212,180 @@ public CompletableFuture<ApiResponse<OCIConfigsResponse>> listCostOCIConfigsWith
32113212
new GenericType<OCIConfigsResponse>() {});
32123213
}
32133214

3215+
/** Manage optional parameters to listCostTagDescriptions. */
3216+
public static class ListCostTagDescriptionsOptionalParameters {
3217+
private String filterCloud;
3218+
3219+
/**
3220+
* Set filterCloud.
3221+
*
3222+
* @param filterCloud Filter descriptions to a specific cloud provider (for example, <code>aws
3223+
* </code>). Omit to return descriptions across all clouds. (optional)
3224+
* @return ListCostTagDescriptionsOptionalParameters
3225+
*/
3226+
public ListCostTagDescriptionsOptionalParameters filterCloud(String filterCloud) {
3227+
this.filterCloud = filterCloud;
3228+
return this;
3229+
}
3230+
}
3231+
3232+
/**
3233+
* List Cloud Cost Management tag descriptions.
3234+
*
3235+
* <p>See {@link #listCostTagDescriptionsWithHttpInfo}.
3236+
*
3237+
* @return CostTagDescriptionsResponse
3238+
* @throws ApiException if fails to make API call
3239+
*/
3240+
public CostTagDescriptionsResponse listCostTagDescriptions() throws ApiException {
3241+
return listCostTagDescriptionsWithHttpInfo(new ListCostTagDescriptionsOptionalParameters())
3242+
.getData();
3243+
}
3244+
3245+
/**
3246+
* List Cloud Cost Management tag descriptions.
3247+
*
3248+
* <p>See {@link #listCostTagDescriptionsWithHttpInfoAsync}.
3249+
*
3250+
* @return CompletableFuture&lt;CostTagDescriptionsResponse&gt;
3251+
*/
3252+
public CompletableFuture<CostTagDescriptionsResponse> listCostTagDescriptionsAsync() {
3253+
return listCostTagDescriptionsWithHttpInfoAsync(new ListCostTagDescriptionsOptionalParameters())
3254+
.thenApply(
3255+
response -> {
3256+
return response.getData();
3257+
});
3258+
}
3259+
3260+
/**
3261+
* List Cloud Cost Management tag descriptions.
3262+
*
3263+
* <p>See {@link #listCostTagDescriptionsWithHttpInfo}.
3264+
*
3265+
* @param parameters Optional parameters for the request.
3266+
* @return CostTagDescriptionsResponse
3267+
* @throws ApiException if fails to make API call
3268+
*/
3269+
public CostTagDescriptionsResponse listCostTagDescriptions(
3270+
ListCostTagDescriptionsOptionalParameters parameters) throws ApiException {
3271+
return listCostTagDescriptionsWithHttpInfo(parameters).getData();
3272+
}
3273+
3274+
/**
3275+
* List Cloud Cost Management tag descriptions.
3276+
*
3277+
* <p>See {@link #listCostTagDescriptionsWithHttpInfoAsync}.
3278+
*
3279+
* @param parameters Optional parameters for the request.
3280+
* @return CompletableFuture&lt;CostTagDescriptionsResponse&gt;
3281+
*/
3282+
public CompletableFuture<CostTagDescriptionsResponse> listCostTagDescriptionsAsync(
3283+
ListCostTagDescriptionsOptionalParameters parameters) {
3284+
return listCostTagDescriptionsWithHttpInfoAsync(parameters)
3285+
.thenApply(
3286+
response -> {
3287+
return response.getData();
3288+
});
3289+
}
3290+
3291+
/**
3292+
* List Cloud Cost Management tag key descriptions for the organization. Use <code>filter[cloud]
3293+
* </code> to scope the result to a single cloud provider; when omitted, both cross-cloud defaults
3294+
* and cloud-specific descriptions are returned.
3295+
*
3296+
* @param parameters Optional parameters for the request.
3297+
* @return ApiResponse&lt;CostTagDescriptionsResponse&gt;
3298+
* @throws ApiException if fails to make API call
3299+
* @http.response.details
3300+
* <table border="1">
3301+
* <caption>Response details</caption>
3302+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
3303+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
3304+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
3305+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
3306+
* </table>
3307+
*/
3308+
public ApiResponse<CostTagDescriptionsResponse> listCostTagDescriptionsWithHttpInfo(
3309+
ListCostTagDescriptionsOptionalParameters parameters) throws ApiException {
3310+
Object localVarPostBody = null;
3311+
String filterCloud = parameters.filterCloud;
3312+
// create path and map variables
3313+
String localVarPath = "/api/v2/cost/tag_descriptions";
3314+
3315+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
3316+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3317+
3318+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud));
3319+
3320+
Invocation.Builder builder =
3321+
apiClient.createBuilder(
3322+
"v2.CloudCostManagementApi.listCostTagDescriptions",
3323+
localVarPath,
3324+
localVarQueryParams,
3325+
localVarHeaderParams,
3326+
new HashMap<String, String>(),
3327+
new String[] {"application/json"},
3328+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3329+
return apiClient.invokeAPI(
3330+
"GET",
3331+
builder,
3332+
localVarHeaderParams,
3333+
new String[] {},
3334+
localVarPostBody,
3335+
new HashMap<String, Object>(),
3336+
false,
3337+
new GenericType<CostTagDescriptionsResponse>() {});
3338+
}
3339+
3340+
/**
3341+
* List Cloud Cost Management tag descriptions.
3342+
*
3343+
* <p>See {@link #listCostTagDescriptionsWithHttpInfo}.
3344+
*
3345+
* @param parameters Optional parameters for the request.
3346+
* @return CompletableFuture&lt;ApiResponse&lt;CostTagDescriptionsResponse&gt;&gt;
3347+
*/
3348+
public CompletableFuture<ApiResponse<CostTagDescriptionsResponse>>
3349+
listCostTagDescriptionsWithHttpInfoAsync(
3350+
ListCostTagDescriptionsOptionalParameters parameters) {
3351+
Object localVarPostBody = null;
3352+
String filterCloud = parameters.filterCloud;
3353+
// create path and map variables
3354+
String localVarPath = "/api/v2/cost/tag_descriptions";
3355+
3356+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
3357+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3358+
3359+
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[cloud]", filterCloud));
3360+
3361+
Invocation.Builder builder;
3362+
try {
3363+
builder =
3364+
apiClient.createBuilder(
3365+
"v2.CloudCostManagementApi.listCostTagDescriptions",
3366+
localVarPath,
3367+
localVarQueryParams,
3368+
localVarHeaderParams,
3369+
new HashMap<String, String>(),
3370+
new String[] {"application/json"},
3371+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3372+
} catch (ApiException ex) {
3373+
CompletableFuture<ApiResponse<CostTagDescriptionsResponse>> result =
3374+
new CompletableFuture<>();
3375+
result.completeExceptionally(ex);
3376+
return result;
3377+
}
3378+
return apiClient.invokeAPIAsync(
3379+
"GET",
3380+
builder,
3381+
localVarHeaderParams,
3382+
new String[] {},
3383+
localVarPostBody,
3384+
new HashMap<String, Object>(),
3385+
false,
3386+
new GenericType<CostTagDescriptionsResponse>() {});
3387+
}
3388+
32143389
/**
32153390
* List custom allocation rules.
32163391
*

0 commit comments

Comments
 (0)