Skip to content

Commit 161031f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Cloud Cost Management ListCostOCIConfigs endpoint (#3775)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c90c633 commit 161031f

9 files changed

Lines changed: 994 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45948,6 +45948,90 @@ components:
4594845948
- id
4594945949
- type
4595045950
type: object
45951+
OCIConfig:
45952+
description: OCI config.
45953+
properties:
45954+
attributes:
45955+
$ref: "#/components/schemas/OCIConfigAttributes"
45956+
id:
45957+
description: The ID of the OCI config.
45958+
example: "1"
45959+
type: string
45960+
type:
45961+
$ref: "#/components/schemas/OCIConfigType"
45962+
required:
45963+
- attributes
45964+
- id
45965+
- type
45966+
type: object
45967+
OCIConfigAttributes:
45968+
description: Attributes for an OCI config.
45969+
properties:
45970+
account_id:
45971+
description: The OCID of the OCI tenancy.
45972+
example: "ocid1.tenancy.oc1..example"
45973+
type: string
45974+
created_at:
45975+
description: The timestamp when the OCI config was created.
45976+
example: "2026-01-01T12:00:00Z"
45977+
type: string
45978+
error_messages:
45979+
description: The error messages for the OCI config.
45980+
items:
45981+
description: An error message string.
45982+
type: string
45983+
nullable: true
45984+
type: array
45985+
status:
45986+
description: The status of the OCI config.
45987+
example: "active"
45988+
type: string
45989+
status_updated_at:
45990+
description: The timestamp when the OCI config status was last updated.
45991+
example: "2026-01-01T12:00:00Z"
45992+
type: string
45993+
updated_at:
45994+
description: The timestamp when the OCI config was last updated.
45995+
example: "2026-01-01T12:00:00Z"
45996+
type: string
45997+
required:
45998+
- account_id
45999+
- created_at
46000+
- status
46001+
- status_updated_at
46002+
- updated_at
46003+
type: object
46004+
OCIConfigType:
46005+
default: oci_config
46006+
description: Type of OCI config.
46007+
enum:
46008+
- oci_config
46009+
example: oci_config
46010+
type: string
46011+
x-enum-varnames:
46012+
- OCI_CONFIG
46013+
OCIConfigsResponse:
46014+
description: List of OCI configs.
46015+
example:
46016+
data:
46017+
- attributes:
46018+
account_id: "ocid1.tenancy.oc1..example"
46019+
created_at: "2026-01-01T12:00:00Z"
46020+
error_messages: []
46021+
status: active
46022+
status_updated_at: "2026-01-01T12:00:00Z"
46023+
updated_at: "2026-01-01T12:00:00Z"
46024+
id: "1"
46025+
type: oci_config
46026+
properties:
46027+
data:
46028+
description: An OCI config.
46029+
items:
46030+
$ref: "#/components/schemas/OCIConfig"
46031+
type: array
46032+
required:
46033+
- data
46034+
type: object
4595146035
ObservabilityPipeline:
4595246036
description: Top-level schema representing a pipeline.
4595346037
properties:
@@ -93443,6 +93527,37 @@ paths:
9344393527
operator: OR
9344493528
permissions:
9344593529
- cloud_cost_management_write
93530+
/api/v2/cost/oci_config:
93531+
get:
93532+
description: List the OCI configs.
93533+
operationId: ListCostOCIConfigs
93534+
responses:
93535+
"200":
93536+
content:
93537+
application/json:
93538+
schema:
93539+
$ref: "#/components/schemas/OCIConfigsResponse"
93540+
description: OK
93541+
"403":
93542+
content:
93543+
application/json:
93544+
schema:
93545+
$ref: "#/components/schemas/APIErrorResponse"
93546+
description: Forbidden
93547+
"429":
93548+
$ref: "#/components/responses/TooManyRequestsResponse"
93549+
security:
93550+
- apiKeyAuth: []
93551+
appKeyAuth: []
93552+
- AuthZ:
93553+
- cloud_cost_management_read
93554+
summary: List Cloud Cost Management OCI configs
93555+
tags:
93556+
- Cloud Cost Management
93557+
"x-permission":
93558+
operator: OR
93559+
permissions:
93560+
- cloud_cost_management_read
9344693561
/api/v2/cost_by_tag/active_billing_dimensions:
9344793562
get:
9344893563
description: |-
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List Cloud Cost Management OCI configs 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.OCIConfigsResponse;
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+
OCIConfigsResponse result = apiInstance.listCostOCIConfigs();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling CloudCostManagementApi#listCostOCIConfigs");
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: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse;
3030
import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse;
3131
import com.datadog.api.client.v2.model.GcpUcConfigResponse;
32+
import com.datadog.api.client.v2.model.OCIConfigsResponse;
3233
import com.datadog.api.client.v2.model.ReorderRuleResourceArray;
3334
import com.datadog.api.client.v2.model.ReorderRulesetResourceArray;
3435
import com.datadog.api.client.v2.model.RulesValidateQueryRequest;
@@ -3099,6 +3100,115 @@ public ApiResponse<GCPUsageCostConfigsResponse> listCostGCPUsageCostConfigsWithH
30993100
new GenericType<GCPUsageCostConfigsResponse>() {});
31003101
}
31013102

