diff --git a/.apigentools-info b/.apigentools-info index 68c29d69e1..2324158ca5 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-18 16:21:35.283327", - "spec_repo_commit": "e12aeab9" + "regenerated": "2024-12-18 17:18:32.703322", + "spec_repo_commit": "8cb3faac" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-18 16:21:35.297169", - "spec_repo_commit": "e12aeab9" + "regenerated": "2024-12-18 17:18:32.717421", + "spec_repo_commit": "8cb3faac" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 51185eef69..dc238c59a7 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -844,8 +844,15 @@ components: Only hosts that match one of the defined tags are imported into Datadog.' example: key:value,filter:example type: string - metrics_config: - $ref: '#/components/schemas/AzureAccountMetricsConfig' + metrics_enabled: + description: Enable Azure metrics for your organization. + example: true + type: boolean + metrics_enabled_default: + description: Enable Azure metrics for your organization for resource providers + where no resource provider config is specified. + example: true + type: boolean new_client_id: description: Your New Azure web application ID. example: new1c7f6-1234-5678-9101-3fcbf464test @@ -860,37 +867,26 @@ components: monitored by this app registration. example: true type: boolean + resource_provider_configs: + description: Configuration settings applied to resources from the specified + Azure resource providers. + items: + $ref: '#/components/schemas/ResourceProviderConfig' + type: array tenant_name: description: Your Azure Active Directory ID. example: testc44-1234-5678-9101-cc00736ftest type: string + usage_metrics_enabled: + description: Enable azure.usage metrics for your organization. + example: true + type: boolean type: object AzureAccountListResponse: description: Accounts configured for your organization. items: $ref: '#/components/schemas/AzureAccount' type: array - AzureAccountMetricsConfig: - description: 'Dictionary containing the key `excluded_resource_providers` which - has to be a list of Microsoft Azure Resource Provider names. - - This feature is currently being beta tested. - - In order to enable all resource providers for metric collection, pass: - - `metrics_config: {"excluded_resource_providers": []}` (i.e., an empty list - for `excluded_resource_providers`).' - properties: - excluded_resource_providers: - description: List of Microsoft Azure Resource Providers to exclude from - metric collection. - example: - - Microsoft.Sql - - Microsoft.Cdn - items: - type: string - type: array - type: object CancelDowntimesByScopeRequest: description: Cancel downtimes according to scope. properties: @@ -10209,6 +10205,19 @@ components: - lookup_enrichment_table - type type: object + ResourceProviderConfig: + description: Configuration settings applied to resources from the specified + Azure resource provider. + properties: + metrics_enabled: + description: Collect metrics for resources from this provider. + example: true + type: boolean + namespace: + description: The provider namespace to apply this configuration to. + example: Microsoft.Compute + type: string + type: object ResponseMetaAttributes: description: Object describing meta attributes of response. properties: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 7e95890e8d..fc86ee2cb1 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -319,13 +319,6 @@ datadog\_api\_client.v1.model.azure\_account\_list\_response module :members: :show-inheritance: -datadog\_api\_client.v1.model.azure\_account\_metrics\_config module --------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v1.model.azure_account_metrics_config - :members: - :show-inheritance: - datadog\_api\_client.v1.model.cancel\_downtimes\_by\_scope\_request module -------------------------------------------------------------------------- @@ -2839,6 +2832,13 @@ datadog\_api\_client.v1.model.reference\_table\_logs\_lookup\_processor module :members: :show-inheritance: +datadog\_api\_client.v1.model.resource\_provider\_config module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.resource_provider_config + :members: + :show-inheritance: + datadog\_api\_client.v1.model.response\_meta\_attributes module --------------------------------------------------------------- diff --git a/examples/v1/azure-integration/UpdateAzureHostFilters.py b/examples/v1/azure-integration/UpdateAzureHostFilters.py index 5c1a901ee8..ddb277349b 100644 --- a/examples/v1/azure-integration/UpdateAzureHostFilters.py +++ b/examples/v1/azure-integration/UpdateAzureHostFilters.py @@ -5,7 +5,7 @@ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.azure_integration_api import AzureIntegrationApi from datadog_api_client.v1.model.azure_account import AzureAccount -from datadog_api_client.v1.model.azure_account_metrics_config import AzureAccountMetricsConfig +from datadog_api_client.v1.model.resource_provider_config import ResourceProviderConfig body = AzureAccount( app_service_plan_filters="key:value,filter:example", @@ -19,16 +19,19 @@ "*", ], host_filters="key:value,filter:example", - metrics_config=AzureAccountMetricsConfig( - excluded_resource_providers=[ - "Microsoft.Sql", - "Microsoft.Cdn", - ], - ), + metrics_enabled=True, + metrics_enabled_default=True, new_client_id="new1c7f6-1234-5678-9101-3fcbf464test", new_tenant_name="new1c44-1234-5678-9101-cc00736ftest", resource_collection_enabled=True, + resource_provider_configs=[ + ResourceProviderConfig( + metrics_enabled=True, + namespace="Microsoft.Compute", + ), + ], tenant_name="testc44-1234-5678-9101-cc00736ftest", + usage_metrics_enabled=True, ) configuration = Configuration() diff --git a/examples/v1/azure-integration/UpdateAzureIntegration.py b/examples/v1/azure-integration/UpdateAzureIntegration.py index fe6711e6b7..548a15dac6 100644 --- a/examples/v1/azure-integration/UpdateAzureIntegration.py +++ b/examples/v1/azure-integration/UpdateAzureIntegration.py @@ -5,7 +5,6 @@ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.azure_integration_api import AzureIntegrationApi from datadog_api_client.v1.model.azure_account import AzureAccount -from datadog_api_client.v1.model.azure_account_metrics_config import AzureAccountMetricsConfig body = AzureAccount( app_service_plan_filters="key:value,filter:example", @@ -22,12 +21,6 @@ new_client_id="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", new_tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resource_collection_enabled=True, - metrics_config=AzureAccountMetricsConfig( - excluded_resource_providers=[ - "Microsoft.Sql", - "Microsoft.Cdn", - ], - ), tenant_name="9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", ) diff --git a/src/datadog_api_client/v1/model/azure_account.py b/src/datadog_api_client/v1/model/azure_account.py index 06dfa9f931..f82d098bae 100644 --- a/src/datadog_api_client/v1/model/azure_account.py +++ b/src/datadog_api_client/v1/model/azure_account.py @@ -14,13 +14,13 @@ if TYPE_CHECKING: - from datadog_api_client.v1.model.azure_account_metrics_config import AzureAccountMetricsConfig + from datadog_api_client.v1.model.resource_provider_config import ResourceProviderConfig class AzureAccount(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v1.model.azure_account_metrics_config import AzureAccountMetricsConfig + from datadog_api_client.v1.model.resource_provider_config import ResourceProviderConfig return { "app_service_plan_filters": (str,), @@ -32,11 +32,14 @@ def openapi_types(_): "custom_metrics_enabled": (bool,), "errors": ([str],), "host_filters": (str,), - "metrics_config": (AzureAccountMetricsConfig,), + "metrics_enabled": (bool,), + "metrics_enabled_default": (bool,), "new_client_id": (str,), "new_tenant_name": (str,), "resource_collection_enabled": (bool,), + "resource_provider_configs": ([ResourceProviderConfig],), "tenant_name": (str,), + "usage_metrics_enabled": (bool,), } attribute_map = { @@ -49,11 +52,14 @@ def openapi_types(_): "custom_metrics_enabled": "custom_metrics_enabled", "errors": "errors", "host_filters": "host_filters", - "metrics_config": "metrics_config", + "metrics_enabled": "metrics_enabled", + "metrics_enabled_default": "metrics_enabled_default", "new_client_id": "new_client_id", "new_tenant_name": "new_tenant_name", "resource_collection_enabled": "resource_collection_enabled", + "resource_provider_configs": "resource_provider_configs", "tenant_name": "tenant_name", + "usage_metrics_enabled": "usage_metrics_enabled", } def __init__( @@ -67,11 +73,14 @@ def __init__( custom_metrics_enabled: Union[bool, UnsetType] = unset, errors: Union[List[str], UnsetType] = unset, host_filters: Union[str, UnsetType] = unset, - metrics_config: Union[AzureAccountMetricsConfig, UnsetType] = unset, + metrics_enabled: Union[bool, UnsetType] = unset, + metrics_enabled_default: Union[bool, UnsetType] = unset, new_client_id: Union[str, UnsetType] = unset, new_tenant_name: Union[str, UnsetType] = unset, resource_collection_enabled: Union[bool, UnsetType] = unset, + resource_provider_configs: Union[List[ResourceProviderConfig], UnsetType] = unset, tenant_name: Union[str, UnsetType] = unset, + usage_metrics_enabled: Union[bool, UnsetType] = unset, **kwargs, ): """ @@ -108,11 +117,11 @@ def __init__( Only hosts that match one of the defined tags are imported into Datadog. :type host_filters: str, optional - :param metrics_config: Dictionary containing the key ``excluded_resource_providers`` which has to be a list of Microsoft Azure Resource Provider names. - This feature is currently being beta tested. - In order to enable all resource providers for metric collection, pass: - ``metrics_config: {"excluded_resource_providers": []}`` (i.e., an empty list for ``excluded_resource_providers`` ). - :type metrics_config: AzureAccountMetricsConfig, optional + :param metrics_enabled: Enable Azure metrics for your organization. + :type metrics_enabled: bool, optional + + :param metrics_enabled_default: Enable Azure metrics for your organization for resource providers where no resource provider config is specified. + :type metrics_enabled_default: bool, optional :param new_client_id: Your New Azure web application ID. :type new_client_id: str, optional @@ -123,8 +132,14 @@ def __init__( :param resource_collection_enabled: When enabled, Datadog collects metadata and configuration info from cloud resources (compute instances, databases, load balancers, etc.) monitored by this app registration. :type resource_collection_enabled: bool, optional + :param resource_provider_configs: Configuration settings applied to resources from the specified Azure resource providers. + :type resource_provider_configs: [ResourceProviderConfig], optional + :param tenant_name: Your Azure Active Directory ID. :type tenant_name: str, optional + + :param usage_metrics_enabled: Enable azure.usage metrics for your organization. + :type usage_metrics_enabled: bool, optional """ if app_service_plan_filters is not unset: kwargs["app_service_plan_filters"] = app_service_plan_filters @@ -144,14 +159,20 @@ def __init__( kwargs["errors"] = errors if host_filters is not unset: kwargs["host_filters"] = host_filters - if metrics_config is not unset: - kwargs["metrics_config"] = metrics_config + if metrics_enabled is not unset: + kwargs["metrics_enabled"] = metrics_enabled + if metrics_enabled_default is not unset: + kwargs["metrics_enabled_default"] = metrics_enabled_default if new_client_id is not unset: kwargs["new_client_id"] = new_client_id if new_tenant_name is not unset: kwargs["new_tenant_name"] = new_tenant_name if resource_collection_enabled is not unset: kwargs["resource_collection_enabled"] = resource_collection_enabled + if resource_provider_configs is not unset: + kwargs["resource_provider_configs"] = resource_provider_configs if tenant_name is not unset: kwargs["tenant_name"] = tenant_name + if usage_metrics_enabled is not unset: + kwargs["usage_metrics_enabled"] = usage_metrics_enabled super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/azure_account_metrics_config.py b/src/datadog_api_client/v1/model/azure_account_metrics_config.py deleted file mode 100644 index 4cdf76a495..0000000000 --- a/src/datadog_api_client/v1/model/azure_account_metrics_config.py +++ /dev/null @@ -1,39 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import List, Union - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -class AzureAccountMetricsConfig(ModelNormal): - @cached_property - def openapi_types(_): - return { - "excluded_resource_providers": ([str],), - } - - attribute_map = { - "excluded_resource_providers": "excluded_resource_providers", - } - - def __init__(self_, excluded_resource_providers: Union[List[str], UnsetType] = unset, **kwargs): - """ - Dictionary containing the key ``excluded_resource_providers`` which has to be a list of Microsoft Azure Resource Provider names. - This feature is currently being beta tested. - In order to enable all resource providers for metric collection, pass: - ``metrics_config: {"excluded_resource_providers": []}`` (i.e., an empty list for ``excluded_resource_providers`` ). - - :param excluded_resource_providers: List of Microsoft Azure Resource Providers to exclude from metric collection. - :type excluded_resource_providers: [str], optional - """ - if excluded_resource_providers is not unset: - kwargs["excluded_resource_providers"] = excluded_resource_providers - super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/resource_provider_config.py b/src/datadog_api_client/v1/model/resource_provider_config.py new file mode 100644 index 0000000000..079c6995c4 --- /dev/null +++ b/src/datadog_api_client/v1/model/resource_provider_config.py @@ -0,0 +1,45 @@ +# 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 ResourceProviderConfig(ModelNormal): + @cached_property + def openapi_types(_): + return { + "metrics_enabled": (bool,), + "namespace": (str,), + } + + attribute_map = { + "metrics_enabled": "metrics_enabled", + "namespace": "namespace", + } + + def __init__( + self_, metrics_enabled: Union[bool, UnsetType] = unset, namespace: Union[str, UnsetType] = unset, **kwargs + ): + """ + Configuration settings applied to resources from the specified Azure resource provider. + + :param metrics_enabled: Collect metrics for resources from this provider. + :type metrics_enabled: bool, optional + + :param namespace: The provider namespace to apply this configuration to. + :type namespace: str, optional + """ + if metrics_enabled is not unset: + kwargs["metrics_enabled"] = metrics_enabled + if namespace is not unset: + kwargs["namespace"] = namespace + super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 0e2687395e..c36e6e760b 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -43,7 +43,6 @@ from datadog_api_client.v1.model.authentication_validation_response import AuthenticationValidationResponse from datadog_api_client.v1.model.azure_account import AzureAccount from datadog_api_client.v1.model.azure_account_list_response import AzureAccountListResponse -from datadog_api_client.v1.model.azure_account_metrics_config import AzureAccountMetricsConfig from datadog_api_client.v1.model.cancel_downtimes_by_scope_request import CancelDowntimesByScopeRequest from datadog_api_client.v1.model.canceled_downtimes_ids import CanceledDowntimesIds from datadog_api_client.v1.model.change_widget_definition import ChangeWidgetDefinition @@ -463,6 +462,7 @@ from datadog_api_client.v1.model.query_value_widget_definition_type import QueryValueWidgetDefinitionType from datadog_api_client.v1.model.query_value_widget_request import QueryValueWidgetRequest from datadog_api_client.v1.model.reference_table_logs_lookup_processor import ReferenceTableLogsLookupProcessor +from datadog_api_client.v1.model.resource_provider_config import ResourceProviderConfig from datadog_api_client.v1.model.response_meta_attributes import ResponseMetaAttributes from datadog_api_client.v1.model.run_workflow_widget_definition import RunWorkflowWidgetDefinition from datadog_api_client.v1.model.run_workflow_widget_definition_type import RunWorkflowWidgetDefinitionType @@ -1100,7 +1100,6 @@ "AuthenticationValidationResponse", "AzureAccount", "AzureAccountListResponse", - "AzureAccountMetricsConfig", "CancelDowntimesByScopeRequest", "CanceledDowntimesIds", "ChangeWidgetDefinition", @@ -1460,6 +1459,7 @@ "QueryValueWidgetDefinitionType", "QueryValueWidgetRequest", "ReferenceTableLogsLookupProcessor", + "ResourceProviderConfig", "ResponseMetaAttributes", "RunWorkflowWidgetDefinition", "RunWorkflowWidgetDefinitionType", diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen index 870f562199..4cf590b2a0 100644 --- a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.frozen @@ -1 +1 @@ -2024-07-25T18:47:35.517Z \ No newline at end of file +2024-12-17T21:43:00.678Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml index c4fe832b4e..11bd3382ac 100644 --- a/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_delete_an_azure_integration_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17219332-0000-0000-0000-172193325500","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17219332-0000-0000-0000-172193325500","new_tenant_name":"17219332-0000-0000-0000-172193325500","resource_collection_enabled":true,"tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178000","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17344717-0000-0000-0000-173447178000","new_tenant_name":"17344717-0000-0000-0000-173447178000","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"tenant_name":"17344717-0000-0000-0000-173447178000","usage_metrics_enabled":true}' headers: accept: - application/json @@ -20,7 +20,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17219332-0000-0000-0000-172193325500","tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178000","tenant_name":"17344717-0000-0000-0000-173447178000"}' headers: accept: - application/json @@ -40,7 +40,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17219332-0000-0000-0000-172193325500","tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178000","tenant_name":"17344717-0000-0000-0000-173447178000"}' headers: accept: - application/json diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen index fd432cbc30..d500dc214e 100644 --- a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.frozen @@ -1 +1 @@ -2024-07-25T18:47:35.975Z \ No newline at end of file +2024-12-17T21:43:01.129Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml index f4843e8d8b..92ac1431f1 100644 --- a/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_update_an_azure_integration_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17219332-0000-0000-0000-172193325500","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17219332-0000-0000-0000-172193325500","new_tenant_name":"17219332-0000-0000-0000-172193325500","resource_collection_enabled":true,"tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178100","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_enabled":true,"metrics_enabled_default":true,"new_client_id":"17344717-0000-0000-0000-173447178100","new_tenant_name":"17344717-0000-0000-0000-173447178100","resource_collection_enabled":true,"resource_provider_configs":[{"metrics_enabled":false,"namespace":"Microsoft.Compute"},{"metrics_enabled":false,"namespace":"Microsoft.Web"}],"tenant_name":"17344717-0000-0000-0000-173447178100","usage_metrics_enabled":true}' headers: accept: - application/json @@ -20,7 +20,7 @@ interactions: code: 200 message: OK - request: - body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17219332-0000-0000-0000-172193325500","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17219332-0000-0000-0000-172193325500","new_tenant_name":"17219332-0000-0000-0000-172193325500","resource_collection_enabled":true,"tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17344717-0000-0000-0000-173447178100","client_secret":"TestingRh2nx664kUy5dIApvM54T4AtO","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17344717-0000-0000-0000-173447178100","new_tenant_name":"17344717-0000-0000-0000-173447178100","resource_collection_enabled":true,"tenant_name":"17344717-0000-0000-0000-173447178100"}' headers: accept: - application/json @@ -40,7 +40,7 @@ interactions: code: 200 message: OK - request: - body: '{"client_id":"17219332-0000-0000-0000-172193325500","tenant_name":"17219332-0000-0000-0000-172193325500"}' + body: '{"client_id":"17344717-0000-0000-0000-173447178100","tenant_name":"17344717-0000-0000-0000-173447178100"}' headers: accept: - application/json diff --git a/tests/v1/features/azure_integration.feature b/tests/v1/features/azure_integration.feature index 6a9449c67b..8d31237b5b 100644 --- a/tests/v1/features/azure_integration.feature +++ b/tests/v1/features/azure_integration.feature @@ -12,7 +12,7 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -26,7 +26,7 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -53,21 +53,21 @@ Feature: Azure Integration @generated @skip @team:DataDog/azure-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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/azure-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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/azure-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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "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": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "metrics_enabled": true, "metrics_enabled_default": true, "new_client_id": "new1c7f6-1234-5678-9101-3fcbf464test", "new_tenant_name": "new1c44-1234-5678-9101-cc00736ftest", "resource_collection_enabled": true, "resource_provider_configs": [{"metrics_enabled": true, "namespace": "Microsoft.Compute"}], "tenant_name": "testc44-1234-5678-9101-cc00736ftest", "usage_metrics_enabled": true} When the request is sent Then the response status is 400 Bad Request @@ -75,6 +75,6 @@ Feature: Azure Integration Scenario: Update an Azure integration returns "OK" response Given there is a valid "azure_account" in the system And new "UpdateAzureIntegration" request - And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "tenant_name": "{{ uuid }}"} + And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "client_secret": "TestingRh2nx664kUy5dIApvM54T4AtO", "container_app_filters": "key:value,filter:example", "cspm_enabled": true, "custom_metrics_enabled": true, "errors": ["*"], "host_filters": "key:value,filter:example", "new_client_id": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"} When the request is sent Then the response status is 200 OK diff --git a/tests/v1/features/given.json b/tests/v1/features/given.json index 1997404026..8b01df19ad 100644 --- a/tests/v1/features/given.json +++ b/tests/v1/features/given.json @@ -117,7 +117,7 @@ { "name": "body", "origin": "request", - "value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"TestingRh2nx664kUy5dIApvM54T4AtO\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"new_client_id\": \"{{ uuid }}\",\n \"new_tenant_name\": \"{{ uuid }}\",\n \"resource_collection_enabled\": true,\n \"metrics_config\": {\n \"excluded_resource_providers\": [\"Microsoft.Sql\", \"Microsoft.Cdn\"]\n },\n \"tenant_name\": \"{{ uuid }}\"\n}" + "value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"TestingRh2nx664kUy5dIApvM54T4AtO\",\n \"container_app_filters\": \"key:value,filter:example\",\n \"cspm_enabled\": true,\n \"custom_metrics_enabled\": true,\n \"errors\": [\"*\"],\n \"host_filters\": \"key:value,filter:example\",\n \"metrics_enabled\": true,\n \"metrics_enabled_default\": true,\n \"new_client_id\": \"{{ uuid }}\",\n \"new_tenant_name\": \"{{ uuid }}\",\n \"resource_collection_enabled\": true,\n \"resource_provider_configs\": [\n {\n \"namespace\": \"Microsoft.Compute\",\n \"metrics_enabled\": false\n },\n {\n \"namespace\": \"Microsoft.Web\",\n \"metrics_enabled\": false\n }\n ],\n \"tenant_name\": \"{{ uuid }}\",\n \"usage_metrics_enabled\": true\n}" } ], "step": "there is a valid \"azure_account\" in the system",