diff --git a/.apigentools-info b/.apigentools-info index e69f65aada..5541a4dbde 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-23 18:35:36.214958", - "spec_repo_commit": "696abec0" + "regenerated": "2023-10-24 13:43:41.689136", + "spec_repo_commit": "51dd569e" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-23 18:35:36.233010", - "spec_repo_commit": "696abec0" + "regenerated": "2023-10-24 13:43:41.704260", + "spec_repo_commit": "51dd569e" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 29cfdad974..83d578e58d 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -56,7 +56,7 @@ components: type: string account_id: description: Your AWS Account ID without dashes. - example: '1234567' + example: '123456789012' type: string account_specific_namespace_rules: additionalProperties: @@ -80,7 +80,9 @@ components: example: true type: boolean excluded_regions: - description: An array of AWS regions to exclude from metrics collection. + description: 'An array of [AWS regions](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) + + to exclude from metrics collection.' example: - us-east-1 - us-west-2 @@ -116,7 +118,7 @@ components: example: - $KEY:$VALUE items: - description: The list of the the host_tags. + description: The list of the host_tags. type: string type: array metrics_collection_enabled: @@ -171,7 +173,7 @@ components: type: string account_id: description: Your AWS Account ID without dashes. - example: '1234567' + example: '123456789012' type: string role_name: description: Your Datadog role delegation name. @@ -187,6 +189,136 @@ components: $ref: '#/components/schemas/AWSAccount' type: array type: object + AWSEventBridgeAccountConfiguration: + description: The EventBridge configuration for one AWS account. + properties: + accountId: + description: Your AWS Account ID without dashes. + example: '123456789012' + type: string + eventHubs: + description: Array of AWS event sources associated with this account. + items: + $ref: '#/components/schemas/AWSEventBridgeSource' + type: array + tags: + description: 'Array of tags (in the form `key:value`) which are added to + all hosts + + and metrics reporting through the main AWS integration.' + example: + - $KEY:$VALUE + items: + description: The list of the host_tags. + type: string + type: array + type: object + AWSEventBridgeCreateRequest: + description: An object used to create an EventBridge source. + properties: + account_id: + description: Your AWS Account ID without dashes. + example: '123456789012' + type: string + create_event_bus: + description: 'True if Datadog should create the event bus in addition to + the event + + source. Requires the events:CreateEventBus permission.' + example: true + type: boolean + event_generator_name: + description: 'The given part of the event source name, which is then combined + with an + + assigned suffix to form the full name.' + example: app-alerts + type: string + region: + description: The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + example: us-east-1 + type: string + type: object + AWSEventBridgeCreateResponse: + description: A created EventBridge source. + properties: + event_source_name: + description: The event source name. + example: app-alerts-zyxw3210 + type: string + has_bus: + description: True if the event bus was created in addition to the source. + example: true + type: boolean + region: + description: The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + example: us-east-1 + type: string + status: + $ref: '#/components/schemas/AWSEventBridgeCreatedStatus' + type: object + AWSEventBridgeCreatedStatus: + description: The event source status "created". + enum: + - created + example: created + type: string + x-enum-varnames: + - CREATED + AWSEventBridgeDeleteRequest: + description: An object used to delete an EventBridge source. + properties: + account_id: + description: Your AWS Account ID without dashes. + example: '123456789012' + type: string + event_generator_name: + description: The event source name. + example: app-alerts-zyxw3210 + type: string + region: + description: The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + example: us-east-1 + type: string + type: object + AWSEventBridgeDeleteResponse: + description: An indicator of the successful deletion of an EventBridge source. + properties: + status: + $ref: '#/components/schemas/AWSEventBridgeEmptyStatus' + type: object + AWSEventBridgeEmptyStatus: + description: The event source status "empty". + enum: + - empty + example: empty + type: string + x-enum-varnames: + - EMPTY + AWSEventBridgeListResponse: + description: An object describing the EventBridge configuration for multiple + accounts. + properties: + accounts: + description: List of accounts with their event sources. + items: + $ref: '#/components/schemas/AWSEventBridgeAccountConfiguration' + type: array + isInstalled: + description: True if the EventBridge sub-integration is enabled for your + organization. + type: boolean + type: object + AWSEventBridgeSource: + description: An EventBridge source. + properties: + name: + description: The event source name. + type: string + region: + description: The event source's [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + type: string + type: object AWSLogsAsyncError: description: Description of errors. properties: @@ -323,7 +455,7 @@ components: properties: account_id: description: Your AWS Account ID without dashes. - example: '1234567' + example: '123456789012' type: string namespace: $ref: '#/components/schemas/AWSNamespace' @@ -23393,6 +23525,107 @@ paths: summary: List namespace rules tags: - AWS Integration + /api/v1/integration/aws/event_bridge: + delete: + description: Delete an Amazon EventBridge source. + operationId: DeleteAWSEventBridgeSource + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeDeleteRequest' + description: Delete the Amazon EventBridge source with the given name, region, + and associated AWS account. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeDeleteResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an Amazon EventBridge source + tags: + - AWS Integration + x-codegen-request-body-name: body + get: + description: Get all Amazon EventBridge sources. + operationId: ListAWSEventBridgeSources + parameters: [] + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all Amazon EventBridge sources + tags: + - AWS Integration + post: + description: Create an Amazon EventBridge source. + operationId: CreateAWSEventBridgeSource + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeCreateRequest' + description: Create an Amazon EventBridge source for an AWS account with a + given name and region. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeCreateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create an Amazon EventBridge source + tags: + - AWS Integration + x-codegen-request-body-name: body /api/v1/integration/aws/filtering: delete: description: Delete a tag filtering entry. diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 0a0169f873..d27908634f 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -162,6 +162,69 @@ aws\_account\_list\_response :members: :show-inheritance: +aws\_event\_bridge\_account\_configuration +------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_account_configuration + :members: + :show-inheritance: + +aws\_event\_bridge\_create\_request +----------------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_create_request + :members: + :show-inheritance: + +aws\_event\_bridge\_create\_response +------------------------------------ + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_create_response + :members: + :show-inheritance: + +aws\_event\_bridge\_created\_status +----------------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_created_status + :members: + :show-inheritance: + +aws\_event\_bridge\_delete\_request +----------------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_delete_request + :members: + :show-inheritance: + +aws\_event\_bridge\_delete\_response +------------------------------------ + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_delete_response + :members: + :show-inheritance: + +aws\_event\_bridge\_empty\_status +--------------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_empty_status + :members: + :show-inheritance: + +aws\_event\_bridge\_list\_response +---------------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_list_response + :members: + :show-inheritance: + +aws\_event\_bridge\_source +-------------------------- + +.. automodule:: datadog_api_client.v1.model.aws_event_bridge_source + :members: + :show-inheritance: + aws\_logs\_async\_error ----------------------- diff --git a/examples/v1/aws-integration/CreateAWSAccount.py b/examples/v1/aws-integration/CreateAWSAccount.py index 8bd3a0c503..268c5e2cee 100644 --- a/examples/v1/aws-integration/CreateAWSAccount.py +++ b/examples/v1/aws-integration/CreateAWSAccount.py @@ -7,7 +7,7 @@ from datadog_api_client.v1.model.aws_account import AWSAccount body = AWSAccount( - account_id="1234567", + account_id="123456789012", account_specific_namespace_rules=dict( auto_scaling=False, opswork=False, diff --git a/examples/v1/aws-integration/CreateAWSEventBridgeSource.py b/examples/v1/aws-integration/CreateAWSEventBridgeSource.py new file mode 100644 index 0000000000..bb3940a746 --- /dev/null +++ b/examples/v1/aws-integration/CreateAWSEventBridgeSource.py @@ -0,0 +1,21 @@ +""" +Create an Amazon EventBridge source returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.aws_integration_api import AWSIntegrationApi +from datadog_api_client.v1.model.aws_event_bridge_create_request import AWSEventBridgeCreateRequest + +body = AWSEventBridgeCreateRequest( + account_id="123456789012", + create_event_bus=True, + event_generator_name="app-alerts", + region="us-east-1", +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.create_aws_event_bridge_source(body=body) + + print(response) diff --git a/examples/v1/aws-integration/CreateAWSTagFilter.py b/examples/v1/aws-integration/CreateAWSTagFilter.py index 20f4fa04d5..c31c1aa614 100644 --- a/examples/v1/aws-integration/CreateAWSTagFilter.py +++ b/examples/v1/aws-integration/CreateAWSTagFilter.py @@ -8,7 +8,7 @@ from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest body = AWSTagFilterCreateRequest( - account_id="1234567", + account_id="123456789012", namespace=AWSNamespace.ELB, tag_filter_str="prod*", ) diff --git a/examples/v1/aws-integration/CreateNewAWSExternalID.py b/examples/v1/aws-integration/CreateNewAWSExternalID.py index ef765d8a75..83b34e7192 100644 --- a/examples/v1/aws-integration/CreateNewAWSExternalID.py +++ b/examples/v1/aws-integration/CreateNewAWSExternalID.py @@ -7,7 +7,7 @@ from datadog_api_client.v1.model.aws_account import AWSAccount body = AWSAccount( - account_id="1234567", + account_id="123456789012", account_specific_namespace_rules=dict( auto_scaling=False, opswork=False, diff --git a/examples/v1/aws-integration/DeleteAWSAccount.py b/examples/v1/aws-integration/DeleteAWSAccount.py index 513b2d310b..0a7a598247 100644 --- a/examples/v1/aws-integration/DeleteAWSAccount.py +++ b/examples/v1/aws-integration/DeleteAWSAccount.py @@ -7,7 +7,7 @@ from datadog_api_client.v1.model.aws_account_delete_request import AWSAccountDeleteRequest body = AWSAccountDeleteRequest( - account_id="1234567", + account_id="123456789012", role_name="DatadogAWSIntegrationRole", ) diff --git a/examples/v1/aws-integration/DeleteAWSEventBridgeSource.py b/examples/v1/aws-integration/DeleteAWSEventBridgeSource.py new file mode 100644 index 0000000000..b4f8c7780a --- /dev/null +++ b/examples/v1/aws-integration/DeleteAWSEventBridgeSource.py @@ -0,0 +1,20 @@ +""" +Delete an Amazon EventBridge source returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.aws_integration_api import AWSIntegrationApi +from datadog_api_client.v1.model.aws_event_bridge_delete_request import AWSEventBridgeDeleteRequest + +body = AWSEventBridgeDeleteRequest( + account_id="123456789012", + event_generator_name="app-alerts-zyxw3210", + region="us-east-1", +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.delete_aws_event_bridge_source(body=body) + + print(response) diff --git a/examples/v1/aws-integration/ListAWSEventBridgeSources.py b/examples/v1/aws-integration/ListAWSEventBridgeSources.py new file mode 100644 index 0000000000..ef49d30640 --- /dev/null +++ b/examples/v1/aws-integration/ListAWSEventBridgeSources.py @@ -0,0 +1,13 @@ +""" +Get all Amazon EventBridge sources returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.aws_integration_api import AWSIntegrationApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = AWSIntegrationApi(api_client) + response = api_instance.list_aws_event_bridge_sources() + + print(response) diff --git a/src/datadog_api_client/v1/api/aws_integration_api.py b/src/datadog_api_client/v1/api/aws_integration_api.py index c6325450c7..5f957c7747 100644 --- a/src/datadog_api_client/v1/api/aws_integration_api.py +++ b/src/datadog_api_client/v1/api/aws_integration_api.py @@ -15,6 +15,11 @@ from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse from datadog_api_client.v1.model.aws_account import AWSAccount +from datadog_api_client.v1.model.aws_event_bridge_delete_response import AWSEventBridgeDeleteResponse +from datadog_api_client.v1.model.aws_event_bridge_delete_request import AWSEventBridgeDeleteRequest +from datadog_api_client.v1.model.aws_event_bridge_list_response import AWSEventBridgeListResponse +from datadog_api_client.v1.model.aws_event_bridge_create_response import AWSEventBridgeCreateResponse +from datadog_api_client.v1.model.aws_event_bridge_create_request import AWSEventBridgeCreateRequest from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest from datadog_api_client.v1.model.aws_tag_filter_list_response import AWSTagFilterListResponse from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest @@ -51,6 +56,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_aws_event_bridge_source_endpoint = _Endpoint( + settings={ + "response_type": (AWSEventBridgeCreateResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/integration/aws/event_bridge", + "operation_id": "create_aws_event_bridge_source", + "http_method": "POST", + "version": "v1", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AWSEventBridgeCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_aws_tag_filter_endpoint = _Endpoint( settings={ "response_type": (dict,), @@ -111,6 +136,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_aws_event_bridge_source_endpoint = _Endpoint( + settings={ + "response_type": (AWSEventBridgeDeleteResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/integration/aws/event_bridge", + "operation_id": "delete_aws_event_bridge_source", + "http_method": "DELETE", + "version": "v1", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AWSEventBridgeDeleteRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_aws_tag_filter_endpoint = _Endpoint( settings={ "response_type": (dict,), @@ -179,6 +224,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_aws_event_bridge_sources_endpoint = _Endpoint( + settings={ + "response_type": (AWSEventBridgeListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/integration/aws/event_bridge", + "operation_id": "list_aws_event_bridge_sources", + "http_method": "GET", + "version": "v1", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_aws_tag_filters_endpoint = _Endpoint( settings={ "response_type": (AWSTagFilterListResponse,), @@ -257,6 +318,23 @@ def create_aws_account( return self._create_aws_account_endpoint.call_with_http_info(**kwargs) + def create_aws_event_bridge_source( + self, + body: AWSEventBridgeCreateRequest, + ) -> AWSEventBridgeCreateResponse: + """Create an Amazon EventBridge source. + + Create an Amazon EventBridge source. + + :param body: Create an Amazon EventBridge source for an AWS account with a given name and region. + :type body: AWSEventBridgeCreateRequest + :rtype: AWSEventBridgeCreateResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_aws_event_bridge_source_endpoint.call_with_http_info(**kwargs) + def create_aws_tag_filter( self, body: AWSTagFilterCreateRequest, @@ -311,6 +389,23 @@ def delete_aws_account( return self._delete_aws_account_endpoint.call_with_http_info(**kwargs) + def delete_aws_event_bridge_source( + self, + body: AWSEventBridgeDeleteRequest, + ) -> AWSEventBridgeDeleteResponse: + """Delete an Amazon EventBridge source. + + Delete an Amazon EventBridge source. + + :param body: Delete the Amazon EventBridge source with the given name, region, and associated AWS account. + :type body: AWSEventBridgeDeleteRequest + :rtype: AWSEventBridgeDeleteResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._delete_aws_event_bridge_source_endpoint.call_with_http_info(**kwargs) + def delete_aws_tag_filter( self, body: AWSTagFilterDeleteRequest, @@ -371,6 +466,18 @@ def list_aws_accounts( return self._list_aws_accounts_endpoint.call_with_http_info(**kwargs) + def list_aws_event_bridge_sources( + self, + ) -> AWSEventBridgeListResponse: + """Get all Amazon EventBridge sources. + + Get all Amazon EventBridge sources. + + :rtype: AWSEventBridgeListResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_aws_event_bridge_sources_endpoint.call_with_http_info(**kwargs) + def list_aws_tag_filters( self, account_id: str, diff --git a/src/datadog_api_client/v1/model/aws_account.py b/src/datadog_api_client/v1/model/aws_account.py index 93b7498139..2af11aa2e4 100644 --- a/src/datadog_api_client/v1/model/aws_account.py +++ b/src/datadog_api_client/v1/model/aws_account.py @@ -76,7 +76,8 @@ def __init__( :param cspm_resource_collection_enabled: Whether Datadog collects cloud security posture management resources from your AWS account. This includes additional resources not covered under the general ``resource_collection``. :type cspm_resource_collection_enabled: bool, optional - :param excluded_regions: An array of AWS regions to exclude from metrics collection. + :param excluded_regions: An array of `AWS regions `_ + to exclude from metrics collection. :type excluded_regions: [str], optional :param filter_tags: The array of EC2 tags (in the form ``key:value`` ) defines a filter that Datadog uses when collecting metrics from EC2. diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_account_configuration.py b/src/datadog_api_client/v1/model/aws_event_bridge_account_configuration.py new file mode 100644 index 0000000000..e151b31786 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_account_configuration.py @@ -0,0 +1,63 @@ +# 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.v1.model.aws_event_bridge_source import AWSEventBridgeSource + + +class AWSEventBridgeAccountConfiguration(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.aws_event_bridge_source import AWSEventBridgeSource + + return { + "account_id": (str,), + "event_hubs": ([AWSEventBridgeSource],), + "tags": ([str],), + } + + attribute_map = { + "account_id": "accountId", + "event_hubs": "eventHubs", + "tags": "tags", + } + + def __init__( + self_, + account_id: Union[str, UnsetType] = unset, + event_hubs: Union[List[AWSEventBridgeSource], UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + The EventBridge configuration for one AWS account. + + :param account_id: Your AWS Account ID without dashes. + :type account_id: str, optional + + :param event_hubs: Array of AWS event sources associated with this account. + :type event_hubs: [AWSEventBridgeSource], optional + + :param tags: Array of tags (in the form ``key:value`` ) which are added to all hosts + and metrics reporting through the main AWS integration. + :type tags: [str], optional + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if event_hubs is not unset: + kwargs["event_hubs"] = event_hubs + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_create_request.py b/src/datadog_api_client/v1/model/aws_event_bridge_create_request.py new file mode 100644 index 0000000000..f3d662b5de --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_create_request.py @@ -0,0 +1,66 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AWSEventBridgeCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "create_event_bus": (bool,), + "event_generator_name": (str,), + "region": (str,), + } + + attribute_map = { + "account_id": "account_id", + "create_event_bus": "create_event_bus", + "event_generator_name": "event_generator_name", + "region": "region", + } + + def __init__( + self_, + account_id: Union[str, UnsetType] = unset, + create_event_bus: Union[bool, UnsetType] = unset, + event_generator_name: Union[str, UnsetType] = unset, + region: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An object used to create an EventBridge source. + + :param account_id: Your AWS Account ID without dashes. + :type account_id: str, optional + + :param create_event_bus: True if Datadog should create the event bus in addition to the event + source. Requires the events:CreateEventBus permission. + :type create_event_bus: bool, optional + + :param event_generator_name: The given part of the event source name, which is then combined with an + assigned suffix to form the full name. + :type event_generator_name: str, optional + + :param region: The event source's `AWS region `_. + :type region: str, optional + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if create_event_bus is not unset: + kwargs["create_event_bus"] = create_event_bus + if event_generator_name is not unset: + kwargs["event_generator_name"] = event_generator_name + if region is not unset: + kwargs["region"] = region + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_create_response.py b/src/datadog_api_client/v1/model/aws_event_bridge_create_response.py new file mode 100644 index 0000000000..d5af2a8040 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_create_response.py @@ -0,0 +1,70 @@ +# 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.v1.model.aws_event_bridge_created_status import AWSEventBridgeCreatedStatus + + +class AWSEventBridgeCreateResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.aws_event_bridge_created_status import AWSEventBridgeCreatedStatus + + return { + "event_source_name": (str,), + "has_bus": (bool,), + "region": (str,), + "status": (AWSEventBridgeCreatedStatus,), + } + + attribute_map = { + "event_source_name": "event_source_name", + "has_bus": "has_bus", + "region": "region", + "status": "status", + } + + def __init__( + self_, + event_source_name: Union[str, UnsetType] = unset, + has_bus: Union[bool, UnsetType] = unset, + region: Union[str, UnsetType] = unset, + status: Union[AWSEventBridgeCreatedStatus, UnsetType] = unset, + **kwargs, + ): + """ + A created EventBridge source. + + :param event_source_name: The event source name. + :type event_source_name: str, optional + + :param has_bus: True if the event bus was created in addition to the source. + :type has_bus: bool, optional + + :param region: The event source's `AWS region `_. + :type region: str, optional + + :param status: The event source status "created". + :type status: AWSEventBridgeCreatedStatus, optional + """ + if event_source_name is not unset: + kwargs["event_source_name"] = event_source_name + if has_bus is not unset: + kwargs["has_bus"] = has_bus + if region is not unset: + kwargs["region"] = region + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_created_status.py b/src/datadog_api_client/v1/model/aws_event_bridge_created_status.py new file mode 100644 index 0000000000..2402109232 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_created_status.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 AWSEventBridgeCreatedStatus(ModelSimple): + """ + The event source status "created". + + :param value: If omitted defaults to "created". Must be one of ["created"]. + :type value: str + """ + + allowed_values = { + "created", + } + CREATED: ClassVar["AWSEventBridgeCreatedStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSEventBridgeCreatedStatus.CREATED = AWSEventBridgeCreatedStatus("created") diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_delete_request.py b/src/datadog_api_client/v1/model/aws_event_bridge_delete_request.py new file mode 100644 index 0000000000..8dd0c94053 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_delete_request.py @@ -0,0 +1,56 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AWSEventBridgeDeleteRequest(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_id": (str,), + "event_generator_name": (str,), + "region": (str,), + } + + attribute_map = { + "account_id": "account_id", + "event_generator_name": "event_generator_name", + "region": "region", + } + + def __init__( + self_, + account_id: Union[str, UnsetType] = unset, + event_generator_name: Union[str, UnsetType] = unset, + region: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An object used to delete an EventBridge source. + + :param account_id: Your AWS Account ID without dashes. + :type account_id: str, optional + + :param event_generator_name: The event source name. + :type event_generator_name: str, optional + + :param region: The event source's `AWS region `_. + :type region: str, optional + """ + if account_id is not unset: + kwargs["account_id"] = account_id + if event_generator_name is not unset: + kwargs["event_generator_name"] = event_generator_name + if region is not unset: + kwargs["region"] = region + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_delete_response.py b/src/datadog_api_client/v1/model/aws_event_bridge_delete_response.py new file mode 100644 index 0000000000..e0e6fcfbbf --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_delete_response.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.aws_event_bridge_empty_status import AWSEventBridgeEmptyStatus + + +class AWSEventBridgeDeleteResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.aws_event_bridge_empty_status import AWSEventBridgeEmptyStatus + + return { + "status": (AWSEventBridgeEmptyStatus,), + } + + attribute_map = { + "status": "status", + } + + def __init__(self_, status: Union[AWSEventBridgeEmptyStatus, UnsetType] = unset, **kwargs): + """ + An indicator of the successful deletion of an EventBridge source. + + :param status: The event source status "empty". + :type status: AWSEventBridgeEmptyStatus, optional + """ + if status is not unset: + kwargs["status"] = status + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_empty_status.py b/src/datadog_api_client/v1/model/aws_event_bridge_empty_status.py new file mode 100644 index 0000000000..2955c9d505 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_empty_status.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 AWSEventBridgeEmptyStatus(ModelSimple): + """ + The event source status "empty". + + :param value: If omitted defaults to "empty". Must be one of ["empty"]. + :type value: str + """ + + allowed_values = { + "empty", + } + EMPTY: ClassVar["AWSEventBridgeEmptyStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AWSEventBridgeEmptyStatus.EMPTY = AWSEventBridgeEmptyStatus("empty") diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_list_response.py b/src/datadog_api_client/v1/model/aws_event_bridge_list_response.py new file mode 100644 index 0000000000..f7eba6161a --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_list_response.py @@ -0,0 +1,56 @@ +# 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.v1.model.aws_event_bridge_account_configuration import AWSEventBridgeAccountConfiguration + + +class AWSEventBridgeListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.aws_event_bridge_account_configuration import ( + AWSEventBridgeAccountConfiguration, + ) + + return { + "accounts": ([AWSEventBridgeAccountConfiguration],), + "is_installed": (bool,), + } + + attribute_map = { + "accounts": "accounts", + "is_installed": "isInstalled", + } + + def __init__( + self_, + accounts: Union[List[AWSEventBridgeAccountConfiguration], UnsetType] = unset, + is_installed: Union[bool, UnsetType] = unset, + **kwargs, + ): + """ + An object describing the EventBridge configuration for multiple accounts. + + :param accounts: List of accounts with their event sources. + :type accounts: [AWSEventBridgeAccountConfiguration], optional + + :param is_installed: True if the EventBridge sub-integration is enabled for your organization. + :type is_installed: bool, optional + """ + if accounts is not unset: + kwargs["accounts"] = accounts + if is_installed is not unset: + kwargs["is_installed"] = is_installed + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/aws_event_bridge_source.py b/src/datadog_api_client/v1/model/aws_event_bridge_source.py new file mode 100644 index 0000000000..22a9c82195 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_event_bridge_source.py @@ -0,0 +1,43 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AWSEventBridgeSource(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "region": (str,), + } + + attribute_map = { + "name": "name", + "region": "region", + } + + def __init__(self_, name: Union[str, UnsetType] = unset, region: Union[str, UnsetType] = unset, **kwargs): + """ + An EventBridge source. + + :param name: The event source name. + :type name: str, optional + + :param region: The event source's `AWS region `_. + :type region: str, optional + """ + if name is not unset: + kwargs["name"] = name + if region is not unset: + kwargs["region"] = region + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 26733a9c84..2ee15aad11 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -4,6 +4,15 @@ from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse from datadog_api_client.v1.model.aws_account_delete_request import AWSAccountDeleteRequest from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse +from datadog_api_client.v1.model.aws_event_bridge_account_configuration import AWSEventBridgeAccountConfiguration +from datadog_api_client.v1.model.aws_event_bridge_create_request import AWSEventBridgeCreateRequest +from datadog_api_client.v1.model.aws_event_bridge_create_response import AWSEventBridgeCreateResponse +from datadog_api_client.v1.model.aws_event_bridge_created_status import AWSEventBridgeCreatedStatus +from datadog_api_client.v1.model.aws_event_bridge_delete_request import AWSEventBridgeDeleteRequest +from datadog_api_client.v1.model.aws_event_bridge_delete_response import AWSEventBridgeDeleteResponse +from datadog_api_client.v1.model.aws_event_bridge_empty_status import AWSEventBridgeEmptyStatus +from datadog_api_client.v1.model.aws_event_bridge_list_response import AWSEventBridgeListResponse +from datadog_api_client.v1.model.aws_event_bridge_source import AWSEventBridgeSource from datadog_api_client.v1.model.aws_logs_async_error import AWSLogsAsyncError from datadog_api_client.v1.model.aws_logs_async_response import AWSLogsAsyncResponse from datadog_api_client.v1.model.aws_logs_lambda import AWSLogsLambda @@ -944,6 +953,15 @@ "AWSAccountCreateResponse", "AWSAccountDeleteRequest", "AWSAccountListResponse", + "AWSEventBridgeAccountConfiguration", + "AWSEventBridgeCreateRequest", + "AWSEventBridgeCreateResponse", + "AWSEventBridgeCreatedStatus", + "AWSEventBridgeDeleteRequest", + "AWSEventBridgeDeleteResponse", + "AWSEventBridgeEmptyStatus", + "AWSEventBridgeListResponse", + "AWSEventBridgeSource", "AWSLogsAsyncError", "AWSLogsAsyncResponse", "AWSLogsLambda", diff --git a/tests/v1/features/aws_integration.feature b/tests/v1/features/aws_integration.feature index 65e77acfb9..d86bff2b32 100644 --- a/tests/v1/features/aws_integration.feature +++ b/tests/v1/features/aws_integration.feature @@ -12,21 +12,35 @@ Feature: AWS Integration @generated @skip @team:DataDog/cloud-integrations Scenario: Create an AWS integration returns "Bad Request" response Given new "CreateAWSAccount" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Create an AWS integration returns "Conflict Error" response Given new "CreateAWSAccount" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error @generated @skip @team:DataDog/cloud-integrations Scenario: Create an AWS integration returns "OK" response Given new "CreateAWSAccount" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-integrations + Scenario: Create an Amazon EventBridge source returns "Bad Request" response + Given new "CreateAWSEventBridgeSource" request + And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-integrations + Scenario: Create an Amazon EventBridge source returns "OK" response + Given new "CreateAWSEventBridgeSource" request + And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} When the request is sent Then the response status is 200 OK @@ -47,35 +61,49 @@ Feature: AWS Integration @generated @skip @team:DataDog/cloud-integrations Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request - And body with value {"account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Delete an AWS integration returns "Conflict Error" response Given new "DeleteAWSAccount" request - And body with value {"account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error @generated @skip @team:DataDog/cloud-integrations Scenario: Delete an AWS integration returns "OK" response Given new "DeleteAWSAccount" request - And body with value {"account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-integrations + Scenario: Delete an Amazon EventBridge source returns "Bad Request" response + Given new "DeleteAWSEventBridgeSource" request + And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-integrations + Scenario: Delete an Amazon EventBridge source returns "OK" response + Given new "DeleteAWSEventBridgeSource" request + And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/cloud-integrations Scenario: Generate a new external ID returns "Bad Request" response Given new "CreateNewAWSExternalID" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Generate a new external ID returns "OK" response Given new "CreateNewAWSExternalID" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK @@ -93,6 +121,18 @@ Feature: AWS Integration When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-integrations + Scenario: Get all Amazon EventBridge sources returns "Bad Request" response + Given new "ListAWSEventBridgeSources" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-integrations + Scenario: Get all Amazon EventBridge sources returns "OK" response + Given new "ListAWSEventBridgeSources" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-integrations Scenario: List all AWS integrations returns "Bad Request" response Given new "ListAWSAccounts" request @@ -114,28 +154,28 @@ Feature: AWS Integration @generated @skip @team:DataDog/cloud-integrations Scenario: Set an AWS tag filter returns "Bad Request" response Given new "CreateAWSTagFilter" request - And body with value {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"} + And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Set an AWS tag filter returns "OK" response Given new "CreateAWSTagFilter" request - And body with value {"account_id": "1234567", "namespace": "elb", "tag_filter_str": "prod*"} + And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/cloud-integrations Scenario: Update an AWS integration returns "Bad Request" response Given new "UpdateAWSAccount" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Update an AWS integration returns "Conflict Error" response Given new "UpdateAWSAccount" request - And body with value {"account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} + And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error diff --git a/tests/v1/features/undo.json b/tests/v1/features/undo.json index 3c1f3f60c0..cb8c824383 100644 --- a/tests/v1/features/undo.json +++ b/tests/v1/features/undo.json @@ -372,6 +372,26 @@ "type": "safe" } }, + "DeleteAWSEventBridgeSource": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "ListAWSEventBridgeSources": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateAWSEventBridgeSource": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSEventBridgeSource", + "parameters": [], + "type": "unsafe" + } + }, "DeleteAWSTagFilter": { "tag": "AWS Integration", "undo": {