Skip to content

Commit

Permalink
Update Azure Spec to include Resource Collection (#1782)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Dec 4, 2023
1 parent 169c3fc commit 9a1a7aa
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-21 21:47:39.641703",
"spec_repo_commit": "891a7c39"
"regenerated": "2023-12-04 14:33:57.370401",
"spec_repo_commit": "37397584"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-21 21:47:40.007237",
"spec_repo_commit": "891a7c39"
"regenerated": "2023-12-04 14:33:57.397495",
"spec_repo_commit": "37397584"
}
}
}
11 changes: 9 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,9 @@ components:
example: key:value,filter:example
type: string
cspm_enabled:
description: Enable Cloud Security Management Misconfigurations for your
organization.
description: "When enabled, Datadog\u2019s Cloud Security Management product
will scan resource configurations monitored by this app registration.\nNote:
This requires resource_collection_enabled to be set to true."
example: true
type: boolean
custom_metrics_enabled:
Expand Down Expand Up @@ -840,6 +841,12 @@ components:
description: Your New Azure Active Directory ID.
example: new1c44-1234-5678-9101-cc00736ftest
type: string
resource_collection_enabled:
description: When enabled, Datadog collects metadata and configuration info
from cloud resources (compute instances, databases, load balancers, etc.)
monitored by this app registration.
example: true
type: boolean
tenant_name:
description: Your Azure Active Directory ID.
example: testc44-1234-5678-9101-cc00736ftest
Expand Down
1 change: 1 addition & 0 deletions examples/v1/azure-integration/CreateAzureIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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",
)

Expand Down
1 change: 1 addition & 0 deletions examples/v1/azure-integration/DeleteAzureIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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",
)

Expand Down
1 change: 1 addition & 0 deletions examples/v1/azure-integration/UpdateAzureHostFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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",
)

Expand Down
1 change: 1 addition & 0 deletions examples/v1/azure-integration/UpdateAzureIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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",
)

Expand Down
11 changes: 10 additions & 1 deletion src/datadog_api_client/v1/model/azure_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def openapi_types(_):
"host_filters": (str,),
"new_client_id": (str,),
"new_tenant_name": (str,),
"resource_collection_enabled": (bool,),
"tenant_name": (str,),
}

Expand All @@ -43,6 +44,7 @@ def openapi_types(_):
"host_filters": "host_filters",
"new_client_id": "new_client_id",
"new_tenant_name": "new_tenant_name",
"resource_collection_enabled": "resource_collection_enabled",
"tenant_name": "tenant_name",
}

Expand All @@ -59,6 +61,7 @@ def __init__(
host_filters: Union[str, UnsetType] = unset,
new_client_id: Union[str, UnsetType] = unset,
new_tenant_name: Union[str, UnsetType] = unset,
resource_collection_enabled: Union[bool, UnsetType] = unset,
tenant_name: Union[str, UnsetType] = unset,
**kwargs,
):
Expand All @@ -82,7 +85,8 @@ def __init__(
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.
:param cspm_enabled: When enabled, Datadog’s Cloud Security Management product will scan resource configurations monitored by this app registration.
Note: This requires resource_collection_enabled to be set to true.
:type cspm_enabled: bool, optional
:param custom_metrics_enabled: Enable custom metrics for your organization.
Expand All @@ -101,6 +105,9 @@ def __init__(
:param new_tenant_name: Your New Azure Active Directory ID.
:type new_tenant_name: str, optional
: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 tenant_name: Your Azure Active Directory ID.
:type tenant_name: str, optional
"""
Expand All @@ -126,6 +133,8 @@ def __init__(
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 tenant_name is not unset:
kwargs["tenant_name"] = tenant_name
super().__init__(kwargs)
36 changes: 18 additions & 18 deletions tests/v1/features/azure_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,70 @@ Feature: Azure Integration
And a valid "appKeyAuth" key in the system
And an instance of "AzureIntegration" API

@generated @skip @team:DataDog/cloud-integrations
@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": "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"}
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"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
@generated @skip @team:DataDog/azure-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", "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"}
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"}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-integrations
@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": "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"}
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"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
@generated @skip @team:DataDog/azure-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", "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"}
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"}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-integrations
@generated @skip @team:DataDog/azure-integrations
Scenario: List all Azure integrations returns "Bad Request" response
Given new "ListAzureIntegration" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
@generated @skip @team:DataDog/azure-integrations
Scenario: List all Azure integrations returns "OK" response
Given new "ListAzureIntegration" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-integrations
@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": "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"}
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"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
@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": "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"}
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"}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/cloud-integrations
@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": "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"}
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"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/cloud-integrations
@generated @skip @team:DataDog/azure-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", "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"}
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"}
When the request is sent
Then the response status is 200 OK

0 comments on commit 9a1a7aa

Please sign in to comment.