From 78f6bad7c5d841250978d724cce0afb117398c3e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 9 Mar 2026 14:18:48 +0000 Subject: [PATCH] Regenerate client from commit 11f6077 of spec repo --- .generator/schemas/v2/openapi.yaml | 253 +++++++++++++++++- docs/datadog_api_client.v2.model.rst | 63 +++++ .../CreateAWSAccountCCMConfig.py | 39 +++ .../DeleteAWSAccountCCMConfig.py | 14 + .../aws-integration/GetAWSAccountCCMConfig.py | 16 ++ .../UpdateAWSAccountCCMConfig.py | 39 +++ src/datadog_api_client/configuration.py | 4 + .../v2/api/aws_integration_api.py | 199 +++++++++++++- .../v2/model/aws_ccm_config.py | 40 +++ .../v2/model/aws_ccm_config_request.py | 40 +++ .../aws_ccm_config_request_attributes.py | 40 +++ .../v2/model/aws_ccm_config_request_data.py | 48 ++++ .../v2/model/aws_ccm_config_response.py | 40 +++ .../aws_ccm_config_response_attributes.py | 42 +++ .../v2/model/aws_ccm_config_response_data.py | 67 +++++ .../v2/model/aws_ccm_config_type.py | 35 +++ .../v2/model/aws_lambda_forwarder_config.py | 3 +- .../v2/model/data_export_config.py | 59 ++++ src/datadog_api_client/v2/models/__init__.py | 18 ++ ...urns_aws_ccm_config_object_response.frozen | 1 + ...eturns_aws_ccm_config_object_response.yaml | 51 ++++ ...cm_config_returns_conflict_response.frozen | 1 + ..._ccm_config_returns_conflict_response.yaml | 40 +++ ...m_config_returns_not_found_response.frozen | 1 + ...ccm_config_returns_not_found_response.yaml | 21 ++ ..._config_returns_no_content_response.frozen | 1 + ...cm_config_returns_no_content_response.yaml | 16 ++ ...m_config_returns_not_found_response.frozen | 1 + ...ccm_config_returns_not_found_response.yaml | 19 ++ ...m_config_returns_not_found_response.frozen | 1 + ...ccm_config_returns_not_found_response.yaml | 19 ++ ...urns_aws_ccm_config_object_response.frozen | 1 + ...eturns_aws_ccm_config_object_response.yaml | 20 ++ ...m_config_returns_not_found_response.frozen | 1 + ...ccm_config_returns_not_found_response.yaml | 21 ++ tests/v2/features/aws_integration.feature | 77 ++++++ tests/v2/features/undo.json | 26 ++ 37 files changed, 1372 insertions(+), 5 deletions(-) create mode 100644 examples/v2/aws-integration/CreateAWSAccountCCMConfig.py create mode 100644 examples/v2/aws-integration/DeleteAWSAccountCCMConfig.py create mode 100644 examples/v2/aws-integration/GetAWSAccountCCMConfig.py create mode 100644 examples/v2/aws-integration/UpdateAWSAccountCCMConfig.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_request.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_request_data.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_response.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_response_attributes.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_response_data.py create mode 100644 src/datadog_api_client/v2/model/aws_ccm_config_type.py create mode 100644 src/datadog_api_client/v2/model/data_export_config.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9b5458e7d7..051d86838f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -89,6 +89,7 @@ components: the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) + endpoint and query by AWS Account ID.' in: path name: aws_account_config_id @@ -1921,6 +1922,82 @@ components: required: - role_name type: object + AWSCcmConfig: + description: AWS Cloud Cost Management config. + properties: + data_export_configs: + description: List of data export configurations for Cost and Usage Reports. + items: + $ref: '#/components/schemas/DataExportConfig' + type: array + required: + - data_export_configs + type: object + AWSCcmConfigRequest: + description: AWS CCM Config Create/Update Request body. + properties: + data: + $ref: '#/components/schemas/AWSCcmConfigRequestData' + required: + - data + type: object + AWSCcmConfigRequestAttributes: + description: AWS CCM Config attributes for Create/Update requests. + properties: + ccm_config: + $ref: '#/components/schemas/AWSCcmConfig' + required: + - ccm_config + type: object + AWSCcmConfigRequestData: + description: AWS CCM Config Create/Update Request data. + properties: + attributes: + $ref: '#/components/schemas/AWSCcmConfigRequestAttributes' + type: + $ref: '#/components/schemas/AWSCcmConfigType' + required: + - attributes + - type + type: object + AWSCcmConfigResponse: + description: AWS CCM Config response body. + properties: + data: + $ref: '#/components/schemas/AWSCcmConfigResponseData' + required: + - data + type: object + AWSCcmConfigResponseAttributes: + description: AWS CCM Config response attributes. + properties: + data_export_configs: + description: List of data export configurations for Cost and Usage Reports. + items: + $ref: '#/components/schemas/DataExportConfig' + type: array + type: object + AWSCcmConfigResponseData: + description: AWS CCM Config response data. + properties: + attributes: + $ref: '#/components/schemas/AWSCcmConfigResponseAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSCcmConfigType' + required: + - type + type: object + AWSCcmConfigType: + default: ccm_config + description: AWS CCM Config resource type. + enum: + - ccm_config + example: ccm_config + type: string + x-enum-varnames: + - CCM_CONFIG AWSCloudAuthPersonaMappingAttributesResponse: description: Attributes for AWS cloud authentication persona mapping response properties: @@ -2394,7 +2471,9 @@ components: Discover the list of available services with the - [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) + [Get list of AWS log ready + + services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) endpoint.' items: @@ -19597,6 +19676,37 @@ components: example: canceled type: string type: object + DataExportConfig: + description: AWS Cost and Usage Report data export configuration. + properties: + bucket_name: + description: Name of the S3 bucket where the Cost and Usage Report is stored. + example: billing + type: string + bucket_region: + description: AWS region of the S3 bucket. + example: us-east-1 + type: string + report_name: + description: Name of the Cost and Usage Report. + example: cost-and-usage-report + type: string + report_prefix: + description: S3 prefix where the Cost and Usage Report is stored. + example: reports + type: string + report_type: + description: Type of the Cost and Usage Report. Currently only `CUR2.0` + is supported. + example: CUR2.0 + type: string + required: + - report_name + - report_prefix + - report_type + - bucket_name + - bucket_region + type: object DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: @@ -85853,6 +85963,147 @@ paths: operator: OR permissions: - aws_configuration_edit + /api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config: + delete: + description: 'Delete the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: DeleteAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete AWS CCM config + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: 'Get the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: GetAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get AWS CCM config + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: 'Update the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: UpdateAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigRequest' + description: Update a Cloud Cost Management config for an AWS Account Integration + Config. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update AWS CCM config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Create the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: CreateAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigRequest' + description: Create a Cloud Cost Management config for an AWS Account Integration + Config. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create AWS CCM config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/aws/available_namespaces: get: description: Get a list of available AWS CloudWatch namespaces that can send diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index e2c6c0447f..9bb9d939b9 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1782,6 +1782,62 @@ datadog\_api\_client.v2.model.aws\_auth\_config\_role module :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_ccm\_config module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_request module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_request\_attributes module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_request\_data module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_response module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_response\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_response\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_ccm\_config\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_ccm_config_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_attributes\_response module --------------------------------------------------------------------------------------------- @@ -7648,6 +7704,13 @@ datadog\_api\_client.v2.model.data\_deletion\_response\_meta module :members: :show-inheritance: +datadog\_api\_client.v2.model.data\_export\_config module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.data_export_config + :members: + :show-inheritance: + datadog\_api\_client.v2.model.data\_relationships\_teams module --------------------------------------------------------------- diff --git a/examples/v2/aws-integration/CreateAWSAccountCCMConfig.py b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.py new file mode 100644 index 0000000000..4c183e6e63 --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.py @@ -0,0 +1,39 @@ +""" +Create AWS CCM config returns "AWS CCM Config object" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi +from datadog_api_client.v2.model.aws_ccm_config import AWSCcmConfig +from datadog_api_client.v2.model.aws_ccm_config_request import AWSCcmConfigRequest +from datadog_api_client.v2.model.aws_ccm_config_request_attributes import AWSCcmConfigRequestAttributes +from datadog_api_client.v2.model.aws_ccm_config_request_data import AWSCcmConfigRequestData +from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType +from datadog_api_client.v2.model.data_export_config import DataExportConfig + +body = AWSCcmConfigRequest( + data=AWSCcmConfigRequestData( + attributes=AWSCcmConfigRequestAttributes( + ccm_config=AWSCcmConfig( + data_export_configs=[ + DataExportConfig( + bucket_name="billing", + bucket_region="us-east-1", + report_name="cost-and-usage-report", + report_prefix="reports", + report_type="CUR2.0", + ), + ], + ), + ), + type=AWSCcmConfigType.CCM_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_aws_account_ccm_config"] = True +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.create_aws_account_ccm_config(aws_account_config_id="aws_account_config_id", body=body) + + print(response) diff --git a/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.py b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.py new file mode 100644 index 0000000000..c9955ed888 --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.py @@ -0,0 +1,14 @@ +""" +Delete AWS CCM config returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi + +configuration = Configuration() +configuration.unstable_operations["delete_aws_account_ccm_config"] = True +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + api_instance.delete_aws_account_ccm_config( + aws_account_config_id="aws_account_config_id", + ) diff --git a/examples/v2/aws-integration/GetAWSAccountCCMConfig.py b/examples/v2/aws-integration/GetAWSAccountCCMConfig.py new file mode 100644 index 0000000000..f02032192a --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccountCCMConfig.py @@ -0,0 +1,16 @@ +""" +Get AWS CCM config returns "AWS CCM Config object" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi + +configuration = Configuration() +configuration.unstable_operations["get_aws_account_ccm_config"] = True +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.get_aws_account_ccm_config( + aws_account_config_id="aws_account_config_id", + ) + + print(response) diff --git a/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.py b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.py new file mode 100644 index 0000000000..e2598c80bd --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.py @@ -0,0 +1,39 @@ +""" +Update AWS CCM config returns "AWS CCM Config object" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.aws_integration_api import AWSIntegrationApi +from datadog_api_client.v2.model.aws_ccm_config import AWSCcmConfig +from datadog_api_client.v2.model.aws_ccm_config_request import AWSCcmConfigRequest +from datadog_api_client.v2.model.aws_ccm_config_request_attributes import AWSCcmConfigRequestAttributes +from datadog_api_client.v2.model.aws_ccm_config_request_data import AWSCcmConfigRequestData +from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType +from datadog_api_client.v2.model.data_export_config import DataExportConfig + +body = AWSCcmConfigRequest( + data=AWSCcmConfigRequestData( + attributes=AWSCcmConfigRequestAttributes( + ccm_config=AWSCcmConfig( + data_export_configs=[ + DataExportConfig( + bucket_name="billing", + bucket_region="us-east-1", + report_name="cost-and-usage-report", + report_prefix="reports", + report_type="CUR2.0", + ), + ], + ), + ), + type=AWSCcmConfigType.CCM_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_aws_account_ccm_config"] = True +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.update_aws_account_ccm_config(aws_account_config_id="aws_account_config_id", body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9ce8728c93..5cedd11cae 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -374,6 +374,10 @@ def __init__( "v2.update_incident_postmortem_template": False, "v2.update_incident_todo": False, "v2.update_incident_type": False, + "v2.create_aws_account_ccm_config": False, + "v2.delete_aws_account_ccm_config": False, + "v2.get_aws_account_ccm_config": False, + "v2.update_aws_account_ccm_config": False, "v2.create_jira_issue_template": False, "v2.delete_jira_account": False, "v2.delete_jira_issue_template": False, diff --git a/src/datadog_api_client/v2/api/aws_integration_api.py b/src/datadog_api_client/v2/api/aws_integration_api.py index 44f4eb58f9..4cf94d9051 100644 --- a/src/datadog_api_client/v2/api/aws_integration_api.py +++ b/src/datadog_api_client/v2/api/aws_integration_api.py @@ -15,6 +15,8 @@ from datadog_api_client.v2.model.aws_account_response import AWSAccountResponse from datadog_api_client.v2.model.aws_account_create_request import AWSAccountCreateRequest from datadog_api_client.v2.model.aws_account_update_request import AWSAccountUpdateRequest +from datadog_api_client.v2.model.aws_ccm_config_response import AWSCcmConfigResponse +from datadog_api_client.v2.model.aws_ccm_config_request import AWSCcmConfigRequest from datadog_api_client.v2.model.aws_namespaces_response import AWSNamespacesResponse from datadog_api_client.v2.model.aws_event_bridge_delete_response import AWSEventBridgeDeleteResponse from datadog_api_client.v2.model.aws_event_bridge_delete_request import AWSEventBridgeDeleteRequest @@ -56,6 +58,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_aws_account_ccm_config_endpoint = _Endpoint( + settings={ + "response_type": (AWSCcmConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config", + "operation_id": "create_aws_account_ccm_config", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "aws_account_config_id": { + "required": True, + "openapi_types": (str,), + "attribute": "aws_account_config_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AWSCcmConfigRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_aws_event_bridge_source_endpoint = _Endpoint( settings={ "response_type": (AWSEventBridgeCreateResponse,), @@ -115,6 +143,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_aws_account_ccm_config_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config", + "operation_id": "delete_aws_account_ccm_config", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "aws_account_config_id": { + "required": True, + "openapi_types": (str,), + "attribute": "aws_account_config_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_aws_event_bridge_source_endpoint = _Endpoint( settings={ "response_type": (AWSEventBridgeDeleteResponse,), @@ -158,6 +209,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_aws_account_ccm_config_endpoint = _Endpoint( + settings={ + "response_type": (AWSCcmConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config", + "operation_id": "get_aws_account_ccm_config", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "aws_account_config_id": { + "required": True, + "openapi_types": (str,), + "attribute": "aws_account_config_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_aws_integration_iam_permissions_endpoint = _Endpoint( settings={ "response_type": (AWSIntegrationIamPermissionsResponse,), @@ -286,6 +360,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_aws_account_ccm_config_endpoint = _Endpoint( + settings={ + "response_type": (AWSCcmConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config", + "operation_id": "update_aws_account_ccm_config", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "aws_account_config_id": { + "required": True, + "openapi_types": (str,), + "attribute": "aws_account_config_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AWSCcmConfigRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def create_aws_account( self, body: AWSAccountCreateRequest, @@ -302,6 +402,31 @@ def create_aws_account( return self._create_aws_account_endpoint.call_with_http_info(**kwargs) + def create_aws_account_ccm_config( + self, + aws_account_config_id: str, + body: AWSCcmConfigRequest, + ) -> AWSCcmConfigResponse: + """Create AWS CCM config. + + Create the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + (CUR) 2.0 by config ID. + + :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the + `List all AWS integrations `_ + endpoint and query by AWS Account ID. + :type aws_account_config_id: str + :param body: Create a Cloud Cost Management config for an AWS Account Integration Config. + :type body: AWSCcmConfigRequest + :rtype: AWSCcmConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["aws_account_config_id"] = aws_account_config_id + + kwargs["body"] = body + + return self._create_aws_account_ccm_config_endpoint.call_with_http_info(**kwargs) + def create_aws_event_bridge_source( self, body: AWSEventBridgeCreateRequest, @@ -340,7 +465,8 @@ def delete_aws_account( Delete an AWS Account Integration Config by config ID. :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the - `List all AWS integrations `_ endpoint and query by AWS Account ID. + `List all AWS integrations `_ + endpoint and query by AWS Account ID. :type aws_account_config_id: str :rtype: None """ @@ -349,6 +475,26 @@ def delete_aws_account( return self._delete_aws_account_endpoint.call_with_http_info(**kwargs) + def delete_aws_account_ccm_config( + self, + aws_account_config_id: str, + ) -> None: + """Delete AWS CCM config. + + Delete the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + (CUR) 2.0 by config ID. + + :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the + `List all AWS integrations `_ + endpoint and query by AWS Account ID. + :type aws_account_config_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["aws_account_config_id"] = aws_account_config_id + + return self._delete_aws_account_ccm_config_endpoint.call_with_http_info(**kwargs) + def delete_aws_event_bridge_source( self, body: AWSEventBridgeDeleteRequest, @@ -375,7 +521,8 @@ def get_aws_account( Get an AWS Account Integration Config by config ID. :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the - `List all AWS integrations `_ endpoint and query by AWS Account ID. + `List all AWS integrations `_ + endpoint and query by AWS Account ID. :type aws_account_config_id: str :rtype: AWSAccountResponse """ @@ -384,6 +531,26 @@ def get_aws_account( return self._get_aws_account_endpoint.call_with_http_info(**kwargs) + def get_aws_account_ccm_config( + self, + aws_account_config_id: str, + ) -> AWSCcmConfigResponse: + """Get AWS CCM config. + + Get the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + (CUR) 2.0 by config ID. + + :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the + `List all AWS integrations `_ + endpoint and query by AWS Account ID. + :type aws_account_config_id: str + :rtype: AWSCcmConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["aws_account_config_id"] = aws_account_config_id + + return self._get_aws_account_ccm_config_endpoint.call_with_http_info(**kwargs) + def get_aws_integration_iam_permissions( self, ) -> AWSIntegrationIamPermissionsResponse: @@ -474,7 +641,8 @@ def update_aws_account( Update an AWS Account Integration Config by config ID. :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the - `List all AWS integrations `_ endpoint and query by AWS Account ID. + `List all AWS integrations `_ + endpoint and query by AWS Account ID. :type aws_account_config_id: str :type body: AWSAccountUpdateRequest :rtype: AWSAccountResponse @@ -485,3 +653,28 @@ def update_aws_account( kwargs["body"] = body return self._update_aws_account_endpoint.call_with_http_info(**kwargs) + + def update_aws_account_ccm_config( + self, + aws_account_config_id: str, + body: AWSCcmConfigRequest, + ) -> AWSCcmConfigResponse: + """Update AWS CCM config. + + Update the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + (CUR) 2.0 by config ID. + + :param aws_account_config_id: Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the + `List all AWS integrations `_ + endpoint and query by AWS Account ID. + :type aws_account_config_id: str + :param body: Update a Cloud Cost Management config for an AWS Account Integration Config. + :type body: AWSCcmConfigRequest + :rtype: AWSCcmConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["aws_account_config_id"] = aws_account_config_id + + kwargs["body"] = body + + return self._update_aws_account_ccm_config_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/aws_ccm_config.py b/src/datadog_api_client/v2/model/aws_ccm_config.py new file mode 100644 index 0000000000..181d3c62e1 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config.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.data_export_config import DataExportConfig + + +class AWSCcmConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.data_export_config import DataExportConfig + + return { + "data_export_configs": ([DataExportConfig],), + } + + attribute_map = { + "data_export_configs": "data_export_configs", + } + + def __init__(self_, data_export_configs: List[DataExportConfig], **kwargs): + """ + AWS Cloud Cost Management config. + + :param data_export_configs: List of data export configurations for Cost and Usage Reports. + :type data_export_configs: [DataExportConfig] + """ + super().__init__(kwargs) + + self_.data_export_configs = data_export_configs diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_request.py b/src/datadog_api_client/v2/model/aws_ccm_config_request.py new file mode 100644 index 0000000000..010132d662 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_request.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_ccm_config_request_data import AWSCcmConfigRequestData + + +class AWSCcmConfigRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_ccm_config_request_data import AWSCcmConfigRequestData + + return { + "data": (AWSCcmConfigRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AWSCcmConfigRequestData, **kwargs): + """ + AWS CCM Config Create/Update Request body. + + :param data: AWS CCM Config Create/Update Request data. + :type data: AWSCcmConfigRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_request_attributes.py b/src/datadog_api_client/v2/model/aws_ccm_config_request_attributes.py new file mode 100644 index 0000000000..9337edde4f --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_request_attributes.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_ccm_config import AWSCcmConfig + + +class AWSCcmConfigRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_ccm_config import AWSCcmConfig + + return { + "ccm_config": (AWSCcmConfig,), + } + + attribute_map = { + "ccm_config": "ccm_config", + } + + def __init__(self_, ccm_config: AWSCcmConfig, **kwargs): + """ + AWS CCM Config attributes for Create/Update requests. + + :param ccm_config: AWS Cloud Cost Management config. + :type ccm_config: AWSCcmConfig + """ + super().__init__(kwargs) + + self_.ccm_config = ccm_config diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_request_data.py b/src/datadog_api_client/v2/model/aws_ccm_config_request_data.py new file mode 100644 index 0000000000..f81ef99489 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_request_data.py @@ -0,0 +1,48 @@ +# 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.aws_ccm_config_request_attributes import AWSCcmConfigRequestAttributes + from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType + + +class AWSCcmConfigRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_ccm_config_request_attributes import AWSCcmConfigRequestAttributes + from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType + + return { + "attributes": (AWSCcmConfigRequestAttributes,), + "type": (AWSCcmConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AWSCcmConfigRequestAttributes, type: AWSCcmConfigType, **kwargs): + """ + AWS CCM Config Create/Update Request data. + + :param attributes: AWS CCM Config attributes for Create/Update requests. + :type attributes: AWSCcmConfigRequestAttributes + + :param type: AWS CCM Config resource type. + :type type: AWSCcmConfigType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_response.py b/src/datadog_api_client/v2/model/aws_ccm_config_response.py new file mode 100644 index 0000000000..14aec0eade --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_ccm_config_response_data import AWSCcmConfigResponseData + + +class AWSCcmConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_ccm_config_response_data import AWSCcmConfigResponseData + + return { + "data": (AWSCcmConfigResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AWSCcmConfigResponseData, **kwargs): + """ + AWS CCM Config response body. + + :param data: AWS CCM Config response data. + :type data: AWSCcmConfigResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_response_attributes.py b/src/datadog_api_client/v2/model/aws_ccm_config_response_attributes.py new file mode 100644 index 0000000000..5f514ad72e --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_response_attributes.py @@ -0,0 +1,42 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.data_export_config import DataExportConfig + + +class AWSCcmConfigResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.data_export_config import DataExportConfig + + return { + "data_export_configs": ([DataExportConfig],), + } + + attribute_map = { + "data_export_configs": "data_export_configs", + } + + def __init__(self_, data_export_configs: Union[List[DataExportConfig], UnsetType] = unset, **kwargs): + """ + AWS CCM Config response attributes. + + :param data_export_configs: List of data export configurations for Cost and Usage Reports. + :type data_export_configs: [DataExportConfig], optional + """ + if data_export_configs is not unset: + kwargs["data_export_configs"] = data_export_configs + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_response_data.py b/src/datadog_api_client/v2/model/aws_ccm_config_response_data.py new file mode 100644 index 0000000000..9c50ebd825 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_config_response_data.py @@ -0,0 +1,67 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_ccm_config_response_attributes import AWSCcmConfigResponseAttributes + from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType + + +class AWSCcmConfigResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_ccm_config_response_attributes import AWSCcmConfigResponseAttributes + from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType + + return { + "attributes": (AWSCcmConfigResponseAttributes,), + "id": (str,), + "type": (AWSCcmConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: AWSCcmConfigType, + attributes: Union[AWSCcmConfigResponseAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + AWS CCM Config response data. + + :param attributes: AWS CCM Config response attributes. + :type attributes: AWSCcmConfigResponseAttributes, optional + + :param id: Unique Datadog ID of the AWS Account Integration Config. + To get the config ID for an account, use the + `List all AWS integrations `_ + endpoint and query by AWS Account ID. + :type id: str, optional + + :param type: AWS CCM Config resource type. + :type type: AWSCcmConfigType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_ccm_config_type.py b/src/datadog_api_client/v2/model/aws_ccm_config_type.py new file mode 100644 index 0000000000..8efdd6a025 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_ccm_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 AWSCcmConfigType(ModelSimple): + """ + AWS CCM Config resource type. + + :param value: If omitted defaults to "ccm_config". Must be one of ["ccm_config"]. + :type value: str + """ + + allowed_values = { + "ccm_config", + } + CCM_CONFIG: ClassVar["AWSCcmConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSCcmConfigType.CCM_CONFIG = AWSCcmConfigType("ccm_config") diff --git a/src/datadog_api_client/v2/model/aws_lambda_forwarder_config.py b/src/datadog_api_client/v2/model/aws_lambda_forwarder_config.py index 40dcc2ebff..06f745cfaf 100644 --- a/src/datadog_api_client/v2/model/aws_lambda_forwarder_config.py +++ b/src/datadog_api_client/v2/model/aws_lambda_forwarder_config.py @@ -58,7 +58,8 @@ def __init__( :param sources: List of service IDs set to enable automatic log collection. Discover the list of available services with the - `Get list of AWS log ready services `_ + `Get list of AWS log ready + services `_ endpoint. :type sources: [str], optional """ diff --git a/src/datadog_api_client/v2/model/data_export_config.py b/src/datadog_api_client/v2/model/data_export_config.py new file mode 100644 index 0000000000..75c2282c61 --- /dev/null +++ b/src/datadog_api_client/v2/model/data_export_config.py @@ -0,0 +1,59 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class DataExportConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "bucket_name": (str,), + "bucket_region": (str,), + "report_name": (str,), + "report_prefix": (str,), + "report_type": (str,), + } + + attribute_map = { + "bucket_name": "bucket_name", + "bucket_region": "bucket_region", + "report_name": "report_name", + "report_prefix": "report_prefix", + "report_type": "report_type", + } + + def __init__( + self_, bucket_name: str, bucket_region: str, report_name: str, report_prefix: str, report_type: str, **kwargs + ): + """ + AWS Cost and Usage Report data export configuration. + + :param bucket_name: Name of the S3 bucket where the Cost and Usage Report is stored. + :type bucket_name: str + + :param bucket_region: AWS region of the S3 bucket. + :type bucket_region: str + + :param report_name: Name of the Cost and Usage Report. + :type report_name: str + + :param report_prefix: S3 prefix where the Cost and Usage Report is stored. + :type report_prefix: str + + :param report_type: Type of the Cost and Usage Report. Currently only ``CUR2.0`` is supported. + :type report_type: str + """ + super().__init__(kwargs) + + self_.bucket_name = bucket_name + self_.bucket_region = bucket_region + self_.report_name = report_name + self_.report_prefix = report_prefix + self_.report_type = report_type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 6b9a7bec23..efed907243 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -33,6 +33,14 @@ from datadog_api_client.v2.model.aws_auth_config import AWSAuthConfig from datadog_api_client.v2.model.aws_auth_config_keys import AWSAuthConfigKeys from datadog_api_client.v2.model.aws_auth_config_role import AWSAuthConfigRole +from datadog_api_client.v2.model.aws_ccm_config import AWSCcmConfig +from datadog_api_client.v2.model.aws_ccm_config_request import AWSCcmConfigRequest +from datadog_api_client.v2.model.aws_ccm_config_request_attributes import AWSCcmConfigRequestAttributes +from datadog_api_client.v2.model.aws_ccm_config_request_data import AWSCcmConfigRequestData +from datadog_api_client.v2.model.aws_ccm_config_response import AWSCcmConfigResponse +from datadog_api_client.v2.model.aws_ccm_config_response_attributes import AWSCcmConfigResponseAttributes +from datadog_api_client.v2.model.aws_ccm_config_response_data import AWSCcmConfigResponseData +from datadog_api_client.v2.model.aws_ccm_config_type import AWSCcmConfigType from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_attributes_response import ( AWSCloudAuthPersonaMappingAttributesResponse, ) @@ -1564,6 +1572,7 @@ from datadog_api_client.v2.model.data_deletion_response_item import DataDeletionResponseItem from datadog_api_client.v2.model.data_deletion_response_item_attributes import DataDeletionResponseItemAttributes from datadog_api_client.v2.model.data_deletion_response_meta import DataDeletionResponseMeta +from datadog_api_client.v2.model.data_export_config import DataExportConfig from datadog_api_client.v2.model.data_relationships_teams import DataRelationshipsTeams from datadog_api_client.v2.model.data_relationships_teams_data_items import DataRelationshipsTeamsDataItems from datadog_api_client.v2.model.data_relationships_teams_data_items_type import DataRelationshipsTeamsDataItemsType @@ -6471,6 +6480,14 @@ "AWSAuthConfig", "AWSAuthConfigKeys", "AWSAuthConfigRole", + "AWSCcmConfig", + "AWSCcmConfigRequest", + "AWSCcmConfigRequestAttributes", + "AWSCcmConfigRequestData", + "AWSCcmConfigResponse", + "AWSCcmConfigResponseAttributes", + "AWSCcmConfigResponseData", + "AWSCcmConfigType", "AWSCloudAuthPersonaMappingAttributesResponse", "AWSCloudAuthPersonaMappingCreateAttributes", "AWSCloudAuthPersonaMappingCreateData", @@ -7566,6 +7583,7 @@ "DataDeletionResponseItem", "DataDeletionResponseItemAttributes", "DataDeletionResponseMeta", + "DataExportConfig", "DataRelationshipsTeams", "DataRelationshipsTeamsDataItems", "DataRelationshipsTeamsDataItemsType", diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.frozen new file mode 100644 index 0000000000..6f32454e82 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:24.949Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.yaml new file mode 100644 index 0000000000..a6956cd8e1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_aws_ccm_config_object_response.yaml @@ -0,0 +1,51 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '{"data":{"id":"b2087a32-4d4f-45b1-9321-1a0a48e9d7cf","type":"ccm_config","attributes":{"data_export_configs":[{"report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0","bucket_name":"billing","bucket_region":"us-east-1"}]}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/%7Baws_account_config_id%7D/ccm_config + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"aws_account_config_id\" in \"path\"; expected type \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.frozen new file mode 100644 index 0000000000..58c78b7309 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:25.275Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.yaml new file mode 100644 index 0000000000..be8f5c5fb1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_conflict_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '{"errors":[{"status":"409","title":"Account already exists","detail":"CCM + config already exists for this account"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '{"errors":[{"status":"409","title":"Account already exists","detail":"CCM + config already exists for this account"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..42aaeea7fe --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:25.575Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..e5f697352a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_aws_ccm_config_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.frozen new file mode 100644 index 0000000000..45f4b0fc3e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:25.766Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.yaml new file mode 100644 index 0000000000..318750cc45 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_no_content_response.yaml @@ -0,0 +1,16 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..033ac2e27a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:25.891Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..94bd770f2a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_aws_ccm_config_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..cf986cfe94 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:25.966Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..67b70f2a7d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_aws_ccm_config_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.frozen new file mode 100644 index 0000000000..db064b9a80 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:26.142Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.yaml new file mode 100644 index 0000000000..e811928907 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_aws_ccm_config_object_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing-updated","bucket_region":"us-west-2","report_name":"cost-report-updated","report_prefix":"reports-updated","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/b2087a32-4d4f-45b1-9321-1a0a48e9d7cf/ccm_config + response: + body: + string: '{"data":{"id":"b2087a32-4d4f-45b1-9321-1a0a48e9d7cf","type":"ccm_config","attributes":{"data_export_configs":[{"report_name":"cost-report-updated","report_prefix":"reports-updated","report_type":"CUR2.0","bucket_name":"billing-updated","bucket_region":"us-west-2"}]}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.frozen new file mode 100644 index 0000000000..418f960ea9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.frozen @@ -0,0 +1 @@ +2026-02-23T18:02:26.253Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.yaml new file mode 100644 index 0000000000..4c7c3e613e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_aws_ccm_config_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/features/aws_integration.feature b/tests/v2/features/aws_integration.feature index 30ded64d73..5989319f4e 100644 --- a/tests/v2/features/aws_integration.feature +++ b/tests/v2/features/aws_integration.feature @@ -9,6 +9,33 @@ Feature: AWS Integration And a valid "appKeyAuth" key in the system And an instance of "AWSIntegration" API + @skip @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "AWS CCM Config object" response + Given operation "CreateAWSAccountCCMConfig" enabled + And new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 200 AWS CCM Config object + + @skip @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "Conflict" response + Given operation "CreateAWSAccountCCMConfig" enabled + And new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 409 Conflict + + @skip @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "Not Found" response + Given operation "CreateAWSAccountCCMConfig" enabled + And new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Create an AWS account returns "AWS Account object" response Given new "CreateAWSAccount" request @@ -59,6 +86,22 @@ Feature: AWS Integration When the request is sent Then the response status is 409 Conflict + @skip @team:DataDog/aws-integrations + Scenario: Delete AWS CCM config returns "No Content" response + Given operation "DeleteAWSAccountCCMConfig" enabled + And new "DeleteAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @skip @team:DataDog/aws-integrations + Scenario: Delete AWS CCM config returns "Not Found" response + Given operation "DeleteAWSAccountCCMConfig" enabled + And new "DeleteAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request @@ -108,6 +151,22 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS External ID object + @skip @team:DataDog/aws-integrations + Scenario: Get AWS CCM config returns "AWS CCM Config object" response + Given operation "GetAWSAccountCCMConfig" enabled + And new "GetAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 AWS CCM Config object + + @skip @team:DataDog/aws-integrations + Scenario: Get AWS CCM config returns "Not Found" response + Given operation "GetAWSAccountCCMConfig" enabled + And new "GetAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/aws-integrations Scenario: Get AWS integration IAM permissions returns "AWS IAM Permissions object" response Given new "GetAWSIntegrationIAMPermissions" request @@ -190,6 +249,24 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS Namespaces List object + @skip @team:DataDog/aws-integrations + Scenario: Update AWS CCM config returns "AWS CCM Config object" response + Given operation "UpdateAWSAccountCCMConfig" enabled + And new "UpdateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 200 AWS CCM Config object + + @skip @team:DataDog/aws-integrations + Scenario: Update AWS CCM config returns "Not Found" response + Given operation "UpdateAWSAccountCCMConfig" enabled + And new "UpdateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "AWS Account object" response Given there is a valid "aws_account_v2" in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 3dc80275cf..e33094f9f8 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2196,6 +2196,32 @@ "type": "idempotent" } }, + "DeleteAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "GetAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "UpdateAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "CreateAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSAccountCCMConfig", + "parameters": [], + "type": "unsafe" + } + }, "ListAWSNamespaces": { "tag": "AWS Integration", "undo": {