Skip to content

Commit 04fa2a1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Support metric filtering in integration azure GET, PUT APIs (#1880)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ba1f92c commit 04fa2a1

13 files changed

+160
-26
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-02 18:50:31.571748",
8-
"spec_repo_commit": "fae9d797"
7+
"regenerated": "2024-07-03 18:25:11.005515",
8+
"spec_repo_commit": "ce846cd6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-02 18:50:31.591802",
13-
"spec_repo_commit": "fae9d797"
12+
"regenerated": "2024-07-03 18:25:11.023835",
13+
"spec_repo_commit": "ce846cd6"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ components:
840840
Only hosts that match one of the defined tags are imported into Datadog.'
841841
example: key:value,filter:example
842842
type: string
843+
metrics_config:
844+
$ref: '#/components/schemas/AzureAccountMetricsConfig'
843845
new_client_id:
844846
description: Your New Azure web application ID.
845847
example: new1c7f6-1234-5678-9101-3fcbf464test
@@ -864,6 +866,27 @@ components:
864866
items:
865867
$ref: '#/components/schemas/AzureAccount'
866868
type: array
869+
AzureAccountMetricsConfig:
870+
description: 'Dictionary containing the key `excluded_resource_providers` which
871+
has to be a list of Microsoft Azure Resource Provider names.
872+
873+
This feature is currently being beta tested.
874+
875+
In order to enable all resource providers for metric collection, pass:
876+
877+
`metrics_config: {"excluded_resource_providers": []}` (i.e., an empty list
878+
for `excluded_resource_providers`).'
879+
properties:
880+
excluded_resource_providers:
881+
description: List of Microsoft Azure Resource Providers to exclude from
882+
metric collection.
883+
example:
884+
- Microsoft.Sql
885+
- Microsoft.Cdn
886+
items:
887+
type: string
888+
type: array
889+
type: object
867890
CancelDowntimesByScopeRequest:
868891
description: Cancel downtimes according to scope.
869892
properties:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-02-28T20:25:59.931Z
1+
2024-07-01T18:40:05.567Z

cassettes/features/v1/azure_integration/Delete-an-Azure-integration-returns-OK-response.yml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-02-28T20:26:00.368Z
1+
2024-07-01T18:40:05.942Z

cassettes/features/v1/azure_integration/Update-an-Azure-integration-returns-OK-response.yml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/v1/azure-integration/UpdateAzureHostFilters.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
"*",
1616
],
1717
host_filters: "key:value,filter:example",
18+
metrics_config: DatadogAPIClient::V1::AzureAccountMetricsConfig.new({
19+
excluded_resource_providers: [
20+
"Microsoft.Sql",
21+
"Microsoft.Cdn",
22+
],
23+
}),
1824
new_client_id: "new1c7f6-1234-5678-9101-3fcbf464test",
1925
new_tenant_name: "new1c44-1234-5678-9101-cc00736ftest",
2026
resource_collection_enabled: true,

examples/v1/azure-integration/UpdateAzureIntegration.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
new_client_id: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
1919
new_tenant_name: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
2020
resource_collection_enabled: true,
21+
metrics_config: DatadogAPIClient::V1::AzureAccountMetricsConfig.new({
22+
excluded_resource_providers: [
23+
"Microsoft.Sql",
24+
"Microsoft.Cdn",
25+
],
26+
}),
2127
tenant_name: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
2228
})
2329
p api_instance.update_azure_integration(body)

features/v1/azure_integration.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Feature: Azure Integration
1212
@generated @skip @team:DataDog/azure-integrations
1313
Scenario: Create an Azure integration returns "Bad Request" response
1414
Given new "CreateAzureIntegration" request
15-
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", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"}
15+
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", "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"}
1616
When the request is sent
1717
Then the response status is 400 Bad Request
1818

@@ -26,7 +26,7 @@ Feature: Azure Integration
2626
@generated @skip @team:DataDog/azure-integrations
2727
Scenario: Delete an Azure integration returns "Bad Request" response
2828
Given new "DeleteAzureIntegration" request
29-
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", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"}
29+
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", "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"}
3030
When the request is sent
3131
Then the response status is 400 Bad Request
3232

@@ -53,28 +53,28 @@ Feature: Azure Integration
5353
@generated @skip @team:DataDog/azure-integrations
5454
Scenario: Update Azure integration host filters returns "Bad Request" response
5555
Given new "UpdateAzureHostFilters" request
56-
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", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"}
56+
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", "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"}
5757
When the request is sent
5858
Then the response status is 400 Bad Request
5959

6060
@generated @skip @team:DataDog/azure-integrations
6161
Scenario: Update Azure integration host filters returns "OK" response
6262
Given new "UpdateAzureHostFilters" request
63-
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", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"}
63+
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", "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"}
6464
When the request is sent
6565
Then the response status is 200 OK
6666

6767
@generated @skip @team:DataDog/azure-integrations
6868
Scenario: Update an Azure integration returns "Bad Request" response
6969
Given new "UpdateAzureIntegration" request
70-
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", "resource_collection_enabled": true, "tenant_name": "testc44-1234-5678-9101-cc00736ftest"}
70+
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", "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"}
7171
When the request is sent
7272
Then the response status is 400 Bad Request
7373

7474
@team:DataDog/azure-integrations
7575
Scenario: Update an Azure integration returns "OK" response
7676
Given there is a valid "azure_account" in the system
7777
And new "UpdateAzureIntegration" request
78-
And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "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": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "tenant_name": "{{ uuid }}"}
78+
And body with value {"app_service_plan_filters": "key:value,filter:example", "automute": true, "client_id": "{{ uuid }}", "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": "{{ uuid }}", "new_tenant_name": "{{ uuid }}", "resource_collection_enabled": true, "metrics_config": {"excluded_resource_providers": ["Microsoft.Sql", "Microsoft.Cdn"]}, "tenant_name": "{{ uuid }}"}
7979
When the request is sent
8080
Then the response status is 200 OK

features/v1/given.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
{
118118
"name": "body",
119119
"origin": "request",
120-
"value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"testingx./Sw*g/Y33t..R1cH+hScMDt\",\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 \"tenant_name\": \"{{ uuid }}\"\n}"
120+
"value": "{\n \"app_service_plan_filters\": \"key:value,filter:example\",\n \"automute\": true,\n \"client_id\": \"{{ uuid }}\",\n \"client_secret\": \"testingx./Sw*g/Y33t..R1cH+hScMDt\",\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}"
121121
}
122122
],
123123
"step": "there is a valid \"azure_account\" in the system",

0 commit comments

Comments
 (0)