From 8bae4c12f3e863d3623e06dbbe20c3ff81d26072 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 21:10:20 +0000 Subject: [PATCH] Add Container App filters to Azure API (#1703) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .generator/schemas/v1/openapi.yaml | 8 ++++++++ .../azure-integration/CreateAzureIntegration.py | 1 + .../azure-integration/DeleteAzureIntegration.py | 1 + .../azure-integration/UpdateAzureHostFilters.py | 1 + .../azure-integration/UpdateAzureIntegration.py | 1 + src/datadog_api_client/v1/model/azure_account.py | 9 +++++++++ tests/v1/features/azure_integration.feature | 16 ++++++++-------- 8 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index be13046327..5d99e4674c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-26 14:19:42.869700", - "spec_repo_commit": "10504fc3" + "regenerated": "2023-10-26 18:12:28.293778", + "spec_repo_commit": "d4ce0c7b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-26 14:19:42.888260", - "spec_repo_commit": "10504fc3" + "regenerated": "2023-10-26 18:12:28.383428", + "spec_repo_commit": "d4ce0c7b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 986b2f612e..3164b67600 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -799,6 +799,14 @@ components: description: Your Azure web application secret key. example: testingx./Sw*g/Y33t..R1cH+hScMDt type: string + container_app_filters: + description: 'Limit the Azure container apps that are pulled into Datadog + using tags. + + Only container apps that match one of the defined tags are imported into + Datadog.' + example: key:value,filter:example + type: string cspm_enabled: description: Enable Cloud Security Management Misconfigurations for your organization. diff --git a/examples/v1/azure-integration/CreateAzureIntegration.py b/examples/v1/azure-integration/CreateAzureIntegration.py index ad3e261d22..94011d1601 100644 --- a/examples/v1/azure-integration/CreateAzureIntegration.py +++ b/examples/v1/azure-integration/CreateAzureIntegration.py @@ -11,6 +11,7 @@ automute=True, client_id="testc7f6-1234-5678-9101-3fcbf464test", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", + container_app_filters="key:value,filter:example", cspm_enabled=True, custom_metrics_enabled=True, errors=[ diff --git a/examples/v1/azure-integration/DeleteAzureIntegration.py b/examples/v1/azure-integration/DeleteAzureIntegration.py index b93df1947d..d4342eb7c8 100644 --- a/examples/v1/azure-integration/DeleteAzureIntegration.py +++ b/examples/v1/azure-integration/DeleteAzureIntegration.py @@ -11,6 +11,7 @@ automute=True, client_id="testc7f6-1234-5678-9101-3fcbf464test", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", + container_app_filters="key:value,filter:example", cspm_enabled=True, custom_metrics_enabled=True, errors=[ diff --git a/examples/v1/azure-integration/UpdateAzureHostFilters.py b/examples/v1/azure-integration/UpdateAzureHostFilters.py index 83a05f4797..c6033af3cb 100644 --- a/examples/v1/azure-integration/UpdateAzureHostFilters.py +++ b/examples/v1/azure-integration/UpdateAzureHostFilters.py @@ -11,6 +11,7 @@ automute=True, client_id="testc7f6-1234-5678-9101-3fcbf464test", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", + container_app_filters="key:value,filter:example", cspm_enabled=True, custom_metrics_enabled=True, errors=[ diff --git a/examples/v1/azure-integration/UpdateAzureIntegration.py b/examples/v1/azure-integration/UpdateAzureIntegration.py index e132de46e9..84bd7ca4ef 100644 --- a/examples/v1/azure-integration/UpdateAzureIntegration.py +++ b/examples/v1/azure-integration/UpdateAzureIntegration.py @@ -11,6 +11,7 @@ automute=True, client_id="testc7f6-1234-5678-9101-3fcbf464test", client_secret="testingx./Sw*g/Y33t..R1cH+hScMDt", + container_app_filters="key:value,filter:example", cspm_enabled=True, custom_metrics_enabled=True, errors=[ diff --git a/src/datadog_api_client/v1/model/azure_account.py b/src/datadog_api_client/v1/model/azure_account.py index a1ed8feb66..da28d2f1fb 100644 --- a/src/datadog_api_client/v1/model/azure_account.py +++ b/src/datadog_api_client/v1/model/azure_account.py @@ -21,6 +21,7 @@ def openapi_types(_): "automute": (bool,), "client_id": (str,), "client_secret": (str,), + "container_app_filters": (str,), "cspm_enabled": (bool,), "custom_metrics_enabled": (bool,), "errors": ([str],), @@ -35,6 +36,7 @@ def openapi_types(_): "automute": "automute", "client_id": "client_id", "client_secret": "client_secret", + "container_app_filters": "container_app_filters", "cspm_enabled": "cspm_enabled", "custom_metrics_enabled": "custom_metrics_enabled", "errors": "errors", @@ -50,6 +52,7 @@ def __init__( automute: Union[bool, UnsetType] = unset, client_id: Union[str, UnsetType] = unset, client_secret: Union[str, UnsetType] = unset, + container_app_filters: Union[str, UnsetType] = unset, cspm_enabled: Union[bool, UnsetType] = unset, custom_metrics_enabled: Union[bool, UnsetType] = unset, errors: Union[List[str], UnsetType] = unset, @@ -75,6 +78,10 @@ def __init__( :param client_secret: Your Azure web application secret key. :type client_secret: str, optional + :param container_app_filters: Limit the Azure container apps that are pulled into Datadog using tags. + Only container apps that match one of the defined tags are imported into Datadog. + :type container_app_filters: str, optional + :param cspm_enabled: Enable Cloud Security Management Misconfigurations for your organization. :type cspm_enabled: bool, optional @@ -105,6 +112,8 @@ def __init__( kwargs["client_id"] = client_id if client_secret is not unset: kwargs["client_secret"] = client_secret + if container_app_filters is not unset: + kwargs["container_app_filters"] = container_app_filters if cspm_enabled is not unset: kwargs["cspm_enabled"] = cspm_enabled if custom_metrics_enabled is not unset: diff --git a/tests/v1/features/azure_integration.feature b/tests/v1/features/azure_integration.feature index eb8cf95d11..c7ef5e4b83 100644 --- a/tests/v1/features/azure_integration.feature +++ b/tests/v1/features/azure_integration.feature @@ -12,28 +12,28 @@ Feature: Azure Integration @generated @skip @team:DataDog/cloud-integrations Scenario: Create an Azure integration returns "Bad Request" response Given new "CreateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Create an Azure integration returns "OK" response Given new "CreateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/cloud-integrations Scenario: Delete an Azure integration returns "Bad Request" response Given new "DeleteAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Delete an Azure integration returns "OK" response Given new "DeleteAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 200 OK @@ -52,27 +52,27 @@ Feature: Azure Integration @generated @skip @team:DataDog/cloud-integrations Scenario: Update Azure integration host filters returns "Bad Request" response Given new "UpdateAzureHostFilters" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Update Azure integration host filters returns "OK" response Given new "UpdateAzureHostFilters" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/cloud-integrations Scenario: Update an Azure integration returns "Bad Request" response Given new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-integrations Scenario: Update an Azure integration returns "OK" response Given new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "testc7f6-1234-5678-9101-3fcbf464test", "client_secret": "testingx./Sw*g/Y33t..R1cH+hScMDt", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "tenant_name": "testc44-1234-5678-9101-cc00736ftest"} When the request is sent Then the response status is 200 OK