diff --git a/sdk/security/azure-mgmt-security/MANIFEST.in b/sdk/security/azure-mgmt-security/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/security/azure-mgmt-security/MANIFEST.in +++ b/sdk/security/azure-mgmt-security/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/security/azure-mgmt-security/_meta.json b/sdk/security/azure-mgmt-security/_meta.json new file mode 100644 index 000000000000..a99777557e90 --- /dev/null +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "4503642bb09b0f2c6cd181cf16b1bbdcbe1619ec", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/security/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/security/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/_metadata.json new file mode 100644 index 000000000000..80f2c942cfe3 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_metadata.json @@ -0,0 +1,170 @@ +{ + "chosen_version": "", + "total_api_version_list": ["2015-06-01-preview", "2017-08-01", "2017-08-01-preview", "2018-06-01", "2019-01-01", "2019-01-01-preview", "2019-08-01", "2020-01-01", "2020-01-01-preview", "2020-07-01-preview", "2020-08-06-preview", "2021-01-01", "2021-01-15-preview", "2021-05-01-preview", "2021-06-01"], + "client": { + "name": "SecurityCenter", + "filename": "_security_center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure subscription ID.", + "docstring_type": "str", + "required": true + }, + "asc_location": { + "signature": "asc_location, # type: str", + "description": "The location where ASC stores the data of the subscription. can be retrieved from Get locations.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Azure subscription ID.", + "docstring_type": "str", + "required": true + }, + "asc_location": { + "signature": "asc_location: str,", + "description": "The location where ASC stores the data of the subscription. can be retrieved from Get locations.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id, asc_location", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "compliance_results": "ComplianceResultsOperations", + "pricings": "PricingsOperations", + "advanced_threat_protection": "AdvancedThreatProtectionOperations", + "device_security_groups": "DeviceSecurityGroupsOperations", + "iot_security_solution": "IotSecuritySolutionOperations", + "iot_security_solution_analytics": "IotSecuritySolutionAnalyticsOperations", + "iot_security_solutions_analytics_aggregated_alert": "IotSecuritySolutionsAnalyticsAggregatedAlertOperations", + "iot_security_solutions_analytics_recommendation": "IotSecuritySolutionsAnalyticsRecommendationOperations", + "locations": "LocationsOperations", + "operations": "Operations", + "tasks": "TasksOperations", + "auto_provisioning_settings": "AutoProvisioningSettingsOperations", + "compliances": "CompliancesOperations", + "information_protection_policies": "InformationProtectionPoliciesOperations", + "security_contacts": "SecurityContactsOperations", + "workspace_settings": "WorkspaceSettingsOperations", + "regulatory_compliance_standards": "RegulatoryComplianceStandardsOperations", + "regulatory_compliance_controls": "RegulatoryComplianceControlsOperations", + "regulatory_compliance_assessments": "RegulatoryComplianceAssessmentsOperations", + "sub_assessments": "SubAssessmentsOperations", + "automations": "AutomationsOperations", + "alerts_suppression_rules": "AlertsSuppressionRulesOperations", + "server_vulnerability_assessment": "ServerVulnerabilityAssessmentOperations", + "assessments_metadata": "AssessmentsMetadataOperations", + "assessments": "AssessmentsOperations", + "adaptive_application_controls": "AdaptiveApplicationControlsOperations", + "adaptive_network_hardenings": "AdaptiveNetworkHardeningsOperations", + "allowed_connections": "AllowedConnectionsOperations", + "topology": "TopologyOperations", + "jit_network_access_policies": "JitNetworkAccessPoliciesOperations", + "discovered_security_solutions": "DiscoveredSecuritySolutionsOperations", + "security_solutions_reference_data": "SecuritySolutionsReferenceDataOperations", + "external_security_solutions": "ExternalSecuritySolutionsOperations", + "secure_scores": "SecureScoresOperations", + "secure_score_controls": "SecureScoreControlsOperations", + "secure_score_control_definitions": "SecureScoreControlDefinitionsOperations", + "security_solutions": "SecuritySolutionsOperations", + "connectors": "ConnectorsOperations", + "sql_vulnerability_assessment_scans": "SqlVulnerabilityAssessmentScansOperations", + "sql_vulnerability_assessment_scan_results": "SqlVulnerabilityAssessmentScanResultsOperations", + "sql_vulnerability_assessment_baseline_rules": "SqlVulnerabilityAssessmentBaselineRulesOperations", + "iot_defender_settings": "IotDefenderSettingsOperations", + "iot_sensors": "IotSensorsOperations", + "devices_for_subscription": "DevicesForSubscriptionOperations", + "devices_for_hub": "DevicesForHubOperations", + "device": "DeviceOperations", + "on_premise_iot_sensors": "OnPremiseIotSensorsOperations", + "iot_sites": "IotSitesOperations", + "iot_alerts": "IotAlertsOperations", + "iot_alert_types": "IotAlertTypesOperations", + "iot_recommendations": "IotRecommendationsOperations", + "iot_recommendation_types": "IotRecommendationTypesOperations", + "alerts": "AlertsOperations", + "settings": "SettingsOperations", + "ingestion_settings": "IngestionSettingsOperations", + "software_inventories": "SoftwareInventoriesOperations" + } +} \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index 4195f5c364a8..16821577809d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py @@ -16,21 +16,17 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import SecurityCenterConfiguration from .operations import ComplianceResultsOperations from .operations import PricingsOperations -from .operations import SettingsOperations from .operations import AdvancedThreatProtectionOperations from .operations import DeviceSecurityGroupsOperations from .operations import IotSecuritySolutionOperations from .operations import IotSecuritySolutionAnalyticsOperations from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations -from .operations import IotAlertTypesOperations -from .operations import IotAlertsOperations -from .operations import IotRecommendationTypesOperations -from .operations import IotRecommendationsOperations from .operations import LocationsOperations from .operations import Operations from .operations import TasksOperations @@ -52,7 +48,6 @@ from .operations import AdaptiveNetworkHardeningsOperations from .operations import AllowedConnectionsOperations from .operations import TopologyOperations -from .operations import AlertsOperations from .operations import JitNetworkAccessPoliciesOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import SecuritySolutionsReferenceDataOperations @@ -72,6 +67,14 @@ from .operations import DeviceOperations from .operations import OnPremiseIotSensorsOperations from .operations import IotSitesOperations +from .operations import IotAlertsOperations +from .operations import IotAlertTypesOperations +from .operations import IotRecommendationsOperations +from .operations import IotRecommendationTypesOperations +from .operations import AlertsOperations +from .operations import SettingsOperations +from .operations import IngestionSettingsOperations +from .operations import SoftwareInventoriesOperations from . import models @@ -82,8 +85,6 @@ class SecurityCenter(object): :vartype compliance_results: azure.mgmt.security.operations.ComplianceResultsOperations :ivar pricings: PricingsOperations operations :vartype pricings: azure.mgmt.security.operations.PricingsOperations - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar advanced_threat_protection: AdvancedThreatProtectionOperations operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations :ivar device_security_groups: DeviceSecurityGroupsOperations operations @@ -96,14 +97,6 @@ class SecurityCenter(object): :vartype iot_security_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsAggregatedAlertOperations :ivar iot_security_solutions_analytics_recommendation: IotSecuritySolutionsAnalyticsRecommendationOperations operations :vartype iot_security_solutions_analytics_recommendation: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsRecommendationOperations - :ivar iot_alert_types: IotAlertTypesOperations operations - :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations - :ivar iot_alerts: IotAlertsOperations operations - :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations - :ivar iot_recommendation_types: IotRecommendationTypesOperations operations - :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations - :ivar iot_recommendations: IotRecommendationsOperations operations - :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.security.operations.LocationsOperations :ivar operations: Operations operations @@ -146,8 +139,6 @@ class SecurityCenter(object): :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar topology: TopologyOperations operations :vartype topology: azure.mgmt.security.operations.TopologyOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar jit_network_access_policies: JitNetworkAccessPoliciesOperations operations :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutionsOperations operations @@ -186,6 +177,22 @@ class SecurityCenter(object): :vartype on_premise_iot_sensors: azure.mgmt.security.operations.OnPremiseIotSensorsOperations :ivar iot_sites: IotSitesOperations operations :vartype iot_sites: azure.mgmt.security.operations.IotSitesOperations + :ivar iot_alerts: IotAlertsOperations operations + :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations + :ivar iot_alert_types: IotAlertTypesOperations operations + :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations + :ivar iot_recommendations: IotRecommendationsOperations operations + :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations + :ivar iot_recommendation_types: IotRecommendationTypesOperations operations + :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.security.operations.AlertsOperations + :ivar settings: SettingsOperations operations + :vartype settings: azure.mgmt.security.operations.SettingsOperations + :ivar ingestion_settings: IngestionSettingsOperations operations + :vartype ingestion_settings: azure.mgmt.security.operations.IngestionSettingsOperations + :ivar software_inventories: SoftwareInventoriesOperations operations + :vartype software_inventories: azure.mgmt.security.operations.SoftwareInventoriesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure subscription ID. @@ -219,8 +226,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.pricings = PricingsOperations( self._client, self._config, self._serialize, self._deserialize) - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self._config, self._serialize, self._deserialize) self.device_security_groups = DeviceSecurityGroupsOperations( @@ -233,14 +238,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( self._client, self._config, self._serialize, self._deserialize) - self.iot_alert_types = IotAlertTypesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_alerts = IotAlertsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_recommendation_types = IotRecommendationTypesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_recommendations = IotRecommendationsOperations( - self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( @@ -283,8 +280,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.topology = TopologyOperations( self._client, self._config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize) self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.discovered_security_solutions = DiscoveredSecuritySolutionsOperations( @@ -323,6 +318,41 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.iot_sites = IotSitesOperations( self._client, self._config, self._serialize, self._deserialize) + self.iot_alerts = IotAlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_alert_types = IotAlertTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_recommendations = IotRecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_recommendation_types = IotRecommendationTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ingestion_settings = IngestionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_inventories = SoftwareInventoriesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response def close(self): # type: () -> None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py index 9315ad04c5ba..6001b19ae1b9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -18,17 +19,12 @@ from ._configuration import SecurityCenterConfiguration from .operations import ComplianceResultsOperations from .operations import PricingsOperations -from .operations import SettingsOperations from .operations import AdvancedThreatProtectionOperations from .operations import DeviceSecurityGroupsOperations from .operations import IotSecuritySolutionOperations from .operations import IotSecuritySolutionAnalyticsOperations from .operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations from .operations import IotSecuritySolutionsAnalyticsRecommendationOperations -from .operations import IotAlertTypesOperations -from .operations import IotAlertsOperations -from .operations import IotRecommendationTypesOperations -from .operations import IotRecommendationsOperations from .operations import LocationsOperations from .operations import Operations from .operations import TasksOperations @@ -50,7 +46,6 @@ from .operations import AdaptiveNetworkHardeningsOperations from .operations import AllowedConnectionsOperations from .operations import TopologyOperations -from .operations import AlertsOperations from .operations import JitNetworkAccessPoliciesOperations from .operations import DiscoveredSecuritySolutionsOperations from .operations import SecuritySolutionsReferenceDataOperations @@ -70,6 +65,14 @@ from .operations import DeviceOperations from .operations import OnPremiseIotSensorsOperations from .operations import IotSitesOperations +from .operations import IotAlertsOperations +from .operations import IotAlertTypesOperations +from .operations import IotRecommendationsOperations +from .operations import IotRecommendationTypesOperations +from .operations import AlertsOperations +from .operations import SettingsOperations +from .operations import IngestionSettingsOperations +from .operations import SoftwareInventoriesOperations from .. import models @@ -80,8 +83,6 @@ class SecurityCenter(object): :vartype compliance_results: azure.mgmt.security.aio.operations.ComplianceResultsOperations :ivar pricings: PricingsOperations operations :vartype pricings: azure.mgmt.security.aio.operations.PricingsOperations - :ivar settings: SettingsOperations operations - :vartype settings: azure.mgmt.security.aio.operations.SettingsOperations :ivar advanced_threat_protection: AdvancedThreatProtectionOperations operations :vartype advanced_threat_protection: azure.mgmt.security.aio.operations.AdvancedThreatProtectionOperations :ivar device_security_groups: DeviceSecurityGroupsOperations operations @@ -94,14 +95,6 @@ class SecurityCenter(object): :vartype iot_security_solutions_analytics_aggregated_alert: azure.mgmt.security.aio.operations.IotSecuritySolutionsAnalyticsAggregatedAlertOperations :ivar iot_security_solutions_analytics_recommendation: IotSecuritySolutionsAnalyticsRecommendationOperations operations :vartype iot_security_solutions_analytics_recommendation: azure.mgmt.security.aio.operations.IotSecuritySolutionsAnalyticsRecommendationOperations - :ivar iot_alert_types: IotAlertTypesOperations operations - :vartype iot_alert_types: azure.mgmt.security.aio.operations.IotAlertTypesOperations - :ivar iot_alerts: IotAlertsOperations operations - :vartype iot_alerts: azure.mgmt.security.aio.operations.IotAlertsOperations - :ivar iot_recommendation_types: IotRecommendationTypesOperations operations - :vartype iot_recommendation_types: azure.mgmt.security.aio.operations.IotRecommendationTypesOperations - :ivar iot_recommendations: IotRecommendationsOperations operations - :vartype iot_recommendations: azure.mgmt.security.aio.operations.IotRecommendationsOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.security.aio.operations.LocationsOperations :ivar operations: Operations operations @@ -144,8 +137,6 @@ class SecurityCenter(object): :vartype allowed_connections: azure.mgmt.security.aio.operations.AllowedConnectionsOperations :ivar topology: TopologyOperations operations :vartype topology: azure.mgmt.security.aio.operations.TopologyOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.security.aio.operations.AlertsOperations :ivar jit_network_access_policies: JitNetworkAccessPoliciesOperations operations :vartype jit_network_access_policies: azure.mgmt.security.aio.operations.JitNetworkAccessPoliciesOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutionsOperations operations @@ -184,6 +175,22 @@ class SecurityCenter(object): :vartype on_premise_iot_sensors: azure.mgmt.security.aio.operations.OnPremiseIotSensorsOperations :ivar iot_sites: IotSitesOperations operations :vartype iot_sites: azure.mgmt.security.aio.operations.IotSitesOperations + :ivar iot_alerts: IotAlertsOperations operations + :vartype iot_alerts: azure.mgmt.security.aio.operations.IotAlertsOperations + :ivar iot_alert_types: IotAlertTypesOperations operations + :vartype iot_alert_types: azure.mgmt.security.aio.operations.IotAlertTypesOperations + :ivar iot_recommendations: IotRecommendationsOperations operations + :vartype iot_recommendations: azure.mgmt.security.aio.operations.IotRecommendationsOperations + :ivar iot_recommendation_types: IotRecommendationTypesOperations operations + :vartype iot_recommendation_types: azure.mgmt.security.aio.operations.IotRecommendationTypesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.security.aio.operations.AlertsOperations + :ivar settings: SettingsOperations operations + :vartype settings: azure.mgmt.security.aio.operations.SettingsOperations + :ivar ingestion_settings: IngestionSettingsOperations operations + :vartype ingestion_settings: azure.mgmt.security.aio.operations.IngestionSettingsOperations + :ivar software_inventories: SoftwareInventoriesOperations operations + :vartype software_inventories: azure.mgmt.security.aio.operations.SoftwareInventoriesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure subscription ID. @@ -216,8 +223,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.pricings = PricingsOperations( self._client, self._config, self._serialize, self._deserialize) - self.settings = SettingsOperations( - self._client, self._config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self._config, self._serialize, self._deserialize) self.device_security_groups = DeviceSecurityGroupsOperations( @@ -230,14 +235,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.iot_security_solutions_analytics_recommendation = IotSecuritySolutionsAnalyticsRecommendationOperations( self._client, self._config, self._serialize, self._deserialize) - self.iot_alert_types = IotAlertTypesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_alerts = IotAlertsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_recommendation_types = IotRecommendationTypesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.iot_recommendations = IotRecommendationsOperations( - self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( @@ -280,8 +277,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.topology = TopologyOperations( self._client, self._config, self._serialize, self._deserialize) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize) self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.discovered_security_solutions = DiscoveredSecuritySolutionsOperations( @@ -320,6 +315,40 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.iot_sites = IotSitesOperations( self._client, self._config, self._serialize, self._deserialize) + self.iot_alerts = IotAlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_alert_types = IotAlertTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_recommendations = IotRecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.iot_recommendation_types = IotRecommendationTypesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.ingestion_settings = IngestionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.software_inventories = SoftwareInventoriesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response async def close(self) -> None: await self._client.close() diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/__init__.py index 1a08490429ea..ad9f762804ba 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/__init__.py @@ -8,17 +8,12 @@ from ._compliance_results_operations import ComplianceResultsOperations from ._pricings_operations import PricingsOperations -from ._settings_operations import SettingsOperations from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations from ._device_security_groups_operations import DeviceSecurityGroupsOperations from ._iot_security_solution_operations import IotSecuritySolutionOperations from ._iot_security_solution_analytics_operations import IotSecuritySolutionAnalyticsOperations from ._iot_security_solutions_analytics_aggregated_alert_operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations from ._iot_security_solutions_analytics_recommendation_operations import IotSecuritySolutionsAnalyticsRecommendationOperations -from ._iot_alert_types_operations import IotAlertTypesOperations -from ._iot_alerts_operations import IotAlertsOperations -from ._iot_recommendation_types_operations import IotRecommendationTypesOperations -from ._iot_recommendations_operations import IotRecommendationsOperations from ._locations_operations import LocationsOperations from ._operations import Operations from ._tasks_operations import TasksOperations @@ -40,7 +35,6 @@ from ._adaptive_network_hardenings_operations import AdaptiveNetworkHardeningsOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._topology_operations import TopologyOperations -from ._alerts_operations import AlertsOperations from ._jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._security_solutions_reference_data_operations import SecuritySolutionsReferenceDataOperations @@ -60,21 +54,24 @@ from ._device_operations import DeviceOperations from ._on_premise_iot_sensors_operations import OnPremiseIotSensorsOperations from ._iot_sites_operations import IotSitesOperations +from ._iot_alerts_operations import IotAlertsOperations +from ._iot_alert_types_operations import IotAlertTypesOperations +from ._iot_recommendations_operations import IotRecommendationsOperations +from ._iot_recommendation_types_operations import IotRecommendationTypesOperations +from ._alerts_operations import AlertsOperations +from ._settings_operations import SettingsOperations +from ._ingestion_settings_operations import IngestionSettingsOperations +from ._software_inventories_operations import SoftwareInventoriesOperations __all__ = [ 'ComplianceResultsOperations', 'PricingsOperations', - 'SettingsOperations', 'AdvancedThreatProtectionOperations', 'DeviceSecurityGroupsOperations', 'IotSecuritySolutionOperations', 'IotSecuritySolutionAnalyticsOperations', 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', 'IotSecuritySolutionsAnalyticsRecommendationOperations', - 'IotAlertTypesOperations', - 'IotAlertsOperations', - 'IotRecommendationTypesOperations', - 'IotRecommendationsOperations', 'LocationsOperations', 'Operations', 'TasksOperations', @@ -96,7 +93,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -116,4 +112,12 @@ 'DeviceOperations', 'OnPremiseIotSensorsOperations', 'IotSitesOperations', + 'IotAlertsOperations', + 'IotAlertTypesOperations', + 'IotRecommendationsOperations', + 'IotRecommendationTypesOperations', + 'AlertsOperations', + 'SettingsOperations', + 'IngestionSettingsOperations', + 'SoftwareInventoriesOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_application_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_application_controls_operations.py index 52e5f1e90623..14db3cdfd414 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_application_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_application_controls_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -42,16 +42,16 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - include_path_recommendations: Optional[Union[bool, "_models.Enum37"]] = None, - summary: Optional[Union[bool, "_models.Enum38"]] = None, - **kwargs + include_path_recommendations: Optional[bool] = None, + summary: Optional[bool] = None, + **kwargs: Any ) -> "_models.AdaptiveApplicationControlGroups": """Gets a list of application control machine groups for the subscription. :param include_path_recommendations: Include the policy rules. - :type include_path_recommendations: str or ~azure.mgmt.security.models.Enum37 + :type include_path_recommendations: bool :param summary: Return output in a summarized form. - :type summary: str or ~azure.mgmt.security.models.Enum38 + :type summary: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: AdaptiveApplicationControlGroups, or the result of cls(response) :rtype: ~azure.mgmt.security.models.AdaptiveApplicationControlGroups @@ -103,7 +103,7 @@ async def list( async def get( self, group_name: str, - **kwargs + **kwargs: Any ) -> "_models.AdaptiveApplicationControlGroup": """Gets an application control VM/server group. @@ -159,7 +159,7 @@ async def put( self, group_name: str, body: "_models.AdaptiveApplicationControlGroup", - **kwargs + **kwargs: Any ) -> "_models.AdaptiveApplicationControlGroup": """Update an application control machine group. @@ -221,7 +221,7 @@ async def put( async def delete( self, group_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete an application control machine group. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_network_hardenings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_network_hardenings_operations.py index 6ad91f7eead7..3a66706140ae 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_network_hardenings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_adaptive_network_hardenings_operations.py @@ -49,7 +49,7 @@ def list_by_extended_resource( resource_namespace: str, resource_type: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AdaptiveNetworkHardeningsList"]: """Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. @@ -133,7 +133,7 @@ async def get( resource_type: str, resource_name: str, adaptive_network_hardening_resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.AdaptiveNetworkHardening": """Gets a single Adaptive Network Hardening resource. @@ -206,7 +206,7 @@ async def _enforce_initial( resource_name: str, adaptive_network_hardening_resource_name: str, body: "_models.AdaptiveNetworkHardeningEnforceRequest", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -264,7 +264,7 @@ async def begin_enforce( resource_name: str, adaptive_network_hardening_resource_name: str, body: "_models.AdaptiveNetworkHardeningEnforceRequest", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Enforces the given rules on the NSG(s) listed in the request. @@ -284,8 +284,8 @@ async def begin_enforce( :type body: ~azure.mgmt.security.models.AdaptiveNetworkHardeningEnforceRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -318,6 +318,7 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) + adaptive_network_hardening_enforce_action = "enforce" path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_advanced_threat_protection_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_advanced_threat_protection_operations.py index 23701ea63b7b..9e1c93fc00a1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_advanced_threat_protection_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_advanced_threat_protection_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.AdvancedThreatProtectionSetting": """Gets the Advanced Threat Protection settings for the specified resource. @@ -99,7 +99,7 @@ async def create( self, resource_id: str, advanced_threat_protection_setting: "_models.AdvancedThreatProtectionSetting", - **kwargs + **kwargs: Any ) -> "_models.AdvancedThreatProtectionSetting": """Creates or updates the Advanced Threat Protection settings on a specified resource. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_operations.py index 4367b7bd2c49..4374722f99e7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_operations.py @@ -5,14 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -43,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertList"]: """List all the alerts that are associated with the subscription. @@ -57,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -110,7 +112,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertList"]: """List all the alerts that are associated with the resource group. @@ -127,7 +129,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -178,9 +180,9 @@ async def get_next(next_link=None): ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} # type: ignore - def list_subscription_level_alerts_by_region( + def list_subscription_level_by_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertList"]: """List all the alerts that are associated with the subscription that are stored in a specific location. @@ -195,7 +197,7 @@ def list_subscription_level_alerts_by_region( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -205,7 +207,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_subscription_level_alerts_by_region.metadata['url'] # type: ignore + url = self.list_subscription_level_by_region.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -244,12 +246,12 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore + list_subscription_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore - def list_resource_group_level_alerts_by_region( + def list_resource_group_level_by_region( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertList"]: """List all the alerts that are associated with the resource group that are stored in a specific location. @@ -267,7 +269,7 @@ def list_resource_group_level_alerts_by_region( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -277,7 +279,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_resource_group_level_alerts_by_region.metadata['url'] # type: ignore + url = self.list_resource_group_level_by_region.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -317,12 +319,12 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore + list_resource_group_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore - async def get_subscription_level_alert( + async def get_subscription_level( self, alert_name: str, - **kwargs + **kwargs: Any ) -> "_models.Alert": """Get an alert that is associated with a subscription. @@ -338,11 +340,11 @@ async def get_subscription_level_alert( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.get_subscription_level_alert.metadata['url'] # type: ignore + url = self.get_subscription_level.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -372,13 +374,13 @@ async def get_subscription_level_alert( return cls(pipeline_response, deserialized, {}) return deserialized - get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore + get_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore - async def get_resource_group_level_alerts( + async def get_resource_group_level( self, alert_name: str, resource_group_name: str, - **kwargs + **kwargs: Any ) -> "_models.Alert": """Get an alert that is associated a resource group or a resource in a resource group. @@ -397,11 +399,11 @@ async def get_resource_group_level_alerts( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.get_resource_group_level_alerts.metadata['url'] # type: ignore + url = self.get_resource_group_level.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -432,12 +434,12 @@ async def get_resource_group_level_alerts( return cls(pipeline_response, deserialized, {}) return deserialized - get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore + get_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore - async def update_subscription_level_alert_state_to_dismiss( + async def update_subscription_level_state_to_dismiss( self, alert_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -453,11 +455,11 @@ async def update_subscription_level_alert_state_to_dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_subscription_level_alert_state_to_dismiss.metadata['url'] # type: ignore + url = self.update_subscription_level_state_to_dismiss.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -484,12 +486,12 @@ async def update_subscription_level_alert_state_to_dismiss( if cls: return cls(pipeline_response, None, {}) - update_subscription_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore + update_subscription_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore async def update_subscription_level_state_to_resolve( self, alert_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -505,7 +507,7 @@ async def update_subscription_level_state_to_resolve( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -538,10 +540,10 @@ async def update_subscription_level_state_to_resolve( update_subscription_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} # type: ignore - async def update_subscription_level_alert_state_to_reactivate( + async def update_subscription_level_state_to_activate( self, alert_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -557,11 +559,11 @@ async def update_subscription_level_alert_state_to_reactivate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_subscription_level_alert_state_to_reactivate.metadata['url'] # type: ignore + url = self.update_subscription_level_state_to_activate.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -588,13 +590,13 @@ async def update_subscription_level_alert_state_to_reactivate( if cls: return cls(pipeline_response, None, {}) - update_subscription_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + update_subscription_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore async def update_resource_group_level_state_to_resolve( self, alert_name: str, resource_group_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -613,7 +615,7 @@ async def update_resource_group_level_state_to_resolve( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -647,11 +649,11 @@ async def update_resource_group_level_state_to_resolve( update_resource_group_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} # type: ignore - async def update_resource_group_level_alert_state_to_dismiss( + async def update_resource_group_level_state_to_dismiss( self, alert_name: str, resource_group_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -670,11 +672,11 @@ async def update_resource_group_level_alert_state_to_dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_resource_group_level_alert_state_to_dismiss.metadata['url'] # type: ignore + url = self.update_resource_group_level_state_to_dismiss.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -702,13 +704,13 @@ async def update_resource_group_level_alert_state_to_dismiss( if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore - async def update_resource_group_level_alert_state_to_reactivate( + async def update_resource_group_level_state_to_activate( self, alert_name: str, resource_group_name: str, - **kwargs + **kwargs: Any ) -> None: """Update the alert's state. @@ -727,11 +729,11 @@ async def update_resource_group_level_alert_state_to_reactivate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_resource_group_level_alert_state_to_reactivate.metadata['url'] # type: ignore + url = self.update_resource_group_level_state_to_activate.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -759,4 +761,110 @@ async def update_resource_group_level_alert_state_to_reactivate( if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + update_resource_group_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + + async def _simulate_initial( + self, + alert_simulator_request_body: "_models.AlertSimulatorRequestBody", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._simulate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(alert_simulator_request_body, 'AlertSimulatorRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _simulate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} # type: ignore + + async def begin_simulate( + self, + alert_simulator_request_body: "_models.AlertSimulatorRequestBody", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Simulate security alerts. + + :param alert_simulator_request_body: Alert Simulator Request Properties. + :type alert_simulator_request_body: ~azure.mgmt.security.models.AlertSimulatorRequestBody + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._simulate_initial( + alert_simulator_request_body=alert_simulator_request_body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_simulate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_suppression_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_suppression_rules_operations.py index 868d647f6084..24ad78f67198 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_suppression_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_alerts_suppression_rules_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, alert_type: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertsSuppressionRulesList"]: """List of all the dismiss rules for the given subscription. @@ -115,7 +115,7 @@ async def get_next(next_link=None): async def get( self, alerts_suppression_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.AlertsSuppressionRule": """Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. @@ -170,7 +170,7 @@ async def update( self, alerts_suppression_rule_name: str, alerts_suppression_rule: "_models.AlertsSuppressionRule", - **kwargs + **kwargs: Any ) -> "_models.AlertsSuppressionRule": """Update existing rule or create new rule if it doesn't exist. @@ -231,7 +231,7 @@ async def update( async def delete( self, alerts_suppression_rule_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete dismiss alert rule for this subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_allowed_connections_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_allowed_connections_operations.py index 191f105c8619..86f634a6af27 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_allowed_connections_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_allowed_connections_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AllowedConnectionsList"]: """Gets the list of all possible traffic between resources for the subscription. @@ -109,7 +109,7 @@ async def get_next(next_link=None): def list_by_home_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AllowedConnectionsList"]: """Gets the list of all possible traffic between resources for the subscription and location. @@ -178,7 +178,7 @@ async def get( self, resource_group_name: str, connection_type: Union[str, "_models.ConnectionType"], - **kwargs + **kwargs: Any ) -> "_models.AllowedConnectionsResource": """Gets the list of all possible traffic between resources for the subscription and location, based on connection type. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_metadata_operations.py index feef47840ea2..77a6b3b139b0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_metadata_operations.py @@ -43,21 +43,21 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs - ) -> AsyncIterable["_models.SecurityAssessmentMetadataList"]: + **kwargs: Any + ) -> AsyncIterable["_models.SecurityAssessmentMetadataResponseList"]: """Get metadata information on all assessment types. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList] + :return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -80,7 +80,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,23 +106,23 @@ async def get_next(next_link=None): async def get( self, assessment_metadata_name: str, - **kwargs - ) -> "_models.SecurityAssessmentMetadata": + **kwargs: Any + ) -> "_models.SecurityAssessmentMetadataResponse": """Get metadata information on an assessment type. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. :type assessment_metadata_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -148,7 +148,7 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -158,21 +158,21 @@ async def get( def list_by_subscription( self, - **kwargs - ) -> AsyncIterable["_models.SecurityAssessmentMetadataList"]: + **kwargs: Any + ) -> AsyncIterable["_models.SecurityAssessmentMetadataResponseList"]: """Get metadata information on all assessment types in a specific subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList] + :return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -199,7 +199,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -225,23 +225,23 @@ async def get_next(next_link=None): async def get_in_subscription( self, assessment_metadata_name: str, - **kwargs - ) -> "_models.SecurityAssessmentMetadata": + **kwargs: Any + ) -> "_models.SecurityAssessmentMetadataResponse": """Get metadata information on an assessment type in a specific subscription. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. :type assessment_metadata_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -268,7 +268,7 @@ async def get_in_subscription( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -280,8 +280,8 @@ async def create_in_subscription( self, assessment_metadata_name: str, assessment_metadata: "_models.SecurityAssessmentMetadata", - **kwargs - ) -> "_models.SecurityAssessmentMetadata": + **kwargs: Any + ) -> "_models.SecurityAssessmentMetadataResponse": """Create metadata information on an assessment type in a specific subscription. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. @@ -289,16 +289,16 @@ async def create_in_subscription( :param assessment_metadata: AssessmentMetadata object. :type assessment_metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadata :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -330,7 +330,7 @@ async def create_in_subscription( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -341,7 +341,7 @@ async def create_in_subscription( async def delete_in_subscription( self, assessment_metadata_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription. @@ -358,7 +358,7 @@ async def delete_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_operations.py index fd307bd94f27..460dce53bce5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_assessments_operations.py @@ -44,12 +44,12 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecurityAssessmentList"]: """Get security assessments on all your scanned resources inside a scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -117,8 +117,8 @@ async def get( resource_id: str, assessment_name: str, expand: Optional[Union[str, "_models.ExpandEnum"]] = None, - **kwargs - ) -> "_models.SecurityAssessment": + **kwargs: Any + ) -> "_models.SecurityAssessmentResponse": """Get a security assessment on your scanned resource. :param resource_id: The identifier of the resource. @@ -128,16 +128,16 @@ async def get( :param expand: OData expand. Optional. :type expand: str or ~azure.mgmt.security.models.ExpandEnum :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessment, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessment + :return: SecurityAssessmentResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -166,7 +166,7 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -179,8 +179,8 @@ async def create_or_update( resource_id: str, assessment_name: str, assessment: "_models.SecurityAssessment", - **kwargs - ) -> "_models.SecurityAssessment": + **kwargs: Any + ) -> "_models.SecurityAssessmentResponse": """Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. @@ -191,16 +191,16 @@ async def create_or_update( :param assessment: Calculated assessment on a pre-defined assessment metadata. :type assessment: ~azure.mgmt.security.models.SecurityAssessment :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessment, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessment + :return: SecurityAssessmentResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -233,10 +233,10 @@ async def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -248,7 +248,7 @@ async def delete( self, resource_id: str, assessment_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. @@ -267,7 +267,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_auto_provisioning_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_auto_provisioning_settings_operations.py index 9b83c928c128..ab252d8978e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_auto_provisioning_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_auto_provisioning_settings_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AutoProvisioningSettingList"]: """Exposes the auto provisioning settings of the subscriptions. @@ -110,7 +110,7 @@ async def get_next(next_link=None): async def get( self, setting_name: str, - **kwargs + **kwargs: Any ) -> "_models.AutoProvisioningSetting": """Details of a specific setting. @@ -165,7 +165,7 @@ async def create( self, setting_name: str, setting: "_models.AutoProvisioningSetting", - **kwargs + **kwargs: Any ) -> "_models.AutoProvisioningSetting": """Details of a specific setting. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_automations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_automations_operations.py index e5bd953a9539..b2f197c45478 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_automations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_automations_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AutomationList"]: """Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. @@ -111,7 +111,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AutomationList"]: """Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. @@ -184,7 +184,7 @@ async def get( self, resource_group_name: str, automation_name: str, - **kwargs + **kwargs: Any ) -> "_models.Automation": """Retrieves information about the model of a security automation. @@ -244,7 +244,7 @@ async def create_or_update( resource_group_name: str, automation_name: str, automation: "_models.Automation", - **kwargs + **kwargs: Any ) -> "_models.Automation": """Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. @@ -315,7 +315,7 @@ async def delete( self, resource_group_name: str, automation_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a security automation. @@ -372,7 +372,7 @@ async def validate( resource_group_name: str, automation_name: str, automation: "_models.Automation", - **kwargs + **kwargs: Any ) -> "_models.AutomationValidationStatus": """Validates the security automation model before create or update. Any validation errors are returned to the client. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliance_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliance_results_operations.py index 79bca04487e6..791a6cba3736 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliance_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliance_results_operations.py @@ -44,12 +44,12 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ComplianceResultList"]: """Security compliance results in the subscription. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -116,7 +116,7 @@ async def get( self, resource_id: str, compliance_result_name: str, - **kwargs + **kwargs: Any ) -> "_models.ComplianceResult": """Security Compliance Result. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliances_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliances_operations.py index a3df1a6b69d4..6e8444354d24 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliances_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_compliances_operations.py @@ -44,12 +44,12 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ComplianceList"]: """The Compliance scores of the specific management group. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -116,12 +116,12 @@ async def get( self, scope: str, compliance_name: str, - **kwargs + **kwargs: Any ) -> "_models.Compliance": """Details of a specific Compliance. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param compliance_name: name of the Compliance. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_connectors_operations.py index 77ec91141acd..5df7e742ad66 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_connectors_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ConnectorSettingList"]: """Cloud accounts connectors of a subscription. @@ -110,7 +110,7 @@ async def get_next(next_link=None): async def get( self, connector_name: str, - **kwargs + **kwargs: Any ) -> "_models.ConnectorSetting": """Details of a specific cloud account connector. @@ -165,7 +165,7 @@ async def create_or_update( self, connector_name: str, connector_setting: "_models.ConnectorSetting", - **kwargs + **kwargs: Any ) -> "_models.ConnectorSetting": """Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account @@ -228,7 +228,7 @@ async def create_or_update( async def delete( self, connector_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a cloud account connector from a subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_operations.py index 030c6d5daf7b..e42b384cd7dc 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_id: str, device_id: str, - **kwargs + **kwargs: Any ) -> "_models.Device": """Get device. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_security_groups_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_security_groups_operations.py index f0b73258de94..25828e3acbb7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_security_groups_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_device_security_groups_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, resource_id: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeviceSecurityGroupList"]: """Use this method get the list of device security groups for the specified IoT Hub resource. @@ -114,7 +114,7 @@ async def get( self, resource_id: str, device_security_group_name: str, - **kwargs + **kwargs: Any ) -> "_models.DeviceSecurityGroup": """Use this method to get the device security group for the specified IoT Hub resource. @@ -173,7 +173,7 @@ async def create_or_update( resource_id: str, device_security_group_name: str, device_security_group: "_models.DeviceSecurityGroup", - **kwargs + **kwargs: Any ) -> "_models.DeviceSecurityGroup": """Use this method to creates or updates the device security group on a specified IoT Hub resource. @@ -243,7 +243,7 @@ async def delete( self, resource_id: str, device_security_group_name: str, - **kwargs + **kwargs: Any ) -> None: """User this method to deletes the device security group. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_hub_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_hub_operations.py index 45ebb8b0cfe0..37592e6ade77 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_hub_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_hub_operations.py @@ -47,7 +47,7 @@ def list( limit: Optional[int] = None, skip_token: Optional[str] = None, device_management_type: Optional[Union[str, "_models.ManagementState"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeviceList"]: """Get list of the devices for the specified IoT Hub resource. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_subscription_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_subscription_operations.py index a232897352c4..63ab7d0f7219 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_subscription_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_devices_for_subscription_operations.py @@ -46,7 +46,7 @@ def list( limit: Optional[int] = None, skip_token: Optional[str] = None, device_management_type: Optional[Union[str, "_models.ManagementState"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeviceList"]: """Get list of the devices by their subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_discovered_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_discovered_security_solutions_operations.py index 010cff2b3c1e..7fac89302664 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_discovered_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_discovered_security_solutions_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DiscoveredSecuritySolutionList"]: """Gets a list of discovered Security Solutions for the subscription. @@ -109,7 +109,7 @@ async def get_next(next_link=None): def list_by_home_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DiscoveredSecuritySolutionList"]: """Gets a list of discovered Security Solutions for the subscription and location. @@ -178,7 +178,7 @@ async def get( self, resource_group_name: str, discovered_security_solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.DiscoveredSecuritySolution": """Gets a specific discovered Security Solution. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_external_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_external_security_solutions_operations.py index 0a0ffa57eb8a..5734e6ff6fce 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_external_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_external_security_solutions_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ExternalSecuritySolutionList"]: """Gets a list of external security solutions for the subscription. @@ -109,7 +109,7 @@ async def get_next(next_link=None): def list_by_home_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ExternalSecuritySolutionList"]: """Gets a list of external Security Solutions for the subscription and location. @@ -178,7 +178,7 @@ async def get( self, resource_group_name: str, external_security_solutions_name: str, - **kwargs + **kwargs: Any ) -> "_models.ExternalSecuritySolution": """Gets a specific external Security Solution. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_information_protection_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_information_protection_policies_operations.py index a9e6441c5bb8..821084dba221 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_information_protection_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_information_protection_policies_operations.py @@ -44,17 +44,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, scope: str, - information_protection_policy_name: Union[str, "_models.Enum17"], - **kwargs + information_protection_policy_name: Union[str, "_models.Enum15"], + **kwargs: Any ) -> "_models.InformationProtectionPolicy": """Details of the information protection policy. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param information_protection_policy_name: Name of the information protection policy. - :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum17 + :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum15 :keyword callable cls: A custom type or function that will be passed the direct response :return: InformationProtectionPolicy, or the result of cls(response) :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy @@ -103,18 +103,18 @@ async def get( async def create_or_update( self, scope: str, - information_protection_policy_name: Union[str, "_models.Enum17"], + information_protection_policy_name: Union[str, "_models.Enum15"], information_protection_policy: "_models.InformationProtectionPolicy", - **kwargs + **kwargs: Any ) -> "_models.InformationProtectionPolicy": """Details of the information protection policy. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param information_protection_policy_name: Name of the information protection policy. - :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum17 + :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum15 :param information_protection_policy: Information protection policy. :type information_protection_policy: ~azure.mgmt.security.models.InformationProtectionPolicy :keyword callable cls: A custom type or function that will be passed the direct response @@ -174,12 +174,12 @@ async def create_or_update( def list( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.InformationProtectionPolicyList"]: """Information protection policies of a specific management group. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_ingestion_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_ingestion_settings_operations.py new file mode 100644 index 000000000000..d601b6ff1714 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_ingestion_settings_operations.py @@ -0,0 +1,387 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IngestionSettingsOperations: + """IngestionSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.security.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.IngestionSettingList"]: + """Settings for ingesting security data and logs to correlate with resources associated with the + subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IngestionSettingList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.IngestionSettingList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSettingList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IngestionSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings'} # type: ignore + + async def get( + self, + ingestion_setting_name: str, + **kwargs: Any + ) -> "_models.IngestionSetting": + """Settings for ingesting security data and logs to correlate with resources associated with the + subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSetting, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + async def create( + self, + ingestion_setting_name: str, + ingestion_setting: "_models.IngestionSetting", + **kwargs: Any + ) -> "_models.IngestionSetting": + """Create setting for ingesting security data and logs to correlate with resources associated with + the subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :param ingestion_setting: Ingestion setting object. + :type ingestion_setting: ~azure.mgmt.security.models.IngestionSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSetting, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ingestion_setting, 'IngestionSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + async def delete( + self, + ingestion_setting_name: str, + **kwargs: Any + ) -> None: + """Deletes the ingestion settings for this subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + async def list_tokens( + self, + ingestion_setting_name: str, + **kwargs: Any + ) -> "_models.IngestionSettingToken": + """Returns the token that is used for correlating ingested telemetry with the resources in the + subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSettingToken, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSettingToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSettingToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.list_tokens.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSettingToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_tokens.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens'} # type: ignore + + async def list_connection_strings( + self, + ingestion_setting_name: str, + **kwargs: Any + ) -> "_models.ConnectionStrings": + """Connection strings for ingesting security scan logs and data. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStrings, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.ConnectionStrings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStrings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStrings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alert_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alert_types_operations.py index 2cf34373997d..8a7e59fa58e9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alert_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alert_types_operations.py @@ -42,17 +42,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - resource_group_name: str, - solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotAlertTypeList": """List IoT alert types. - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IotAlertTypeList, or the result of cls(response) :rtype: ~azure.mgmt.security.models.IotAlertTypeList @@ -63,15 +56,13 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" + api_version = "2020-08-06-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -97,125 +88,12 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes'} # type: ignore + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} # type: ignore async def get( - self, - resource_group_name: str, - solution_name: str, - iot_alert_type_name: str, - **kwargs - ) -> "_models.IotAlertType": - """Get IoT alert type. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_alert_type_name: Name of the alert type. - :type iot_alert_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlertType, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlertType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlertType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}'} # type: ignore - - async def list_at_subscription_scope( - self, - **kwargs - ) -> "_models.IotAlertTypeList": - """List IoT alert types. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlertTypeList, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlertTypeList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertTypeList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-06-preview" - accept = "application/json" - - # Construct URL - url = self.list_at_subscription_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlertTypeList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} # type: ignore - - async def get_at_subscription_scope( self, iot_alert_type_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotAlertType": """Get IoT alert type. @@ -235,7 +113,7 @@ async def get_at_subscription_scope( accept = "application/json" # Construct URL - url = self.get_at_subscription_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str'), @@ -264,4 +142,4 @@ async def get_at_subscription_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alerts_operations.py index d54dc8f93dcc..baec0c226883 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_alerts_operations.py @@ -42,174 +42,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config def list( - self, - resource_group_name: str, - solution_name: str, - min_start_time_utc: Optional[str] = None, - max_start_time_utc: Optional[str] = None, - alert_type: Optional[str] = None, - compromised_entity: Optional[str] = None, - limit: Optional[int] = None, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.IotAlertList"]: - """List IoT alerts. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param min_start_time_utc: Filter by minimum startTimeUtc (ISO 8601 format). - :type min_start_time_utc: str - :param max_start_time_utc: Filter by maximum startTimeUtc (ISO 8601 format). - :type max_start_time_utc: str - :param alert_type: Filter by alert type. - :type alert_type: str - :param compromised_entity: Filter by compromised device. - :type compromised_entity: str - :param limit: Limit the number of items returned in a single page. - :type limit: int - :param skip_token: Skip token used for pagination. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IotAlertList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.IotAlertList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if min_start_time_utc is not None: - query_parameters['startTimeUtc>'] = self._serialize.query("min_start_time_utc", min_start_time_utc, 'str') - if max_start_time_utc is not None: - query_parameters['startTimeUtc<'] = self._serialize.query("max_start_time_utc", max_start_time_utc, 'str') - if alert_type is not None: - query_parameters['alertType'] = self._serialize.query("alert_type", alert_type, 'str') - if compromised_entity is not None: - query_parameters['compromisedEntity'] = self._serialize.query("compromised_entity", compromised_entity, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('IotAlertList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts'} # type: ignore - - async def get( - self, - resource_group_name: str, - solution_name: str, - iot_alert_id: str, - **kwargs - ) -> "_models.IotAlert": - """Get IoT alert. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_alert_id: Id of the alert. - :type iot_alert_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlert, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlert - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlert"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlert', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}'} # type: ignore - - def list_at_scope( self, scope: str, min_start_time_utc: Optional[str] = None, @@ -219,7 +51,7 @@ def list_at_scope( compromised_entity: Optional[str] = None, limit: Optional[int] = None, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotAlertListModel"]: """List IoT alerts. @@ -261,7 +93,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_at_scope.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -313,13 +145,13 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} # type: ignore + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} # type: ignore - async def get_at_scope( + async def get( self, scope: str, iot_alert_id: str, - **kwargs + **kwargs: Any ) -> "_models.IotAlertModel": """Get IoT alert. @@ -343,7 +175,7 @@ async def get_at_scope( accept = "application/json" # Construct URL - url = self.get_at_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str'), @@ -372,4 +204,4 @@ async def get_at_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_defender_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_defender_settings_operations.py index 384e52bff380..3c766862c9a3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_defender_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_defender_settings_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.IotDefenderSettingsList": """List IoT Defender Settings. @@ -92,7 +92,7 @@ async def list( async def get( self, - **kwargs + **kwargs: Any ) -> "_models.IotDefenderSettingsModel": """Get IoT Defender Settings. @@ -143,7 +143,7 @@ async def get( async def create_or_update( self, iot_defender_settings_model: "_models.IotDefenderSettingsModel", - **kwargs + **kwargs: Any ) -> "_models.IotDefenderSettingsModel": """Create or update IoT Defender settings. @@ -204,7 +204,7 @@ async def create_or_update( async def delete( self, - **kwargs + **kwargs: Any ) -> None: """Delete IoT Defender settings. @@ -251,7 +251,7 @@ async def delete( async def package_downloads( self, - **kwargs + **kwargs: Any ) -> "_models.PackageDownloads": """Information about downloadable packages. @@ -301,7 +301,7 @@ async def package_downloads( async def download_manager_activation( self, - **kwargs + **kwargs: Any ) -> IO: """Download manager activation data defined for this subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendation_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendation_types_operations.py index 03eeda50a744..91c3b7f552a4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendation_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendation_types_operations.py @@ -42,17 +42,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - resource_group_name: str, - solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotRecommendationTypeList": """List IoT recommendation types. - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IotRecommendationTypeList, or the result of cls(response) :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList @@ -63,15 +56,13 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" + api_version = "2020-08-06-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -97,125 +88,12 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes'} # type: ignore + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} # type: ignore async def get( - self, - resource_group_name: str, - solution_name: str, - iot_recommendation_type_name: str, - **kwargs - ) -> "_models.IotRecommendationType": - """Get IoT recommendation type. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_recommendation_type_name: Name of the recommendation type. - :type iot_recommendation_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendationType, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendationType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendationType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore - - async def list_at_subscription_scope( - self, - **kwargs - ) -> "_models.IotRecommendationTypeList": - """List IoT recommendation types. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendationTypeList, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationTypeList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-06-preview" - accept = "application/json" - - # Construct URL - url = self.list_at_subscription_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendationTypeList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} # type: ignore - - async def get_at_subscription_scope( self, iot_recommendation_type_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotRecommendationType": """Get IoT recommendation type. @@ -235,7 +113,7 @@ async def get_at_subscription_scope( accept = "application/json" # Construct URL - url = self.get_at_subscription_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str'), @@ -264,4 +142,4 @@ async def get_at_subscription_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendations_operations.py index 21150eab40d6..91b7bda86ea5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_recommendations_operations.py @@ -42,171 +42,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config def list( - self, - resource_group_name: str, - solution_name: str, - recommendation_type: Optional[str] = None, - device_id: Optional[str] = None, - limit: Optional[int] = None, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.IotRecommendationList"]: - """List IoT recommendations. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param recommendation_type: Filter by recommendation type. - :type recommendation_type: str - :param device_id: Filter by device id. - :type device_id: str - :param limit: Limit the number of items returned in a single page. - :type limit: int - :param skip_token: Skip token used for pagination. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IotRecommendationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.IotRecommendationList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if recommendation_type is not None: - query_parameters['recommendationType'] = self._serialize.query("recommendation_type", recommendation_type, 'str') - if device_id is not None: - query_parameters['deviceId'] = self._serialize.query("device_id", device_id, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('IotRecommendationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations'} # type: ignore - - async def get( - self, - resource_group_name: str, - solution_name: str, - iot_recommendation_id: str, - **kwargs - ) -> "_models.IotRecommendation": - """Get IoT recommendation. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_recommendation_id: Id of the recommendation. - :type iot_recommendation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendation, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendation - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations/{iotRecommendationId}'} # type: ignore - - def list_at_scope( self, scope: str, recommendation_type: Optional[str] = None, device_id: Optional[str] = None, limit: Optional[int] = None, skip_token: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IotRecommendationListModel"]: """List IoT recommendations. @@ -242,7 +84,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_at_scope.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -288,13 +130,13 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} # type: ignore + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} # type: ignore - async def get_at_scope( + async def get( self, scope: str, iot_recommendation_id: str, - **kwargs + **kwargs: Any ) -> "_models.IotRecommendationModel": """Get IoT recommendation. @@ -318,7 +160,7 @@ async def get_at_scope( accept = "application/json" # Construct URL - url = self.get_at_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str'), @@ -347,4 +189,4 @@ async def get_at_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_analytics_operations.py index c1360b74a96e..ec6b2c993fde 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_analytics_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.IoTSecuritySolutionAnalyticsModelList": """Use this method to get IoT security Analytics metrics in an array. @@ -103,7 +103,7 @@ async def get( self, resource_group_name: str, solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.IoTSecuritySolutionAnalyticsModel": """Use this method to get IoT Security Analytics metrics. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_operations.py index 7f680bd35fe4..0caa63196f55 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solution_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IoTSecuritySolutionsList"]: """Use this method to get the list of IoT Security solutions by subscription. @@ -117,7 +117,7 @@ def list_by_resource_group( self, resource_group_name: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IoTSecuritySolutionsList"]: """Use this method to get the list IoT Security solutions organized by resource group. @@ -194,7 +194,7 @@ async def get( self, resource_group_name: str, solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.IoTSecuritySolutionModel": """User this method to get details of a specific IoT Security solution based on solution name. @@ -254,7 +254,7 @@ async def create_or_update( resource_group_name: str, solution_name: str, iot_security_solution_data: "_models.IoTSecuritySolutionModel", - **kwargs + **kwargs: Any ) -> "_models.IoTSecuritySolutionModel": """Use this method to create or update yours IoT Security solution. @@ -325,7 +325,7 @@ async def update( resource_group_name: str, solution_name: str, update_iot_security_solution_data: "_models.UpdateIotSecuritySolutionData", - **kwargs + **kwargs: Any ) -> "_models.IoTSecuritySolutionModel": """Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method. @@ -392,7 +392,7 @@ async def delete( self, resource_group_name: str, solution_name: str, - **kwargs + **kwargs: Any ) -> None: """Use this method to delete yours IoT Security solution. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py index 264d6155dbfa..80c3c47f7db1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py @@ -46,7 +46,7 @@ def list( resource_group_name: str, solution_name: str, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IoTSecurityAggregatedAlertList"]: """Use this method to get the aggregated alert list of yours IoT Security solution. @@ -126,7 +126,7 @@ async def get( resource_group_name: str, solution_name: str, aggregated_alert_name: str, - **kwargs + **kwargs: Any ) -> "_models.IoTSecurityAggregatedAlert": """Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. @@ -190,7 +190,7 @@ async def dismiss( resource_group_name: str, solution_name: str, aggregated_alert_name: str, - **kwargs + **kwargs: Any ) -> None: """Use this method to dismiss an aggregated IoT Security Solution Alert. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py index 98d5267916b4..771b12ab1ca2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, solution_name: str, aggregated_recommendation_name: str, - **kwargs + **kwargs: Any ) -> "_models.IoTSecurityAggregatedRecommendation": """Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. @@ -110,7 +110,7 @@ def list( resource_group_name: str, solution_name: str, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.IoTSecurityAggregatedRecommendationList"]: """Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sensors_operations.py index 96112139722f..60c9a060a658 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sensors_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, scope: str, - **kwargs + **kwargs: Any ) -> "_models.IotSensorsList": """List IoT sensors. @@ -97,7 +97,7 @@ async def get( self, scope: str, iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> "_models.IotSensorsModel": """Get IoT sensor. @@ -155,7 +155,7 @@ async def create_or_update( scope: str, iot_sensor_name: str, iot_sensors_model: "_models.IotSensorsModel", - **kwargs + **kwargs: Any ) -> "_models.IotSensorsModel": """Create or update IoT sensor. @@ -223,7 +223,7 @@ async def delete( self, scope: str, iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete IoT sensor. @@ -277,7 +277,7 @@ async def download_activation( self, scope: str, iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> IO: """Download sensor activation file. @@ -335,7 +335,7 @@ async def download_reset_password( scope: str, iot_sensor_name: str, body: "_models.ResetPasswordInput", - **kwargs + **kwargs: Any ) -> IO: """Download file for reset password of the sensor. @@ -399,7 +399,7 @@ async def trigger_ti_package_update( self, scope: str, iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> None: """Trigger threat intelligence package update. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sites_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sites_operations.py index 42fb12eb2680..9baf9c444e6d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sites_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_iot_sites_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, scope: str, - **kwargs + **kwargs: Any ) -> "_models.IotSitesList": """List IoT sites. @@ -96,7 +96,7 @@ async def list( async def get( self, scope: str, - **kwargs + **kwargs: Any ) -> "_models.IotSitesModel": """Get IoT site. @@ -150,7 +150,7 @@ async def create_or_update( self, scope: str, iot_sites_model: "_models.IotSitesModel", - **kwargs + **kwargs: Any ) -> "_models.IotSitesModel": """Create or update IoT site. @@ -214,7 +214,7 @@ async def create_or_update( async def delete( self, scope: str, - **kwargs + **kwargs: Any ) -> None: """Delete IoT site. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_jit_network_access_policies_operations.py index ac4bf25955a0..bda90ec34063 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_jit_network_access_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_jit_network_access_policies_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JitNetworkAccessPoliciesList"]: """Policies for protecting resources using Just-in-Time access control. @@ -109,7 +109,7 @@ async def get_next(next_link=None): def list_by_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JitNetworkAccessPoliciesList"]: """Policies for protecting resources using Just-in-Time access control for the subscription, location. @@ -178,7 +178,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JitNetworkAccessPoliciesList"]: """Policies for protecting resources using Just-in-Time access control for the subscription, location. @@ -250,7 +250,7 @@ async def get_next(next_link=None): def list_by_resource_group_and_region( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JitNetworkAccessPoliciesList"]: """Policies for protecting resources using Just-in-Time access control for the subscription, location. @@ -324,7 +324,7 @@ async def get( self, resource_group_name: str, jit_network_access_policy_name: str, - **kwargs + **kwargs: Any ) -> "_models.JitNetworkAccessPolicy": """Policies for protecting resources using Just-in-Time access control for the subscription, location. @@ -386,7 +386,7 @@ async def create_or_update( resource_group_name: str, jit_network_access_policy_name: str, body: "_models.JitNetworkAccessPolicy", - **kwargs + **kwargs: Any ) -> "_models.JitNetworkAccessPolicy": """Create a policy for protecting resources using Just-in-Time access control. @@ -453,7 +453,7 @@ async def delete( self, resource_group_name: str, jit_network_access_policy_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Just-in-Time access control policy. @@ -511,7 +511,7 @@ async def initiate( resource_group_name: str, jit_network_access_policy_name: str, body: "_models.JitNetworkAccessPolicyInitiateRequest", - **kwargs + **kwargs: Any ) -> "_models.JitNetworkAccessRequest": """Initiate a JIT access from a specific Just-in-Time policy configuration. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_locations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_locations_operations.py index 13071a3bfde4..0597ef7bfed6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_locations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_locations_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AscLocationList"]: """The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be @@ -111,7 +111,7 @@ async def get_next(next_link=None): async def get( self, - **kwargs + **kwargs: Any ) -> "_models.AscLocation": """Details of a specific location. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_on_premise_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_on_premise_iot_sensors_operations.py index 3ea54ecd99ea..ce877a0cc1c7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_on_premise_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_on_premise_iot_sensors_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.OnPremiseIotSensorsList": """List on-premise IoT sensors. @@ -93,7 +93,7 @@ async def list( async def get( self, on_premise_iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> "_models.OnPremiseIotSensor": """Get on-premise IoT sensor. @@ -147,7 +147,7 @@ async def get( async def create_or_update( self, on_premise_iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> "_models.OnPremiseIotSensor": """Create or update on-premise IoT sensor. @@ -205,7 +205,7 @@ async def create_or_update( async def delete( self, on_premise_iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete on-premise IoT sensor. @@ -256,7 +256,7 @@ async def delete( async def download_activation( self, on_premise_iot_sensor_name: str, - **kwargs + **kwargs: Any ) -> IO: """Download sensor activation file. @@ -311,7 +311,7 @@ async def download_reset_password( self, on_premise_iot_sensor_name: str, body: "_models.ResetPasswordInput", - **kwargs + **kwargs: Any ) -> IO: """Download file for reset password of the sensor. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_operations.py index f0e4d5362d2b..81c86cb0e66b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """Exposes all available operations for discovery purposes. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_pricings_operations.py index 88b4e4cf2a09..2f5c1427124a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_pricings_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.PricingList": """Lists Security Center pricing configurations in the subscription. @@ -93,7 +93,7 @@ async def list( async def get( self, pricing_name: str, - **kwargs + **kwargs: Any ) -> "_models.Pricing": """Gets a provided Security Center pricing configuration in the subscription. @@ -148,7 +148,7 @@ async def update( self, pricing_name: str, pricing: "_models.Pricing", - **kwargs + **kwargs: Any ) -> "_models.Pricing": """Updates a provided Security Center pricing configuration in the subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_assessments_operations.py index 930ef91b087c..32614aec3d99 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_assessments_operations.py @@ -46,7 +46,7 @@ def list( regulatory_compliance_standard_name: str, regulatory_compliance_control_name: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.RegulatoryComplianceAssessmentList"]: """Details and state of assessments mapped to selected regulatory compliance control. @@ -125,7 +125,7 @@ async def get( regulatory_compliance_standard_name: str, regulatory_compliance_control_name: str, regulatory_compliance_assessment_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegulatoryComplianceAssessment": """Supported regulatory compliance details and state for selected assessment. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_controls_operations.py index 67e5df29aa0c..2c64a381af9c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_controls_operations.py @@ -45,7 +45,7 @@ def list( self, regulatory_compliance_standard_name: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.RegulatoryComplianceControlList"]: """All supported regulatory compliance controls details and state for selected standard. @@ -120,7 +120,7 @@ async def get( self, regulatory_compliance_standard_name: str, regulatory_compliance_control_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegulatoryComplianceControl": """Selected regulatory compliance control details and state. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_standards_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_standards_operations.py index 8a7c10f30b23..5dbcd284f0d0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_standards_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_regulatory_compliance_standards_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.RegulatoryComplianceStandardList"]: """Supported regulatory compliance standards details and state. @@ -115,7 +115,7 @@ async def get_next(next_link=None): async def get( self, regulatory_compliance_standard_name: str, - **kwargs + **kwargs: Any ) -> "_models.RegulatoryComplianceStandard": """Supported regulatory compliance details state for selected standard. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_control_definitions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_control_definitions_operations.py index f04a10e7cb19..e5df37ba2e9b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_control_definitions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_control_definitions_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecureScoreControlDefinitionList"]: """List the available security controls, their assessments, and the max score. @@ -105,7 +105,7 @@ async def get_next(next_link=None): def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecureScoreControlDefinitionList"]: """For a specified subscription, list the available security controls, their assessments, and the max score. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_controls_operations.py index 4a376c753457..07f3d874ea7e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_score_controls_operations.py @@ -45,7 +45,7 @@ def list_by_secure_score( self, secure_score_name: str, expand: Optional[Union[str, "_models.ExpandControlsEnum"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecureScoreControlList"]: """Get all security controls for a specific initiative within a scope. @@ -120,7 +120,7 @@ async def get_next(next_link=None): def list( self, expand: Optional[Union[str, "_models.ExpandControlsEnum"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecureScoreControlList"]: """Get all security controls within a scope. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_scores_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_scores_operations.py index 849421e1653d..90e1ceb3501b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_scores_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_secure_scores_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecureScoresList"]: """List secure scores for all your Security Center initiatives within your current scope. @@ -110,7 +110,7 @@ async def get_next(next_link=None): async def get( self, secure_score_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecureScoreItem": """Get secure score for a specific Security Center initiative within your current scope. For the ASC Default initiative, use 'ascScore'. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_contacts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_contacts_operations.py index b5ebee2d9517..d2466e69b609 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_contacts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_contacts_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecurityContactList"]: """Security contact configurations for the subscription. @@ -110,7 +110,7 @@ async def get_next(next_link=None): async def get( self, security_contact_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecurityContact": """Security contact configurations for the subscription. @@ -165,7 +165,7 @@ async def create( self, security_contact_name: str, security_contact: "_models.SecurityContact", - **kwargs + **kwargs: Any ) -> "_models.SecurityContact": """Security contact configurations for the subscription. @@ -226,7 +226,7 @@ async def create( async def delete( self, security_contact_name: str, - **kwargs + **kwargs: Any ) -> None: """Security contact configurations for the subscription. @@ -278,7 +278,7 @@ async def update( self, security_contact_name: str, security_contact: "_models.SecurityContact", - **kwargs + **kwargs: Any ) -> "_models.SecurityContact": """Security contact configurations for the subscription. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_operations.py index 9bcf98ef9d48..24b5cc9fe67b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecuritySolutionList"]: """Gets a list of Security Solutions for the subscription. @@ -111,7 +111,7 @@ async def get( self, resource_group_name: str, security_solution_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecuritySolution": """Gets a specific Security Solution. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_reference_data_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_reference_data_operations.py index 4751c0ccf7db..944d446ef9e1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_reference_data_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_security_solutions_reference_data_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.SecuritySolutionsReferenceDataList": """Gets a list of all supported Security Solutions for the subscription. @@ -92,7 +92,7 @@ async def list( async def list_by_home_region( self, - **kwargs + **kwargs: Any ) -> "_models.SecuritySolutionsReferenceDataList": """Gets list of all supported Security Solutions for subscription and location. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_server_vulnerability_assessment_operations.py index 09abee11e506..f66bf8978920 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_server_vulnerability_assessment_operations.py @@ -5,13 +5,15 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -46,7 +48,7 @@ async def list_by_extended_resource( resource_namespace: str, resource_type: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ServerVulnerabilityAssessmentsList": """Gets a list of server vulnerability assessment onboarding statuses on a given resource. @@ -113,7 +115,7 @@ async def get( resource_namespace: str, resource_type: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ServerVulnerabilityAssessment": """Gets a server vulnerability assessment onboarding statuses on a given resource. @@ -182,7 +184,7 @@ async def create_or_update( resource_namespace: str, resource_type: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ServerVulnerabilityAssessment": """Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it. @@ -246,30 +248,14 @@ async def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore - async def delete( + async def _delete_initial( self, resource_group_name: str, resource_namespace: str, resource_type: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: - """Removing server vulnerability assessment from a resource. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param resource_namespace: The Namespace of the resource. - :type resource_namespace: str - :param resource_type: The type of the resource. - :type resource_type: str - :param resource_name: Name of the resource. - :type resource_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -280,7 +266,7 @@ async def delete( accept = "application/json" # Construct URL - url = self.delete.metadata['url'] # type: ignore + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -303,11 +289,88 @@ async def delete( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_namespace: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Removing server vulnerability assessment from a resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_namespace=resource_namespace, + resource_type=resource_type, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + server_vulnerability_assessment = "default" + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'serverVulnerabilityAssessment': self._serialize.url("server_vulnerability_assessment", server_vulnerability_assessment, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_settings_operations.py index 1fa7bef6e559..1324b2166ed2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_settings_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SettingsList"]: """Settings about different configurations in security center. @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -109,13 +109,13 @@ async def get_next(next_link=None): async def get( self, - setting_name: Union[str, "_models.Enum3"], - **kwargs + setting_name: Union[str, "_models.Enum86"], + **kwargs: Any ) -> "_models.Setting": """Settings of different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). - :type setting_name: str or ~azure.mgmt.security.models.Enum3 + :param setting_name: The name of the setting. + :type setting_name: str or ~azure.mgmt.security.models.Enum86 :keyword callable cls: A custom type or function that will be passed the direct response :return: Setting, or the result of cls(response) :rtype: ~azure.mgmt.security.models.Setting @@ -126,7 +126,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -163,14 +163,14 @@ async def get( async def update( self, - setting_name: Union[str, "_models.Enum3"], + setting_name: Union[str, "_models.Enum86"], setting: "_models.Setting", - **kwargs + **kwargs: Any ) -> "_models.Setting": """updating settings about different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). - :type setting_name: str or ~azure.mgmt.security.models.Enum3 + :param setting_name: The name of the setting. + :type setting_name: str or ~azure.mgmt.security.models.Enum86 :param setting: Setting object. :type setting: ~azure.mgmt.security.models.Setting :keyword callable cls: A custom type or function that will be passed the direct response @@ -183,7 +183,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_software_inventories_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_software_inventories_operations.py new file mode 100644 index 000000000000..d38fc050a78a --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_software_inventories_operations.py @@ -0,0 +1,262 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareInventoriesOperations: + """SoftwareInventoriesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.security.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_extended_resource( + self, + resource_group_name: str, + resource_namespace: str, + resource_type: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SoftwaresList"]: + """Gets the software inventory of the virtual machine. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SoftwaresList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SoftwaresList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SoftwaresList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_extended_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SoftwaresList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories'} # type: ignore + + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SoftwaresList"]: + """Gets the software inventory of all virtual machines in the subscriptions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SoftwaresList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.models.SoftwaresList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SoftwaresList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SoftwaresList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_namespace: str, + resource_type: str, + resource_name: str, + software_name: str, + **kwargs: Any + ) -> "_models.Software": + """Gets a single software data of the virtual machine. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param software_name: Name of the installed software. + :type software_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Software, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.Software + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Software"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'softwareName': self._serialize.url("software_name", software_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Software', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py index 53fe4b6c5066..025272f789c9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -46,7 +46,7 @@ async def create_or_update( workspace_id: str, resource_id: str, body: Optional["_models.RuleResultsInput"] = None, - **kwargs + **kwargs: Any ) -> "_models.RuleResults": """Creates a Baseline for a rule in a database. Will overwrite any previously existing results. @@ -119,7 +119,7 @@ async def get( rule_id: str, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.RuleResults": """Gets the results for a given rule in the Baseline. @@ -182,7 +182,7 @@ async def delete( rule_id: str, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a rule from the Baseline of a given database. @@ -241,7 +241,7 @@ async def list( self, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.RulesResults": """Gets the results for all rules in the Baseline. @@ -301,7 +301,7 @@ async def add( workspace_id: str, resource_id: str, body: Optional["_models.RulesResultsInput"] = None, - **kwargs + **kwargs: Any ) -> "_models.RulesResults": """Add a list of baseline rules. Will overwrite any previously existing results (for all rules). diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py index 31723efbf0a8..0ff8ebb2bbe3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -46,7 +46,7 @@ async def get( scan_result_id: str, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.ScanResult": """Gets the scan results of a single rule in a scan record. @@ -112,7 +112,7 @@ async def list( scan_id: str, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.ScanResults": """Gets a list of scan results for a single scan record. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scans_operations.py index 5c43e253a792..dc4e1348504b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sql_vulnerability_assessment_scans_operations.py @@ -45,7 +45,7 @@ async def get( scan_id: str, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.Scan": """Gets the scan details of a single scan record. @@ -107,7 +107,7 @@ async def list( self, workspace_id: str, resource_id: str, - **kwargs + **kwargs: Any ) -> "_models.Scans": """Gets a list of scan records. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sub_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sub_assessments_operations.py index 53f4871a1584..36f502551163 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sub_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_sub_assessments_operations.py @@ -44,12 +44,12 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_all( self, scope: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecuritySubAssessmentList"]: """Get security sub-assessments on all your scanned resources inside a subscription scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -116,12 +116,12 @@ def list( self, scope: str, assessment_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecuritySubAssessmentList"]: """Get security sub-assessments on all your scanned resources inside a scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param assessment_name: The Assessment Key - Unique key for the assessment type. @@ -192,12 +192,12 @@ async def get( scope: str, assessment_name: str, sub_assessment_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecuritySubAssessment": """Get a security sub-assessment on your scanned resource. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param assessment_name: The Assessment Key - Unique key for the assessment type. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_tasks_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_tasks_operations.py index cd494576ed07..db7bbd5d59af 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_tasks_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_tasks_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecurityTaskList"]: """Recommended tasks that will help improve the security of the subscription proactively. @@ -115,7 +115,7 @@ async def get_next(next_link=None): def list_by_home_region( self, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecurityTaskList"]: """Recommended tasks that will help improve the security of the subscription proactively. @@ -187,7 +187,7 @@ async def get_next(next_link=None): async def get_subscription_level_task( self, task_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecurityTask": """Recommended tasks that will help improve the security of the subscription proactively. @@ -242,15 +242,15 @@ async def get_subscription_level_task( async def update_subscription_level_task_state( self, task_name: str, - task_update_action_type: Union[str, "_models.Enum15"], - **kwargs + task_update_action_type: Union[str, "_models.Enum13"], + **kwargs: Any ) -> None: """Recommended tasks that will help improve the security of the subscription proactively. :param task_name: Name of the task object, will be a GUID. :type task_name: str :param task_update_action_type: Type of the action to do on the task. - :type task_update_action_type: str or ~azure.mgmt.security.models.Enum15 + :type task_update_action_type: str or ~azure.mgmt.security.models.Enum13 :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -299,7 +299,7 @@ def list_by_resource_group( self, resource_group_name: str, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SecurityTaskList"]: """Recommended tasks that will help improve the security of the subscription proactively. @@ -376,7 +376,7 @@ async def get_resource_group_level_task( self, resource_group_name: str, task_name: str, - **kwargs + **kwargs: Any ) -> "_models.SecurityTask": """Recommended tasks that will help improve the security of the subscription proactively. @@ -436,8 +436,8 @@ async def update_resource_group_level_task_state( self, resource_group_name: str, task_name: str, - task_update_action_type: Union[str, "_models.Enum15"], - **kwargs + task_update_action_type: Union[str, "_models.Enum13"], + **kwargs: Any ) -> None: """Recommended tasks that will help improve the security of the subscription proactively. @@ -447,7 +447,7 @@ async def update_resource_group_level_task_state( :param task_name: Name of the task object, will be a GUID. :type task_name: str :param task_update_action_type: Type of the action to do on the task. - :type task_update_action_type: str or ~azure.mgmt.security.models.Enum15 + :type task_update_action_type: str or ~azure.mgmt.security.models.Enum13 :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_topology_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_topology_operations.py index 12a1223032bd..9f2d93a6b94c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_topology_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_topology_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.TopologyList"]: """Gets a list that allows to build a topology view of a subscription. @@ -109,7 +109,7 @@ async def get_next(next_link=None): def list_by_home_region( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.TopologyList"]: """Gets a list that allows to build a topology view of a subscription and location. @@ -178,7 +178,7 @@ async def get( self, resource_group_name: str, topology_resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.TopologyResource": """Gets a specific topology component. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_workspace_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_workspace_settings_operations.py index a3389b20ece8..e2f283eec3d4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_workspace_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/operations/_workspace_settings_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WorkspaceSettingList"]: """Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. @@ -111,7 +111,7 @@ async def get_next(next_link=None): async def get( self, workspace_setting_name: str, - **kwargs + **kwargs: Any ) -> "_models.WorkspaceSetting": """Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. @@ -167,7 +167,7 @@ async def create( self, workspace_setting_name: str, workspace_setting: "_models.WorkspaceSetting", - **kwargs + **kwargs: Any ) -> "_models.WorkspaceSetting": """creating settings about where we should store your security data and logs. @@ -229,7 +229,7 @@ async def update( self, workspace_setting_name: str, workspace_setting: "_models.WorkspaceSetting", - **kwargs + **kwargs: Any ) -> "_models.WorkspaceSetting": """Settings about where we should store your security data and logs. @@ -290,7 +290,7 @@ async def update( async def delete( self, workspace_setting_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py index ebc6c7fb5d4a..0ef8511fb3ea 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -18,10 +18,15 @@ from ._models_py3 import AdaptiveNetworkHardeningEnforceRequest from ._models_py3 import AdaptiveNetworkHardeningsList from ._models_py3 import AdditionalData + from ._models_py3 import AdditionalWorkspacesProperties from ._models_py3 import AdvancedThreatProtectionSetting from ._models_py3 import Alert from ._models_py3 import AlertEntity from ._models_py3 import AlertList + from ._models_py3 import AlertSimulatorBundlesRequestProperties + from ._models_py3 import AlertSimulatorRequestBody + from ._models_py3 import AlertSimulatorRequestProperties + from ._models_py3 import AlertSyncSettings from ._models_py3 import AlertsSuppressionRule from ._models_py3 import AlertsSuppressionRulesList from ._models_py3 import AllowedConnectionsList @@ -34,6 +39,7 @@ from ._models_py3 import AscLocationList from ._models_py3 import AssessmentLinks from ._models_py3 import AssessmentStatus + from ._models_py3 import AssessmentStatusResponse from ._models_py3 import AtaExternalSecuritySolution from ._models_py3 import AtaSolutionProperties from ._models_py3 import AuthenticationDetailsProperties @@ -63,6 +69,7 @@ from ._models_py3 import CVSS from ._models_py3 import CefExternalSecuritySolution from ._models_py3 import CefSolutionProperties + from ._models_py3 import CloudErrorBody from ._models_py3 import Compliance from ._models_py3 import ComplianceList from ._models_py3 import ComplianceResult @@ -71,6 +78,8 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import ConnectionFromIpNotAllowed + from ._models_py3 import ConnectionStrings from ._models_py3 import ConnectionToIpNotAllowed from ._models_py3 import ConnectorSetting from ._models_py3 import ConnectorSettingList @@ -87,6 +96,7 @@ from ._models_py3 import DiscoveredSecuritySolutionList from ._models_py3 import ETag from ._models_py3 import EffectiveNetworkSecurityGroups + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind from ._models_py3 import ExternalSecuritySolutionList @@ -103,6 +113,10 @@ from ._models_py3 import InformationProtectionPolicy from ._models_py3 import InformationProtectionPolicyList from ._models_py3 import InformationType + from ._models_py3 import IngestionConnectionString + from ._models_py3 import IngestionSetting + from ._models_py3 import IngestionSettingList + from ._models_py3 import IngestionSettingToken from ._models_py3 import IoTSecurityAggregatedAlert from ._models_py3 import IoTSecurityAggregatedAlertList from ._models_py3 import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem @@ -117,16 +131,12 @@ from ._models_py3 import IoTSecuritySolutionModel from ._models_py3 import IoTSecuritySolutionsList from ._models_py3 import IoTSeverityMetrics - from ._models_py3 import IotAlert - from ._models_py3 import IotAlertList from ._models_py3 import IotAlertListModel from ._models_py3 import IotAlertModel from ._models_py3 import IotAlertType from ._models_py3 import IotAlertTypeList from ._models_py3 import IotDefenderSettingsList from ._models_py3 import IotDefenderSettingsModel - from ._models_py3 import IotRecommendation - from ._models_py3 import IotRecommendationList from ._models_py3 import IotRecommendationListModel from ._models_py3 import IotRecommendationModel from ._models_py3 import IotRecommendationType @@ -217,10 +227,17 @@ from ._models_py3 import SecurityAssessment from ._models_py3 import SecurityAssessmentList from ._models_py3 import SecurityAssessmentMetadata - from ._models_py3 import SecurityAssessmentMetadataList from ._models_py3 import SecurityAssessmentMetadataPartnerData from ._models_py3 import SecurityAssessmentMetadataProperties + from ._models_py3 import SecurityAssessmentMetadataPropertiesResponse + from ._models_py3 import SecurityAssessmentMetadataPropertiesResponsePublishDates + from ._models_py3 import SecurityAssessmentMetadataResponse + from ._models_py3 import SecurityAssessmentMetadataResponseList from ._models_py3 import SecurityAssessmentPartnerData + from ._models_py3 import SecurityAssessmentProperties + from ._models_py3 import SecurityAssessmentPropertiesBase + from ._models_py3 import SecurityAssessmentPropertiesResponse + from ._models_py3 import SecurityAssessmentResponse from ._models_py3 import SecurityContact from ._models_py3 import SecurityContactList from ._models_py3 import SecuritySolution @@ -241,9 +258,12 @@ from ._models_py3 import Setting from ._models_py3 import SettingsList from ._models_py3 import Site + from ._models_py3 import Software + from ._models_py3 import SoftwaresList from ._models_py3 import SqlServerVulnerabilityProperties from ._models_py3 import SubAssessmentStatus from ._models_py3 import SuppressionAlertsScope + from ._models_py3 import SystemData from ._models_py3 import Tags from ._models_py3 import TagsResource from ._models_py3 import ThresholdCustomAlertRule @@ -277,10 +297,15 @@ from ._models import AdaptiveNetworkHardeningEnforceRequest # type: ignore from ._models import AdaptiveNetworkHardeningsList # type: ignore from ._models import AdditionalData # type: ignore + from ._models import AdditionalWorkspacesProperties # type: ignore from ._models import AdvancedThreatProtectionSetting # type: ignore from ._models import Alert # type: ignore from ._models import AlertEntity # type: ignore from ._models import AlertList # type: ignore + from ._models import AlertSimulatorBundlesRequestProperties # type: ignore + from ._models import AlertSimulatorRequestBody # type: ignore + from ._models import AlertSimulatorRequestProperties # type: ignore + from ._models import AlertSyncSettings # type: ignore from ._models import AlertsSuppressionRule # type: ignore from ._models import AlertsSuppressionRulesList # type: ignore from ._models import AllowedConnectionsList # type: ignore @@ -293,6 +318,7 @@ from ._models import AscLocationList # type: ignore from ._models import AssessmentLinks # type: ignore from ._models import AssessmentStatus # type: ignore + from ._models import AssessmentStatusResponse # type: ignore from ._models import AtaExternalSecuritySolution # type: ignore from ._models import AtaSolutionProperties # type: ignore from ._models import AuthenticationDetailsProperties # type: ignore @@ -322,6 +348,7 @@ from ._models import CVSS # type: ignore from ._models import CefExternalSecuritySolution # type: ignore from ._models import CefSolutionProperties # type: ignore + from ._models import CloudErrorBody # type: ignore from ._models import Compliance # type: ignore from ._models import ComplianceList # type: ignore from ._models import ComplianceResult # type: ignore @@ -330,6 +357,8 @@ from ._models import ConnectableResource # type: ignore from ._models import ConnectedResource # type: ignore from ._models import ConnectedWorkspace # type: ignore + from ._models import ConnectionFromIpNotAllowed # type: ignore + from ._models import ConnectionStrings # type: ignore from ._models import ConnectionToIpNotAllowed # type: ignore from ._models import ConnectorSetting # type: ignore from ._models import ConnectorSettingList # type: ignore @@ -346,6 +375,7 @@ from ._models import DiscoveredSecuritySolutionList # type: ignore from ._models import ETag # type: ignore from ._models import EffectiveNetworkSecurityGroups # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore from ._models import ExternalSecuritySolution # type: ignore from ._models import ExternalSecuritySolutionKind # type: ignore from ._models import ExternalSecuritySolutionList # type: ignore @@ -362,6 +392,10 @@ from ._models import InformationProtectionPolicy # type: ignore from ._models import InformationProtectionPolicyList # type: ignore from ._models import InformationType # type: ignore + from ._models import IngestionConnectionString # type: ignore + from ._models import IngestionSetting # type: ignore + from ._models import IngestionSettingList # type: ignore + from ._models import IngestionSettingToken # type: ignore from ._models import IoTSecurityAggregatedAlert # type: ignore from ._models import IoTSecurityAggregatedAlertList # type: ignore from ._models import IoTSecurityAggregatedAlertPropertiesTopDevicesListItem # type: ignore @@ -376,16 +410,12 @@ from ._models import IoTSecuritySolutionModel # type: ignore from ._models import IoTSecuritySolutionsList # type: ignore from ._models import IoTSeverityMetrics # type: ignore - from ._models import IotAlert # type: ignore - from ._models import IotAlertList # type: ignore from ._models import IotAlertListModel # type: ignore from ._models import IotAlertModel # type: ignore from ._models import IotAlertType # type: ignore from ._models import IotAlertTypeList # type: ignore from ._models import IotDefenderSettingsList # type: ignore from ._models import IotDefenderSettingsModel # type: ignore - from ._models import IotRecommendation # type: ignore - from ._models import IotRecommendationList # type: ignore from ._models import IotRecommendationListModel # type: ignore from ._models import IotRecommendationModel # type: ignore from ._models import IotRecommendationType # type: ignore @@ -476,10 +506,17 @@ from ._models import SecurityAssessment # type: ignore from ._models import SecurityAssessmentList # type: ignore from ._models import SecurityAssessmentMetadata # type: ignore - from ._models import SecurityAssessmentMetadataList # type: ignore from ._models import SecurityAssessmentMetadataPartnerData # type: ignore from ._models import SecurityAssessmentMetadataProperties # type: ignore + from ._models import SecurityAssessmentMetadataPropertiesResponse # type: ignore + from ._models import SecurityAssessmentMetadataPropertiesResponsePublishDates # type: ignore + from ._models import SecurityAssessmentMetadataResponse # type: ignore + from ._models import SecurityAssessmentMetadataResponseList # type: ignore from ._models import SecurityAssessmentPartnerData # type: ignore + from ._models import SecurityAssessmentProperties # type: ignore + from ._models import SecurityAssessmentPropertiesBase # type: ignore + from ._models import SecurityAssessmentPropertiesResponse # type: ignore + from ._models import SecurityAssessmentResponse # type: ignore from ._models import SecurityContact # type: ignore from ._models import SecurityContactList # type: ignore from ._models import SecuritySolution # type: ignore @@ -500,9 +537,12 @@ from ._models import Setting # type: ignore from ._models import SettingsList # type: ignore from ._models import Site # type: ignore + from ._models import Software # type: ignore + from ._models import SoftwaresList # type: ignore from ._models import SqlServerVulnerabilityProperties # type: ignore from ._models import SubAssessmentStatus # type: ignore from ._models import SuppressionAlertsScope # type: ignore + from ._models import SystemData # type: ignore from ._models import Tags # type: ignore from ._models import TagsResource # type: ignore from ._models import ThresholdCustomAlertRule # type: ignore @@ -529,6 +569,8 @@ AadConnectivityStateEnum, ActionType, AdaptiveApplicationControlIssue, + AdditionalWorkspaceDataType, + AdditionalWorkspaceType, AlertIntent, AlertNotifications, AlertSeverity, @@ -541,19 +583,22 @@ AuthenticationType, AuthorizationState, AutoProvision, - Category, + BundleType, + Categories, ConfigurationStatus, ConnectionType, ControlType, + CreatedByType, DataSource, DeviceCriticality, DeviceStatus, Direction, + EndOfSupportStatus, EnforcementMode, EnforcementSupport, + Enum13, Enum15, - Enum17, - Enum3, + Enum86, EventSource, ExpandControlsEnum, ExpandEnum, @@ -563,8 +608,10 @@ HybridComputeProvisioningState, ImplementationEffort, Intent, + KindEnum, MacSignificance, ManagementState, + OnboardingKind, Operator, PermissionProperty, PricingTier, @@ -593,6 +640,7 @@ SecurityFamily, SecuritySolutionStatus, SensorStatus, + SensorType, ServerVulnerabilityAssessmentPropertiesProvisioningState, SettingKind, Severity, @@ -602,6 +650,7 @@ Status, StatusReason, SubAssessmentStatusCode, + Tactics, Threats, TiStatus, TransportProtocol, @@ -623,10 +672,15 @@ 'AdaptiveNetworkHardeningEnforceRequest', 'AdaptiveNetworkHardeningsList', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', 'AlertList', + 'AlertSimulatorBundlesRequestProperties', + 'AlertSimulatorRequestBody', + 'AlertSimulatorRequestProperties', + 'AlertSyncSettings', 'AlertsSuppressionRule', 'AlertsSuppressionRulesList', 'AllowedConnectionsList', @@ -639,6 +693,7 @@ 'AscLocationList', 'AssessmentLinks', 'AssessmentStatus', + 'AssessmentStatusResponse', 'AtaExternalSecuritySolution', 'AtaSolutionProperties', 'AuthenticationDetailsProperties', @@ -668,6 +723,7 @@ 'CVSS', 'CefExternalSecuritySolution', 'CefSolutionProperties', + 'CloudErrorBody', 'Compliance', 'ComplianceList', 'ComplianceResult', @@ -676,6 +732,8 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', + 'ConnectionStrings', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ConnectorSettingList', @@ -692,6 +750,7 @@ 'DiscoveredSecuritySolutionList', 'ETag', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind', 'ExternalSecuritySolutionList', @@ -708,6 +767,10 @@ 'InformationProtectionPolicy', 'InformationProtectionPolicyList', 'InformationType', + 'IngestionConnectionString', + 'IngestionSetting', + 'IngestionSettingList', + 'IngestionSettingToken', 'IoTSecurityAggregatedAlert', 'IoTSecurityAggregatedAlertList', 'IoTSecurityAggregatedAlertPropertiesTopDevicesListItem', @@ -722,16 +785,12 @@ 'IoTSecuritySolutionModel', 'IoTSecuritySolutionsList', 'IoTSeverityMetrics', - 'IotAlert', - 'IotAlertList', 'IotAlertListModel', 'IotAlertModel', 'IotAlertType', 'IotAlertTypeList', 'IotDefenderSettingsList', 'IotDefenderSettingsModel', - 'IotRecommendation', - 'IotRecommendationList', 'IotRecommendationListModel', 'IotRecommendationModel', 'IotRecommendationType', @@ -822,10 +881,17 @@ 'SecurityAssessment', 'SecurityAssessmentList', 'SecurityAssessmentMetadata', - 'SecurityAssessmentMetadataList', 'SecurityAssessmentMetadataPartnerData', 'SecurityAssessmentMetadataProperties', + 'SecurityAssessmentMetadataPropertiesResponse', + 'SecurityAssessmentMetadataPropertiesResponsePublishDates', + 'SecurityAssessmentMetadataResponse', + 'SecurityAssessmentMetadataResponseList', 'SecurityAssessmentPartnerData', + 'SecurityAssessmentProperties', + 'SecurityAssessmentPropertiesBase', + 'SecurityAssessmentPropertiesResponse', + 'SecurityAssessmentResponse', 'SecurityContact', 'SecurityContactList', 'SecuritySolution', @@ -846,9 +912,12 @@ 'Setting', 'SettingsList', 'Site', + 'Software', + 'SoftwaresList', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -873,6 +942,8 @@ 'AadConnectivityStateEnum', 'ActionType', 'AdaptiveApplicationControlIssue', + 'AdditionalWorkspaceDataType', + 'AdditionalWorkspaceType', 'AlertIntent', 'AlertNotifications', 'AlertSeverity', @@ -885,19 +956,22 @@ 'AuthenticationType', 'AuthorizationState', 'AutoProvision', - 'Category', + 'BundleType', + 'Categories', 'ConfigurationStatus', 'ConnectionType', 'ControlType', + 'CreatedByType', 'DataSource', 'DeviceCriticality', 'DeviceStatus', 'Direction', + 'EndOfSupportStatus', 'EnforcementMode', 'EnforcementSupport', + 'Enum13', 'Enum15', - 'Enum17', - 'Enum3', + 'Enum86', 'EventSource', 'ExpandControlsEnum', 'ExpandEnum', @@ -907,8 +981,10 @@ 'HybridComputeProvisioningState', 'ImplementationEffort', 'Intent', + 'KindEnum', 'MacSignificance', 'ManagementState', + 'OnboardingKind', 'Operator', 'PermissionProperty', 'PricingTier', @@ -937,6 +1013,7 @@ 'SecurityFamily', 'SecuritySolutionStatus', 'SensorStatus', + 'SensorType', 'ServerVulnerabilityAssessmentPropertiesProvisioningState', 'SettingKind', 'Severity', @@ -946,6 +1023,7 @@ 'Status', 'StatusReason', 'SubAssessmentStatusCode', + 'Tactics', 'Threats', 'TiStatus', 'TransportProtocol', diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py index 9a5efeb9d418..10f7d524bd91 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models.py @@ -205,7 +205,7 @@ class ExternalSecuritySolutionProperties(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -240,7 +240,7 @@ class AadSolutionProperties(ExternalSecuritySolutionProperties, AadConnectivityS :type connectivity_state: str or ~azure.mgmt.security.models.AadConnectivityStateEnum :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -752,6 +752,33 @@ def __init__( self.assessed_resource_type = None # type: Optional[str] +class AdditionalWorkspacesProperties(msrest.serialization.Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id. + :type workspace: str + :param type: Workspace type. Possible values include: "Sentinel". Default value: "Sentinel". + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace. + :type data_types: list[str or ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = kwargs.get('workspace', None) + self.type = kwargs.get('type', "Sentinel") + self.data_types = kwargs.get('data_types', None) + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -805,16 +832,16 @@ class Alert(Resource): :ivar system_alert_id: Unique identifier for the alert. :vartype system_alert_id: str :ivar product_component_name: The name of Azure Security Center pricing tier which powering - this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center- - pricing. + this alert. Learn more: + https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. :vartype product_component_name: str :ivar alert_display_name: The display name of the alert. :vartype alert_display_name: str :ivar description: Description of the suspicious activity that was detected. :vartype description: str :ivar severity: The risk level of the threat that was detected. Learn more: - https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are- - alerts-classified. Possible values include: "Informational", "Low", "Medium", "High". + https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. + Possible values include: "Informational", "Low", "Medium", "High". :vartype severity: str or ~azure.mgmt.security.models.AlertSeverity :ivar intent: The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents. Possible values include: @@ -958,7 +985,7 @@ class AlertEntity(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :ivar type: Type of entity. :vartype type: str """ @@ -1010,6 +1037,97 @@ def __init__( self.next_link = None +class AlertSimulatorRequestProperties(msrest.serialization.Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param kind: Required. The kind of alert simulation.Constant filled by server. Possible values + include: "Bundles". + :type kind: str or ~azure.mgmt.security.models.KindEnum + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__( + self, + **kwargs + ): + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.kind = 'AlertSimulatorRequestProperties' # type: str + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param kind: Required. The kind of alert simulation.Constant filled by server. Possible values + include: "Bundles". + :type kind: str or ~azure.mgmt.security.models.KindEnum + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertSimulatorBundlesRequestProperties, self).__init__(**kwargs) + self.kind = 'Bundles' # type: str + self.bundles = kwargs.get('bundles', None) + + +class AlertSimulatorRequestBody(msrest.serialization.Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -1105,6 +1223,97 @@ def __init__( self.next_link = None +class Setting(Resource): + """The kind of the security setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSyncSettings, DataExportSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AlertSyncSettings': 'AlertSyncSettings', 'DataExportSettings': 'DataExportSettings'} + } + + def __init__( + self, + **kwargs + ): + super(Setting, self).__init__(**kwargs) + self.kind = 'Setting' # type: str + + +class AlertSyncSettings(Setting): + """Represents an alert sync setting. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". + :type kind: str or ~azure.mgmt.security.models.SettingKind + :param enabled: Is the alert sync setting enabled. + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AlertSyncSettings, self).__init__(**kwargs) + self.kind = 'AlertSyncSettings' # type: str + self.enabled = kwargs.get('enabled', None) + + class AllowedConnectionsList(msrest.serialization.Model): """List of all possible traffic between Azure resources. @@ -1244,7 +1453,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): """A custom alert rule that checks if a value (depends on the custom alert type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, ProcessNotAllowed. + sub-classes are: ConnectionFromIpNotAllowed, ConnectionToIpNotAllowed, LocalUserNotAllowed, ProcessNotAllowed. Variables are only populated by the server, and will be ignored when sending a request. @@ -1285,7 +1494,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__( @@ -1462,7 +1671,7 @@ class AscLocation(Resource): :ivar type: Resource type. :vartype type: str :param properties: Any object. - :type properties: object + :type properties: any """ _validation = { @@ -1575,6 +1784,51 @@ def __init__( self.description = kwargs.get('description', None) +class AssessmentStatusResponse(AssessmentStatus): + """The result of the assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Programmatic code for the status of the assessment. Possible values + include: "Healthy", "Unhealthy", "NotApplicable". + :type code: str or ~azure.mgmt.security.models.AssessmentStatusCode + :param cause: Programmatic code for the cause of the assessment status. + :type cause: str + :param description: Human readable description of the assessment status. + :type description: str + :ivar first_evaluation_date: The time that the assessment was created and first evaluated. + Returned as UTC time in ISO 8601 format. + :vartype first_evaluation_date: ~datetime.datetime + :ivar status_change_date: The time that the status of the assessment last changed. Returned as + UTC time in ISO 8601 format. + :vartype status_change_date: ~datetime.datetime + """ + + _validation = { + 'code': {'required': True}, + 'first_evaluation_date': {'readonly': True}, + 'status_change_date': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'first_evaluation_date': {'key': 'firstEvaluationDate', 'type': 'iso-8601'}, + 'status_change_date': {'key': 'statusChangeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AssessmentStatusResponse, self).__init__(**kwargs) + self.first_evaluation_date = None + self.status_change_date = None + + class AtaExternalSecuritySolution(ExternalSecuritySolution): """Represents an ATA security solution which sends logs to an OMS workspace. @@ -1623,7 +1877,7 @@ class AtaSolutionProperties(ExternalSecuritySolutionProperties): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -2140,7 +2394,9 @@ class AutomationSource(msrest.serialization.Model): """The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: "Assessments", - "SubAssessments", "Alerts", "SecureScores", "SecureScoreControls". + "SubAssessments", "Alerts", "SecureScores", "SecureScoresSnapshot", "SecureScoreControls", + "SecureScoreControlsSnapshot", "RegulatoryComplianceAssessment", + "RegulatoryComplianceAssessmentSnapshot". :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2683,7 +2939,7 @@ class CefSolutionProperties(ExternalSecuritySolutionProperties): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -2718,6 +2974,51 @@ def __init__( self.last_event_received = kwargs.get('last_event_received', None) +class CloudErrorBody(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -2988,8 +3289,8 @@ def __init__( self.id = kwargs.get('id', None) -class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): - """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when sending a request. @@ -3033,66 +3334,140 @@ def __init__( self, **kwargs ): - super(ConnectionToIpNotAllowed, self).__init__(**kwargs) - self.rule_type = 'ConnectionToIpNotAllowed' # type: str + super(ConnectionFromIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' # type: str -class ConnectorSetting(Resource): - """The connector setting. +class ConnectionStrings(msrest.serialization.Model): + """Connection string for ingesting security data and logs. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management. These settings are - relevant only for Arc autoProvision (Hybrid Compute). - :type hybrid_compute_settings: ~azure.mgmt.security.models.HybridComputeSettingsProperties - :param authentication_details: Settings for authentication management, these settings are - relevant only for the cloud connector. - :type authentication_details: ~azure.mgmt.security.models.AuthenticationDetailsProperties + :param value: Required. Connection strings. + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'value': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, - 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, } def __init__( self, **kwargs ): - super(ConnectorSetting, self).__init__(**kwargs) - self.hybrid_compute_settings = kwargs.get('hybrid_compute_settings', None) - self.authentication_details = kwargs.get('authentication_details', None) + super(ConnectionStrings, self).__init__(**kwargs) + self.value = kwargs['value'] -class ConnectorSettingList(msrest.serialization.Model): - """For a subscription, list of all cloud account connectors and their settings. +class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): + """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when sending a request. - :param value: List of all the cloud account connector settings. - :type value: list[~azure.mgmt.security.models.ConnectorSetting] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ + All required parameters must be populated in order to send to Azure. - _validation = { - 'next_link': {'readonly': True}, - } + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule.Constant filled by server. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values include: "IpCidr", + "String". + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the values depends on the + rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionToIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionToIpNotAllowed' # type: str + + +class ConnectorSetting(Resource): + """The connector setting. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param hybrid_compute_settings: Settings for hybrid compute management. These settings are + relevant only for Arc autoProvision (Hybrid Compute). + :type hybrid_compute_settings: ~azure.mgmt.security.models.HybridComputeSettingsProperties + :param authentication_details: Settings for authentication management, these settings are + relevant only for the cloud connector. + :type authentication_details: ~azure.mgmt.security.models.AuthenticationDetailsProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, + 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectorSetting, self).__init__(**kwargs) + self.hybrid_compute_settings = kwargs.get('hybrid_compute_settings', None) + self.authentication_details = kwargs.get('authentication_details', None) + + +class ConnectorSettingList(msrest.serialization.Model): + """For a subscription, list of all cloud account connectors and their settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of all the cloud account connector settings. + :type value: list[~azure.mgmt.security.models.ConnectorSetting] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } _attribute_map = { 'value': {'key': 'value', 'type': '[ConnectorSetting]'}, @@ -3233,53 +3608,6 @@ def __init__( self.base = None -class Setting(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSettings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param kind: Required. the kind of the settings string (DataExportSettings).Constant filled by - server. Possible values include: "DataExportSettings", "AlertSuppressionSetting". - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'DataExportSettings': 'DataExportSettings'} - } - - def __init__( - self, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.kind = 'Setting' # type: str - - class DataExportSettings(Setting): """Represents a data export setting. @@ -3293,10 +3621,10 @@ class DataExportSettings(Setting): :vartype name: str :ivar type: Resource type. :vartype type: str - :param kind: Required. the kind of the settings string (DataExportSettings).Constant filled by - server. Possible values include: "DataExportSettings", "AlertSuppressionSetting". + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". :type kind: str or ~azure.mgmt.security.models.SettingKind - :param enabled: Is the data export setting is enabled. + :param enabled: Is the data export setting enabled. :type enabled: bool """ @@ -3805,6 +4133,36 @@ def __init__( self.network_security_groups = kwargs.get('network_security_groups', None) +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ExternalSecuritySolutionList(msrest.serialization.Model): """ExternalSecuritySolutionList. @@ -3954,7 +4312,7 @@ class Firmware(msrest.serialization.Model): :ivar version: Firmware version. :vartype version: str :ivar additional_data: A bag of fields which extends the firmware information. - :vartype additional_data: object + :vartype additional_data: any """ _validation = { @@ -4447,96 +4805,126 @@ def __init__( self.keywords = kwargs.get('keywords', None) -class IotAlert(msrest.serialization.Model): - """IoT alert. +class IngestionConnectionString(msrest.serialization.Model): + """Connection string for ingesting security data and logs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of - a product. - :vartype system_alert_id: str - :ivar compromised_entity: Display name of the main entity being reported on. - :vartype compromised_entity: str - :ivar alert_type: The type name of the alert. - :vartype alert_type: str - :ivar start_time_utc: The impact start time of the alert (the time of the first event or - activity included in the alert). - :vartype start_time_utc: str - :ivar end_time_utc: The impact end time of the alert (the time of the last event or activity - included in the alert). - :vartype end_time_utc: str - :param entities: A list of entities related to the alert. - :type entities: list[object] - :param extended_properties: A bag of fields which extends the alert information. - :type extended_properties: object + :ivar location: The region where ingested logs and data resides. + :vartype location: str + :ivar value: Connection string value. + :vartype value: str """ _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'location': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, - 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, - 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, - 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'str'}, - 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'str'}, - 'entities': {'key': 'properties.entities', 'type': '[object]'}, - 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, } def __init__( self, **kwargs ): - super(IotAlert, self).__init__(**kwargs) - self.system_alert_id = None - self.compromised_entity = None - self.alert_type = None - self.start_time_utc = None - self.end_time_utc = None - self.entities = kwargs.get('entities', None) - self.extended_properties = kwargs.get('extended_properties', None) + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None + self.value = None -class IotAlertList(msrest.serialization.Model): - """List of IoT alerts. +class IngestionSetting(Resource): + """Configures how to correlate scan data and logs with resources associated with the subscription. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List data. - :vartype value: list[~azure.mgmt.security.models.IotAlert] - :ivar next_link: When available, follow the URI to get the next page of data. + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: Ingestion setting data. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(IngestionSetting, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class IngestionSettingList(msrest.serialization.Model): + """List of ingestion settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of ingestion settings. + :vartype value: list[~azure.mgmt.security.models.IngestionSetting] + :ivar next_link: The URI to fetch the next page. :vartype next_link: str - :ivar total_count: Total count of alerts that conforms with the given filter options (not - affected by page size). - :vartype total_count: int """ _validation = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, - 'total_count': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotAlert]'}, + 'value': {'key': 'value', 'type': '[IngestionSetting]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'total_count': {'key': 'totalCount', 'type': 'int'}, } def __init__( self, **kwargs ): - super(IotAlertList, self).__init__(**kwargs) + super(IngestionSettingList, self).__init__(**kwargs) self.value = None self.next_link = None - self.total_count = None + + +class IngestionSettingToken(msrest.serialization.Model): + """Configures how to correlate scan data and logs with resources associated with the subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar token: The token is used for correlating security data and logs with the resources in the + subscription. + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None class IotAlertListModel(msrest.serialization.Model): @@ -4569,12 +4957,18 @@ def __init__( self.next_link = None -class IotAlertModel(msrest.serialization.Model): +class IotAlertModel(Resource): """IoT alert. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product. :vartype system_alert_id: str :ivar compromised_entity: Display name of the main entity being reported on. @@ -4588,12 +4982,15 @@ class IotAlertModel(msrest.serialization.Model): included in the alert). :vartype end_time_utc: str :param entities: A list of entities related to the alert. - :type entities: list[object] + :type entities: list[any] :param extended_properties: A bag of fields which extends the alert information. - :type extended_properties: object + :type extended_properties: any """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4602,6 +4999,9 @@ class IotAlertModel(msrest.serialization.Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4768,6 +5168,11 @@ class IotDefenderSettingsModel(Resource): :type device_quota: int :param sentinel_workspace_resource_ids: Sentinel Workspace Resource Ids. :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: The kind of onboarding for the subscription. Possible values include: + "Default", "MigratedToAzure", "Evaluation", "Purchased". + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind + :ivar evaluation_end_time: End time of the evaluation period, if such exist. + :vartype evaluation_end_time: ~datetime.datetime """ _validation = { @@ -4775,6 +5180,7 @@ class IotDefenderSettingsModel(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'device_quota': {'minimum': 1000}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { @@ -4783,6 +5189,8 @@ class IotDefenderSettingsModel(Resource): 'type': {'key': 'type', 'type': 'str'}, 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, + 'evaluation_end_time': {'key': 'properties.evaluationEndTime', 'type': 'iso-8601'}, } def __init__( @@ -4792,94 +5200,8 @@ def __init__( super(IotDefenderSettingsModel, self).__init__(**kwargs) self.device_quota = kwargs.get('device_quota', None) self.sentinel_workspace_resource_ids = kwargs.get('sentinel_workspace_resource_ids', None) - - -class IotRecommendation(Resource): - """IoT recommendation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar device_id: Identifier of the device being reported on. - :vartype device_id: str - :ivar recommendation_type: The type name of the recommendation. - :vartype recommendation_type: str - :ivar discovered_time_utc: The discovery time of the recommendation. - :vartype discovered_time_utc: str - :param recommendation_additional_data: A bag of fields which extends the recommendation - information. - :type recommendation_additional_data: object - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, - 'recommendation_type': {'key': 'properties.recommendationType', 'type': 'str'}, - 'discovered_time_utc': {'key': 'properties.discoveredTimeUtc', 'type': 'str'}, - 'recommendation_additional_data': {'key': 'properties.recommendationAdditionalData', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(IotRecommendation, self).__init__(**kwargs) - self.device_id = None - self.recommendation_type = None - self.discovered_time_utc = None - self.recommendation_additional_data = kwargs.get('recommendation_additional_data', None) - - -class IotRecommendationList(msrest.serialization.Model): - """List of IoT recommendations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List data. - :vartype value: list[~azure.mgmt.security.models.IotRecommendation] - :ivar next_link: When available, follow the URI to get the next page of data. - :vartype next_link: str - :ivar total_count: Total count of recommendations that conforms with the given filter options - (not affected by page size). - :vartype total_count: int - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - 'total_count': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotRecommendation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'total_count': {'key': 'totalCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(IotRecommendationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - self.total_count = None + self.onboarding_kind = kwargs.get('onboarding_kind', None) + self.evaluation_end_time = None class IotRecommendationListModel(msrest.serialization.Model): @@ -4931,7 +5253,7 @@ class IotRecommendationModel(Resource): :vartype discovered_time_utc: str :param recommendation_additional_data: A bag of fields which extends the recommendation information. - :type recommendation_additional_data: object + :type recommendation_additional_data: any """ _validation = { @@ -5110,7 +5432,7 @@ class IoTSecurityAggregatedAlert(Resource, TagsResource): :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str :ivar system_source: The type of the alerted resource (Azure, Non-Azure). @@ -5156,7 +5478,7 @@ class IoTSecurityAggregatedAlert(Resource, TagsResource): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -5242,7 +5564,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(msrest.serializatio :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str """ @@ -5255,7 +5577,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(msrest.serializatio _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -5298,9 +5620,9 @@ class IoTSecurityAggregatedRecommendation(Resource, TagsResource): "Informational", "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str """ @@ -5332,8 +5654,8 @@ class IoTSecurityAggregatedRecommendation(Resource, TagsResource): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -5409,7 +5731,7 @@ class IoTSecurityAlertedDevice(msrest.serialization.Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -5419,7 +5741,7 @@ class IoTSecurityAlertedDevice(msrest.serialization.Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__( @@ -5442,7 +5764,7 @@ class IoTSecurityDeviceAlert(msrest.serialization.Model): "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -5454,7 +5776,7 @@ class IoTSecurityDeviceAlert(msrest.serialization.Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__( @@ -5478,7 +5800,7 @@ class IoTSecurityDeviceRecommendation(msrest.serialization.Model): "Informational", "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -5490,7 +5812,7 @@ class IoTSecurityDeviceRecommendation(msrest.serialization.Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__( @@ -5517,7 +5839,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -5545,7 +5867,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -5636,6 +5958,9 @@ class IoTSecuritySolutionModel(Resource, TagsResource): :vartype type: str :param location: The resource location. :type location: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.security.models.SystemData :param workspace: Workspace resource ID. :type workspace: str :param display_name: Resource display name. @@ -5663,12 +5988,15 @@ class IoTSecuritySolutionModel(Resource, TagsResource): :param unmasked_ip_logging_status: Unmasked IP address logging status. Possible values include: "Disabled", "Enabled". Default value: "Disabled". :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces. + :type additional_workspaces: list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'auto_discovered_resources': {'readonly': True}, } @@ -5678,6 +6006,7 @@ class IoTSecuritySolutionModel(Resource, TagsResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'workspace': {'key': 'properties.workspace', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, @@ -5688,6 +6017,7 @@ class IoTSecuritySolutionModel(Resource, TagsResource): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, } def __init__( @@ -5697,6 +6027,7 @@ def __init__( super(IoTSecuritySolutionModel, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) + self.system_data = None self.workspace = kwargs.get('workspace', None) self.display_name = kwargs.get('display_name', None) self.status = kwargs.get('status', "Enabled") @@ -5707,10 +6038,12 @@ def __init__( self.auto_discovered_resources = None self.recommendations_configuration = kwargs.get('recommendations_configuration', None) self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") + self.additional_workspaces = kwargs.get('additional_workspaces', None) self.id = None self.name = None self.type = None self.location = kwargs.get('location', None) + self.system_data = None self.workspace = kwargs.get('workspace', None) self.display_name = kwargs.get('display_name', None) self.status = kwargs.get('status', "Enabled") @@ -5721,6 +6054,7 @@ def __init__( self.auto_discovered_resources = None self.recommendations_configuration = kwargs.get('recommendations_configuration', None) self.unmasked_ip_logging_status = kwargs.get('unmasked_ip_logging_status', "Disabled") + self.additional_workspaces = kwargs.get('additional_workspaces', None) class IoTSecuritySolutionsList(msrest.serialization.Model): @@ -5813,6 +6147,8 @@ class IotSensorsModel(Resource): :vartype ti_version: str :param zone: Zone of the IoT sensor. :type zone: str + :param sensor_type: Type of sensor. Possible values include: "Ot", "Enterprise". + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { @@ -5843,6 +6179,7 @@ class IotSensorsModel(Resource): 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, } def __init__( @@ -5860,23 +6197,24 @@ def __init__( self.ti_status = None self.ti_version = None self.zone = kwargs.get('zone', None) + self.sensor_type = kwargs.get('sensor_type', None) class IoTSeverityMetrics(msrest.serialization.Model): """IoT Security solution analytics severity metrics. :param high: Count of high severity alerts/recommendations. - :type high: int + :type high: long :param medium: Count of medium severity alerts/recommendations. - :type medium: int + :type medium: long :param low: Count of low severity alerts/recommendations. - :type low: int + :type low: long """ _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__( @@ -6745,7 +7083,7 @@ class OnPremiseIotSensor(Resource): :ivar type: Resource type. :vartype type: str :param properties: On-premise IoT sensor properties. - :type properties: object + :type properties: any """ _validation = { @@ -8443,7 +8781,7 @@ class ScopeElement(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param field: The alert entity type to suppress by. :type field: str """ @@ -8819,8 +9157,6 @@ class SecurityAssessment(Resource): :type resource_details: ~azure.mgmt.security.models.ResourceDetails :ivar display_name: User friendly display name of the assessment. :vartype display_name: str - :param status: The result of the assessment. - :type status: ~azure.mgmt.security.models.AssessmentStatus :param additional_data: Additional data regarding the assessment. :type additional_data: dict[str, str] :ivar links: Links relevant to the assessment. @@ -8829,6 +9165,8 @@ class SecurityAssessment(Resource): :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties :param partners_data: Data regarding 3rd party partner integration. :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatus """ _validation = { @@ -8845,11 +9183,11 @@ class SecurityAssessment(Resource): 'type': {'key': 'type', 'type': 'str'}, 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, } def __init__( @@ -8859,11 +9197,11 @@ def __init__( super(SecurityAssessment, self).__init__(**kwargs) self.resource_details = kwargs.get('resource_details', None) self.display_name = None - self.status = kwargs.get('status', None) self.additional_data = kwargs.get('additional_data', None) self.links = None self.metadata = kwargs.get('metadata', None) self.partners_data = kwargs.get('partners_data', None) + self.status = kwargs.get('status', None) class SecurityAssessmentList(msrest.serialization.Model): @@ -8872,7 +9210,7 @@ class SecurityAssessmentList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Collection of security assessments in this page. - :vartype value: list[~azure.mgmt.security.models.SecurityAssessment] + :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentResponse] :ivar next_link: The URI to fetch the next page. :vartype next_link: str """ @@ -8883,7 +9221,7 @@ class SecurityAssessmentList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityAssessment]'}, + 'value': {'key': 'value', 'type': '[SecurityAssessmentResponse]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8917,8 +9255,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue. :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: The severity level of the assessment. Possible values include: "Low", "Medium", "High". :type severity: str or ~azure.mgmt.security.models.Severity @@ -8955,7 +9293,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -8974,7 +9312,7 @@ def __init__( self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs.get('severity', None) self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -8984,36 +9322,6 @@ def __init__( self.partner_data = kwargs.get('partner_data', None) -class SecurityAssessmentMetadataList(msrest.serialization.Model): - """List of security assessment metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentMetadata] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityAssessmentMetadata]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityAssessmentMetadataList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - class SecurityAssessmentMetadataPartnerData(msrest.serialization.Model): """Describes the partner that created the assessment. @@ -9066,8 +9374,8 @@ class SecurityAssessmentMetadataProperties(msrest.serialization.Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue. :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: "Low", "Medium", "High". :type severity: str or ~azure.mgmt.security.models.Severity @@ -9101,7 +9409,7 @@ class SecurityAssessmentMetadataProperties(msrest.serialization.Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -9120,7 +9428,7 @@ def __init__( self.policy_definition_id = None self.description = kwargs.get('description', None) self.remediation_description = kwargs.get('remediation_description', None) - self.category = kwargs.get('category', None) + self.categories = kwargs.get('categories', None) self.severity = kwargs['severity'] self.user_impact = kwargs.get('user_impact', None) self.implementation_effort = kwargs.get('implementation_effort', None) @@ -9130,132 +9438,584 @@ def __init__( self.partner_data = kwargs.get('partner_data', None) -class SecurityAssessmentPartnerData(msrest.serialization.Model): - """Data regarding 3rd party partner integration. - - All required parameters must be populated in order to send to Azure. - - :param partner_name: Required. Name of the company of the partner. - :type partner_name: str - :param secret: Required. secret to authenticate the partner - write only. - :type secret: str - """ - - _validation = { - 'partner_name': {'required': True}, - 'secret': {'required': True}, - } - - _attribute_map = { - 'partner_name': {'key': 'partnerName', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityAssessmentPartnerData, self).__init__(**kwargs) - self.partner_name = kwargs['partner_name'] - self.secret = kwargs['secret'] - - -class SecurityContact(Resource): - """Contact details for security issues. +class SecurityAssessmentMetadataPropertiesResponse(SecurityAssessmentMetadataProperties): + """Describes properties of an assessment metadata response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param email: The email of this security contact. - :type email: str - :param phone: The phone number of this security contact. - :type phone: str - :param alert_notifications: Whether to send security alerts notifications to the security - contact. Possible values include: "On", "Off". - :type alert_notifications: str or ~azure.mgmt.security.models.AlertNotifications - :param alerts_to_admins: Whether to send security alerts notifications to subscription admins. - Possible values include: "On", "Off". - :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. User friendly display name of the assessment. + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition that turns this + assessment calculation on. + :vartype policy_definition_id: str + :param description: Human readable description of the assessment. + :type description: str + :param remediation_description: Human readable description of what you should do to mitigate + this security issue. + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: Required. The severity level of the assessment. Possible values include: + "Low", "Medium", "High". + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values include: "Low", + "Moderate", "High". + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to remediate this assessment. + Possible values include: "Low", "Moderate", "High". + :type implementation_effort: str or ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status. + :type preview: bool + :param assessment_type: Required. BuiltIn if the assessment based on built-in Azure Policy + definition, Custom if the assessment based on custom Azure Policy definition. Possible values + include: "BuiltIn", "CustomPolicy", "CustomerManaged", "VerifiedPartner". + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: Describes the partner that created the assessment. + :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'display_name': {'required': True}, + 'policy_definition_id': {'readonly': True}, + 'severity': {'required': True}, + 'assessment_type': {'required': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'email': {'key': 'properties.email', 'type': 'str'}, - 'phone': {'key': 'properties.phone', 'type': 'str'}, - 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, - 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'user_impact': {'key': 'userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, + 'threats': {'key': 'threats', 'type': '[str]'}, + 'preview': {'key': 'preview', 'type': 'bool'}, + 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'plannedDeprecationDate', 'type': 'str'}, + 'tactics': {'key': 'tactics', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(SecurityContact, self).__init__(**kwargs) - self.email = kwargs.get('email', None) - self.phone = kwargs.get('phone', None) - self.alert_notifications = kwargs.get('alert_notifications', None) - self.alerts_to_admins = kwargs.get('alerts_to_admins', None) + super(SecurityAssessmentMetadataPropertiesResponse, self).__init__(**kwargs) + self.publish_dates = kwargs.get('publish_dates', None) + self.planned_deprecation_date = kwargs.get('planned_deprecation_date', None) + self.tactics = kwargs.get('tactics', None) -class SecurityContactList(msrest.serialization.Model): - """List of security contacts response. +class SecurityAssessmentMetadataPropertiesResponsePublishDates(msrest.serialization.Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: List of security contacts. - :vartype value: list[~azure.mgmt.security.models.SecurityContact] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str + :param ga: + :type ga: str + :param public: Required. + :type public: str """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityContact]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, } def __init__( self, **kwargs ): - super(SecurityContactList, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = kwargs.get('ga', None) + self.public = kwargs['public'] -class SecuritySolution(Resource, Location): - """SecuritySolution. +class SecurityAssessmentMetadataResponse(Resource): + """Security assessment metadata response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar location: Location where the resource is stored. - :vartype location: str :ivar id: Resource Id. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param security_family: The security family of the security solution. Possible values include: - "Waf", "Ngfw", "SaasWaf", "Va". - :type security_family: str or ~azure.mgmt.security.models.SecurityFamily + :param display_name: User friendly display name of the assessment. + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition that turns this + assessment calculation on. + :vartype policy_definition_id: str + :param description: Human readable description of the assessment. + :type description: str + :param remediation_description: Human readable description of what you should do to mitigate + this security issue. + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: The severity level of the assessment. Possible values include: "Low", + "Medium", "High". + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values include: "Low", + "Moderate", "High". + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to remediate this assessment. + Possible values include: "Low", "Moderate", "High". + :type implementation_effort: str or ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status. + :type preview: bool + :param assessment_type: BuiltIn if the assessment based on built-in Azure Policy definition, + Custom if the assessment based on custom Azure Policy definition. Possible values include: + "BuiltIn", "CustomPolicy", "CustomerManaged", "VerifiedPartner". + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: Describes the partner that created the assessment. + :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_definition_id': {'readonly': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'properties.publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'properties.plannedDeprecationDate', 'type': 'str'}, + 'tactics': {'key': 'properties.tactics', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentMetadataResponse, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.policy_definition_id = None + self.description = kwargs.get('description', None) + self.remediation_description = kwargs.get('remediation_description', None) + self.categories = kwargs.get('categories', None) + self.severity = kwargs.get('severity', None) + self.user_impact = kwargs.get('user_impact', None) + self.implementation_effort = kwargs.get('implementation_effort', None) + self.threats = kwargs.get('threats', None) + self.preview = kwargs.get('preview', None) + self.assessment_type = kwargs.get('assessment_type', None) + self.partner_data = kwargs.get('partner_data', None) + self.publish_dates = kwargs.get('publish_dates', None) + self.planned_deprecation_date = kwargs.get('planned_deprecation_date', None) + self.tactics = kwargs.get('tactics', None) + + +class SecurityAssessmentMetadataResponseList(msrest.serialization.Model): + """List of security assessment metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentMetadataResponse] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityAssessmentMetadataResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentMetadataResponseList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SecurityAssessmentPartnerData(msrest.serialization.Model): + """Data regarding 3rd party partner integration. + + All required parameters must be populated in order to send to Azure. + + :param partner_name: Required. Name of the company of the partner. + :type partner_name: str + :param secret: Required. secret to authenticate the partner - write only. + :type secret: str + """ + + _validation = { + 'partner_name': {'required': True}, + 'secret': {'required': True}, + } + + _attribute_map = { + 'partner_name': {'key': 'partnerName', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentPartnerData, self).__init__(**kwargs) + self.partner_name = kwargs['partner_name'] + self.secret = kwargs['secret'] + + +class SecurityAssessmentPropertiesBase(msrest.serialization.Model): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentPropertiesBase, self).__init__(**kwargs) + self.resource_details = kwargs['resource_details'] + self.display_name = None + self.additional_data = kwargs.get('additional_data', None) + self.links = None + self.metadata = kwargs.get('metadata', None) + self.partners_data = kwargs.get('partners_data', None) + + +class SecurityAssessmentProperties(SecurityAssessmentPropertiesBase): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatus + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'status', 'type': 'AssessmentStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentProperties, self).__init__(**kwargs) + self.status = kwargs['status'] + + +class SecurityAssessmentPropertiesResponse(SecurityAssessmentPropertiesBase): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentPropertiesResponse, self).__init__(**kwargs) + self.status = kwargs['status'] + + +class SecurityAssessmentResponse(Resource): + """Security assessment on a resource - response format. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param resource_details: Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, + 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentResponse, self).__init__(**kwargs) + self.resource_details = kwargs.get('resource_details', None) + self.display_name = None + self.additional_data = kwargs.get('additional_data', None) + self.links = None + self.metadata = kwargs.get('metadata', None) + self.partners_data = kwargs.get('partners_data', None) + self.status = kwargs.get('status', None) + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param email: The email of this security contact. + :type email: str + :param phone: The phone number of this security contact. + :type phone: str + :param alert_notifications: Whether to send security alerts notifications to the security + contact. Possible values include: "On", "Off". + :type alert_notifications: str or ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Whether to send security alerts notifications to subscription admins. + Possible values include: "On", "Off". + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityContact, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + self.phone = kwargs.get('phone', None) + self.alert_notifications = kwargs.get('alert_notifications', None) + self.alerts_to_admins = kwargs.get('alerts_to_admins', None) + + +class SecurityContactList(msrest.serialization.Model): + """List of security contacts response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of security contacts. + :vartype value: list[~azure.mgmt.security.models.SecurityContact] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityContact]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityContactList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SecuritySolution(Resource, Location): + """SecuritySolution. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location where the resource is stored. + :vartype location: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param security_family: The security family of the security solution. Possible values include: + "Waf", "Ngfw", "SaasWaf", "Va". + :type security_family: str or ~azure.mgmt.security.models.SecurityFamily :param provisioning_state: The security family provisioning State. Possible values include: "Succeeded", "Failed", "Updating". :type provisioning_state: str or ~azure.mgmt.security.models.ProvisioningState @@ -9638,7 +10398,7 @@ class SecurityTaskParameters(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :ivar name: Name of the task type. :vartype name: str """ @@ -9929,6 +10689,106 @@ def __init__( self.display_name = None +class Software(Resource): + """Represents a software data. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param device_id: Unique identifier for the virtual machine in the service. + :type device_id: str + :param os_platform: Platform of the operating system running on the device. + :type os_platform: str + :param vendor: Name of the software vendor. + :type vendor: str + :param software_name: Name of the software product. + :type software_name: str + :param version: Version number of the software product. + :type version: str + :param end_of_support_status: End of support status. Possible values include: "None", + "noLongerSupported", "versionNoLongerSupported", "upcomingNoLongerSupported", + "upcomingVersionNoLongerSupported". + :type end_of_support_status: str or ~azure.mgmt.security.models.EndOfSupportStatus + :param end_of_support_date: The end of support date in case the product is upcoming end of + support. + :type end_of_support_date: str + :param number_of_known_vulnerabilities: Number of weaknesses. + :type number_of_known_vulnerabilities: int + :param first_seen_at: First time that the software was seen in the device. + :type first_seen_at: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'os_platform': {'key': 'properties.osPlatform', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'software_name': {'key': 'properties.softwareName', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'end_of_support_status': {'key': 'properties.endOfSupportStatus', 'type': 'str'}, + 'end_of_support_date': {'key': 'properties.endOfSupportDate', 'type': 'str'}, + 'number_of_known_vulnerabilities': {'key': 'properties.numberOfKnownVulnerabilities', 'type': 'int'}, + 'first_seen_at': {'key': 'properties.firstSeenAt', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Software, self).__init__(**kwargs) + self.device_id = kwargs.get('device_id', None) + self.os_platform = kwargs.get('os_platform', None) + self.vendor = kwargs.get('vendor', None) + self.software_name = kwargs.get('software_name', None) + self.version = kwargs.get('version', None) + self.end_of_support_status = kwargs.get('end_of_support_status', None) + self.end_of_support_date = kwargs.get('end_of_support_date', None) + self.number_of_known_vulnerabilities = kwargs.get('number_of_known_vulnerabilities', None) + self.first_seen_at = kwargs.get('first_seen_at', None) + + +class SoftwaresList(msrest.serialization.Model): + """Represents the software inventory of the virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: + :type value: list[~azure.mgmt.security.models.Software] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Software]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SoftwaresList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -10036,6 +10896,47 @@ def __init__( self.all_of = kwargs['all_of'] +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + class TopologyList(msrest.serialization.Model): """TopologyList. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py index 5ba418c3e4eb..a32468eaef45 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union import msrest.serialization @@ -219,7 +219,7 @@ class ExternalSecuritySolutionProperties(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -238,7 +238,7 @@ class ExternalSecuritySolutionProperties(msrest.serialization.Model): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, device_vendor: Optional[str] = None, device_type: Optional[str] = None, workspace: Optional["ConnectedWorkspace"] = None, @@ -259,7 +259,7 @@ class AadSolutionProperties(ExternalSecuritySolutionProperties, AadConnectivityS :type connectivity_state: str or ~azure.mgmt.security.models.AadConnectivityStateEnum :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -280,7 +280,7 @@ def __init__( self, *, connectivity_state: Optional[Union[str, "AadConnectivityStateEnum"]] = None, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, device_vendor: Optional[str] = None, device_type: Optional[str] = None, workspace: Optional["ConnectedWorkspace"] = None, @@ -813,6 +813,37 @@ def __init__( self.assessed_resource_type = None # type: Optional[str] +class AdditionalWorkspacesProperties(msrest.serialization.Model): + """Properties of the additional workspaces. + + :param workspace: Workspace resource id. + :type workspace: str + :param type: Workspace type. Possible values include: "Sentinel". Default value: "Sentinel". + :type type: str or ~azure.mgmt.security.models.AdditionalWorkspaceType + :param data_types: List of data types sent to workspace. + :type data_types: list[str or ~azure.mgmt.security.models.AdditionalWorkspaceDataType] + """ + + _attribute_map = { + 'workspace': {'key': 'workspace', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_types': {'key': 'dataTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + workspace: Optional[str] = None, + type: Optional[Union[str, "AdditionalWorkspaceType"]] = "Sentinel", + data_types: Optional[List[Union[str, "AdditionalWorkspaceDataType"]]] = None, + **kwargs + ): + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = workspace + self.type = type + self.data_types = data_types + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -868,16 +899,16 @@ class Alert(Resource): :ivar system_alert_id: Unique identifier for the alert. :vartype system_alert_id: str :ivar product_component_name: The name of Azure Security Center pricing tier which powering - this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center- - pricing. + this alert. Learn more: + https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. :vartype product_component_name: str :ivar alert_display_name: The display name of the alert. :vartype alert_display_name: str :ivar description: Description of the suspicious activity that was detected. :vartype description: str :ivar severity: The risk level of the threat that was detected. Learn more: - https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are- - alerts-classified. Possible values include: "Informational", "Low", "Medium", "High". + https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. + Possible values include: "Informational", "Low", "Medium", "High". :vartype severity: str or ~azure.mgmt.security.models.AlertSeverity :ivar intent: The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents. Possible values include: @@ -1023,7 +1054,7 @@ class AlertEntity(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :ivar type: Type of entity. :vartype type: str """ @@ -1040,7 +1071,7 @@ class AlertEntity(msrest.serialization.Model): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, **kwargs ): super(AlertEntity, self).__init__(**kwargs) @@ -1079,6 +1110,104 @@ def __init__( self.next_link = None +class AlertSimulatorRequestProperties(msrest.serialization.Model): + """Describes properties of an alert simulation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSimulatorBundlesRequestProperties. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param kind: Required. The kind of alert simulation.Constant filled by server. Possible values + include: "Bundles". + :type kind: str or ~azure.mgmt.security.models.KindEnum + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Bundles': 'AlertSimulatorBundlesRequestProperties'} + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.kind = 'AlertSimulatorRequestProperties' # type: str + + +class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): + """Simulate alerts according to this bundles. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param kind: Required. The kind of alert simulation.Constant filled by server. Possible values + include: "Bundles". + :type kind: str or ~azure.mgmt.security.models.KindEnum + :param bundles: Bundles list. + :type bundles: list[str or ~azure.mgmt.security.models.BundleType] + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'bundles': {'key': 'bundles', 'type': '[str]'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + bundles: Optional[List[Union[str, "BundleType"]]] = None, + **kwargs + ): + super(AlertSimulatorBundlesRequestProperties, self).__init__(additional_properties=additional_properties, **kwargs) + self.kind = 'Bundles' # type: str + self.bundles = bundles + + +class AlertSimulatorRequestBody(msrest.serialization.Model): + """Alert Simulator request body. + + :param properties: Alert Simulator request body data. + :type properties: ~azure.mgmt.security.models.AlertSimulatorRequestProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'AlertSimulatorRequestProperties'}, + } + + def __init__( + self, + *, + properties: Optional["AlertSimulatorRequestProperties"] = None, + **kwargs + ): + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = properties + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -1183,6 +1312,99 @@ def __init__( self.next_link = None +class Setting(Resource): + """The kind of the security setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AlertSyncSettings, DataExportSettings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AlertSyncSettings': 'AlertSyncSettings', 'DataExportSettings': 'DataExportSettings'} + } + + def __init__( + self, + **kwargs + ): + super(Setting, self).__init__(**kwargs) + self.kind = 'Setting' # type: str + + +class AlertSyncSettings(Setting): + """Represents an alert sync setting. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". + :type kind: str or ~azure.mgmt.security.models.SettingKind + :param enabled: Is the alert sync setting enabled. + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(AlertSyncSettings, self).__init__(**kwargs) + self.kind = 'AlertSyncSettings' # type: str + self.enabled = enabled + + class AllowedConnectionsList(msrest.serialization.Model): """List of all possible traffic between Azure resources. @@ -1324,7 +1546,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): """A custom alert rule that checks if a value (depends on the custom alert type) is allowed. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ConnectionToIpNotAllowed, LocalUserNotAllowed, ProcessNotAllowed. + sub-classes are: ConnectionFromIpNotAllowed, ConnectionToIpNotAllowed, LocalUserNotAllowed, ProcessNotAllowed. Variables are only populated by the server, and will be ignored when sending a request. @@ -1365,7 +1587,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__( @@ -1560,7 +1782,7 @@ class AscLocation(Resource): :ivar type: Resource type. :vartype type: str :param properties: Any object. - :type properties: object + :type properties: any """ _validation = { @@ -1579,7 +1801,7 @@ class AscLocation(Resource): def __init__( self, *, - properties: Optional[object] = None, + properties: Optional[Any] = None, **kwargs ): super(AscLocation, self).__init__(**kwargs) @@ -1679,6 +1901,55 @@ def __init__( self.description = description +class AssessmentStatusResponse(AssessmentStatus): + """The result of the assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Programmatic code for the status of the assessment. Possible values + include: "Healthy", "Unhealthy", "NotApplicable". + :type code: str or ~azure.mgmt.security.models.AssessmentStatusCode + :param cause: Programmatic code for the cause of the assessment status. + :type cause: str + :param description: Human readable description of the assessment status. + :type description: str + :ivar first_evaluation_date: The time that the assessment was created and first evaluated. + Returned as UTC time in ISO 8601 format. + :vartype first_evaluation_date: ~datetime.datetime + :ivar status_change_date: The time that the status of the assessment last changed. Returned as + UTC time in ISO 8601 format. + :vartype status_change_date: ~datetime.datetime + """ + + _validation = { + 'code': {'required': True}, + 'first_evaluation_date': {'readonly': True}, + 'status_change_date': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'cause': {'key': 'cause', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'first_evaluation_date': {'key': 'firstEvaluationDate', 'type': 'iso-8601'}, + 'status_change_date': {'key': 'statusChangeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + code: Union[str, "AssessmentStatusCode"], + cause: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(AssessmentStatusResponse, self).__init__(code=code, cause=cause, description=description, **kwargs) + self.first_evaluation_date = None + self.status_change_date = None + + class AtaExternalSecuritySolution(ExternalSecuritySolution): """Represents an ATA security solution which sends logs to an OMS workspace. @@ -1730,7 +2001,7 @@ class AtaSolutionProperties(ExternalSecuritySolutionProperties): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -1752,7 +2023,7 @@ class AtaSolutionProperties(ExternalSecuritySolutionProperties): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, device_vendor: Optional[str] = None, device_type: Optional[str] = None, workspace: Optional["ConnectedWorkspace"] = None, @@ -2291,7 +2562,9 @@ class AutomationSource(msrest.serialization.Model): """The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: "Assessments", - "SubAssessments", "Alerts", "SecureScores", "SecureScoreControls". + "SubAssessments", "Alerts", "SecureScores", "SecureScoresSnapshot", "SecureScoreControls", + "SecureScoreControlsSnapshot", "RegulatoryComplianceAssessment", + "RegulatoryComplianceAssessmentSnapshot". :type event_source: str or ~azure.mgmt.security.models.EventSource :param rule_sets: A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). @@ -2869,7 +3142,7 @@ class CefSolutionProperties(ExternalSecuritySolutionProperties): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param device_vendor: :type device_vendor: str :param device_type: @@ -2897,7 +3170,7 @@ class CefSolutionProperties(ExternalSecuritySolutionProperties): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, device_vendor: Optional[str] = None, device_type: Optional[str] = None, workspace: Optional["ConnectedWorkspace"] = None, @@ -2912,6 +3185,51 @@ def __init__( self.last_event_received = last_event_received +class CloudErrorBody(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.security.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.security.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Compliance(Resource): """Compliance of a scope. @@ -3188,8 +3506,8 @@ def __init__( self.id = id -class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): - """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. +class ConnectionFromIpNotAllowed(AllowlistCustomAlertRule): + """Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. Variables are only populated by the server, and will be ignored when sending a request. @@ -3236,53 +3554,132 @@ def __init__( allowlist_values: List[str], **kwargs ): - super(ConnectionToIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = 'ConnectionToIpNotAllowed' # type: str + super(ConnectionFromIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' # type: str -class ConnectorSetting(Resource): - """The connector setting. +class ConnectionStrings(msrest.serialization.Model): + """Connection string for ingesting security data and logs. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param hybrid_compute_settings: Settings for hybrid compute management. These settings are - relevant only for Arc autoProvision (Hybrid Compute). - :type hybrid_compute_settings: ~azure.mgmt.security.models.HybridComputeSettingsProperties - :param authentication_details: Settings for authentication management, these settings are - relevant only for the cloud connector. - :type authentication_details: ~azure.mgmt.security.models.AuthenticationDetailsProperties + :param value: Required. Connection strings. + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'value': {'required': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, - 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, } def __init__( self, *, - hybrid_compute_settings: Optional["HybridComputeSettingsProperties"] = None, - authentication_details: Optional["AuthenticationDetailsProperties"] = None, + value: List["IngestionConnectionString"], **kwargs ): - super(ConnectorSetting, self).__init__(**kwargs) - self.hybrid_compute_settings = hybrid_compute_settings - self.authentication_details = authentication_details + super(ConnectionStrings, self).__init__(**kwargs) + self.value = value + + +class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): + """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Status of the custom alert. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule.Constant filled by server. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values include: "IpCidr", + "String". + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the values depends on the + rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__( + self, + *, + is_enabled: bool, + allowlist_values: List[str], + **kwargs + ): + super(ConnectionToIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionToIpNotAllowed' # type: str + + +class ConnectorSetting(Resource): + """The connector setting. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param hybrid_compute_settings: Settings for hybrid compute management. These settings are + relevant only for Arc autoProvision (Hybrid Compute). + :type hybrid_compute_settings: ~azure.mgmt.security.models.HybridComputeSettingsProperties + :param authentication_details: Settings for authentication management, these settings are + relevant only for the cloud connector. + :type authentication_details: ~azure.mgmt.security.models.AuthenticationDetailsProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'hybrid_compute_settings': {'key': 'properties.hybridComputeSettings', 'type': 'HybridComputeSettingsProperties'}, + 'authentication_details': {'key': 'properties.authenticationDetails', 'type': 'AuthenticationDetailsProperties'}, + } + + def __init__( + self, + *, + hybrid_compute_settings: Optional["HybridComputeSettingsProperties"] = None, + authentication_details: Optional["AuthenticationDetailsProperties"] = None, + **kwargs + ): + super(ConnectorSetting, self).__init__(**kwargs) + self.hybrid_compute_settings = hybrid_compute_settings + self.authentication_details = authentication_details class ConnectorSettingList(msrest.serialization.Model): @@ -3441,53 +3838,6 @@ def __init__( self.base = None -class Setting(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSettings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param kind: Required. the kind of the settings string (DataExportSettings).Constant filled by - server. Possible values include: "DataExportSettings", "AlertSuppressionSetting". - :type kind: str or ~azure.mgmt.security.models.SettingKind - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - _subtype_map = { - 'kind': {'DataExportSettings': 'DataExportSettings'} - } - - def __init__( - self, - **kwargs - ): - super(Setting, self).__init__(**kwargs) - self.kind = 'Setting' # type: str - - class DataExportSettings(Setting): """Represents a data export setting. @@ -3501,10 +3851,10 @@ class DataExportSettings(Setting): :vartype name: str :ivar type: Resource type. :vartype type: str - :param kind: Required. the kind of the settings string (DataExportSettings).Constant filled by - server. Possible values include: "DataExportSettings", "AlertSuppressionSetting". + :param kind: Required. the kind of the settings string.Constant filled by server. Possible + values include: "DataExportSettings", "AlertSuppressionSetting", "AlertSyncSettings". :type kind: str or ~azure.mgmt.security.models.SettingKind - :param enabled: Is the data export setting is enabled. + :param enabled: Is the data export setting enabled. :type enabled: bool """ @@ -4050,6 +4400,36 @@ def __init__( self.network_security_groups = network_security_groups +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ExternalSecuritySolutionList(msrest.serialization.Model): """ExternalSecuritySolutionList. @@ -4211,7 +4591,7 @@ class Firmware(msrest.serialization.Model): :ivar version: Firmware version. :vartype version: str :ivar additional_data: A bag of fields which extends the firmware information. - :vartype additional_data: object + :vartype additional_data: any """ _validation = { @@ -4755,99 +5135,128 @@ def __init__( self.keywords = keywords -class IotAlert(msrest.serialization.Model): - """IoT alert. +class IngestionConnectionString(msrest.serialization.Model): + """Connection string for ingesting security data and logs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of - a product. - :vartype system_alert_id: str - :ivar compromised_entity: Display name of the main entity being reported on. - :vartype compromised_entity: str - :ivar alert_type: The type name of the alert. - :vartype alert_type: str - :ivar start_time_utc: The impact start time of the alert (the time of the first event or - activity included in the alert). - :vartype start_time_utc: str - :ivar end_time_utc: The impact end time of the alert (the time of the last event or activity - included in the alert). - :vartype end_time_utc: str - :param entities: A list of entities related to the alert. - :type entities: list[object] - :param extended_properties: A bag of fields which extends the alert information. - :type extended_properties: object + :ivar location: The region where ingested logs and data resides. + :vartype location: str + :ivar value: Connection string value. + :vartype value: str """ _validation = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'location': {'readonly': True}, + 'value': {'readonly': True}, } _attribute_map = { - 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, - 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, - 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, - 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'str'}, - 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'str'}, - 'entities': {'key': 'properties.entities', 'type': '[object]'}, - 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IngestionConnectionString, self).__init__(**kwargs) + self.location = None + self.value = None + + +class IngestionSetting(Resource): + """Configures how to correlate scan data and logs with resources associated with the subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: Ingestion setting data. + :type properties: any + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, } def __init__( self, *, - entities: Optional[List[object]] = None, - extended_properties: Optional[object] = None, + properties: Optional[Any] = None, **kwargs ): - super(IotAlert, self).__init__(**kwargs) - self.system_alert_id = None - self.compromised_entity = None - self.alert_type = None - self.start_time_utc = None - self.end_time_utc = None - self.entities = entities - self.extended_properties = extended_properties + super(IngestionSetting, self).__init__(**kwargs) + self.properties = properties -class IotAlertList(msrest.serialization.Model): - """List of IoT alerts. +class IngestionSettingList(msrest.serialization.Model): + """List of ingestion settings. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List data. - :vartype value: list[~azure.mgmt.security.models.IotAlert] - :ivar next_link: When available, follow the URI to get the next page of data. + :ivar value: List of ingestion settings. + :vartype value: list[~azure.mgmt.security.models.IngestionSetting] + :ivar next_link: The URI to fetch the next page. :vartype next_link: str - :ivar total_count: Total count of alerts that conforms with the given filter options (not - affected by page size). - :vartype total_count: int """ _validation = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, - 'total_count': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotAlert]'}, + 'value': {'key': 'value', 'type': '[IngestionSetting]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'total_count': {'key': 'totalCount', 'type': 'int'}, } def __init__( self, **kwargs ): - super(IotAlertList, self).__init__(**kwargs) + super(IngestionSettingList, self).__init__(**kwargs) self.value = None self.next_link = None - self.total_count = None + + +class IngestionSettingToken(msrest.serialization.Model): + """Configures how to correlate scan data and logs with resources associated with the subscription. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar token: The token is used for correlating security data and logs with the resources in the + subscription. + :vartype token: str + """ + + _validation = { + 'token': {'readonly': True}, + } + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None class IotAlertListModel(msrest.serialization.Model): @@ -4880,12 +5289,18 @@ def __init__( self.next_link = None -class IotAlertModel(msrest.serialization.Model): +class IotAlertModel(Resource): """IoT alert. Variables are only populated by the server, and will be ignored when sending a request. - :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_alert_id: Holds the product canonical identifier of the alert within the scope of a product. :vartype system_alert_id: str :ivar compromised_entity: Display name of the main entity being reported on. @@ -4899,12 +5314,15 @@ class IotAlertModel(msrest.serialization.Model): included in the alert). :vartype end_time_utc: str :param entities: A list of entities related to the alert. - :type entities: list[object] + :type entities: list[any] :param extended_properties: A bag of fields which extends the alert information. - :type extended_properties: object + :type extended_properties: any """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4913,6 +5331,9 @@ class IotAlertModel(msrest.serialization.Model): } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, 'system_alert_id': {'key': 'properties.systemAlertId', 'type': 'str'}, 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, 'alert_type': {'key': 'properties.alertType', 'type': 'str'}, @@ -4925,8 +5346,8 @@ class IotAlertModel(msrest.serialization.Model): def __init__( self, *, - entities: Optional[List[object]] = None, - extended_properties: Optional[object] = None, + entities: Optional[List[Any]] = None, + extended_properties: Optional[Any] = None, **kwargs ): super(IotAlertModel, self).__init__(**kwargs) @@ -5084,6 +5505,11 @@ class IotDefenderSettingsModel(Resource): :type device_quota: int :param sentinel_workspace_resource_ids: Sentinel Workspace Resource Ids. :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: The kind of onboarding for the subscription. Possible values include: + "Default", "MigratedToAzure", "Evaluation", "Purchased". + :type onboarding_kind: str or ~azure.mgmt.security.models.OnboardingKind + :ivar evaluation_end_time: End time of the evaluation period, if such exist. + :vartype evaluation_end_time: ~datetime.datetime """ _validation = { @@ -5091,6 +5517,7 @@ class IotDefenderSettingsModel(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'device_quota': {'minimum': 1000}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { @@ -5099,6 +5526,8 @@ class IotDefenderSettingsModel(Resource): 'type': {'key': 'type', 'type': 'str'}, 'device_quota': {'key': 'properties.deviceQuota', 'type': 'int'}, 'sentinel_workspace_resource_ids': {'key': 'properties.sentinelWorkspaceResourceIds', 'type': '[str]'}, + 'onboarding_kind': {'key': 'properties.onboardingKind', 'type': 'str'}, + 'evaluation_end_time': {'key': 'properties.evaluationEndTime', 'type': 'iso-8601'}, } def __init__( @@ -5106,101 +5535,14 @@ def __init__( *, device_quota: Optional[int] = None, sentinel_workspace_resource_ids: Optional[List[str]] = None, + onboarding_kind: Optional[Union[str, "OnboardingKind"]] = None, **kwargs ): super(IotDefenderSettingsModel, self).__init__(**kwargs) self.device_quota = device_quota self.sentinel_workspace_resource_ids = sentinel_workspace_resource_ids - - -class IotRecommendation(Resource): - """IoT recommendation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar device_id: Identifier of the device being reported on. - :vartype device_id: str - :ivar recommendation_type: The type name of the recommendation. - :vartype recommendation_type: str - :ivar discovered_time_utc: The discovery time of the recommendation. - :vartype discovered_time_utc: str - :param recommendation_additional_data: A bag of fields which extends the recommendation - information. - :type recommendation_additional_data: object - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'device_id': {'readonly': True}, - 'recommendation_type': {'readonly': True}, - 'discovered_time_utc': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, - 'recommendation_type': {'key': 'properties.recommendationType', 'type': 'str'}, - 'discovered_time_utc': {'key': 'properties.discoveredTimeUtc', 'type': 'str'}, - 'recommendation_additional_data': {'key': 'properties.recommendationAdditionalData', 'type': 'object'}, - } - - def __init__( - self, - *, - recommendation_additional_data: Optional[object] = None, - **kwargs - ): - super(IotRecommendation, self).__init__(**kwargs) - self.device_id = None - self.recommendation_type = None - self.discovered_time_utc = None - self.recommendation_additional_data = recommendation_additional_data - - -class IotRecommendationList(msrest.serialization.Model): - """List of IoT recommendations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List data. - :vartype value: list[~azure.mgmt.security.models.IotRecommendation] - :ivar next_link: When available, follow the URI to get the next page of data. - :vartype next_link: str - :ivar total_count: Total count of recommendations that conforms with the given filter options - (not affected by page size). - :vartype total_count: int - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - 'total_count': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotRecommendation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'total_count': {'key': 'totalCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(IotRecommendationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - self.total_count = None + self.onboarding_kind = onboarding_kind + self.evaluation_end_time = None class IotRecommendationListModel(msrest.serialization.Model): @@ -5252,7 +5594,7 @@ class IotRecommendationModel(Resource): :vartype discovered_time_utc: str :param recommendation_additional_data: A bag of fields which extends the recommendation information. - :type recommendation_additional_data: object + :type recommendation_additional_data: any """ _validation = { @@ -5277,7 +5619,7 @@ class IotRecommendationModel(Resource): def __init__( self, *, - recommendation_additional_data: Optional[object] = None, + recommendation_additional_data: Optional[Any] = None, **kwargs ): super(IotRecommendationModel, self).__init__(**kwargs) @@ -5437,7 +5779,7 @@ class IoTSecurityAggregatedAlert(Resource, TagsResource): :ivar description: Description of the suspected vulnerability and meaning. :vartype description: str :ivar count: Number of alerts occurrences within the aggregated time window. - :vartype count: int + :vartype count: long :ivar effected_resource_type: Azure resource ID of the resource that received the alerts. :vartype effected_resource_type: str :ivar system_source: The type of the alerted resource (Azure, Non-Azure). @@ -5483,7 +5825,7 @@ class IoTSecurityAggregatedAlert(Resource, TagsResource): 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'count': {'key': 'properties.count', 'type': 'int'}, + 'count': {'key': 'properties.count', 'type': 'long'}, 'effected_resource_type': {'key': 'properties.effectedResourceType', 'type': 'str'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, @@ -5573,7 +5915,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(msrest.serializatio :ivar device_id: Name of the device. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long :ivar last_occurrence: Most recent time this alert was raised for this device, on this day. :vartype last_occurrence: str """ @@ -5586,7 +5928,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(msrest.serializatio _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, 'last_occurrence': {'key': 'lastOccurrence', 'type': 'str'}, } @@ -5629,9 +5971,9 @@ class IoTSecurityAggregatedRecommendation(Resource, TagsResource): "Informational", "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar healthy_devices: Number of healthy devices within the IoT Security solution. - :vartype healthy_devices: int + :vartype healthy_devices: long :ivar unhealthy_device_count: Number of unhealthy devices within the IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar log_analytics_query: Log analytics query for getting the list of affected devices/alerts. :vartype log_analytics_query: str """ @@ -5663,8 +6005,8 @@ class IoTSecurityAggregatedRecommendation(Resource, TagsResource): 'detected_by': {'key': 'properties.detectedBy', 'type': 'str'}, 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, - 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'int'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'healthy_devices': {'key': 'properties.healthyDevices', 'type': 'long'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'log_analytics_query': {'key': 'properties.logAnalyticsQuery', 'type': 'str'}, } @@ -5745,7 +6087,7 @@ class IoTSecurityAlertedDevice(msrest.serialization.Model): :ivar device_id: Device identifier. :vartype device_id: str :ivar alerts_count: Number of alerts raised for this device. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -5755,7 +6097,7 @@ class IoTSecurityAlertedDevice(msrest.serialization.Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__( @@ -5778,7 +6120,7 @@ class IoTSecurityDeviceAlert(msrest.serialization.Model): "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar alerts_count: Number of alerts raised for this alert type. - :vartype alerts_count: int + :vartype alerts_count: long """ _validation = { @@ -5790,7 +6132,7 @@ class IoTSecurityDeviceAlert(msrest.serialization.Model): _attribute_map = { 'alert_display_name': {'key': 'alertDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__( @@ -5814,7 +6156,7 @@ class IoTSecurityDeviceRecommendation(msrest.serialization.Model): "Informational", "Low", "Medium", "High". :vartype reported_severity: str or ~azure.mgmt.security.models.ReportedSeverity :ivar devices_count: Number of devices with this recommendation. - :vartype devices_count: int + :vartype devices_count: long """ _validation = { @@ -5826,7 +6168,7 @@ class IoTSecurityDeviceRecommendation(msrest.serialization.Model): _attribute_map = { 'recommendation_display_name': {'key': 'recommendationDisplayName', 'type': 'str'}, 'reported_severity': {'key': 'reportedSeverity', 'type': 'str'}, - 'devices_count': {'key': 'devicesCount', 'type': 'int'}, + 'devices_count': {'key': 'devicesCount', 'type': 'long'}, } def __init__( @@ -5853,7 +6195,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :ivar metrics: Security analytics of your IoT Security solution. :vartype metrics: ~azure.mgmt.security.models.IoTSeverityMetrics :ivar unhealthy_device_count: Number of unhealthy devices within your IoT Security solution. - :vartype unhealthy_device_count: int + :vartype unhealthy_device_count: long :ivar devices_metrics: List of device metrics by the aggregation date. :vartype devices_metrics: list[~azure.mgmt.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem] @@ -5881,7 +6223,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'metrics': {'key': 'properties.metrics', 'type': 'IoTSeverityMetrics'}, - 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'int'}, + 'unhealthy_device_count': {'key': 'properties.unhealthyDeviceCount', 'type': 'long'}, 'devices_metrics': {'key': 'properties.devicesMetrics', 'type': '[IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem]'}, 'top_alerted_devices': {'key': 'properties.topAlertedDevices', 'type': '[IoTSecurityAlertedDevice]'}, 'most_prevalent_device_alerts': {'key': 'properties.mostPrevalentDeviceAlerts', 'type': '[IoTSecurityDeviceAlert]'}, @@ -5981,6 +6323,9 @@ class IoTSecuritySolutionModel(Resource, TagsResource): :vartype type: str :param location: The resource location. :type location: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.security.models.SystemData :param workspace: Workspace resource ID. :type workspace: str :param display_name: Resource display name. @@ -6008,12 +6353,15 @@ class IoTSecuritySolutionModel(Resource, TagsResource): :param unmasked_ip_logging_status: Unmasked IP address logging status. Possible values include: "Disabled", "Enabled". Default value: "Disabled". :type unmasked_ip_logging_status: str or ~azure.mgmt.security.models.UnmaskedIpLoggingStatus + :param additional_workspaces: List of additional workspaces. + :type additional_workspaces: list[~azure.mgmt.security.models.AdditionalWorkspacesProperties] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'auto_discovered_resources': {'readonly': True}, } @@ -6023,6 +6371,7 @@ class IoTSecuritySolutionModel(Resource, TagsResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'workspace': {'key': 'properties.workspace', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, @@ -6033,6 +6382,7 @@ class IoTSecuritySolutionModel(Resource, TagsResource): 'auto_discovered_resources': {'key': 'properties.autoDiscoveredResources', 'type': '[str]'}, 'recommendations_configuration': {'key': 'properties.recommendationsConfiguration', 'type': '[RecommendationConfigurationProperties]'}, 'unmasked_ip_logging_status': {'key': 'properties.unmaskedIpLoggingStatus', 'type': 'str'}, + 'additional_workspaces': {'key': 'properties.additionalWorkspaces', 'type': '[AdditionalWorkspacesProperties]'}, } def __init__( @@ -6049,11 +6399,13 @@ def __init__( user_defined_resources: Optional["UserDefinedResourcesProperties"] = None, recommendations_configuration: Optional[List["RecommendationConfigurationProperties"]] = None, unmasked_ip_logging_status: Optional[Union[str, "UnmaskedIpLoggingStatus"]] = "Disabled", + additional_workspaces: Optional[List["AdditionalWorkspacesProperties"]] = None, **kwargs ): super(IoTSecuritySolutionModel, self).__init__(tags=tags, **kwargs) self.tags = tags self.location = location + self.system_data = None self.workspace = workspace self.display_name = display_name self.status = status @@ -6064,10 +6416,12 @@ def __init__( self.auto_discovered_resources = None self.recommendations_configuration = recommendations_configuration self.unmasked_ip_logging_status = unmasked_ip_logging_status + self.additional_workspaces = additional_workspaces self.id = None self.name = None self.type = None self.location = location + self.system_data = None self.workspace = workspace self.display_name = display_name self.status = status @@ -6078,6 +6432,7 @@ def __init__( self.auto_discovered_resources = None self.recommendations_configuration = recommendations_configuration self.unmasked_ip_logging_status = unmasked_ip_logging_status + self.additional_workspaces = additional_workspaces class IoTSecuritySolutionsList(msrest.serialization.Model): @@ -6172,6 +6527,8 @@ class IotSensorsModel(Resource): :vartype ti_version: str :param zone: Zone of the IoT sensor. :type zone: str + :param sensor_type: Type of sensor. Possible values include: "Ot", "Enterprise". + :type sensor_type: str or ~azure.mgmt.security.models.SensorType """ _validation = { @@ -6202,6 +6559,7 @@ class IotSensorsModel(Resource): 'ti_status': {'key': 'properties.tiStatus', 'type': 'str'}, 'ti_version': {'key': 'properties.tiVersion', 'type': 'str'}, 'zone': {'key': 'properties.zone', 'type': 'str'}, + 'sensor_type': {'key': 'properties.sensorType', 'type': 'str'}, } def __init__( @@ -6209,6 +6567,7 @@ def __init__( *, ti_automatic_updates: Optional[bool] = None, zone: Optional[str] = None, + sensor_type: Optional[Union[str, "SensorType"]] = None, **kwargs ): super(IotSensorsModel, self).__init__(**kwargs) @@ -6222,23 +6581,24 @@ def __init__( self.ti_status = None self.ti_version = None self.zone = zone + self.sensor_type = sensor_type class IoTSeverityMetrics(msrest.serialization.Model): """IoT Security solution analytics severity metrics. :param high: Count of high severity alerts/recommendations. - :type high: int + :type high: long :param medium: Count of medium severity alerts/recommendations. - :type medium: int + :type medium: long :param low: Count of low severity alerts/recommendations. - :type low: int + :type low: long """ _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__( @@ -7177,7 +7537,7 @@ class OnPremiseIotSensor(Resource): :ivar type: Resource type. :vartype type: str :param properties: On-premise IoT sensor properties. - :type properties: object + :type properties: any """ _validation = { @@ -7196,7 +7556,7 @@ class OnPremiseIotSensor(Resource): def __init__( self, *, - properties: Optional[object] = None, + properties: Optional[Any] = None, **kwargs ): super(OnPremiseIotSensor, self).__init__(**kwargs) @@ -9009,7 +9369,7 @@ class ScopeElement(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :param field: The alert entity type to suppress by. :type field: str """ @@ -9022,7 +9382,7 @@ class ScopeElement(msrest.serialization.Model): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, field: Optional[str] = None, **kwargs ): @@ -9392,8 +9752,6 @@ class SecurityAssessment(Resource): :type resource_details: ~azure.mgmt.security.models.ResourceDetails :ivar display_name: User friendly display name of the assessment. :vartype display_name: str - :param status: The result of the assessment. - :type status: ~azure.mgmt.security.models.AssessmentStatus :param additional_data: Additional data regarding the assessment. :type additional_data: dict[str, str] :ivar links: Links relevant to the assessment. @@ -9402,6 +9760,8 @@ class SecurityAssessment(Resource): :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties :param partners_data: Data regarding 3rd party partner integration. :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatus """ _validation = { @@ -9418,31 +9778,31 @@ class SecurityAssessment(Resource): 'type': {'key': 'type', 'type': 'str'}, 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatus'}, } def __init__( self, *, resource_details: Optional["ResourceDetails"] = None, - status: Optional["AssessmentStatus"] = None, additional_data: Optional[Dict[str, str]] = None, metadata: Optional["SecurityAssessmentMetadataProperties"] = None, partners_data: Optional["SecurityAssessmentPartnerData"] = None, + status: Optional["AssessmentStatus"] = None, **kwargs ): super(SecurityAssessment, self).__init__(**kwargs) self.resource_details = resource_details self.display_name = None - self.status = status self.additional_data = additional_data self.links = None self.metadata = metadata self.partners_data = partners_data + self.status = status class SecurityAssessmentList(msrest.serialization.Model): @@ -9451,7 +9811,7 @@ class SecurityAssessmentList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Collection of security assessments in this page. - :vartype value: list[~azure.mgmt.security.models.SecurityAssessment] + :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentResponse] :ivar next_link: The URI to fetch the next page. :vartype next_link: str """ @@ -9462,7 +9822,7 @@ class SecurityAssessmentList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityAssessment]'}, + 'value': {'key': 'value', 'type': '[SecurityAssessmentResponse]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9496,8 +9856,8 @@ class SecurityAssessmentMetadata(Resource): :param remediation_description: Human readable description of what you should do to mitigate this security issue. :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: The severity level of the assessment. Possible values include: "Low", "Medium", "High". :type severity: str or ~azure.mgmt.security.models.Severity @@ -9534,7 +9894,7 @@ class SecurityAssessmentMetadata(Resource): 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': '[str]'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, 'severity': {'key': 'properties.severity', 'type': 'str'}, 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, @@ -9550,7 +9910,7 @@ def __init__( display_name: Optional[str] = None, description: Optional[str] = None, remediation_description: Optional[str] = None, - category: Optional[List[Union[str, "Category"]]] = None, + categories: Optional[List[Union[str, "Categories"]]] = None, severity: Optional[Union[str, "Severity"]] = None, user_impact: Optional[Union[str, "UserImpact"]] = None, implementation_effort: Optional[Union[str, "ImplementationEffort"]] = None, @@ -9565,7 +9925,7 @@ def __init__( self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -9575,36 +9935,6 @@ def __init__( self.partner_data = partner_data -class SecurityAssessmentMetadataList(msrest.serialization.Model): - """List of security assessment metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: - :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentMetadata] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityAssessmentMetadata]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityAssessmentMetadataList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - class SecurityAssessmentMetadataPartnerData(msrest.serialization.Model): """Describes the partner that created the assessment. @@ -9661,8 +9991,8 @@ class SecurityAssessmentMetadataProperties(msrest.serialization.Model): :param remediation_description: Human readable description of what you should do to mitigate this security issue. :type remediation_description: str - :param category: - :type category: list[str or ~azure.mgmt.security.models.Category] + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] :param severity: Required. The severity level of the assessment. Possible values include: "Low", "Medium", "High". :type severity: str or ~azure.mgmt.security.models.Severity @@ -9696,7 +10026,7 @@ class SecurityAssessmentMetadataProperties(msrest.serialization.Model): 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, - 'category': {'key': 'category', 'type': '[str]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, 'severity': {'key': 'severity', 'type': 'str'}, 'user_impact': {'key': 'userImpact', 'type': 'str'}, 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, @@ -9714,7 +10044,7 @@ def __init__( assessment_type: Union[str, "AssessmentType"], description: Optional[str] = None, remediation_description: Optional[str] = None, - category: Optional[List[Union[str, "Category"]]] = None, + categories: Optional[List[Union[str, "Categories"]]] = None, user_impact: Optional[Union[str, "UserImpact"]] = None, implementation_effort: Optional[Union[str, "ImplementationEffort"]] = None, threats: Optional[List[Union[str, "Threats"]]] = None, @@ -9727,7 +10057,7 @@ def __init__( self.policy_definition_id = None self.description = description self.remediation_description = remediation_description - self.category = category + self.categories = categories self.severity = severity self.user_impact = user_impact self.implementation_effort = implementation_effort @@ -9737,115 +10067,623 @@ def __init__( self.partner_data = partner_data -class SecurityAssessmentPartnerData(msrest.serialization.Model): - """Data regarding 3rd party partner integration. +class SecurityAssessmentMetadataPropertiesResponse(SecurityAssessmentMetadataProperties): + """Describes properties of an assessment metadata response. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param partner_name: Required. Name of the company of the partner. - :type partner_name: str - :param secret: Required. secret to authenticate the partner - write only. - :type secret: str + :param display_name: Required. User friendly display name of the assessment. + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition that turns this + assessment calculation on. + :vartype policy_definition_id: str + :param description: Human readable description of the assessment. + :type description: str + :param remediation_description: Human readable description of what you should do to mitigate + this security issue. + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: Required. The severity level of the assessment. Possible values include: + "Low", "Medium", "High". + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values include: "Low", + "Moderate", "High". + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to remediate this assessment. + Possible values include: "Low", "Moderate", "High". + :type implementation_effort: str or ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status. + :type preview: bool + :param assessment_type: Required. BuiltIn if the assessment based on built-in Azure Policy + definition, Custom if the assessment based on custom Azure Policy definition. Possible values + include: "BuiltIn", "CustomPolicy", "CustomerManaged", "VerifiedPartner". + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: Describes the partner that created the assessment. + :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] """ _validation = { - 'partner_name': {'required': True}, - 'secret': {'required': True}, + 'display_name': {'required': True}, + 'policy_definition_id': {'readonly': True}, + 'severity': {'required': True}, + 'assessment_type': {'required': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, } _attribute_map = { - 'partner_name': {'key': 'partnerName', 'type': 'str'}, - 'secret': {'key': 'secret', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'remediation_description': {'key': 'remediationDescription', 'type': 'str'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'user_impact': {'key': 'userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'implementationEffort', 'type': 'str'}, + 'threats': {'key': 'threats', 'type': '[str]'}, + 'preview': {'key': 'preview', 'type': 'bool'}, + 'assessment_type': {'key': 'assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'plannedDeprecationDate', 'type': 'str'}, + 'tactics': {'key': 'tactics', 'type': '[str]'}, } def __init__( self, *, - partner_name: str, - secret: str, + display_name: str, + severity: Union[str, "Severity"], + assessment_type: Union[str, "AssessmentType"], + description: Optional[str] = None, + remediation_description: Optional[str] = None, + categories: Optional[List[Union[str, "Categories"]]] = None, + user_impact: Optional[Union[str, "UserImpact"]] = None, + implementation_effort: Optional[Union[str, "ImplementationEffort"]] = None, + threats: Optional[List[Union[str, "Threats"]]] = None, + preview: Optional[bool] = None, + partner_data: Optional["SecurityAssessmentMetadataPartnerData"] = None, + publish_dates: Optional["SecurityAssessmentMetadataPropertiesResponsePublishDates"] = None, + planned_deprecation_date: Optional[str] = None, + tactics: Optional[List[Union[str, "Tactics"]]] = None, **kwargs ): - super(SecurityAssessmentPartnerData, self).__init__(**kwargs) - self.partner_name = partner_name - self.secret = secret + super(SecurityAssessmentMetadataPropertiesResponse, self).__init__(display_name=display_name, description=description, remediation_description=remediation_description, categories=categories, severity=severity, user_impact=user_impact, implementation_effort=implementation_effort, threats=threats, preview=preview, assessment_type=assessment_type, partner_data=partner_data, **kwargs) + self.publish_dates = publish_dates + self.planned_deprecation_date = planned_deprecation_date + self.tactics = tactics -class SecurityContact(Resource): - """Contact details for security issues. +class SecurityAssessmentMetadataPropertiesResponsePublishDates(msrest.serialization.Model): + """SecurityAssessmentMetadataPropertiesResponsePublishDates. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param email: The email of this security contact. - :type email: str - :param phone: The phone number of this security contact. - :type phone: str - :param alert_notifications: Whether to send security alerts notifications to the security - contact. Possible values include: "On", "Off". - :type alert_notifications: str or ~azure.mgmt.security.models.AlertNotifications - :param alerts_to_admins: Whether to send security alerts notifications to subscription admins. - Possible values include: "On", "Off". - :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + :param ga: + :type ga: str + :param public: Required. + :type public: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'ga': {'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, + 'public': {'required': True, 'pattern': r'^([0-9]{2}/){2}[0-9]{4}$'}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'email': {'key': 'properties.email', 'type': 'str'}, - 'phone': {'key': 'properties.phone', 'type': 'str'}, - 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, - 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + 'ga': {'key': 'GA', 'type': 'str'}, + 'public': {'key': 'public', 'type': 'str'}, } def __init__( self, *, - email: Optional[str] = None, - phone: Optional[str] = None, - alert_notifications: Optional[Union[str, "AlertNotifications"]] = None, - alerts_to_admins: Optional[Union[str, "AlertsToAdmins"]] = None, + public: str, + ga: Optional[str] = None, **kwargs ): - super(SecurityContact, self).__init__(**kwargs) - self.email = email - self.phone = phone - self.alert_notifications = alert_notifications - self.alerts_to_admins = alerts_to_admins + super(SecurityAssessmentMetadataPropertiesResponsePublishDates, self).__init__(**kwargs) + self.ga = ga + self.public = public -class SecurityContactList(msrest.serialization.Model): - """List of security contacts response. +class SecurityAssessmentMetadataResponse(Resource): + """Security assessment metadata response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of security contacts. - :vartype value: list[~azure.mgmt.security.models.SecurityContact] - :ivar next_link: The URI to fetch the next page. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityContact]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: User friendly display name of the assessment. + :type display_name: str + :ivar policy_definition_id: Azure resource ID of the policy definition that turns this + assessment calculation on. + :vartype policy_definition_id: str + :param description: Human readable description of the assessment. + :type description: str + :param remediation_description: Human readable description of what you should do to mitigate + this security issue. + :type remediation_description: str + :param categories: + :type categories: list[str or ~azure.mgmt.security.models.Categories] + :param severity: The severity level of the assessment. Possible values include: "Low", + "Medium", "High". + :type severity: str or ~azure.mgmt.security.models.Severity + :param user_impact: The user impact of the assessment. Possible values include: "Low", + "Moderate", "High". + :type user_impact: str or ~azure.mgmt.security.models.UserImpact + :param implementation_effort: The implementation effort required to remediate this assessment. + Possible values include: "Low", "Moderate", "High". + :type implementation_effort: str or ~azure.mgmt.security.models.ImplementationEffort + :param threats: + :type threats: list[str or ~azure.mgmt.security.models.Threats] + :param preview: True if this assessment is in preview release status. + :type preview: bool + :param assessment_type: BuiltIn if the assessment based on built-in Azure Policy definition, + Custom if the assessment based on custom Azure Policy definition. Possible values include: + "BuiltIn", "CustomPolicy", "CustomerManaged", "VerifiedPartner". + :type assessment_type: str or ~azure.mgmt.security.models.AssessmentType + :param partner_data: Describes the partner that created the assessment. + :type partner_data: ~azure.mgmt.security.models.SecurityAssessmentMetadataPartnerData + :param publish_dates: + :type publish_dates: + ~azure.mgmt.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates + :param planned_deprecation_date: + :type planned_deprecation_date: str + :param tactics: + :type tactics: list[str or ~azure.mgmt.security.models.Tactics] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_definition_id': {'readonly': True}, + 'planned_deprecation_date': {'pattern': r'^[0-9]{2}/[0-9]{4}$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_description': {'key': 'properties.remediationDescription', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'user_impact': {'key': 'properties.userImpact', 'type': 'str'}, + 'implementation_effort': {'key': 'properties.implementationEffort', 'type': 'str'}, + 'threats': {'key': 'properties.threats', 'type': '[str]'}, + 'preview': {'key': 'properties.preview', 'type': 'bool'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, + 'publish_dates': {'key': 'properties.publishDates', 'type': 'SecurityAssessmentMetadataPropertiesResponsePublishDates'}, + 'planned_deprecation_date': {'key': 'properties.plannedDeprecationDate', 'type': 'str'}, + 'tactics': {'key': 'properties.tactics', 'type': '[str]'}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + description: Optional[str] = None, + remediation_description: Optional[str] = None, + categories: Optional[List[Union[str, "Categories"]]] = None, + severity: Optional[Union[str, "Severity"]] = None, + user_impact: Optional[Union[str, "UserImpact"]] = None, + implementation_effort: Optional[Union[str, "ImplementationEffort"]] = None, + threats: Optional[List[Union[str, "Threats"]]] = None, + preview: Optional[bool] = None, + assessment_type: Optional[Union[str, "AssessmentType"]] = None, + partner_data: Optional["SecurityAssessmentMetadataPartnerData"] = None, + publish_dates: Optional["SecurityAssessmentMetadataPropertiesResponsePublishDates"] = None, + planned_deprecation_date: Optional[str] = None, + tactics: Optional[List[Union[str, "Tactics"]]] = None, + **kwargs + ): + super(SecurityAssessmentMetadataResponse, self).__init__(**kwargs) + self.display_name = display_name + self.policy_definition_id = None + self.description = description + self.remediation_description = remediation_description + self.categories = categories + self.severity = severity + self.user_impact = user_impact + self.implementation_effort = implementation_effort + self.threats = threats + self.preview = preview + self.assessment_type = assessment_type + self.partner_data = partner_data + self.publish_dates = publish_dates + self.planned_deprecation_date = planned_deprecation_date + self.tactics = tactics + + +class SecurityAssessmentMetadataResponseList(msrest.serialization.Model): + """List of security assessment metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: + :vartype value: list[~azure.mgmt.security.models.SecurityAssessmentMetadataResponse] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityAssessmentMetadataResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SecurityAssessmentMetadataResponseList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SecurityAssessmentPartnerData(msrest.serialization.Model): + """Data regarding 3rd party partner integration. + + All required parameters must be populated in order to send to Azure. + + :param partner_name: Required. Name of the company of the partner. + :type partner_name: str + :param secret: Required. secret to authenticate the partner - write only. + :type secret: str + """ + + _validation = { + 'partner_name': {'required': True}, + 'secret': {'required': True}, + } + + _attribute_map = { + 'partner_name': {'key': 'partnerName', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + *, + partner_name: str, + secret: str, + **kwargs + ): + super(SecurityAssessmentPartnerData, self).__init__(**kwargs) + self.partner_name = partner_name + self.secret = secret + + +class SecurityAssessmentPropertiesBase(msrest.serialization.Model): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + } + + def __init__( + self, + *, + resource_details: "ResourceDetails", + additional_data: Optional[Dict[str, str]] = None, + metadata: Optional["SecurityAssessmentMetadataProperties"] = None, + partners_data: Optional["SecurityAssessmentPartnerData"] = None, + **kwargs + ): + super(SecurityAssessmentPropertiesBase, self).__init__(**kwargs) + self.resource_details = resource_details + self.display_name = None + self.additional_data = additional_data + self.links = None + self.metadata = metadata + self.partners_data = partners_data + + +class SecurityAssessmentProperties(SecurityAssessmentPropertiesBase): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatus + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'status', 'type': 'AssessmentStatus'}, + } + + def __init__( + self, + *, + resource_details: "ResourceDetails", + status: "AssessmentStatus", + additional_data: Optional[Dict[str, str]] = None, + metadata: Optional["SecurityAssessmentMetadataProperties"] = None, + partners_data: Optional["SecurityAssessmentPartnerData"] = None, + **kwargs + ): + super(SecurityAssessmentProperties, self).__init__(resource_details=resource_details, additional_data=additional_data, metadata=metadata, partners_data=partners_data, **kwargs) + self.status = status + + +class SecurityAssessmentPropertiesResponse(SecurityAssessmentPropertiesBase): + """Describes properties of an assessment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_details: Required. Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: Required. The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'resource_details': {'required': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'resource_details': {'key': 'resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'additional_data': {'key': 'additionalData', 'type': '{str}'}, + 'links': {'key': 'links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__( + self, + *, + resource_details: "ResourceDetails", + status: "AssessmentStatusResponse", + additional_data: Optional[Dict[str, str]] = None, + metadata: Optional["SecurityAssessmentMetadataProperties"] = None, + partners_data: Optional["SecurityAssessmentPartnerData"] = None, + **kwargs + ): + super(SecurityAssessmentPropertiesResponse, self).__init__(resource_details=resource_details, additional_data=additional_data, metadata=metadata, partners_data=partners_data, **kwargs) + self.status = status + + +class SecurityAssessmentResponse(Resource): + """Security assessment on a resource - response format. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param resource_details: Details of the resource that was assessed. + :type resource_details: ~azure.mgmt.security.models.ResourceDetails + :ivar display_name: User friendly display name of the assessment. + :vartype display_name: str + :param additional_data: Additional data regarding the assessment. + :type additional_data: dict[str, str] + :ivar links: Links relevant to the assessment. + :vartype links: ~azure.mgmt.security.models.AssessmentLinks + :param metadata: Describes properties of an assessment metadata. + :type metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadataProperties + :param partners_data: Data regarding 3rd party partner integration. + :type partners_data: ~azure.mgmt.security.models.SecurityAssessmentPartnerData + :param status: The result of the assessment. + :type status: ~azure.mgmt.security.models.AssessmentStatusResponse + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'links': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'resource_details': {'key': 'properties.resourceDetails', 'type': 'ResourceDetails'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'additional_data': {'key': 'properties.additionalData', 'type': '{str}'}, + 'links': {'key': 'properties.links', 'type': 'AssessmentLinks'}, + 'metadata': {'key': 'properties.metadata', 'type': 'SecurityAssessmentMetadataProperties'}, + 'partners_data': {'key': 'properties.partnersData', 'type': 'SecurityAssessmentPartnerData'}, + 'status': {'key': 'properties.status', 'type': 'AssessmentStatusResponse'}, + } + + def __init__( + self, + *, + resource_details: Optional["ResourceDetails"] = None, + additional_data: Optional[Dict[str, str]] = None, + metadata: Optional["SecurityAssessmentMetadataProperties"] = None, + partners_data: Optional["SecurityAssessmentPartnerData"] = None, + status: Optional["AssessmentStatusResponse"] = None, + **kwargs + ): + super(SecurityAssessmentResponse, self).__init__(**kwargs) + self.resource_details = resource_details + self.display_name = None + self.additional_data = additional_data + self.links = None + self.metadata = metadata + self.partners_data = partners_data + self.status = status + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param email: The email of this security contact. + :type email: str + :param phone: The phone number of this security contact. + :type phone: str + :param alert_notifications: Whether to send security alerts notifications to the security + contact. Possible values include: "On", "Off". + :type alert_notifications: str or ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Whether to send security alerts notifications to subscription admins. + Possible values include: "On", "Off". + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__( + self, + *, + email: Optional[str] = None, + phone: Optional[str] = None, + alert_notifications: Optional[Union[str, "AlertNotifications"]] = None, + alerts_to_admins: Optional[Union[str, "AlertsToAdmins"]] = None, + **kwargs + ): + super(SecurityContact, self).__init__(**kwargs) + self.email = email + self.phone = phone + self.alert_notifications = alert_notifications + self.alerts_to_admins = alerts_to_admins + + +class SecurityContactList(msrest.serialization.Model): + """List of security contacts response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of security contacts. + :vartype value: list[~azure.mgmt.security.models.SecurityContact] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SecurityContact]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + def __init__( self, **kwargs @@ -10276,7 +11114,7 @@ class SecurityTaskParameters(msrest.serialization.Model): :param additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, object] + :type additional_properties: dict[str, any] :ivar name: Name of the task type. :vartype name: str """ @@ -10293,7 +11131,7 @@ class SecurityTaskParameters(msrest.serialization.Model): def __init__( self, *, - additional_properties: Optional[Dict[str, object]] = None, + additional_properties: Optional[Dict[str, Any]] = None, **kwargs ): super(SecurityTaskParameters, self).__init__(**kwargs) @@ -10582,6 +11420,118 @@ def __init__( self.display_name = None +class Software(Resource): + """Represents a software data. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param device_id: Unique identifier for the virtual machine in the service. + :type device_id: str + :param os_platform: Platform of the operating system running on the device. + :type os_platform: str + :param vendor: Name of the software vendor. + :type vendor: str + :param software_name: Name of the software product. + :type software_name: str + :param version: Version number of the software product. + :type version: str + :param end_of_support_status: End of support status. Possible values include: "None", + "noLongerSupported", "versionNoLongerSupported", "upcomingNoLongerSupported", + "upcomingVersionNoLongerSupported". + :type end_of_support_status: str or ~azure.mgmt.security.models.EndOfSupportStatus + :param end_of_support_date: The end of support date in case the product is upcoming end of + support. + :type end_of_support_date: str + :param number_of_known_vulnerabilities: Number of weaknesses. + :type number_of_known_vulnerabilities: int + :param first_seen_at: First time that the software was seen in the device. + :type first_seen_at: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'device_id': {'key': 'properties.deviceId', 'type': 'str'}, + 'os_platform': {'key': 'properties.osPlatform', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'software_name': {'key': 'properties.softwareName', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'end_of_support_status': {'key': 'properties.endOfSupportStatus', 'type': 'str'}, + 'end_of_support_date': {'key': 'properties.endOfSupportDate', 'type': 'str'}, + 'number_of_known_vulnerabilities': {'key': 'properties.numberOfKnownVulnerabilities', 'type': 'int'}, + 'first_seen_at': {'key': 'properties.firstSeenAt', 'type': 'str'}, + } + + def __init__( + self, + *, + device_id: Optional[str] = None, + os_platform: Optional[str] = None, + vendor: Optional[str] = None, + software_name: Optional[str] = None, + version: Optional[str] = None, + end_of_support_status: Optional[Union[str, "EndOfSupportStatus"]] = None, + end_of_support_date: Optional[str] = None, + number_of_known_vulnerabilities: Optional[int] = None, + first_seen_at: Optional[str] = None, + **kwargs + ): + super(Software, self).__init__(**kwargs) + self.device_id = device_id + self.os_platform = os_platform + self.vendor = vendor + self.software_name = software_name + self.version = version + self.end_of_support_status = end_of_support_status + self.end_of_support_date = end_of_support_date + self.number_of_known_vulnerabilities = number_of_known_vulnerabilities + self.first_seen_at = first_seen_at + + +class SoftwaresList(msrest.serialization.Model): + """Represents the software inventory of the virtual machine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: + :type value: list[~azure.mgmt.security.models.Software] + :ivar next_link: The URI to fetch the next page. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Software]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Software"]] = None, + **kwargs + ): + super(SoftwaresList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + class SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -10691,6 +11641,54 @@ def __init__( self.all_of = all_of +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.security.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + class TopologyList(msrest.serialization.Model): """TopologyList. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py index 40f45a66e675..0d8dd6a0e987 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py @@ -53,6 +53,19 @@ class AdaptiveApplicationControlIssue(with_metaclass(_CaseInsensitiveEnumMeta, s EXECUTABLE_VIOLATIONS_AUDITED = "ExecutableViolationsAudited" RULES_VIOLATED_MANUALLY = "RulesViolatedManually" +class AdditionalWorkspaceDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Data types sent to workspace. + """ + + ALERTS = "Alerts" + RAW_EVENTS = "RawEvents" + +class AdditionalWorkspaceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Workspace type. + """ + + SENTINEL = "Sentinel" + class AlertIntent(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Kill chain related intent behind the alert. Could contain multiple enum values (separated by commas) @@ -79,8 +92,10 @@ class AlertNotifications(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Whether to send security alerts notifications to the security contact """ - ON = "On" #: Get notifications on new alerts. - OFF = "Off" #: Don't get notifications on new alerts. + #: Get notifications on new alerts. + ON = "On" + #: Don't get notifications on new alerts. + OFF = "Off" class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The severity of the alert @@ -95,16 +110,21 @@ class AlertStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The life cycle status of the alert. """ - ACTIVE = "Active" #: An alert which doesn't specify a value is assigned the status 'Active'. - RESOLVED = "Resolved" #: Alert closed after handling. - DISMISSED = "Dismissed" #: Alert dismissed as false positive. + #: An alert which doesn't specify a value is assigned the status 'Active'. + ACTIVE = "Active" + #: Alert closed after handling. + RESOLVED = "Resolved" + #: Alert dismissed as false positive. + DISMISSED = "Dismissed" class AlertsToAdmins(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Whether to send security alerts notifications to subscription admins """ - ON = "On" #: Send notification on new alerts to the subscription's admins. - OFF = "Off" #: Don't send notification on new alerts to the subscription's admins. + #: Send notification on new alerts to the subscription's admins. + ON = "On" + #: Don't send notification on new alerts to the subscription's admins. + OFF = "Off" class AssessedResourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Sub-assessment resource type @@ -118,37 +138,52 @@ class AssessmentStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Programmatic code for the status of the assessment """ - HEALTHY = "Healthy" #: The resource is healthy. - UNHEALTHY = "Unhealthy" #: The resource has a security issue that needs to be addressed. - NOT_APPLICABLE = "NotApplicable" #: Assessment for this resource did not happen. + #: The resource is healthy. + HEALTHY = "Healthy" + #: The resource has a security issue that needs to be addressed. + UNHEALTHY = "Unhealthy" + #: Assessment for this resource did not happen. + NOT_APPLICABLE = "NotApplicable" class AssessmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition """ - BUILT_IN = "BuiltIn" #: Azure Security Center managed assessments. - CUSTOM_POLICY = "CustomPolicy" #: User defined policies that are automatically ingested from Azure Policy to Azure Security Center. - CUSTOMER_MANAGED = "CustomerManaged" #: User assessments pushed directly by the user or other third party to Azure Security Center. - VERIFIED_PARTNER = "VerifiedPartner" #: An assessment that was created by a verified 3rd party if the user connected it to ASC. + #: Azure Security Center managed assessments. + BUILT_IN = "BuiltIn" + #: User defined policies that are automatically ingested from Azure Policy to Azure Security + #: Center. + CUSTOM_POLICY = "CustomPolicy" + #: User assessments pushed directly by the user or other third party to Azure Security Center. + CUSTOMER_MANAGED = "CustomerManaged" + #: An assessment that was created by a verified 3rd party if the user connected it to ASC. + VERIFIED_PARTNER = "VerifiedPartner" class AuthenticationProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """State of the multi-cloud connector """ - VALID = "Valid" #: Valid connector. - INVALID = "Invalid" #: Invalid connector. - EXPIRED = "Expired" #: the connection has expired. - INCORRECT_POLICY = "IncorrectPolicy" #: Incorrect policy of the connector. + #: Valid connector. + VALID = "Valid" + #: Invalid connector. + INVALID = "Invalid" + #: the connection has expired. + EXPIRED = "Expired" + #: Incorrect policy of the connector. + INCORRECT_POLICY = "IncorrectPolicy" class AuthenticationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. """ - AWS_CREDS = "awsCreds" #: AWS cloud account connector user credentials authentication. - AWS_ASSUME_ROLE = "awsAssumeRole" #: AWS account connector assume role authentication. - GCP_CREDENTIALS = "gcpCredentials" #: GCP account connector service to service authentication. + #: AWS cloud account connector user credentials authentication. + AWS_CREDS = "awsCreds" + #: AWS account connector assume role authentication. + AWS_ASSUME_ROLE = "awsAssumeRole" + #: GCP account connector service to service authentication. + GCP_CREDENTIALS = "gcpCredentials" class AuthorizationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Authorized state of the device. @@ -161,11 +196,26 @@ class AutoProvision(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes what kind of security agent provisioning action to take """ - ON = "On" #: Install missing security agent on VMs automatically. - OFF = "Off" #: Do not install security agent on the VMs automatically. + #: Install missing security agent on VMs automatically. + ON = "On" + #: Do not install security agent on the VMs automatically. + OFF = "Off" + +class BundleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Alert Simulator supported bundles. + """ + + APP_SERVICES = "AppServices" + DNS = "DNS" + KEY_VAULTS = "KeyVaults" + KUBERNETES_SERVICE = "KubernetesService" + RESOURCE_MANAGER = "ResourceManager" + SQL_SERVERS = "SqlServers" + STORAGE_ACCOUNTS = "StorageAccounts" + VIRTUAL_MACHINES = "VirtualMachines" -class Category(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The category of resource that is at risk when the assessment is unhealthy +class Categories(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The categories of resource that is at risk when the assessment is unhealthy """ COMPUTE = "Compute" @@ -193,12 +243,24 @@ class ControlType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of security control (for example, BuiltIn) """ - BUILT_IN = "BuiltIn" #: Azure Security Center managed assessments. - CUSTOM = "Custom" #: Non Azure Security Center managed assessments. + #: Azure Security Center managed assessments. + BUILT_IN = "BuiltIn" + #: Non Azure Security Center managed assessments. + CUSTOM = "Custom" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" class DataSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - TWIN_DATA = "TwinData" #: Devices twin data. + #: Devices twin data. + TWIN_DATA = "TwinData" class DeviceCriticality(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Device criticality. @@ -221,6 +283,16 @@ class Direction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INBOUND = "Inbound" OUTBOUND = "Outbound" +class EndOfSupportStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """End of support status. + """ + + NONE = "None" + NO_LONGER_SUPPORTED = "noLongerSupported" + VERSION_NO_LONGER_SUPPORTED = "versionNoLongerSupported" + UPCOMING_NO_LONGER_SUPPORTED = "upcomingNoLongerSupported" + UPCOMING_VERSION_NO_LONGER_SUPPORTED = "upcomingVersionNoLongerSupported" + class EnforcementMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The application control policy enforcement/protection mode of the machine group """ @@ -237,7 +309,7 @@ class EnforcementSupport(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NOT_SUPPORTED = "NotSupported" UNKNOWN = "Unknown" -class Enum15(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum13(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACTIVATE = "Activate" DISMISS = "Dismiss" @@ -245,15 +317,16 @@ class Enum15(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESOLVE = "Resolve" CLOSE = "Close" -class Enum17(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum15(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): EFFECTIVE = "effective" CUSTOM = "custom" -class Enum3(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum86(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MCAS = "MCAS" WDATP = "WDATP" + SENTINEL = "Sentinel" class EventSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """A valid event source type. @@ -263,20 +336,28 @@ class EventSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SUB_ASSESSMENTS = "SubAssessments" ALERTS = "Alerts" SECURE_SCORES = "SecureScores" + SECURE_SCORES_SNAPSHOT = "SecureScoresSnapshot" SECURE_SCORE_CONTROLS = "SecureScoreControls" + SECURE_SCORE_CONTROLS_SNAPSHOT = "SecureScoreControlsSnapshot" + REGULATORY_COMPLIANCE_ASSESSMENT = "RegulatoryComplianceAssessment" + REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT = "RegulatoryComplianceAssessmentSnapshot" class ExpandControlsEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DEFINITION = "definition" #: Add definition object for each control. + #: Add definition object for each control. + DEFINITION = "definition" class ExpandEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - LINKS = "links" #: All links associated with an assessment. - METADATA = "metadata" #: Assessment metadata. + #: All links associated with an assessment. + LINKS = "links" + #: Assessment metadata. + METADATA = "metadata" class ExportData(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - RAW_EVENTS = "RawEvents" #: Agent raw events. + #: Agent raw events. + RAW_EVENTS = "RawEvents" class ExternalSecuritySolutionKindEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The kind of the external solution @@ -301,9 +382,12 @@ class HybridComputeProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, st """State of the service principal and its secret """ - VALID = "Valid" #: Valid service principal details. - INVALID = "Invalid" #: Invalid service principal details. - EXPIRED = "Expired" #: the service principal details are expired. + #: Valid service principal details. + VALID = "Valid" + #: Invalid service principal details. + INVALID = "Invalid" + #: the service principal details are expired. + EXPIRED = "Expired" class ImplementationEffort(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The implementation effort required to remediate this assessment @@ -318,22 +402,65 @@ class Intent(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): of Azure Security Center's supported kill chain intents. """ - UNKNOWN = "Unknown" #: Unknown. - PRE_ATTACK = "PreAttack" #: PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in `MITRE Pre-Att&ck matrix `_. - INITIAL_ACCESS = "InitialAccess" #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. - PERSISTENCE = "Persistence" #: Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. - PRIVILEGE_ESCALATION = "PrivilegeEscalation" #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. - DEFENSE_EVASION = "DefenseEvasion" #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. - CREDENTIAL_ACCESS = "CredentialAccess" #: Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. - DISCOVERY = "Discovery" #: Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. - LATERAL_MOVEMENT = "LateralMovement" #: Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. - EXECUTION = "Execution" #: The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. - COLLECTION = "Collection" #: Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. - EXFILTRATION = "Exfiltration" #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. - COMMAND_AND_CONTROL = "CommandAndControl" #: The command and control tactic represents how adversaries communicate with systems under their control within a target network. - IMPACT = "Impact" #: Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. - PROBING = "Probing" #: Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. - EXPLOITATION = "Exploitation" #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. + #: Unknown. + UNKNOWN = "Unknown" + #: PreAttack could be either an attempt to access a certain resource regardless of a malicious + #: intent, or a failed attempt to gain access to a target system to gather information prior to + #: exploitation. This step is usually detected as an attempt, originating from outside the + #: network, to scan the target system and find a way in. Further details on the PreAttack stage + #: can be read in `MITRE Pre-Att&ck matrix `_. + PRE_ATTACK = "PreAttack" + #: InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. + INITIAL_ACCESS = "InitialAccess" + #: Persistence is any access, action, or configuration change to a system that gives a threat + #: actor a persistent presence on that system. + PERSISTENCE = "Persistence" + #: Privilege escalation is the result of actions that allow an adversary to obtain a higher level + #: of permissions on a system or network. + PRIVILEGE_ESCALATION = "PrivilegeEscalation" + #: Defense evasion consists of techniques an adversary may use to evade detection or avoid other + #: defenses. + DEFENSE_EVASION = "DefenseEvasion" + #: Credential access represents techniques resulting in access to or control over system, domain, + #: or service credentials that are used within an enterprise environment. + CREDENTIAL_ACCESS = "CredentialAccess" + #: Discovery consists of techniques that allow the adversary to gain knowledge about the system + #: and internal network. + DISCOVERY = "Discovery" + #: Lateral movement consists of techniques that enable an adversary to access and control remote + #: systems on a network and could, but does not necessarily, include execution of tools on remote + #: systems. + LATERAL_MOVEMENT = "LateralMovement" + #: The execution tactic represents techniques that result in execution of adversary-controlled + #: code on a local or remote system. + EXECUTION = "Execution" + #: Collection consists of techniques used to identify and gather information, such as sensitive + #: files, from a target network prior to exfiltration. + COLLECTION = "Collection" + #: Exfiltration refers to techniques and attributes that result or aid in the adversary removing + #: files and information from a target network. + EXFILTRATION = "Exfiltration" + #: The command and control tactic represents how adversaries communicate with systems under their + #: control within a target network. + COMMAND_AND_CONTROL = "CommandAndControl" + #: Impact events primarily try to directly reduce the availability or integrity of a system, + #: service, or network; including manipulation of data to impact a business or operational + #: process. + IMPACT = "Impact" + #: Probing could be either an attempt to access a certain resource regardless of a malicious + #: intent, or a failed attempt to gain access to a target system to gather information prior to + #: exploitation. + PROBING = "Probing" + #: Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. + #: This stage is relevant for compute hosts and resources such as user accounts, certificates etc. + EXPLOITATION = "Exploitation" + +class KindEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of alert simulation. + """ + + #: Simulate alerts according to bundles. + BUNDLES = "Bundles" class MacSignificance(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates whether this is the primary secondary MAC address of the device @@ -349,29 +476,52 @@ class ManagementState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED = "Managed" UNMANAGED = "Unmanaged" +class OnboardingKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of onboarding for the subscription + """ + + DEFAULT = "Default" + MIGRATED_TO_AZURE = "MigratedToAzure" + EVALUATION = "Evaluation" + PURCHASED = "Purchased" + class Operator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. """ + #: Applies for decimal and non-decimal operands. EQUALS = "Equals" + #: Applies only for decimal operands. GREATER_THAN = "GreaterThan" + #: Applies only for decimal operands. GREATER_THAN_OR_EQUAL_TO = "GreaterThanOrEqualTo" + #: Applies only for decimal operands. LESSER_THAN = "LesserThan" + #: Applies only for decimal operands. LESSER_THAN_OR_EQUAL_TO = "LesserThanOrEqualTo" + #: Applies for decimal and non-decimal operands. NOT_EQUALS = "NotEquals" + #: Applies only for non-decimal operands. CONTAINS = "Contains" + #: Applies only for non-decimal operands. STARTS_WITH = "StartsWith" + #: Applies only for non-decimal operands. ENDS_WITH = "EndsWith" class PermissionProperty(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """A permission detected in the cloud account. """ - AWS_AWS_SECURITY_HUB_READ_ONLY_ACCESS = "AWS::AWSSecurityHubReadOnlyAccess" #: This permission provides read only access to AWS Security Hub resources. - AWS_SECURITY_AUDIT = "AWS::SecurityAudit" #: This permission grants access to read security configuration metadata. - AWS_AMAZON_SSM_AUTOMATION_ROLE = "AWS::AmazonSSMAutomationRole" #: The permission provides for EC2 Automation service to execute activities defined within Automation documents. - GCP_SECURITY_CENTER_ADMIN_VIEWER = "GCP::Security Center Admin Viewer" #: This permission provides read only access to GCP Security Command Center. + #: This permission provides read only access to AWS Security Hub resources. + AWS_AWS_SECURITY_HUB_READ_ONLY_ACCESS = "AWS::AWSSecurityHubReadOnlyAccess" + #: This permission grants access to read security configuration metadata. + AWS_SECURITY_AUDIT = "AWS::SecurityAudit" + #: The permission provides for EC2 Automation service to execute activities defined within + #: Automation documents. + AWS_AMAZON_SSM_AUTOMATION_ROLE = "AWS::AmazonSSMAutomationRole" + #: This permission provides read only access to GCP Security Command Center. + GCP_SECURITY_CENTER_ADMIN_VIEWER = "GCP::Security Center Admin Viewer" class PricingTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The pricing tier value. Azure Security Center is provided in two pricing tiers: free and @@ -379,8 +529,10 @@ class PricingTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): advanced security capabilities, while the free tier offers basic security features. """ - FREE = "Free" #: Get free Azure security center experience with basic security features. - STANDARD = "Standard" #: Get the standard Azure security center experience with advanced security features. + #: Get free Azure security center experience with basic security features. + FREE = "Free" + #: Get the standard Azure security center experience with advanced security features. + STANDARD = "Standard" class ProgrammingState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates whether this device is programming @@ -472,22 +624,50 @@ class RecommendationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of IoT Security recommendation. """ - IO_T_ACRAUTHENTICATION = "IoT_ACRAuthentication" #: Authentication schema used for pull an edge module from an ACR repository does not use Service Principal Authentication. - IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES = "IoT_AgentSendsUnutilizedMessages" #: IoT agent message size capacity is currently underutilized, causing an increase in the number of sent messages. Adjust message intervals for better utilization. - IO_T_BASELINE = "IoT_Baseline" #: Identified security related system configuration issues. - IO_T_EDGE_HUB_MEM_OPTIMIZE = "IoT_EdgeHubMemOptimize" #: You can optimize Edge Hub memory usage by turning off protocol heads for any protocols not used by Edge modules in your solution. - IO_T_EDGE_LOGGING_OPTIONS = "IoT_EdgeLoggingOptions" #: Logging is disabled for this edge module. - IO_T_INCONSISTENT_MODULE_SETTINGS = "IoT_InconsistentModuleSettings" #: A minority within a device security group has inconsistent Edge Module settings with the rest of their group. - IO_T_INSTALL_AGENT = "IoT_InstallAgent" #: Install the Azure Security of Things Agent. - IO_T_IPFILTER_DENY_ALL = "IoT_IPFilter_DenyAll" #: IP Filter Configuration should have rules defined for allowed traffic and should deny all other traffic by default. - IO_T_IPFILTER_PERMISSIVE_RULE = "IoT_IPFilter_PermissiveRule" #: An Allow IP Filter rules source IP range is too large. Overly permissive rules might expose your IoT hub to malicious intenders. - IO_T_OPEN_PORTS = "IoT_OpenPorts" #: A listening endpoint was found on the device. - IO_T_PERMISSIVE_FIREWALL_POLICY = "IoT_PermissiveFirewallPolicy" #: An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny all traffic by default and define rules to allow necessary communication to/from the device. - IO_T_PERMISSIVE_INPUT_FIREWALL_RULES = "IoT_PermissiveInputFirewallRules" #: A rule in the firewall has been found that contains a permissive pattern for a wide range of IP addresses or Ports. - IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES = "IoT_PermissiveOutputFirewallRules" #: A rule in the firewall has been found that contains a permissive pattern for a wide range of IP addresses or Ports. - IO_T_PRIVILEGED_DOCKER_OPTIONS = "IoT_PrivilegedDockerOptions" #: Edge module is configured to run in privileged mode, with extensive Linux capabilities or with host-level network access (send/receive data to host machine). - IO_T_SHARED_CREDENTIALS = "IoT_SharedCredentials" #: Same authentication credentials to the IoT Hub used by multiple devices. This could indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device impersonation by an attacker. - IO_T_VULNERABLE_TLS_CIPHER_SUITE = "IoT_VulnerableTLSCipherSuite" #: Insecure TLS configurations detected. Immediate upgrade recommended. + #: Authentication schema used for pull an edge module from an ACR repository does not use Service + #: Principal Authentication. + IO_T_ACRAUTHENTICATION = "IoT_ACRAuthentication" + #: IoT agent message size capacity is currently underutilized, causing an increase in the number + #: of sent messages. Adjust message intervals for better utilization. + IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES = "IoT_AgentSendsUnutilizedMessages" + #: Identified security related system configuration issues. + IO_T_BASELINE = "IoT_Baseline" + #: You can optimize Edge Hub memory usage by turning off protocol heads for any protocols not used + #: by Edge modules in your solution. + IO_T_EDGE_HUB_MEM_OPTIMIZE = "IoT_EdgeHubMemOptimize" + #: Logging is disabled for this edge module. + IO_T_EDGE_LOGGING_OPTIONS = "IoT_EdgeLoggingOptions" + #: A minority within a device security group has inconsistent Edge Module settings with the rest + #: of their group. + IO_T_INCONSISTENT_MODULE_SETTINGS = "IoT_InconsistentModuleSettings" + #: Install the Azure Security of Things Agent. + IO_T_INSTALL_AGENT = "IoT_InstallAgent" + #: IP Filter Configuration should have rules defined for allowed traffic and should deny all other + #: traffic by default. + IO_T_IPFILTER_DENY_ALL = "IoT_IPFilter_DenyAll" + #: An Allow IP Filter rules source IP range is too large. Overly permissive rules might expose + #: your IoT hub to malicious intenders. + IO_T_IPFILTER_PERMISSIVE_RULE = "IoT_IPFilter_PermissiveRule" + #: A listening endpoint was found on the device. + IO_T_OPEN_PORTS = "IoT_OpenPorts" + #: An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny all traffic by + #: default and define rules to allow necessary communication to/from the device. + IO_T_PERMISSIVE_FIREWALL_POLICY = "IoT_PermissiveFirewallPolicy" + #: A rule in the firewall has been found that contains a permissive pattern for a wide range of IP + #: addresses or Ports. + IO_T_PERMISSIVE_INPUT_FIREWALL_RULES = "IoT_PermissiveInputFirewallRules" + #: A rule in the firewall has been found that contains a permissive pattern for a wide range of IP + #: addresses or Ports. + IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES = "IoT_PermissiveOutputFirewallRules" + #: Edge module is configured to run in privileged mode, with extensive Linux capabilities or with + #: host-level network access (send/receive data to host machine). + IO_T_PRIVILEGED_DOCKER_OPTIONS = "IoT_PrivilegedDockerOptions" + #: Same authentication credentials to the IoT Hub used by multiple devices. This could indicate an + #: illegitimate device impersonating a legitimate device. It also exposes the risk of device + #: impersonation by an attacker. + IO_T_SHARED_CREDENTIALS = "IoT_SharedCredentials" + #: Insecure TLS configurations detected. Immediate upgrade recommended. + IO_T_VULNERABLE_TLS_CIPHER_SUITE = "IoT_VulnerableTLSCipherSuite" class RelationToIpStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates whether the relation of the mac to the ip address is certain or a guess @@ -517,20 +697,29 @@ class ResourceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The status of the resource regarding a single assessment """ - HEALTHY = "Healthy" #: This assessment on the resource is healthy. - NOT_APPLICABLE = "NotApplicable" #: This assessment is not applicable to this resource. - OFF_BY_POLICY = "OffByPolicy" #: This assessment is turned off by policy on this subscription. - NOT_HEALTHY = "NotHealthy" #: This assessment on the resource is not healthy. + #: This assessment on the resource is healthy. + HEALTHY = "Healthy" + #: This assessment is not applicable to this resource. + NOT_APPLICABLE = "NotApplicable" + #: This assessment is turned off by policy on this subscription. + OFF_BY_POLICY = "OffByPolicy" + #: This assessment on the resource is not healthy. + NOT_HEALTHY = "NotHealthy" class RuleSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The rule severity. """ - HIGH = "High" #: High. - MEDIUM = "Medium" #: Medium. - LOW = "Low" #: Low. - INFORMATIONAL = "Informational" #: Informational. - OBSOLETE = "Obsolete" #: Obsolete. + #: High. + HIGH = "High" + #: Medium. + MEDIUM = "Medium" + #: Low. + LOW = "Low" + #: Informational. + INFORMATIONAL = "Informational" + #: Obsolete. + OBSOLETE = "Obsolete" class RuleState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Possible states of the rule @@ -544,18 +733,25 @@ class RuleStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The rule result status. """ - NON_FINDING = "NonFinding" #: NonFinding. - FINDING = "Finding" #: Finding. - INTERNAL_ERROR = "InternalError" #: InternalError. + #: NonFinding. + NON_FINDING = "NonFinding" + #: Finding. + FINDING = "Finding" + #: InternalError. + INTERNAL_ERROR = "InternalError" class RuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The rule type. """ - BINARY = "Binary" #: Binary. - BASELINE_EXPECTED = "BaselineExpected" #: BaselineExpected. - POSITIVE_LIST = "PositiveList" #: PositiveList. - NEGATIVE_LIST = "NegativeList" #: NegativeList. + #: Binary. + BINARY = "Binary" + #: BaselineExpected. + BASELINE_EXPECTED = "BaselineExpected" + #: PositiveList. + POSITIVE_LIST = "PositiveList" + #: NegativeList. + NEGATIVE_LIST = "NegativeList" class ScanningFunctionality(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates whether the device is a scanner @@ -568,17 +764,23 @@ class ScanState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scan status. """ - FAILED = "Failed" #: Failed. - FAILED_TO_RUN = "FailedToRun" #: FailedToRun. - IN_PROGRESS = "InProgress" #: InProgress. - PASSED = "Passed" #: Passed. + #: Failed. + FAILED = "Failed" + #: FailedToRun. + FAILED_TO_RUN = "FailedToRun" + #: InProgress. + IN_PROGRESS = "InProgress" + #: Passed. + PASSED = "Passed" class ScanTriggerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scan trigger type. """ - ON_DEMAND = "OnDemand" #: OnDemand. - RECURRING = "Recurring" #: Recurring. + #: OnDemand. + ON_DEMAND = "OnDemand" + #: Recurring. + RECURRING = "Recurring" class SecurityFamily(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The security family of the discovered solution @@ -604,6 +806,13 @@ class SensorStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DISCONNECTED = "Disconnected" UNAVAILABLE = "Unavailable" +class SensorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of sensor + """ + + OT = "Ot" + ENTERPRISE = "Enterprise" + class ServerVulnerabilityAssessmentPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioningState of the vulnerability assessment capability on the VM """ @@ -615,11 +824,12 @@ class ServerVulnerabilityAssessmentPropertiesProvisioningState(with_metaclass(_C DEPROVISIONING = "Deprovisioning" class SettingKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """the kind of the settings string (DataExportSettings) + """the kind of the settings string """ DATA_EXPORT_SETTINGS = "DataExportSettings" ALERT_SUPPRESSION_SETTING = "AlertSuppressionSetting" + ALERT_SYNC_SETTINGS = "AlertSyncSettings" class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sub-assessment severity level @@ -633,9 +843,12 @@ class Source(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The platform where the assessed resource resides """ - AZURE = "Azure" #: Resource is in Azure. - ON_PREMISE = "OnPremise" #: Resource in an on premise machine connected to Azure cloud. - ON_PREMISE_SQL = "OnPremiseSql" #: SQL Resource in an on premise machine connected to Azure cloud. + #: Resource is in Azure. + AZURE = "Azure" + #: Resource in an on premise machine connected to Azure cloud. + ON_PREMISE = "OnPremise" + #: SQL Resource in an on premise machine connected to Azure cloud. + ON_PREMISE_SQL = "OnPremiseSql" class SourceSystem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The source type of the machine group @@ -651,10 +864,15 @@ class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Aggregative state based on the standard's supported controls states """ - PASSED = "Passed" #: All supported regulatory compliance controls in the given standard have a passed state. - FAILED = "Failed" #: At least one supported regulatory compliance control in the given standard has a state of failed. - SKIPPED = "Skipped" #: All supported regulatory compliance controls in the given standard have a state of skipped. - UNSUPPORTED = "Unsupported" #: No supported regulatory compliance data for the given standard. + #: All supported regulatory compliance controls in the given standard have a passed state. + PASSED = "Passed" + #: At least one supported regulatory compliance control in the given standard has a state of + #: failed. + FAILED = "Failed" + #: All supported regulatory compliance controls in the given standard have a state of skipped. + SKIPPED = "Skipped" + #: No supported regulatory compliance data for the given standard. + UNSUPPORTED = "Unsupported" class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The status of the port @@ -675,9 +893,31 @@ class SubAssessmentStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum """Programmatic code for the status of the assessment """ - HEALTHY = "Healthy" #: The resource is healthy. - UNHEALTHY = "Unhealthy" #: The resource has a security issue that needs to be addressed. - NOT_APPLICABLE = "NotApplicable" #: Assessment for this resource did not happen. + #: The resource is healthy. + HEALTHY = "Healthy" + #: The resource has a security issue that needs to be addressed. + UNHEALTHY = "Unhealthy" + #: Assessment for this resource did not happen. + NOT_APPLICABLE = "NotApplicable" + +class Tactics(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tactic of the assessment + """ + + RECONNAISSANCE = "reconnaissance" + RESOURCE_DEVELOPMENT = "resourceDevelopment" + INITIAL_ACCESS = "initialAccess" + EXECUTION = "execution" + PERSISTENCE = "persistence" + PRIVILEGE_ESCALATION = "privilegeEscalation" + DEFENSE_EVASION = "defenseEvasion" + CREDENTIAL_ACCESS = "credentialAccess" + DISCOVERY = "discovery" + LATERAL_MOVEMENT = "lateralMovement" + COLLECTION = "collection" + COMMAND_AND_CONTROL = "commandAndControl" + EXFILTRATION = "exfiltration" + IMPACT = "impact" class Threats(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Threats impact of the assessment @@ -710,8 +950,10 @@ class UnmaskedIpLoggingStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum """Unmasked IP address logging status """ - DISABLED = "Disabled" #: Unmasked IP logging is disabled. - ENABLED = "Enabled" #: Unmasked IP logging is enabled. + #: Unmasked IP logging is disabled. + DISABLED = "Disabled" + #: Unmasked IP logging is enabled. + ENABLED = "Enabled" class UserImpact(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The user impact of the assessment @@ -725,8 +967,10 @@ class ValueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The value type of the items in the list. """ - IP_CIDR = "IpCidr" #: An IP range in CIDR format (e.g. '192.168.0.1/8'). - STRING = "String" #: Any string value. + #: An IP range in CIDR format (e.g. '192.168.0.1/8'). + IP_CIDR = "IpCidr" + #: Any string value. + STRING = "String" class VersionKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Kind of the version diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 1a08490429ea..ad9f762804ba 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -8,17 +8,12 @@ from ._compliance_results_operations import ComplianceResultsOperations from ._pricings_operations import PricingsOperations -from ._settings_operations import SettingsOperations from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations from ._device_security_groups_operations import DeviceSecurityGroupsOperations from ._iot_security_solution_operations import IotSecuritySolutionOperations from ._iot_security_solution_analytics_operations import IotSecuritySolutionAnalyticsOperations from ._iot_security_solutions_analytics_aggregated_alert_operations import IotSecuritySolutionsAnalyticsAggregatedAlertOperations from ._iot_security_solutions_analytics_recommendation_operations import IotSecuritySolutionsAnalyticsRecommendationOperations -from ._iot_alert_types_operations import IotAlertTypesOperations -from ._iot_alerts_operations import IotAlertsOperations -from ._iot_recommendation_types_operations import IotRecommendationTypesOperations -from ._iot_recommendations_operations import IotRecommendationsOperations from ._locations_operations import LocationsOperations from ._operations import Operations from ._tasks_operations import TasksOperations @@ -40,7 +35,6 @@ from ._adaptive_network_hardenings_operations import AdaptiveNetworkHardeningsOperations from ._allowed_connections_operations import AllowedConnectionsOperations from ._topology_operations import TopologyOperations -from ._alerts_operations import AlertsOperations from ._jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations from ._discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations from ._security_solutions_reference_data_operations import SecuritySolutionsReferenceDataOperations @@ -60,21 +54,24 @@ from ._device_operations import DeviceOperations from ._on_premise_iot_sensors_operations import OnPremiseIotSensorsOperations from ._iot_sites_operations import IotSitesOperations +from ._iot_alerts_operations import IotAlertsOperations +from ._iot_alert_types_operations import IotAlertTypesOperations +from ._iot_recommendations_operations import IotRecommendationsOperations +from ._iot_recommendation_types_operations import IotRecommendationTypesOperations +from ._alerts_operations import AlertsOperations +from ._settings_operations import SettingsOperations +from ._ingestion_settings_operations import IngestionSettingsOperations +from ._software_inventories_operations import SoftwareInventoriesOperations __all__ = [ 'ComplianceResultsOperations', 'PricingsOperations', - 'SettingsOperations', 'AdvancedThreatProtectionOperations', 'DeviceSecurityGroupsOperations', 'IotSecuritySolutionOperations', 'IotSecuritySolutionAnalyticsOperations', 'IotSecuritySolutionsAnalyticsAggregatedAlertOperations', 'IotSecuritySolutionsAnalyticsRecommendationOperations', - 'IotAlertTypesOperations', - 'IotAlertsOperations', - 'IotRecommendationTypesOperations', - 'IotRecommendationsOperations', 'LocationsOperations', 'Operations', 'TasksOperations', @@ -96,7 +93,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -116,4 +112,12 @@ 'DeviceOperations', 'OnPremiseIotSensorsOperations', 'IotSitesOperations', + 'IotAlertsOperations', + 'IotAlertTypesOperations', + 'IotRecommendationsOperations', + 'IotRecommendationTypesOperations', + 'AlertsOperations', + 'SettingsOperations', + 'IngestionSettingsOperations', + 'SoftwareInventoriesOperations', ] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_application_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_application_controls_operations.py index 47aba2c29d54..ff1fdae05480 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_application_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_application_controls_operations.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,17 +46,17 @@ def __init__(self, client, config, serializer, deserializer): def list( self, - include_path_recommendations=None, # type: Optional[Union[bool, "_models.Enum37"]] - summary=None, # type: Optional[Union[bool, "_models.Enum38"]] + include_path_recommendations=None, # type: Optional[bool] + summary=None, # type: Optional[bool] **kwargs # type: Any ): # type: (...) -> "_models.AdaptiveApplicationControlGroups" """Gets a list of application control machine groups for the subscription. :param include_path_recommendations: Include the policy rules. - :type include_path_recommendations: str or ~azure.mgmt.security.models.Enum37 + :type include_path_recommendations: bool :param summary: Return output in a summarized form. - :type summary: str or ~azure.mgmt.security.models.Enum38 + :type summary: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: AdaptiveApplicationControlGroups, or the result of cls(response) :rtype: ~azure.mgmt.security.models.AdaptiveApplicationControlGroups diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_network_hardenings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_network_hardenings_operations.py index ed081c4b27aa..9bb7da3b503f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_network_hardenings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_adaptive_network_hardenings_operations.py @@ -292,8 +292,8 @@ def begin_enforce( :type body: ~azure.mgmt.security.models.AdaptiveNetworkHardeningEnforceRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -326,6 +326,7 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) + adaptive_network_hardening_enforce_action = "enforce" path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py index 62932a6737f0..531b78365081 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_alerts_operations.py @@ -12,13 +12,15 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -133,7 +135,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -184,7 +186,7 @@ def get_next(next_link=None): ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} # type: ignore - def list_subscription_level_alerts_by_region( + def list_subscription_level_by_region( self, **kwargs # type: Any ): @@ -202,7 +204,7 @@ def list_subscription_level_alerts_by_region( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -212,7 +214,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_subscription_level_alerts_by_region.metadata['url'] # type: ignore + url = self.list_subscription_level_by_region.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -251,9 +253,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore + list_subscription_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore - def list_resource_group_level_alerts_by_region( + def list_resource_group_level_by_region( self, resource_group_name, # type: str **kwargs # type: Any @@ -275,7 +277,7 @@ def list_resource_group_level_alerts_by_region( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" def prepare_request(next_link=None): @@ -285,7 +287,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_resource_group_level_alerts_by_region.metadata['url'] # type: ignore + url = self.list_resource_group_level_by_region.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -325,9 +327,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore + list_resource_group_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} # type: ignore - def get_subscription_level_alert( + def get_subscription_level( self, alert_name, # type: str **kwargs # type: Any @@ -347,11 +349,11 @@ def get_subscription_level_alert( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.get_subscription_level_alert.metadata['url'] # type: ignore + url = self.get_subscription_level.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -381,9 +383,9 @@ def get_subscription_level_alert( return cls(pipeline_response, deserialized, {}) return deserialized - get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore + get_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore - def get_resource_group_level_alerts( + def get_resource_group_level( self, alert_name, # type: str resource_group_name, # type: str @@ -407,11 +409,11 @@ def get_resource_group_level_alerts( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.get_resource_group_level_alerts.metadata['url'] # type: ignore + url = self.get_resource_group_level.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -442,9 +444,9 @@ def get_resource_group_level_alerts( return cls(pipeline_response, deserialized, {}) return deserialized - get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore + get_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} # type: ignore - def update_subscription_level_alert_state_to_dismiss( + def update_subscription_level_state_to_dismiss( self, alert_name, # type: str **kwargs # type: Any @@ -464,11 +466,11 @@ def update_subscription_level_alert_state_to_dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_subscription_level_alert_state_to_dismiss.metadata['url'] # type: ignore + url = self.update_subscription_level_state_to_dismiss.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -495,7 +497,7 @@ def update_subscription_level_alert_state_to_dismiss( if cls: return cls(pipeline_response, None, {}) - update_subscription_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore + update_subscription_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore def update_subscription_level_state_to_resolve( self, @@ -517,7 +519,7 @@ def update_subscription_level_state_to_resolve( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -550,7 +552,7 @@ def update_subscription_level_state_to_resolve( update_subscription_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} # type: ignore - def update_subscription_level_alert_state_to_reactivate( + def update_subscription_level_state_to_activate( self, alert_name, # type: str **kwargs # type: Any @@ -570,11 +572,11 @@ def update_subscription_level_alert_state_to_reactivate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_subscription_level_alert_state_to_reactivate.metadata['url'] # type: ignore + url = self.update_subscription_level_state_to_activate.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -601,7 +603,7 @@ def update_subscription_level_alert_state_to_reactivate( if cls: return cls(pipeline_response, None, {}) - update_subscription_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + update_subscription_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore def update_resource_group_level_state_to_resolve( self, @@ -627,7 +629,7 @@ def update_resource_group_level_state_to_resolve( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL @@ -661,7 +663,7 @@ def update_resource_group_level_state_to_resolve( update_resource_group_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} # type: ignore - def update_resource_group_level_alert_state_to_dismiss( + def update_resource_group_level_state_to_dismiss( self, alert_name, # type: str resource_group_name, # type: str @@ -685,11 +687,11 @@ def update_resource_group_level_alert_state_to_dismiss( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_resource_group_level_alert_state_to_dismiss.metadata['url'] # type: ignore + url = self.update_resource_group_level_state_to_dismiss.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -717,9 +719,9 @@ def update_resource_group_level_alert_state_to_dismiss( if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} # type: ignore - def update_resource_group_level_alert_state_to_reactivate( + def update_resource_group_level_state_to_activate( self, alert_name, # type: str resource_group_name, # type: str @@ -743,11 +745,11 @@ def update_resource_group_level_alert_state_to_reactivate( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-01-01" accept = "application/json" # Construct URL - url = self.update_resource_group_level_alert_state_to_reactivate.metadata['url'] # type: ignore + url = self.update_resource_group_level_state_to_activate.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), @@ -775,4 +777,112 @@ def update_resource_group_level_alert_state_to_reactivate( if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + update_resource_group_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} # type: ignore + + def _simulate_initial( + self, + alert_simulator_request_body, # type: "_models.AlertSimulatorRequestBody" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._simulate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(alert_simulator_request_body, 'AlertSimulatorRequestBody') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _simulate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} # type: ignore + + def begin_simulate( + self, + alert_simulator_request_body, # type: "_models.AlertSimulatorRequestBody" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Simulate security alerts. + + :param alert_simulator_request_body: Alert Simulator Request Properties. + :type alert_simulator_request_body: ~azure.mgmt.security.models.AlertSimulatorRequestBody + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._simulate_initial( + alert_simulator_request_body=alert_simulator_request_body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self._config.asc_location", self._config.asc_location, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_simulate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py index df24fe791662..af5a532c0125 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_metadata_operations.py @@ -49,20 +49,20 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["_models.SecurityAssessmentMetadataList"] + # type: (...) -> Iterable["_models.SecurityAssessmentMetadataResponseList"] """Get metadata information on all assessment types. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList] + :return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -85,7 +85,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,22 +113,22 @@ def get( assessment_metadata_name, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.SecurityAssessmentMetadata" + # type: (...) -> "_models.SecurityAssessmentMetadataResponse" """Get metadata information on an assessment type. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. :type assessment_metadata_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -154,7 +154,7 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -166,20 +166,20 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["_models.SecurityAssessmentMetadataList"] + # type: (...) -> Iterable["_models.SecurityAssessmentMetadataResponseList"] """Get metadata information on all assessment types in a specific subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityAssessmentMetadataList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataList] + :return: An iterator like instance of either SecurityAssessmentMetadataResponseList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SecurityAssessmentMetadataResponseList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponseList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -206,7 +206,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityAssessmentMetadataList', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponseList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -234,22 +234,22 @@ def get_in_subscription( assessment_metadata_name, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.SecurityAssessmentMetadata" + # type: (...) -> "_models.SecurityAssessmentMetadataResponse" """Get metadata information on an assessment type in a specific subscription. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. :type assessment_metadata_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -276,7 +276,7 @@ def get_in_subscription( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -290,7 +290,7 @@ def create_in_subscription( assessment_metadata, # type: "_models.SecurityAssessmentMetadata" **kwargs # type: Any ): - # type: (...) -> "_models.SecurityAssessmentMetadata" + # type: (...) -> "_models.SecurityAssessmentMetadataResponse" """Create metadata information on an assessment type in a specific subscription. :param assessment_metadata_name: The Assessment Key - Unique key for the assessment type. @@ -298,16 +298,16 @@ def create_in_subscription( :param assessment_metadata: AssessmentMetadata object. :type assessment_metadata: ~azure.mgmt.security.models.SecurityAssessmentMetadata :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessmentMetadata, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadata + :return: SecurityAssessmentMetadataResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentMetadataResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadata"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentMetadataResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -339,7 +339,7 @@ def create_in_subscription( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessmentMetadata', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentMetadataResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -368,7 +368,7 @@ def delete_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py index 23b2f4f8b372..52997d7f4836 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_assessments_operations.py @@ -53,8 +53,8 @@ def list( # type: (...) -> Iterable["_models.SecurityAssessmentList"] """Get security assessments on all your scanned resources inside a scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -124,7 +124,7 @@ def get( expand=None, # type: Optional[Union[str, "_models.ExpandEnum"]] **kwargs # type: Any ): - # type: (...) -> "_models.SecurityAssessment" + # type: (...) -> "_models.SecurityAssessmentResponse" """Get a security assessment on your scanned resource. :param resource_id: The identifier of the resource. @@ -134,16 +134,16 @@ def get( :param expand: OData expand. Optional. :type expand: str or ~azure.mgmt.security.models.ExpandEnum :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessment, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessment + :return: SecurityAssessmentResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -172,7 +172,7 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -187,7 +187,7 @@ def create_or_update( assessment, # type: "_models.SecurityAssessment" **kwargs # type: Any ): - # type: (...) -> "_models.SecurityAssessment" + # type: (...) -> "_models.SecurityAssessmentResponse" """Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. @@ -198,16 +198,16 @@ def create_or_update( :param assessment: Calculated assessment on a pre-defined assessment metadata. :type assessment: ~azure.mgmt.security.models.SecurityAssessment :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityAssessment, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.SecurityAssessment + :return: SecurityAssessmentResponse, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.SecurityAssessmentResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessment"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityAssessmentResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -240,10 +240,10 @@ def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('SecurityAssessment', pipeline_response) + deserialized = self._deserialize('SecurityAssessmentResponse', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -275,7 +275,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliance_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliance_results_operations.py index ebb225f3cd7b..19c0725e83ec 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliance_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliance_results_operations.py @@ -53,8 +53,8 @@ def list( # type: (...) -> Iterable["_models.ComplianceResultList"] """Security compliance results in the subscription. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliances_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliances_operations.py index 95c66b7864a7..c8b529670f49 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliances_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_compliances_operations.py @@ -53,8 +53,8 @@ def list( # type: (...) -> Iterable["_models.ComplianceList"] """The Compliance scores of the specific management group. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -126,8 +126,8 @@ def get( # type: (...) -> "_models.Compliance" """Details of a specific Compliance. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param compliance_name: name of the Compliance. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py index a7ccd767f495..891af46bac01 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_information_protection_policies_operations.py @@ -48,18 +48,18 @@ def __init__(self, client, config, serializer, deserializer): def get( self, scope, # type: str - information_protection_policy_name, # type: Union[str, "_models.Enum17"] + information_protection_policy_name, # type: Union[str, "_models.Enum15"] **kwargs # type: Any ): # type: (...) -> "_models.InformationProtectionPolicy" """Details of the information protection policy. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param information_protection_policy_name: Name of the information protection policy. - :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum17 + :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum15 :keyword callable cls: A custom type or function that will be passed the direct response :return: InformationProtectionPolicy, or the result of cls(response) :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy @@ -108,19 +108,19 @@ def get( def create_or_update( self, scope, # type: str - information_protection_policy_name, # type: Union[str, "_models.Enum17"] + information_protection_policy_name, # type: Union[str, "_models.Enum15"] information_protection_policy, # type: "_models.InformationProtectionPolicy" **kwargs # type: Any ): # type: (...) -> "_models.InformationProtectionPolicy" """Details of the information protection policy. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param information_protection_policy_name: Name of the information protection policy. - :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum17 + :type information_protection_policy_name: str or ~azure.mgmt.security.models.Enum15 :param information_protection_policy: Information protection policy. :type information_protection_policy: ~azure.mgmt.security.models.InformationProtectionPolicy :keyword callable cls: A custom type or function that will be passed the direct response @@ -185,8 +185,8 @@ def list( # type: (...) -> Iterable["_models.InformationProtectionPolicyList"] """Information protection policies of a specific management group. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py new file mode 100644 index 000000000000..0e8366ffbd0e --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py @@ -0,0 +1,397 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IngestionSettingsOperations(object): + """IngestionSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.security.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IngestionSettingList"] + """Settings for ingesting security data and logs to correlate with resources associated with the + subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IngestionSettingList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.IngestionSettingList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSettingList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IngestionSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings'} # type: ignore + + def get( + self, + ingestion_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.IngestionSetting" + """Settings for ingesting security data and logs to correlate with resources associated with the + subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSetting, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + def create( + self, + ingestion_setting_name, # type: str + ingestion_setting, # type: "_models.IngestionSetting" + **kwargs # type: Any + ): + # type: (...) -> "_models.IngestionSetting" + """Create setting for ingesting security data and logs to correlate with resources associated with + the subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :param ingestion_setting: Ingestion setting object. + :type ingestion_setting: ~azure.mgmt.security.models.IngestionSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSetting, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSetting"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ingestion_setting, 'IngestionSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + def delete( + self, + ingestion_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the ingestion settings for this subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} # type: ignore + + def list_tokens( + self, + ingestion_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.IngestionSettingToken" + """Returns the token that is used for correlating ingested telemetry with the resources in the + subscription. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IngestionSettingToken, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.IngestionSettingToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IngestionSettingToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.list_tokens.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('IngestionSettingToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_tokens.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens'} # type: ignore + + def list_connection_strings( + self, + ingestion_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStrings" + """Connection strings for ingesting security scan logs and data. + + :param ingestion_setting_name: Name of the ingestion setting. + :type ingestion_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStrings, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.ConnectionStrings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStrings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-01-15-preview" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ingestionSettingName': self._serialize.url("ingestion_setting_name", ingestion_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStrings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py index aceaa428bf29..f7b22f012c3a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alert_types_operations.py @@ -46,18 +46,11 @@ def __init__(self, client, config, serializer, deserializer): def list( self, - resource_group_name, # type: str - solution_name, # type: str **kwargs # type: Any ): # type: (...) -> "_models.IotAlertTypeList" """List IoT alert types. - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IotAlertTypeList, or the result of cls(response) :rtype: ~azure.mgmt.security.models.IotAlertTypeList @@ -68,15 +61,13 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" + api_version = "2020-08-06-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -102,124 +93,9 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes'} # type: ignore + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} # type: ignore def get( - self, - resource_group_name, # type: str - solution_name, # type: str - iot_alert_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.IotAlertType" - """Get IoT alert type. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_alert_type_name: Name of the alert type. - :type iot_alert_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlertType, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlertType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlertType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}'} # type: ignore - - def list_at_subscription_scope( - self, - **kwargs # type: Any - ): - # type: (...) -> "_models.IotAlertTypeList" - """List IoT alert types. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlertTypeList, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlertTypeList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertTypeList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-06-preview" - accept = "application/json" - - # Construct URL - url = self.list_at_subscription_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlertTypeList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} # type: ignore - - def get_at_subscription_scope( self, iot_alert_type_name, # type: str **kwargs # type: Any @@ -243,7 +119,7 @@ def get_at_subscription_scope( accept = "application/json" # Construct URL - url = self.get_at_subscription_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotAlertTypeName': self._serialize.url("iot_alert_type_name", iot_alert_type_name, 'str'), @@ -272,4 +148,4 @@ def get_at_subscription_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py index dd1790ab48df..48b7dce519bf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_alerts_operations.py @@ -46,176 +46,6 @@ def __init__(self, client, config, serializer, deserializer): self._config = config def list( - self, - resource_group_name, # type: str - solution_name, # type: str - min_start_time_utc=None, # type: Optional[str] - max_start_time_utc=None, # type: Optional[str] - alert_type=None, # type: Optional[str] - compromised_entity=None, # type: Optional[str] - limit=None, # type: Optional[int] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.IotAlertList"] - """List IoT alerts. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param min_start_time_utc: Filter by minimum startTimeUtc (ISO 8601 format). - :type min_start_time_utc: str - :param max_start_time_utc: Filter by maximum startTimeUtc (ISO 8601 format). - :type max_start_time_utc: str - :param alert_type: Filter by alert type. - :type alert_type: str - :param compromised_entity: Filter by compromised device. - :type compromised_entity: str - :param limit: Limit the number of items returned in a single page. - :type limit: int - :param skip_token: Skip token used for pagination. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IotAlertList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.IotAlertList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlertList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if min_start_time_utc is not None: - query_parameters['startTimeUtc>'] = self._serialize.query("min_start_time_utc", min_start_time_utc, 'str') - if max_start_time_utc is not None: - query_parameters['startTimeUtc<'] = self._serialize.query("max_start_time_utc", max_start_time_utc, 'str') - if alert_type is not None: - query_parameters['alertType'] = self._serialize.query("alert_type", alert_type, 'str') - if compromised_entity is not None: - query_parameters['compromisedEntity'] = self._serialize.query("compromised_entity", compromised_entity, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('IotAlertList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts'} # type: ignore - - def get( - self, - resource_group_name, # type: str - solution_name, # type: str - iot_alert_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.IotAlert" - """Get IoT alert. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_alert_id: Id of the alert. - :type iot_alert_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotAlert, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotAlert - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotAlert"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotAlert', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}'} # type: ignore - - def list_at_scope( self, scope, # type: str min_start_time_utc=None, # type: Optional[str] @@ -268,7 +98,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_at_scope.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -320,9 +150,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} # type: ignore + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} # type: ignore - def get_at_scope( + def get( self, scope, # type: str iot_alert_id, # type: str @@ -351,7 +181,7 @@ def get_at_scope( accept = "application/json" # Construct URL - url = self.get_at_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str'), @@ -380,4 +210,4 @@ def get_at_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py index e34c25cd5f27..46e262417647 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendation_types_operations.py @@ -46,18 +46,11 @@ def __init__(self, client, config, serializer, deserializer): def list( self, - resource_group_name, # type: str - solution_name, # type: str **kwargs # type: Any ): # type: (...) -> "_models.IotRecommendationTypeList" """List IoT recommendation types. - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IotRecommendationTypeList, or the result of cls(response) :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList @@ -68,15 +61,13 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" + api_version = "2020-08-06-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -102,124 +93,9 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes'} # type: ignore + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} # type: ignore def get( - self, - resource_group_name, # type: str - solution_name, # type: str - iot_recommendation_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.IotRecommendationType" - """Get IoT recommendation type. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_recommendation_type_name: Name of the recommendation type. - :type iot_recommendation_type_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendationType, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendationType - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationType"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendationType', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore - - def list_at_subscription_scope( - self, - **kwargs # type: Any - ): - # type: (...) -> "_models.IotRecommendationTypeList" - """List IoT recommendation types. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendationTypeList, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationTypeList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-08-06-preview" - accept = "application/json" - - # Construct URL - url = self.list_at_subscription_scope.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendationTypeList', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} # type: ignore - - def get_at_subscription_scope( self, iot_recommendation_type_name, # type: str **kwargs # type: Any @@ -243,7 +119,7 @@ def get_at_subscription_scope( accept = "application/json" # Construct URL - url = self.get_at_subscription_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'iotRecommendationTypeName': self._serialize.url("iot_recommendation_type_name", iot_recommendation_type_name, 'str'), @@ -272,4 +148,4 @@ def get_at_subscription_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_subscription_scope.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py index ce81c51c1414..53931e90865f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_recommendations_operations.py @@ -46,166 +46,6 @@ def __init__(self, client, config, serializer, deserializer): self._config = config def list( - self, - resource_group_name, # type: str - solution_name, # type: str - recommendation_type=None, # type: Optional[str] - device_id=None, # type: Optional[str] - limit=None, # type: Optional[int] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.IotRecommendationList"] - """List IoT recommendations. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param recommendation_type: Filter by recommendation type. - :type recommendation_type: str - :param device_id: Filter by device id. - :type device_id: str - :param limit: Limit the number of items returned in a single page. - :type limit: int - :param skip_token: Skip token used for pagination. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IotRecommendationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.IotRecommendationList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendationList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if recommendation_type is not None: - query_parameters['recommendationType'] = self._serialize.query("recommendation_type", recommendation_type, 'str') - if device_id is not None: - query_parameters['deviceId'] = self._serialize.query("device_id", device_id, 'str') - if limit is not None: - query_parameters['$limit'] = self._serialize.query("limit", limit, 'int') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('IotRecommendationList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations'} # type: ignore - - def get( - self, - resource_group_name, # type: str - solution_name, # type: str - iot_recommendation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.IotRecommendation" - """Get IoT recommendation. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param solution_name: The name of the IoT Security solution. - :type solution_name: str - :param iot_recommendation_id: Id of the recommendation. - :type iot_recommendation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IotRecommendation, or the result of cls(response) - :rtype: ~azure.mgmt.security.models.IotRecommendation - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IotRecommendation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'solutionName': self._serialize.url("solution_name", solution_name, 'str'), - 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IotRecommendation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations/{iotRecommendationId}'} # type: ignore - - def list_at_scope( self, scope, # type: str recommendation_type=None, # type: Optional[str] @@ -249,7 +89,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_at_scope.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), } @@ -295,9 +135,9 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} # type: ignore + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} # type: ignore - def get_at_scope( + def get( self, scope, # type: str iot_recommendation_id, # type: str @@ -326,7 +166,7 @@ def get_at_scope( accept = "application/json" # Construct URL - url = self.get_at_scope.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str'), @@ -355,4 +195,4 @@ def get_at_scope( return cls(pipeline_response, deserialized, {}) return deserialized - get_at_scope.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} # type: ignore + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py index 0f89f5839393..8d66fb87767e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_server_vulnerability_assessment_operations.py @@ -11,13 +11,15 @@ from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -253,7 +255,7 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore - def delete( + def _delete_initial( self, resource_group_name, # type: str resource_namespace, # type: str @@ -262,22 +264,6 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Removing server vulnerability assessment from a resource. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. - :type resource_group_name: str - :param resource_namespace: The Namespace of the resource. - :type resource_namespace: str - :param resource_type: The type of the resource. - :type resource_type: str - :param resource_name: Name of the resource. - :type resource_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -288,7 +274,7 @@ def delete( accept = "application/json" # Construct URL - url = self.delete.metadata['url'] # type: ignore + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -311,11 +297,89 @@ def delete( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_namespace, # type: str + resource_type, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Removing server vulnerability assessment from a resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The Namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_namespace=resource_namespace, + resource_type=resource_type, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + server_vulnerability_assessment = "default" + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'serverVulnerabilityAssessment': self._serialize.url("server_vulnerability_assessment", server_vulnerability_assessment, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py index 9624e7dc4b79..d356e997666a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_settings_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -114,14 +114,14 @@ def get_next(next_link=None): def get( self, - setting_name, # type: Union[str, "_models.Enum3"] + setting_name, # type: Union[str, "_models.Enum86"] **kwargs # type: Any ): # type: (...) -> "_models.Setting" """Settings of different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). - :type setting_name: str or ~azure.mgmt.security.models.Enum3 + :param setting_name: The name of the setting. + :type setting_name: str or ~azure.mgmt.security.models.Enum86 :keyword callable cls: A custom type or function that will be passed the direct response :return: Setting, or the result of cls(response) :rtype: ~azure.mgmt.security.models.Setting @@ -132,7 +132,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -169,15 +169,15 @@ def get( def update( self, - setting_name, # type: Union[str, "_models.Enum3"] + setting_name, # type: Union[str, "_models.Enum86"] setting, # type: "_models.Setting" **kwargs # type: Any ): # type: (...) -> "_models.Setting" """updating settings about different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). - :type setting_name: str or ~azure.mgmt.security.models.Enum3 + :param setting_name: The name of the setting. + :type setting_name: str or ~azure.mgmt.security.models.Enum86 :param setting: Setting object. :type setting: ~azure.mgmt.security.models.Setting :keyword callable cls: A custom type or function that will be passed the direct response @@ -190,7 +190,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-01-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py new file mode 100644 index 000000000000..410d6ff4e69f --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py @@ -0,0 +1,269 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SoftwareInventoriesOperations(object): + """SoftwareInventoriesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.security.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_extended_resource( + self, + resource_group_name, # type: str + resource_namespace, # type: str + resource_type, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SoftwaresList"] + """Gets the software inventory of the virtual machine. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SoftwaresList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SoftwaresList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SoftwaresList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_extended_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SoftwaresList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SoftwaresList"] + """Gets the software inventory of all virtual machines in the subscriptions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SoftwaresList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.security.models.SoftwaresList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SoftwaresList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SoftwaresList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_namespace, # type: str + resource_type, # type: str + resource_name, # type: str + software_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Software" + """Gets a single software data of the virtual machine. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param resource_namespace: The namespace of the resource. + :type resource_namespace: str + :param resource_type: The type of the resource. + :type resource_type: str + :param resource_name: Name of the resource. + :type resource_name: str + :param software_name: Name of the installed software. + :type software_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Software, or the result of cls(response) + :rtype: ~azure.mgmt.security.models.Software + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Software"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceNamespace': self._serialize.url("resource_namespace", resource_namespace, 'str'), + 'resourceType': self._serialize.url("resource_type", resource_type, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'softwareName': self._serialize.url("software_name", software_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Software', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}'} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py index 48685e7cbe15..98bf219f2712 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_sub_assessments_operations.py @@ -53,8 +53,8 @@ def list_all( # type: (...) -> Iterable["_models.SecuritySubAssessmentList"] """Get security sub-assessments on all your scanned resources inside a subscription scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -126,8 +126,8 @@ def list( # type: (...) -> Iterable["_models.SecuritySubAssessmentList"] """Get security sub-assessments on all your scanned resources inside a scope. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param assessment_name: The Assessment Key - Unique key for the assessment type. @@ -203,8 +203,8 @@ def get( # type: (...) -> "_models.SecuritySubAssessment" """Get a security sub-assessment on your scanned resource. - :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea- - afe6-4779-bd59-30e5c2d9d13f) or management group + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). :type scope: str :param assessment_name: The Assessment Key - Unique key for the assessment type. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_tasks_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_tasks_operations.py index 3d7027bb2c13..387baf6aafbd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_tasks_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_tasks_operations.py @@ -249,7 +249,7 @@ def get_subscription_level_task( def update_subscription_level_task_state( self, task_name, # type: str - task_update_action_type, # type: Union[str, "_models.Enum15"] + task_update_action_type, # type: Union[str, "_models.Enum13"] **kwargs # type: Any ): # type: (...) -> None @@ -258,7 +258,7 @@ def update_subscription_level_task_state( :param task_name: Name of the task object, will be a GUID. :type task_name: str :param task_update_action_type: Type of the action to do on the task. - :type task_update_action_type: str or ~azure.mgmt.security.models.Enum15 + :type task_update_action_type: str or ~azure.mgmt.security.models.Enum13 :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -446,7 +446,7 @@ def update_resource_group_level_task_state( self, resource_group_name, # type: str task_name, # type: str - task_update_action_type, # type: Union[str, "_models.Enum15"] + task_update_action_type, # type: Union[str, "_models.Enum13"] **kwargs # type: Any ): # type: (...) -> None @@ -458,7 +458,7 @@ def update_resource_group_level_task_state( :param task_name: Name of the task object, will be a GUID. :type task_name: str :param task_update_action_type: Type of the action to do on the task. - :type task_update_action_type: str or ~azure.mgmt.security.models.Enum15 + :type task_update_action_type: str or ~azure.mgmt.security.models.Enum13 :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None