Skip to content

Commit b8c786a

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

10 files changed

Lines changed: 739 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# List Cloud Cost Management OCI configs returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
p api_instance.list_cost_oci_configs()

features/v2/cloud_cost_management.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ Feature: Cloud Cost Management
313313
Then the response status is 200 OK
314314
And the response "data[0].attributes.configs[0].export_name" is equal to "test_export_name"
315315

316+
@generated @skip @team:DataDog/cloud-cost-management
317+
Scenario: List Cloud Cost Management OCI configs returns "OK" response
318+
Given new "ListCostOCIConfigs" request
319+
When the request is sent
320+
Then the response status is 200 OK
321+
316322
@replay-only @team:DataDog/cloud-cost-management
317323
Scenario: List Custom Costs Files returns "OK" response
318324
Given new "ListCustomCostsFiles" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,12 @@
14581458
"type": "idempotent"
14591459
}
14601460
},
1461+
"ListCostOCIConfigs": {
1462+
"tag": "Cloud Cost Management",
1463+
"undo": {
1464+
"type": "safe"
1465+
}
1466+
},
14611467
"GetActiveBillingDimensions": {
14621468
"tag": "Usage Metering",
14631469
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4244,6 +4244,10 @@ def overrides
42444244
"v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor",
42454245
"v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType",
42464246
"v2.observability_pipeline_tls" => "ObservabilityPipelineTls",
4247+
"v2.oci_config" => "OCIConfig",
4248+
"v2.oci_config_attributes" => "OCIConfigAttributes",
4249+
"v2.oci_configs_response" => "OCIConfigsResponse",
4250+
"v2.oci_config_type" => "OCIConfigType",
42474251
"v2.okta_account" => "OktaAccount",
42484252
"v2.okta_account_attributes" => "OktaAccountAttributes",
42494253
"v2.okta_account_request" => "OktaAccountRequest",

lib/datadog_api_client/v2/api/cloud_cost_management_api.rb

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,66 @@ def list_cost_gcp_usage_cost_configs_with_http_info(opts = {})
15201520
return data, status_code, headers
15211521
end
15221522

1523+
# List Cloud Cost Management OCI configs.
1524+
#
1525+
# @see #list_cost_oci_configs_with_http_info
1526+
def list_cost_oci_configs(opts = {})
1527+
data, _status_code, _headers = list_cost_oci_configs_with_http_info(opts)
1528+
data
1529+
end
1530+
1531+
# List Cloud Cost Management OCI configs.
1532+
#
1533+
# List the OCI configs.
1534+
#
1535+
# @param opts [Hash] the optional parameters
1536+
# @return [Array<(OCIConfigsResponse, Integer, Hash)>] OCIConfigsResponse data, response status code and response headers
1537+
def list_cost_oci_configs_with_http_info(opts = {})
1538+
1539+
if @api_client.config.debugging
1540+
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_oci_configs ...'
1541+
end
1542+
# resource path
1543+
local_var_path = '/api/v2/cost/oci_config'
1544+
1545+
# query parameters
1546+
query_params = opts[:query_params] || {}
1547+
1548+
# header parameters
1549+
header_params = opts[:header_params] || {}
1550+
# HTTP header 'Accept' (if needed)
1551+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1552+
1553+
# form parameters
1554+
form_params = opts[:form_params] || {}
1555+
1556+
# http body (model)
1557+
post_body = opts[:debug_body]
1558+
1559+
# return_type
1560+
return_type = opts[:debug_return_type] || 'OCIConfigsResponse'
1561+
1562+
# auth_names
1563+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
1564+
1565+
new_options = opts.merge(
1566+
:operation => :list_cost_oci_configs,
1567+
:header_params => header_params,
1568+
:query_params => query_params,
1569+
:form_params => form_params,
1570+
:body => post_body,
1571+
:auth_names => auth_names,
1572+
:return_type => return_type,
1573+
:api_version => "V2"
1574+
)
1575+
1576+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1577+
if @api_client.config.debugging
1578+
@api_client.config.logger.debug "API called: CloudCostManagementAPI#list_cost_oci_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1579+
end
1580+
return data, status_code, headers
1581+
end
1582+
15231583
# List custom allocation rules.
15241584
#
15251585
# @see #list_custom_allocation_rules_with_http_info

0 commit comments

Comments
 (0)