Skip to content

Commit df939b7

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

11 files changed

Lines changed: 411 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: |-

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22180,6 +22180,34 @@ datadog\_api\_client.v2.model.observability\_pipeline\_tls module
2218022180
:members:
2218122181
:show-inheritance:
2218222182

22183+
datadog\_api\_client.v2.model.oci\_config module
22184+
------------------------------------------------
22185+
22186+
.. automodule:: datadog_api_client.v2.model.oci_config
22187+
:members:
22188+
:show-inheritance:
22189+
22190+
datadog\_api\_client.v2.model.oci\_config\_attributes module
22191+
------------------------------------------------------------
22192+
22193+
.. automodule:: datadog_api_client.v2.model.oci_config_attributes
22194+
:members:
22195+
:show-inheritance:
22196+
22197+
datadog\_api\_client.v2.model.oci\_config\_type module
22198+
------------------------------------------------------
22199+
22200+
.. automodule:: datadog_api_client.v2.model.oci_config_type
22201+
:members:
22202+
:show-inheritance:
22203+
22204+
datadog\_api\_client.v2.model.oci\_configs\_response module
22205+
-----------------------------------------------------------
22206+
22207+
.. automodule:: datadog_api_client.v2.model.oci_configs_response
22208+
:members:
22209+
:show-inheritance:
22210+
2218322211
datadog\_api\_client.v2.model.okta\_account module
2218422212
--------------------------------------------------
2218522213

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
List Cloud Cost Management OCI configs returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = CloudCostManagementApi(api_client)
11+
response = api_instance.list_cost_oci_configs()
12+
13+
print(response)

src/datadog_api_client/v2/api/cloud_cost_management_api.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from datadog_api_client.v2.model.gcp_usage_cost_config_post_request import GCPUsageCostConfigPostRequest
3939
from datadog_api_client.v2.model.gcp_uc_config_response import GcpUcConfigResponse
4040
from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest
41+
from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse
4142
from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray
4243
from datadog_api_client.v2.model.ruleset_resp import RulesetResp
4344
from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest
@@ -543,6 +544,22 @@ def __init__(self, api_client=None):
543544
api_client=api_client,
544545
)
545546

547+
self._list_cost_oci_configs_endpoint = _Endpoint(
548+
settings={
549+
"response_type": (OCIConfigsResponse,),
550+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
551+
"endpoint_path": "/api/v2/cost/oci_config",
552+
"operation_id": "list_cost_oci_configs",
553+
"http_method": "GET",
554+
"version": "v2",
555+
},
556+
params_map={},
557+
headers_map={
558+
"accept": ["application/json"],
559+
},
560+
api_client=api_client,
561+
)
562+
546563
self._list_custom_allocation_rules_endpoint = _Endpoint(
547564
settings={
548565
"response_type": (ArbitraryRuleResponseArray,),
@@ -1270,6 +1287,18 @@ def list_cost_gcp_usage_cost_configs(
12701287
kwargs: Dict[str, Any] = {}
12711288
return self._list_cost_gcp_usage_cost_configs_endpoint.call_with_http_info(**kwargs)
12721289

1290+
def list_cost_oci_configs(
1291+
self,
1292+
) -> OCIConfigsResponse:
1293+
"""List Cloud Cost Management OCI configs.
1294+
1295+
List the OCI configs.
1296+
1297+
:rtype: OCIConfigsResponse
1298+
"""
1299+
kwargs: Dict[str, Any] = {}
1300+
return self._list_cost_oci_configs_endpoint.call_with_http_info(**kwargs)
1301+
12731302
def list_custom_allocation_rules(
12741303
self,
12751304
) -> ArbitraryRuleResponseArray:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes
16+
from datadog_api_client.v2.model.oci_config_type import OCIConfigType
17+
18+
19+
class OCIConfig(ModelNormal):
20+
@cached_property
21+
def openapi_types(_):
22+
from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes
23+
from datadog_api_client.v2.model.oci_config_type import OCIConfigType
24+
25+
return {
26+
"attributes": (OCIConfigAttributes,),
27+
"id": (str,),
28+
"type": (OCIConfigType,),
29+
}
30+
31+
attribute_map = {
32+
"attributes": "attributes",
33+
"id": "id",
34+
"type": "type",
35+
}
36+
37+
def __init__(self_, attributes: OCIConfigAttributes, id: str, type: OCIConfigType, **kwargs):
38+
"""
39+
OCI config.
40+
41+
:param attributes: Attributes for an OCI config.
42+
:type attributes: OCIConfigAttributes
43+
44+
:param id: The ID of the OCI config.
45+
:type id: str
46+
47+
:param type: Type of OCI config.
48+
:type type: OCIConfigType
49+
"""
50+
super().__init__(kwargs)
51+
52+
self_.attributes = attributes
53+
self_.id = id
54+
self_.type = type
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
none_type,
12+
unset,
13+
UnsetType,
14+
)
15+
16+
17+
class OCIConfigAttributes(ModelNormal):
18+
@cached_property
19+
def openapi_types(_):
20+
return {
21+
"account_id": (str,),
22+
"created_at": (str,),
23+
"error_messages": ([str], none_type),
24+
"status": (str,),
25+
"status_updated_at": (str,),
26+
"updated_at": (str,),
27+
}
28+
29+
attribute_map = {
30+
"account_id": "account_id",
31+
"created_at": "created_at",
32+
"error_messages": "error_messages",
33+
"status": "status",
34+
"status_updated_at": "status_updated_at",
35+
"updated_at": "updated_at",
36+
}
37+
38+
def __init__(
39+
self_,
40+
account_id: str,
41+
created_at: str,
42+
status: str,
43+
status_updated_at: str,
44+
updated_at: str,
45+
error_messages: Union[List[str], none_type, UnsetType] = unset,
46+
**kwargs,
47+
):
48+
"""
49+
Attributes for an OCI config.
50+
51+
:param account_id: The OCID of the OCI tenancy.
52+
:type account_id: str
53+
54+
:param created_at: The timestamp when the OCI config was created.
55+
:type created_at: str
56+
57+
:param error_messages: The error messages for the OCI config.
58+
:type error_messages: [str], none_type, optional
59+
60+
:param status: The status of the OCI config.
61+
:type status: str
62+
63+
:param status_updated_at: The timestamp when the OCI config status was last updated.
64+
:type status_updated_at: str
65+
66+
:param updated_at: The timestamp when the OCI config was last updated.
67+
:type updated_at: str
68+
"""
69+
if error_messages is not unset:
70+
kwargs["error_messages"] = error_messages
71+
super().__init__(kwargs)
72+
73+
self_.account_id = account_id
74+
self_.created_at = created_at
75+
self_.status = status
76+
self_.status_updated_at = status_updated_at
77+
self_.updated_at = updated_at
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class OCIConfigType(ModelSimple):
16+
"""
17+
Type of OCI config.
18+
19+
:param value: If omitted defaults to "oci_config". Must be one of ["oci_config"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"oci_config",
25+
}
26+
OCI_CONFIG: ClassVar["OCIConfigType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
OCIConfigType.OCI_CONFIG = OCIConfigType("oci_config")

0 commit comments

Comments
 (0)