From ff7b2478dd6c3a71d6fa8bce158c7aa99cf01b19 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:25:45 -0500 Subject: [PATCH] Regenerate client from commit 8cb3faac of spec repo (#1968) Co-authored-by: ci.datadog-api-spec Co-authored-by: amaskara-dd <175134603+amaskara-dd@users.noreply.github.com> --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 55 +++++++++++-------- .../frozen.json | 2 +- .../recording.har | 28 +++++----- .../frozen.json | 2 +- .../recording.har | 28 +++++----- .../UpdateAzureHostFilters.ts | 12 +++- .../UpdateAzureIntegration.ts | 3 - features/v1/azure_integration.feature | 12 ++-- features/v1/given.json | 2 +- packages/datadog-api-client-v1/index.ts | 2 +- .../models/AzureAccount.ts | 39 ++++++++++--- .../models/ObjectSerializer.ts | 4 +- ...icsConfig.ts => ResourceProviderConfig.ts} | 27 +++++---- 14 files changed, 131 insertions(+), 93 deletions(-) rename packages/datadog-api-client-v1/models/{AzureAccountMetricsConfig.ts => ResourceProviderConfig.ts} (57%) diff --git a/.apigentools-info b/.apigentools-info index 85a72bbafd4f..87dd1ec62c9e 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:36.811067", - "spec_repo_commit": "e12aeab9" + "regenerated": "2024-12-18 17:18:37.759145", + "spec_repo_commit": "8cb3faac" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-18 16:21:36.828243", - "spec_repo_commit": "e12aeab9" + "regenerated": "2024-12-18 17:18:37.774123", + "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 51185eef6902..dc238c59a76a 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/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/frozen.json b/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/frozen.json index 34d6efdfa241..ab6863a97b92 100644 --- a/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/frozen.json +++ b/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/frozen.json @@ -1 +1 @@ -"2024-07-25T18:47:35.517Z" +"2024-12-17T21:43:00.678Z" diff --git a/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/recording.har b/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/recording.har index 76c625873dcb..015be6546998 100644 --- a/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/recording.har +++ b/cassettes/v1/Azure-Integration_213553394/Delete-an-Azure-integration-returns-OK-response_2152805638/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "a4786fba223ec55e474f89e7ba3e291f", + "_id": "4e2e023bb6c56332096971d544522742", "_order": 0, "cache": {}, "request": { - "bodySize": 614, + "bodySize": 756, "cookies": [], "headers": [ { @@ -26,13 +26,13 @@ "value": "application/json" } ], - "headersSize": 574, + "headersSize": 573, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"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\"}" + "text": "{\"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}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:35.525Z", - "time": 162 + "startedDateTime": "2024-12-17T21:43:00.686Z", + "time": 164 }, { - "_id": "92cc025e6a5dac9ca6af65450cdedad1", + "_id": "18bf59b15d582ef71a8b79afe390d743", "_order": 0, "cache": {}, "request": { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"client_id\":\"17219332-0000-0000-0000-172193325500\",\"tenant_name\":\"17219332-0000-0000-0000-172193325500\"}" + "text": "{\"client_id\":\"17344717-0000-0000-0000-173447178000\",\"tenant_name\":\"17344717-0000-0000-0000-173447178000\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -110,11 +110,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:35.696Z", - "time": 130 + "startedDateTime": "2024-12-17T21:43:00.855Z", + "time": 138 }, { - "_id": "92cc025e6a5dac9ca6af65450cdedad1", + "_id": "18bf59b15d582ef71a8b79afe390d743", "_order": 1, "cache": {}, "request": { @@ -138,7 +138,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"client_id\":\"17219332-0000-0000-0000-172193325500\",\"tenant_name\":\"17219332-0000-0000-0000-172193325500\"}" + "text": "{\"client_id\":\"17344717-0000-0000-0000-173447178000\",\"tenant_name\":\"17344717-0000-0000-0000-173447178000\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -163,8 +163,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:35.835Z", - "time": 123 + "startedDateTime": "2024-12-17T21:43:00.999Z", + "time": 112 } ], "pages": [], diff --git a/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/frozen.json b/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/frozen.json index 1d65bb2f65a1..5a970ccfbae4 100644 --- a/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/frozen.json +++ b/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/frozen.json @@ -1 +1 @@ -"2024-07-25T18:47:35.975Z" +"2024-12-17T21:43:01.129Z" diff --git a/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/recording.har b/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/recording.har index 835bf2ef421e..d0634d0e18e6 100644 --- a/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/recording.har +++ b/cassettes/v1/Azure-Integration_213553394/Update-an-Azure-integration-returns-OK-response_5343984/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "a4786fba223ec55e474f89e7ba3e291f", + "_id": "6ba1c834178d7fbd05a98c57c5b3a59c", "_order": 0, "cache": {}, "request": { - "bodySize": 614, + "bodySize": 756, "cookies": [], "headers": [ { @@ -32,7 +32,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"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\"}" + "text": "{\"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}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -57,15 +57,15 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:35.979Z", - "time": 132 + "startedDateTime": "2024-12-17T21:43:01.132Z", + "time": 161 }, { - "_id": "4b7878a346702d19bc5fb0a28b21768c", + "_id": "d21774b07473079b4c57d1a122d1c43a", "_order": 0, "cache": {}, "request": { - "bodySize": 614, + "bodySize": 531, "cookies": [], "headers": [ { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"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\"}" + "text": "{\"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\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -110,11 +110,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:36.121Z", - "time": 129 + "startedDateTime": "2024-12-17T21:43:01.298Z", + "time": 158 }, { - "_id": "92cc025e6a5dac9ca6af65450cdedad1", + "_id": "5f728266903295f35a6347b82c4cbe45", "_order": 0, "cache": {}, "request": { @@ -138,7 +138,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"client_id\":\"17219332-0000-0000-0000-172193325500\",\"tenant_name\":\"17219332-0000-0000-0000-172193325500\"}" + "text": "{\"client_id\":\"17344717-0000-0000-0000-173447178100\",\"tenant_name\":\"17344717-0000-0000-0000-173447178100\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/integration/azure" @@ -163,8 +163,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-25T18:47:36.259Z", - "time": 118 + "startedDateTime": "2024-12-17T21:43:01.461Z", + "time": 121 } ], "pages": [], diff --git a/examples/v1/azure-integration/UpdateAzureHostFilters.ts b/examples/v1/azure-integration/UpdateAzureHostFilters.ts index 47c25ca2c36d..a1e4ab762662 100644 --- a/examples/v1/azure-integration/UpdateAzureHostFilters.ts +++ b/examples/v1/azure-integration/UpdateAzureHostFilters.ts @@ -18,13 +18,19 @@ const params: v1.AzureIntegrationApiUpdateAzureHostFiltersRequest = { customMetricsEnabled: true, errors: ["*"], hostFilters: "key:value,filter:example", - metricsConfig: { - excludedResourceProviders: ["Microsoft.Sql", "Microsoft.Cdn"], - }, + metricsEnabled: true, + metricsEnabledDefault: true, newClientId: "new1c7f6-1234-5678-9101-3fcbf464test", newTenantName: "new1c44-1234-5678-9101-cc00736ftest", resourceCollectionEnabled: true, + resourceProviderConfigs: [ + { + metricsEnabled: true, + namespace: "Microsoft.Compute", + }, + ], tenantName: "testc44-1234-5678-9101-cc00736ftest", + usageMetricsEnabled: true, }, }; diff --git a/examples/v1/azure-integration/UpdateAzureIntegration.ts b/examples/v1/azure-integration/UpdateAzureIntegration.ts index 131929f4300e..68e8e88564a3 100644 --- a/examples/v1/azure-integration/UpdateAzureIntegration.ts +++ b/examples/v1/azure-integration/UpdateAzureIntegration.ts @@ -21,9 +21,6 @@ const params: v1.AzureIntegrationApiUpdateAzureIntegrationRequest = { newClientId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", newTenantName: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", resourceCollectionEnabled: true, - metricsConfig: { - excludedResourceProviders: ["Microsoft.Sql", "Microsoft.Cdn"], - }, tenantName: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", }, }; diff --git a/features/v1/azure_integration.feature b/features/v1/azure_integration.feature index 6a9449c67b51..8d31237b5b60 100644 --- a/features/v1/azure_integration.feature +++ b/features/v1/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/features/v1/given.json b/features/v1/given.json index 1997404026d2..8b01df19ad64 100644 --- a/features/v1/given.json +++ b/features/v1/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", diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index ccc757481984..e71c8b8cd0cb 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -374,7 +374,6 @@ export { AWSTagFilterCreateRequest } from "./models/AWSTagFilterCreateRequest"; export { AWSTagFilterDeleteRequest } from "./models/AWSTagFilterDeleteRequest"; export { AWSTagFilterListResponse } from "./models/AWSTagFilterListResponse"; export { AzureAccount } from "./models/AzureAccount"; -export { AzureAccountMetricsConfig } from "./models/AzureAccountMetricsConfig"; export { CancelDowntimesByScopeRequest } from "./models/CancelDowntimesByScopeRequest"; export { CanceledDowntimesIds } from "./models/CanceledDowntimesIds"; export { ChangeWidgetDefinition } from "./models/ChangeWidgetDefinition"; @@ -728,6 +727,7 @@ export { QueryValueWidgetDefinition } from "./models/QueryValueWidgetDefinition" export { QueryValueWidgetDefinitionType } from "./models/QueryValueWidgetDefinitionType"; export { QueryValueWidgetRequest } from "./models/QueryValueWidgetRequest"; export { ReferenceTableLogsLookupProcessor } from "./models/ReferenceTableLogsLookupProcessor"; +export { ResourceProviderConfig } from "./models/ResourceProviderConfig"; export { ResponseMetaAttributes } from "./models/ResponseMetaAttributes"; export { RunWorkflowWidgetDefinition } from "./models/RunWorkflowWidgetDefinition"; export { RunWorkflowWidgetDefinitionType } from "./models/RunWorkflowWidgetDefinitionType"; diff --git a/packages/datadog-api-client-v1/models/AzureAccount.ts b/packages/datadog-api-client-v1/models/AzureAccount.ts index 0b722c4eb204..6bf5c2dd4114 100644 --- a/packages/datadog-api-client-v1/models/AzureAccount.ts +++ b/packages/datadog-api-client-v1/models/AzureAccount.ts @@ -3,7 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { AzureAccountMetricsConfig } from "./AzureAccountMetricsConfig"; +import { ResourceProviderConfig } from "./ResourceProviderConfig"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -52,12 +52,13 @@ export class AzureAccount { */ "hostFilters"?: string; /** - * 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`). + * Enable Azure metrics for your organization. */ - "metricsConfig"?: AzureAccountMetricsConfig; + "metricsEnabled"?: boolean; + /** + * Enable Azure metrics for your organization for resource providers where no resource provider config is specified. + */ + "metricsEnabledDefault"?: boolean; /** * Your New Azure web application ID. */ @@ -70,10 +71,18 @@ export class AzureAccount { * When enabled, Datadog collects metadata and configuration info from cloud resources (compute instances, databases, load balancers, etc.) monitored by this app registration. */ "resourceCollectionEnabled"?: boolean; + /** + * Configuration settings applied to resources from the specified Azure resource providers. + */ + "resourceProviderConfigs"?: Array; /** * Your Azure Active Directory ID. */ "tenantName"?: string; + /** + * Enable azure.usage metrics for your organization. + */ + "usageMetricsEnabled"?: boolean; /** * A container for additional, undeclared properties. @@ -127,9 +136,13 @@ export class AzureAccount { baseName: "host_filters", type: "string", }, - metricsConfig: { - baseName: "metrics_config", - type: "AzureAccountMetricsConfig", + metricsEnabled: { + baseName: "metrics_enabled", + type: "boolean", + }, + metricsEnabledDefault: { + baseName: "metrics_enabled_default", + type: "boolean", }, newClientId: { baseName: "new_client_id", @@ -143,10 +156,18 @@ export class AzureAccount { baseName: "resource_collection_enabled", type: "boolean", }, + resourceProviderConfigs: { + baseName: "resource_provider_configs", + type: "Array", + }, tenantName: { baseName: "tenant_name", type: "string", }, + usageMetricsEnabled: { + baseName: "usage_metrics_enabled", + type: "boolean", + }, additionalProperties: { baseName: "additionalProperties", type: "any", diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 22cad3c9f70b..13eaf4d429ea 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -34,7 +34,6 @@ import { ApplicationKeyListResponse } from "./ApplicationKeyListResponse"; import { ApplicationKeyResponse } from "./ApplicationKeyResponse"; import { AuthenticationValidationResponse } from "./AuthenticationValidationResponse"; import { AzureAccount } from "./AzureAccount"; -import { AzureAccountMetricsConfig } from "./AzureAccountMetricsConfig"; import { CancelDowntimesByScopeRequest } from "./CancelDowntimesByScopeRequest"; import { CanceledDowntimesIds } from "./CanceledDowntimesIds"; import { ChangeWidgetDefinition } from "./ChangeWidgetDefinition"; @@ -286,6 +285,7 @@ import { ProcessQueryDefinition } from "./ProcessQueryDefinition"; import { QueryValueWidgetDefinition } from "./QueryValueWidgetDefinition"; import { QueryValueWidgetRequest } from "./QueryValueWidgetRequest"; import { ReferenceTableLogsLookupProcessor } from "./ReferenceTableLogsLookupProcessor"; +import { ResourceProviderConfig } from "./ResourceProviderConfig"; import { ResponseMetaAttributes } from "./ResponseMetaAttributes"; import { RunWorkflowWidgetDefinition } from "./RunWorkflowWidgetDefinition"; import { RunWorkflowWidgetInput } from "./RunWorkflowWidgetInput"; @@ -1670,7 +1670,6 @@ const typeMap: { [index: string]: any } = { ApplicationKeyResponse: ApplicationKeyResponse, AuthenticationValidationResponse: AuthenticationValidationResponse, AzureAccount: AzureAccount, - AzureAccountMetricsConfig: AzureAccountMetricsConfig, CancelDowntimesByScopeRequest: CancelDowntimesByScopeRequest, CanceledDowntimesIds: CanceledDowntimesIds, ChangeWidgetDefinition: ChangeWidgetDefinition, @@ -1940,6 +1939,7 @@ const typeMap: { [index: string]: any } = { QueryValueWidgetDefinition: QueryValueWidgetDefinition, QueryValueWidgetRequest: QueryValueWidgetRequest, ReferenceTableLogsLookupProcessor: ReferenceTableLogsLookupProcessor, + ResourceProviderConfig: ResourceProviderConfig, ResponseMetaAttributes: ResponseMetaAttributes, RunWorkflowWidgetDefinition: RunWorkflowWidgetDefinition, RunWorkflowWidgetInput: RunWorkflowWidgetInput, diff --git a/packages/datadog-api-client-v1/models/AzureAccountMetricsConfig.ts b/packages/datadog-api-client-v1/models/ResourceProviderConfig.ts similarity index 57% rename from packages/datadog-api-client-v1/models/AzureAccountMetricsConfig.ts rename to packages/datadog-api-client-v1/models/ResourceProviderConfig.ts index 7f68e01d6003..1d8ce4490653 100644 --- a/packages/datadog-api-client-v1/models/AzureAccountMetricsConfig.ts +++ b/packages/datadog-api-client-v1/models/ResourceProviderConfig.ts @@ -7,16 +7,17 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * 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`). + * Configuration settings applied to resources from the specified Azure resource provider. */ -export class AzureAccountMetricsConfig { +export class ResourceProviderConfig { /** - * List of Microsoft Azure Resource Providers to exclude from metric collection. + * Collect metrics for resources from this provider. */ - "excludedResourceProviders"?: Array; + "metricsEnabled"?: boolean; + /** + * The provider namespace to apply this configuration to. + */ + "namespace"?: string; /** * A container for additional, undeclared properties. @@ -34,9 +35,13 @@ export class AzureAccountMetricsConfig { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { - excludedResourceProviders: { - baseName: "excluded_resource_providers", - type: "Array", + metricsEnabled: { + baseName: "metrics_enabled", + type: "boolean", + }, + namespace: { + baseName: "namespace", + type: "string", }, additionalProperties: { baseName: "additionalProperties", @@ -48,7 +53,7 @@ export class AzureAccountMetricsConfig { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return AzureAccountMetricsConfig.attributeTypeMap; + return ResourceProviderConfig.attributeTypeMap; } public constructor() {}