3103+
/**
3104+
* List Cloud Cost Management OCI configs.
3105+
*
3106+
* <p>See {@link #listCostOCIConfigsWithHttpInfo}.
3107+
*
3108+
* @return OCIConfigsResponse
3109+
* @throws ApiException if fails to make API call
3110+
*/
3111+
public OCIConfigsResponse listCostOCIConfigs() throws ApiException {
3112+
return listCostOCIConfigsWithHttpInfo().getData();
3113+
}
3114+
3115+
/**
3116+
* List Cloud Cost Management OCI configs.
3117+
*
3118+
* <p>See {@link #listCostOCIConfigsWithHttpInfoAsync}.
3119+
*
3120+
* @return CompletableFuture&lt;OCIConfigsResponse&gt;
3121+
*/
3122+
public CompletableFuture<OCIConfigsResponse> listCostOCIConfigsAsync() {
3123+
return listCostOCIConfigsWithHttpInfoAsync()
3124+
.thenApply(
3125+
response -> {
3126+
return response.getData();
3127+
});
3128+
}
3129+
3130+
/**
3131+
* List the OCI configs.
3132+
*
3133+
* @return ApiResponse&lt;OCIConfigsResponse&gt;
3134+
* @throws ApiException if fails to make API call
3135+
* @http.response.details
3136+
* <table border="1">
3137+
* <caption>Response details</caption>
3138+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
3139+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
3140+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
3141+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
3142+
* </table>
3143+
*/
3144+
public ApiResponse<OCIConfigsResponse> listCostOCIConfigsWithHttpInfo() throws ApiException {
3145+
Object localVarPostBody = null;
3146+
// create path and map variables
3147+
String localVarPath = "/api/v2/cost/oci_config";
3148+
3149+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3150+
3151+
Invocation.Builder builder =
3152+
apiClient.createBuilder(
3153+
"v2.CloudCostManagementApi.listCostOCIConfigs",
3154+
localVarPath,
3155+
new ArrayList<Pair>(),
3156+
localVarHeaderParams,
3157+
new HashMap<String, String>(),
3158+
new String[] {"application/json"},
3159+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3160+
return apiClient.invokeAPI(
3161+
"GET",
3162+
builder,
3163+
localVarHeaderParams,
3164+
new String[] {},
3165+
localVarPostBody,
3166+
new HashMap<String, Object>(),
3167+
false,
3168+
new GenericType<OCIConfigsResponse>() {});
3169+
}
3170+
3171+
/**
3172+
* List Cloud Cost Management OCI configs.
3173+
*
3174+
* <p>See {@link #listCostOCIConfigsWithHttpInfo}.
3175+
*
3176+
* @return CompletableFuture&lt;ApiResponse&lt;OCIConfigsResponse&gt;&gt;
3177+
*/
3178+
public CompletableFuture<ApiResponse<OCIConfigsResponse>> listCostOCIConfigsWithHttpInfoAsync() {
3179+
Object localVarPostBody = null;
3180+
// create path and map variables
3181+
String localVarPath = "/api/v2/cost/oci_config";
3182+
3183+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3184+
3185+
Invocation.Builder builder;
3186+
try {
3187+
builder =
3188+
apiClient.createBuilder(
3189+
"v2.CloudCostManagementApi.listCostOCIConfigs",
3190+
localVarPath,
3191+
new ArrayList<Pair>(),
3192+
localVarHeaderParams,
3193+
new HashMap<String, String>(),
3194+
new String[] {"application/json"},
3195+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
3196+
} catch (ApiException ex) {
3197+
CompletableFuture<ApiResponse<OCIConfigsResponse>> result = new CompletableFuture<>();
3198+
result.completeExceptionally(ex);
3199+
return result;
3200+
}
3201+
return apiClient.invokeAPIAsync(
3202+
"GET",
3203+
builder,
3204+
localVarHeaderParams,
3205+
new String[] {},
3206+
localVarPostBody,
3207+
new HashMap<String, Object>(),
3208+
false,
3209+
new GenericType<OCIConfigsResponse>() {});
3210+
}
3211+
31023212
/**
31033213
* List custom allocation rules.
31043214
*

0 commit comments

Comments
 (0)