diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 93b41388a7..a96e17193b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -45948,6 +45948,90 @@ components: - id - type type: object + OCIConfig: + description: OCI config. + properties: + attributes: + $ref: "#/components/schemas/OCIConfigAttributes" + id: + description: The ID of the OCI config. + example: "1" + type: string + type: + $ref: "#/components/schemas/OCIConfigType" + required: + - attributes + - id + - type + type: object + OCIConfigAttributes: + description: Attributes for an OCI config. + properties: + account_id: + description: The OCID of the OCI tenancy. + example: "ocid1.tenancy.oc1..example" + type: string + created_at: + description: The timestamp when the OCI config was created. + example: "2026-01-01T12:00:00Z" + type: string + error_messages: + description: The error messages for the OCI config. + items: + description: An error message string. + type: string + nullable: true + type: array + status: + description: The status of the OCI config. + example: "active" + type: string + status_updated_at: + description: The timestamp when the OCI config status was last updated. + example: "2026-01-01T12:00:00Z" + type: string + updated_at: + description: The timestamp when the OCI config was last updated. + example: "2026-01-01T12:00:00Z" + type: string + required: + - account_id + - created_at + - status + - status_updated_at + - updated_at + type: object + OCIConfigType: + default: oci_config + description: Type of OCI config. + enum: + - oci_config + example: oci_config + type: string + x-enum-varnames: + - OCI_CONFIG + OCIConfigsResponse: + description: List of OCI configs. + example: + data: + - attributes: + account_id: "ocid1.tenancy.oc1..example" + created_at: "2026-01-01T12:00:00Z" + error_messages: [] + status: active + status_updated_at: "2026-01-01T12:00:00Z" + updated_at: "2026-01-01T12:00:00Z" + id: "1" + type: oci_config + properties: + data: + description: An OCI config. + items: + $ref: "#/components/schemas/OCIConfig" + type: array + required: + - data + type: object ObservabilityPipeline: description: Top-level schema representing a pipeline. properties: @@ -93443,6 +93527,37 @@ paths: operator: OR permissions: - cloud_cost_management_write + /api/v2/cost/oci_config: + get: + description: List the OCI configs. + operationId: ListCostOCIConfigs + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/OCIConfigsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management OCI configs + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost_by_tag/active_billing_dimensions: get: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index a796374b93..2dfb6b2de3 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -22180,6 +22180,34 @@ datadog\_api\_client.v2.model.observability\_pipeline\_tls module :members: :show-inheritance: +datadog\_api\_client.v2.model.oci\_config module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.oci_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.oci\_config\_attributes module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.oci_config_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.oci\_config\_type module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.oci_config_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.oci\_configs\_response module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.oci_configs_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.okta\_account module -------------------------------------------------- diff --git a/examples/v2/cloud-cost-management/ListCostOCIConfigs.py b/examples/v2/cloud-cost-management/ListCostOCIConfigs.py new file mode 100644 index 0000000000..6e0e3c7930 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostOCIConfigs.py @@ -0,0 +1,13 @@ +""" +List Cloud Cost Management OCI configs returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.list_cost_oci_configs() + + print(response) diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py index b47998090a..0e895e45a1 100644 --- a/src/datadog_api_client/v2/api/cloud_cost_management_api.py +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -38,6 +38,7 @@ from datadog_api_client.v2.model.gcp_usage_cost_config_post_request import GCPUsageCostConfigPostRequest from datadog_api_client.v2.model.gcp_uc_config_response import GcpUcConfigResponse from datadog_api_client.v2.model.gcp_usage_cost_config_patch_request import GCPUsageCostConfigPatchRequest +from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse from datadog_api_client.v2.model.ruleset_resp_array import RulesetRespArray from datadog_api_client.v2.model.ruleset_resp import RulesetResp from datadog_api_client.v2.model.create_ruleset_request import CreateRulesetRequest @@ -543,6 +544,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_cost_oci_configs_endpoint = _Endpoint( + settings={ + "response_type": (OCIConfigsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/oci_config", + "operation_id": "list_cost_oci_configs", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_custom_allocation_rules_endpoint = _Endpoint( settings={ "response_type": (ArbitraryRuleResponseArray,), @@ -1270,6 +1287,18 @@ def list_cost_gcp_usage_cost_configs( kwargs: Dict[str, Any] = {} return self._list_cost_gcp_usage_cost_configs_endpoint.call_with_http_info(**kwargs) + def list_cost_oci_configs( + self, + ) -> OCIConfigsResponse: + """List Cloud Cost Management OCI configs. + + List the OCI configs. + + :rtype: OCIConfigsResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_cost_oci_configs_endpoint.call_with_http_info(**kwargs) + def list_custom_allocation_rules( self, ) -> ArbitraryRuleResponseArray: diff --git a/src/datadog_api_client/v2/model/oci_config.py b/src/datadog_api_client/v2/model/oci_config.py new file mode 100644 index 0000000000..a32033863e --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_config.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes + from datadog_api_client.v2.model.oci_config_type import OCIConfigType + + +class OCIConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes + from datadog_api_client.v2.model.oci_config_type import OCIConfigType + + return { + "attributes": (OCIConfigAttributes,), + "id": (str,), + "type": (OCIConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: OCIConfigAttributes, id: str, type: OCIConfigType, **kwargs): + """ + OCI config. + + :param attributes: Attributes for an OCI config. + :type attributes: OCIConfigAttributes + + :param id: The ID of the OCI config. + :type id: str + + :param type: Type of OCI config. + :type type: OCIConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/oci_config_attributes.py b/src/datadog_api_client/v2/model/oci_config_attributes.py new file mode 100644 index 0000000000..3b2d449d8a --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_config_attributes.py @@ -0,0 +1,77 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class OCIConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "created_at": (str,), + "error_messages": ([str], none_type), + "status": (str,), + "status_updated_at": (str,), + "updated_at": (str,), + } + + attribute_map = { + "account_id": "account_id", + "created_at": "created_at", + "error_messages": "error_messages", + "status": "status", + "status_updated_at": "status_updated_at", + "updated_at": "updated_at", + } + + def __init__( + self_, + account_id: str, + created_at: str, + status: str, + status_updated_at: str, + updated_at: str, + error_messages: Union[List[str], none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for an OCI config. + + :param account_id: The OCID of the OCI tenancy. + :type account_id: str + + :param created_at: The timestamp when the OCI config was created. + :type created_at: str + + :param error_messages: The error messages for the OCI config. + :type error_messages: [str], none_type, optional + + :param status: The status of the OCI config. + :type status: str + + :param status_updated_at: The timestamp when the OCI config status was last updated. + :type status_updated_at: str + + :param updated_at: The timestamp when the OCI config was last updated. + :type updated_at: str + """ + if error_messages is not unset: + kwargs["error_messages"] = error_messages + super().__init__(kwargs) + + self_.account_id = account_id + self_.created_at = created_at + self_.status = status + self_.status_updated_at = status_updated_at + self_.updated_at = updated_at diff --git a/src/datadog_api_client/v2/model/oci_config_type.py b/src/datadog_api_client/v2/model/oci_config_type.py new file mode 100644 index 0000000000..c99bc9ed0f --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_config_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OCIConfigType(ModelSimple): + """ + Type of OCI config. + + :param value: If omitted defaults to "oci_config". Must be one of ["oci_config"]. + :type value: str + """ + + allowed_values = { + "oci_config", + } + OCI_CONFIG: ClassVar["OCIConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OCIConfigType.OCI_CONFIG = OCIConfigType("oci_config") diff --git a/src/datadog_api_client/v2/model/oci_configs_response.py b/src/datadog_api_client/v2/model/oci_configs_response.py new file mode 100644 index 0000000000..9ce7c6763a --- /dev/null +++ b/src/datadog_api_client/v2/model/oci_configs_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.oci_config import OCIConfig + + +class OCIConfigsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.oci_config import OCIConfig + + return { + "data": ([OCIConfig],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[OCIConfig], **kwargs): + """ + List of OCI configs. + + :param data: An OCI config. + :type data: [OCIConfig] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 75f28c1ac9..d067d7cd3b 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3818,6 +3818,10 @@ from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData +from datadog_api_client.v2.model.oci_config import OCIConfig +from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes +from datadog_api_client.v2.model.oci_config_type import OCIConfigType +from datadog_api_client.v2.model.oci_configs_response import OCIConfigsResponse from datadog_api_client.v2.model.observability_pipeline import ObservabilityPipeline from datadog_api_client.v2.model.observability_pipeline_add_env_vars_processor import ( ObservabilityPipelineAddEnvVarsProcessor, @@ -10357,6 +10361,10 @@ "NullableRelationshipToUserData", "NullableUserRelationship", "NullableUserRelationshipData", + "OCIConfig", + "OCIConfigAttributes", + "OCIConfigType", + "OCIConfigsResponse", "ObservabilityPipeline", "ObservabilityPipelineAddEnvVarsProcessor", "ObservabilityPipelineAddEnvVarsProcessorType", diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index 312e05fb38..c5fc0adc05 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -313,6 +313,12 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data[0].attributes.configs[0].export_name" is equal to "test_export_name" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management OCI configs returns "OK" response + Given new "ListCostOCIConfigs" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 4d694af5be..21d7896f03 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1458,6 +1458,12 @@ "type": "idempotent" } }, + "ListCostOCIConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": {