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..4b82d3b2b5e5 --- /dev/null +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "5de64fb1d31e7fa0917c29f44c3b77abd3692d3f", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/security/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/security/resource-manager/readme.md" +} \ 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 de0ae7d443e3..4f1183f0d963 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 @@ -15,17 +15,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 @@ -47,7 +42,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 @@ -66,6 +60,15 @@ from .operations import DevicesForHubOperations 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 @@ -79,8 +82,6 @@ class SecurityCenter(SDKClient): :vartype compliance_results: azure.mgmt.security.operations.ComplianceResultsOperations :ivar pricings: Pricings operations :vartype pricings: azure.mgmt.security.operations.PricingsOperations - :ivar settings: Settings operations - :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations :ivar device_security_groups: DeviceSecurityGroups operations @@ -93,14 +94,6 @@ class SecurityCenter(SDKClient): :vartype iot_security_solutions_analytics_aggregated_alert: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsAggregatedAlertOperations :ivar iot_security_solutions_analytics_recommendation: IotSecuritySolutionsAnalyticsRecommendation operations :vartype iot_security_solutions_analytics_recommendation: azure.mgmt.security.operations.IotSecuritySolutionsAnalyticsRecommendationOperations - :ivar iot_alert_types: IotAlertTypes operations - :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations - :ivar iot_alerts: IotAlerts operations - :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations - :ivar iot_recommendation_types: IotRecommendationTypes operations - :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations - :ivar iot_recommendations: IotRecommendations operations - :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations :ivar locations: Locations operations :vartype locations: azure.mgmt.security.operations.LocationsOperations :ivar operations: Operations operations @@ -143,8 +136,6 @@ class SecurityCenter(SDKClient): :vartype allowed_connections: azure.mgmt.security.operations.AllowedConnectionsOperations :ivar topology: Topology operations :vartype topology: azure.mgmt.security.operations.TopologyOperations - :ivar alerts: Alerts operations - :vartype alerts: azure.mgmt.security.operations.AlertsOperations :ivar jit_network_access_policies: JitNetworkAccessPolicies operations :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations @@ -181,6 +172,24 @@ class SecurityCenter(SDKClient): :vartype device: azure.mgmt.security.operations.DeviceOperations :ivar on_premise_iot_sensors: OnPremiseIotSensors operations :vartype on_premise_iot_sensors: azure.mgmt.security.operations.OnPremiseIotSensorsOperations + :ivar iot_sites: IotSites operations + :vartype iot_sites: azure.mgmt.security.operations.IotSitesOperations + :ivar iot_alerts: IotAlerts operations + :vartype iot_alerts: azure.mgmt.security.operations.IotAlertsOperations + :ivar iot_alert_types: IotAlertTypes operations + :vartype iot_alert_types: azure.mgmt.security.operations.IotAlertTypesOperations + :ivar iot_recommendations: IotRecommendations operations + :vartype iot_recommendations: azure.mgmt.security.operations.IotRecommendationsOperations + :ivar iot_recommendation_types: IotRecommendationTypes operations + :vartype iot_recommendation_types: azure.mgmt.security.operations.IotRecommendationTypesOperations + :ivar alerts: Alerts operations + :vartype alerts: azure.mgmt.security.operations.AlertsOperations + :ivar settings: Settings operations + :vartype settings: azure.mgmt.security.operations.SettingsOperations + :ivar ingestion_settings: IngestionSettings operations + :vartype ingestion_settings: azure.mgmt.security.operations.IngestionSettingsOperations + :ivar software_inventories: SoftwareInventories operations + :vartype software_inventories: azure.mgmt.security.operations.SoftwareInventoriesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -207,8 +216,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( @@ -221,14 +228,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( @@ -271,8 +270,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( @@ -309,3 +306,21 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.on_premise_iot_sensors = OnPremiseIotSensorsOperations( 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) 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 f182e6ae46be..c126d3a72637 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 @@ -20,10 +20,15 @@ from ._models_py3 import AdaptiveNetworkHardening from ._models_py3 import AdaptiveNetworkHardeningEnforceRequest 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 AlertSimulatorBundlesRequestProperties + from ._models_py3 import AlertSimulatorRequestBody + from ._models_py3 import AlertSimulatorRequestProperties from ._models_py3 import AlertsSuppressionRule + from ._models_py3 import AlertSyncSettings from ._models_py3 import AllowedConnectionsResource from ._models_py3 import AllowlistCustomAlertRule from ._models_py3 import AmqpC2DMessagesNotInAllowedRange @@ -63,6 +68,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 ContainerRegistryVulnerabilityProperties @@ -76,6 +83,7 @@ from ._models_py3 import DirectMethodInvokesNotInAllowedRange from ._models_py3 import DiscoveredSecuritySolution from ._models_py3 import EffectiveNetworkSecurityGroups + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ETag from ._models_py3 import ExternalSecuritySolution from ._models_py3 import ExternalSecuritySolutionKind1 @@ -91,13 +99,14 @@ from ._models_py3 import InformationProtectionKeyword from ._models_py3 import InformationProtectionPolicy from ._models_py3 import InformationType - from ._models_py3 import IotAlert + from ._models_py3 import IngestionConnectionString + from ._models_py3 import IngestionSetting + from ._models_py3 import IngestionSettingToken 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 IotRecommendationModel from ._models_py3 import IotRecommendationType from ._models_py3 import IotRecommendationTypeList @@ -111,9 +120,11 @@ from ._models_py3 import IoTSecuritySolutionAnalyticsModelList from ._models_py3 import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models_py3 import IoTSecuritySolutionModel - from ._models_py3 import IotSensor from ._models_py3 import IotSensorsList + from ._models_py3 import IotSensorsModel from ._models_py3 import IoTSeverityMetrics + from ._models_py3 import IotSitesList + from ._models_py3 import IotSitesModel from ._models_py3 import IpAddress from ._models_py3 import JitNetworkAccessPolicy from ._models_py3 import JitNetworkAccessPolicyInitiatePort @@ -148,7 +159,6 @@ from ._models_py3 import PackageDownloadsSensor from ._models_py3 import PackageDownloadsSensorFull from ._models_py3 import PackageDownloadsSensorFullOvf - from ._models_py3 import PackageDownloadsThreatIntelligence from ._models_py3 import PathRecommendation from ._models_py3 import Pricing from ._models_py3 import PricingList @@ -164,6 +174,7 @@ from ._models_py3 import RegulatoryComplianceControl from ._models_py3 import RegulatoryComplianceStandard from ._models_py3 import Remediation + from ._models_py3 import ResetPasswordInput from ._models_py3 import Resource from ._models_py3 import ResourceDetails from ._models_py3 import ResourceIdentifier @@ -204,11 +215,12 @@ from ._models_py3 import ServerVulnerabilityProperties from ._models_py3 import ServicePrincipalProperties from ._models_py3 import Setting - from ._models_py3 import SettingResource from ._models_py3 import Site + from ._models_py3 import Software 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 @@ -221,6 +233,7 @@ from ._models_py3 import TwinUpdatesNotInAllowedRange from ._models_py3 import UnauthorizedOperationsNotInAllowedRange from ._models_py3 import UpdateIotSecuritySolutionData + from ._models_py3 import UpgradePackageDownloadInfo from ._models_py3 import UserDefinedResourcesProperties from ._models_py3 import UserRecommendation from ._models_py3 import VaRule @@ -238,10 +251,15 @@ from ._models import AdaptiveNetworkHardening from ._models import AdaptiveNetworkHardeningEnforceRequest from ._models import AdditionalData + from ._models import AdditionalWorkspacesProperties from ._models import AdvancedThreatProtectionSetting from ._models import Alert from ._models import AlertEntity + from ._models import AlertSimulatorBundlesRequestProperties + from ._models import AlertSimulatorRequestBody + from ._models import AlertSimulatorRequestProperties from ._models import AlertsSuppressionRule + from ._models import AlertSyncSettings from ._models import AllowedConnectionsResource from ._models import AllowlistCustomAlertRule from ._models import AmqpC2DMessagesNotInAllowedRange @@ -281,6 +299,8 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import ConnectionFromIpNotAllowed + from ._models import ConnectionStrings from ._models import ConnectionToIpNotAllowed from ._models import ConnectorSetting from ._models import ContainerRegistryVulnerabilityProperties @@ -294,6 +314,7 @@ from ._models import DirectMethodInvokesNotInAllowedRange from ._models import DiscoveredSecuritySolution from ._models import EffectiveNetworkSecurityGroups + from ._models import ErrorAdditionalInfo from ._models import ETag from ._models import ExternalSecuritySolution from ._models import ExternalSecuritySolutionKind1 @@ -309,13 +330,14 @@ from ._models import InformationProtectionKeyword from ._models import InformationProtectionPolicy from ._models import InformationType - from ._models import IotAlert + from ._models import IngestionConnectionString + from ._models import IngestionSetting + from ._models import IngestionSettingToken from ._models import IotAlertModel from ._models import IotAlertType from ._models import IotAlertTypeList from ._models import IotDefenderSettingsList from ._models import IotDefenderSettingsModel - from ._models import IotRecommendation from ._models import IotRecommendationModel from ._models import IotRecommendationType from ._models import IotRecommendationTypeList @@ -329,9 +351,11 @@ from ._models import IoTSecuritySolutionAnalyticsModelList from ._models import IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem from ._models import IoTSecuritySolutionModel - from ._models import IotSensor from ._models import IotSensorsList + from ._models import IotSensorsModel from ._models import IoTSeverityMetrics + from ._models import IotSitesList + from ._models import IotSitesModel from ._models import IpAddress from ._models import JitNetworkAccessPolicy from ._models import JitNetworkAccessPolicyInitiatePort @@ -366,7 +390,6 @@ from ._models import PackageDownloadsSensor from ._models import PackageDownloadsSensorFull from ._models import PackageDownloadsSensorFullOvf - from ._models import PackageDownloadsThreatIntelligence from ._models import PathRecommendation from ._models import Pricing from ._models import PricingList @@ -382,6 +405,7 @@ from ._models import RegulatoryComplianceControl from ._models import RegulatoryComplianceStandard from ._models import Remediation + from ._models import ResetPasswordInput from ._models import Resource from ._models import ResourceDetails from ._models import ResourceIdentifier @@ -422,11 +446,12 @@ from ._models import ServerVulnerabilityProperties from ._models import ServicePrincipalProperties from ._models import Setting - from ._models import SettingResource from ._models import Site + from ._models import Software from ._models import SqlServerVulnerabilityProperties from ._models import SubAssessmentStatus from ._models import SuppressionAlertsScope + from ._models import SystemData from ._models import Tags from ._models import TagsResource from ._models import ThresholdCustomAlertRule @@ -439,6 +464,7 @@ from ._models import TwinUpdatesNotInAllowedRange from ._models import UnauthorizedOperationsNotInAllowedRange from ._models import UpdateIotSecuritySolutionData + from ._models import UpgradePackageDownloadInfo from ._models import UserDefinedResourcesProperties from ._models import UserRecommendation from ._models import VaRule @@ -460,10 +486,9 @@ from ._paged_models import DiscoveredSecuritySolutionPaged from ._paged_models import ExternalSecuritySolutionPaged from ._paged_models import InformationProtectionPolicyPaged +from ._paged_models import IngestionSettingPaged from ._paged_models import IotAlertModelPaged -from ._paged_models import IotAlertPaged from ._paged_models import IotRecommendationModelPaged -from ._paged_models import IotRecommendationPaged from ._paged_models import IoTSecurityAggregatedAlertPaged from ._paged_models import IoTSecurityAggregatedRecommendationPaged from ._paged_models import IoTSecuritySolutionModelPaged @@ -482,6 +507,7 @@ from ._paged_models import SecuritySubAssessmentPaged from ._paged_models import SecurityTaskPaged from ._paged_models import SettingPaged +from ._paged_models import SoftwarePaged from ._paged_models import TopologyResourcePaged from ._paged_models import WorkspaceSettingPaged from ._security_center_enums import ( @@ -494,10 +520,10 @@ RecommendationType, RecommendationConfigStatus, UnmaskedIpLoggingStatus, + AdditionalWorkspaceType, + AdditionalWorkspaceDataType, + CreatedByType, ReportedSeverity, - AlertSeverity, - AlertIntent, - RecommendationSeverity, AutoProvision, Rank, AlertNotifications, @@ -509,7 +535,7 @@ PropertyType, Operator, RuleState, - Category, + Categories, UserImpact, ImplementationEffort, Threats, @@ -517,8 +543,6 @@ AssessmentStatusCode, Direction, TransportProtocol, - Intent, - AlertStatus, Protocol, Status, StatusReason, @@ -535,7 +559,11 @@ RuleStatus, RuleSeverity, RuleType, + OnboardingKind, VersionKind, + SensorStatus, + TiStatus, + SensorType, MacSignificance, RelationToIpStatus, ManagementState, @@ -545,6 +573,13 @@ ProgrammingState, ScanningFunctionality, DeviceStatus, + AlertSeverity, + AlertIntent, + RecommendationSeverity, + Intent, + AlertStatus, + BundleType, + EndOfSupportStatus, ExpandEnum, ConnectionType, ExpandControlsEnum, @@ -561,10 +596,15 @@ 'AdaptiveNetworkHardening', 'AdaptiveNetworkHardeningEnforceRequest', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', + 'AlertSimulatorBundlesRequestProperties', + 'AlertSimulatorRequestBody', + 'AlertSimulatorRequestProperties', 'AlertsSuppressionRule', + 'AlertSyncSettings', 'AllowedConnectionsResource', 'AllowlistCustomAlertRule', 'AmqpC2DMessagesNotInAllowedRange', @@ -604,6 +644,8 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', + 'ConnectionStrings', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ContainerRegistryVulnerabilityProperties', @@ -617,6 +659,7 @@ 'DirectMethodInvokesNotInAllowedRange', 'DiscoveredSecuritySolution', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ETag', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -632,13 +675,14 @@ 'InformationProtectionKeyword', 'InformationProtectionPolicy', 'InformationType', - 'IotAlert', + 'IngestionConnectionString', + 'IngestionSetting', + 'IngestionSettingToken', 'IotAlertModel', 'IotAlertType', 'IotAlertTypeList', 'IotDefenderSettingsList', 'IotDefenderSettingsModel', - 'IotRecommendation', 'IotRecommendationModel', 'IotRecommendationType', 'IotRecommendationTypeList', @@ -652,9 +696,11 @@ 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', 'IoTSecuritySolutionModel', - 'IotSensor', 'IotSensorsList', + 'IotSensorsModel', 'IoTSeverityMetrics', + 'IotSitesList', + 'IotSitesModel', 'IpAddress', 'JitNetworkAccessPolicy', 'JitNetworkAccessPolicyInitiatePort', @@ -689,7 +735,6 @@ 'PackageDownloadsSensor', 'PackageDownloadsSensorFull', 'PackageDownloadsSensorFullOvf', - 'PackageDownloadsThreatIntelligence', 'PathRecommendation', 'Pricing', 'PricingList', @@ -705,6 +750,7 @@ 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Remediation', + 'ResetPasswordInput', 'Resource', 'ResourceDetails', 'ResourceIdentifier', @@ -745,11 +791,12 @@ 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', 'Site', + 'Software', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -762,6 +809,7 @@ 'TwinUpdatesNotInAllowedRange', 'UnauthorizedOperationsNotInAllowedRange', 'UpdateIotSecuritySolutionData', + 'UpgradePackageDownloadInfo', 'UserDefinedResourcesProperties', 'UserRecommendation', 'VaRule', @@ -769,15 +817,10 @@ 'VmRecommendation', 'WorkspaceSetting', 'ComplianceResultPaged', - 'SettingPaged', 'DeviceSecurityGroupPaged', 'IoTSecuritySolutionModelPaged', 'IoTSecurityAggregatedAlertPaged', 'IoTSecurityAggregatedRecommendationPaged', - 'IotAlertPaged', - 'IotAlertModelPaged', - 'IotRecommendationPaged', - 'IotRecommendationModelPaged', 'AscLocationPaged', 'OperationPaged', 'SecurityTaskPaged', @@ -797,7 +840,6 @@ 'AdaptiveNetworkHardeningPaged', 'AllowedConnectionsResourcePaged', 'TopologyResourcePaged', - 'AlertPaged', 'JitNetworkAccessPolicyPaged', 'DiscoveredSecuritySolutionPaged', 'ExternalSecuritySolutionPaged', @@ -807,6 +849,12 @@ 'SecuritySolutionPaged', 'ConnectorSettingPaged', 'DevicePaged', + 'IotAlertModelPaged', + 'IotRecommendationModelPaged', + 'AlertPaged', + 'SettingPaged', + 'IngestionSettingPaged', + 'SoftwarePaged', 'ResourceStatus', 'PricingTier', 'ValueType', @@ -816,10 +864,10 @@ 'RecommendationType', 'RecommendationConfigStatus', 'UnmaskedIpLoggingStatus', + 'AdditionalWorkspaceType', + 'AdditionalWorkspaceDataType', + 'CreatedByType', 'ReportedSeverity', - 'AlertSeverity', - 'AlertIntent', - 'RecommendationSeverity', 'AutoProvision', 'Rank', 'AlertNotifications', @@ -831,7 +879,7 @@ 'PropertyType', 'Operator', 'RuleState', - 'Category', + 'Categories', 'UserImpact', 'ImplementationEffort', 'Threats', @@ -839,8 +887,6 @@ 'AssessmentStatusCode', 'Direction', 'TransportProtocol', - 'Intent', - 'AlertStatus', 'Protocol', 'Status', 'StatusReason', @@ -857,7 +903,11 @@ 'RuleStatus', 'RuleSeverity', 'RuleType', + 'OnboardingKind', 'VersionKind', + 'SensorStatus', + 'TiStatus', + 'SensorType', 'MacSignificance', 'RelationToIpStatus', 'ManagementState', @@ -867,6 +917,13 @@ 'ProgrammingState', 'ScanningFunctionality', 'DeviceStatus', + 'AlertSeverity', + 'AlertIntent', + 'RecommendationSeverity', + 'Intent', + 'AlertStatus', + 'BundleType', + 'EndOfSupportStatus', 'ExpandEnum', 'ConnectionType', 'ExpandControlsEnum', 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 941c6b8b9bde..f9733d3f5b20 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 @@ -643,6 +643,32 @@ def __init__(self, **kwargs): self.assessed_resource_type = None +class AdditionalWorkspacesProperties(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. @@ -878,6 +904,87 @@ def __init__(self, **kwargs): self.type = None +class AlertSimulatorRequestProperties(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 this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _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 = None + + +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 this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :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.bundles = kwargs.get('bundles', None) + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(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. @@ -947,6 +1054,93 @@ def __init__(self, **kwargs): self.suppression_alerts_scope = kwargs.get('suppression_alerts_scope', 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, AlertSyncSettings + + 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. Constant filled by server. + :type kind: str + """ + + _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', 'AlertSyncSettings': 'AlertSyncSettings'} + } + + def __init__(self, **kwargs): + super(Setting, self).__init__(**kwargs) + self.kind = None + self.kind = 'Setting' + + +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. Constant filled by server. + :type kind: str + :param enabled: Required. Is the alert sync setting enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'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.enabled = kwargs.get('enabled', None) + self.kind = 'AlertSyncSettings' + + class AllowedConnectionsResource(Model): """The resource whose properties describes the allowed traffic between Azure resources. @@ -1053,8 +1247,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): 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: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1290,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, **kwargs): @@ -1797,7 +1991,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', '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'). @@ -2335,33 +2532,49 @@ def __init__(self, **kwargs): class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :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': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2589,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(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. @@ -2580,6 +2837,76 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +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. + + 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. 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(ConnectionFromIpNotAllowed, self).__init__(**kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' + + +class ConnectionStrings(Model): + """Connection string for ingesting security data and logs. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Connection strings + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, + } + + def __init__(self, **kwargs): + super(ConnectionStrings, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. @@ -2789,95 +3116,6 @@ def __init__(self, **kwargs): self.base = None -class SettingResource(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: 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. Constant filled by server. - :type kind: str - """ - - _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': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs): - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - 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. Constant filled by server. - :type kind: str - """ - - _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' - - class DataExportSettings(Setting): """Represents a data export setting. @@ -2894,7 +3132,7 @@ class DataExportSettings(Setting): :vartype type: str :param kind: Required. Constant filled by server. :type kind: str - :param enabled: Required. Is the data export setting is enabled + :param enabled: Required. Is the data export setting enabled :type enabled: bool """ @@ -3309,6 +3547,34 @@ def __init__(self, **kwargs): self.network_security_groups = kwargs.get('network_security_groups', None) +class ErrorAdditionalInfo(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: object + """ + + _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 ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,68 +4188,106 @@ def __init__(self, **kwargs): self.keywords = kwargs.get('keywords', None) -class IotAlert(Model): - """IoT alert. +class IngestionConnectionString(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 = { + 'location': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + '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: object + """ + + _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 IngestionSettingToken(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 = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'token': {'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'}, + 'token': {'key': 'token', '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(IngestionSettingToken, self).__init__(**kwargs) + self.token = None -class IotAlertModel(Model): +class IotAlertModel(Resource): """IoT alert. 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 system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4310,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4321,9 @@ class IotAlertModel(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'}, @@ -4177,6 +4487,13 @@ class IotDefenderSettingsModel(Resource): :param sentinel_workspace_resource_ids: Required. Sentinel Workspace Resource Ids :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. 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 """ _validation = { @@ -4185,6 +4502,8 @@ class IotDefenderSettingsModel(Resource): 'type': {'readonly': True}, 'device_quota': {'required': True, 'minimum': 1000}, 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { @@ -4193,62 +4512,16 @@ 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__(self, **kwargs): 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) + self.onboarding_kind = kwargs.get('onboarding_kind', None) + self.evaluation_end_time = None class IotRecommendationModel(Resource): @@ -4430,7 +4703,7 @@ class IoTSecurityAggregatedAlert(Model): :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 @@ -4478,7 +4751,7 @@ class IoTSecurityAggregatedAlert(Model): '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'}, @@ -4516,7 +4789,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :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 @@ -4530,7 +4803,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _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'}, } @@ -4574,10 +4847,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~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 @@ -4610,8 +4883,8 @@ class IoTSecurityAggregatedRecommendation(Model): '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'}, } @@ -4643,7 +4916,7 @@ class IoTSecurityAlertedDevice(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 = { @@ -4653,7 +4926,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4676,7 +4949,7 @@ class IoTSecurityDeviceAlert(Model): :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 = { @@ -4688,7 +4961,7 @@ class IoTSecurityDeviceAlert(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__(self, **kwargs): @@ -4712,7 +4985,7 @@ class IoTSecurityDeviceRecommendation(Model): :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 = { @@ -4724,7 +4997,7 @@ class IoTSecurityDeviceRecommendation(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__(self, **kwargs): @@ -4750,7 +5023,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :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] @@ -4781,7 +5054,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]'}, @@ -4899,6 +5172,12 @@ class IoTSecuritySolutionModel(Model): . :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] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5187,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,6 +5206,8 @@ class IoTSecuritySolutionModel(Model): '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]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -4945,10 +5227,35 @@ def __init__(self, **kwargs): 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.system_data = None + + +class IotSensorsList(Model): + """List of IoT sensors. + + 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.IotSensorsModel] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs): + super(IotSensorsList, self).__init__(**kwargs) + self.value = None -class IotSensor(Resource): - """IoT sensor. +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5266,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + '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__(self, **kwargs): + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = kwargs.get('ti_automatic_updates', None) + self.ti_status = None + self.ti_version = None + self.zone = kwargs.get('zone', None) + self.sensor_type = kwargs.get('sensor_type', None) + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } def __init__(self, **kwargs): - super(IotSensor, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = kwargs.get('high', None) + self.medium = kwargs.get('medium', None) + self.low = kwargs.get('low', None) -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. 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.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5378,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs): - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + 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 display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__(self, **kwargs): - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = kwargs.get('high', None) - self.medium = kwargs.get('medium', None) - self.low = kwargs.get('low', None) + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.tags = kwargs.get('tags', None) class IpAddress(Model): @@ -6054,19 +6453,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6074,6 +6493,10 @@ def __init__(self, **kwargs): self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6510,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6521,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6187,7 +6611,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6621,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs): @@ -6266,22 +6691,6 @@ def __init__(self, **kwargs): self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = kwargs.get('link', None) - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7318,22 @@ def __init__(self, **kwargs): self.portal_link = kwargs.get('portal_link', None) +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = kwargs.get('appliance_id', None) + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7630,8 +8055,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: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +8100,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'}, @@ -7691,7 +8116,7 @@ def __init__(self, **kwargs): 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) @@ -7753,8 +8178,8 @@ class SecurityAssessmentMetadataProperties(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 @@ -7792,7 +8217,7 @@ class SecurityAssessmentMetadataProperties(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'}, @@ -7808,7 +8233,7 @@ def __init__(self, **kwargs): 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) @@ -8441,6 +8866,78 @@ def __init__(self, **kwargs): 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 SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8541,6 +9038,46 @@ def __init__(self, **kwargs): self.all_of = kwargs.get('all_of', None) +class SystemData(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 + :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 + """ + + _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 Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9397,41 @@ def __init__(self, **kwargs): self.recommendations_configuration = kwargs.get('recommendations_configuration', None) +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpgradePackageDownloadInfo, self).__init__(**kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. 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 13585f8f3453..6c60133d9db2 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 @@ -643,6 +643,32 @@ def __init__(self, **kwargs) -> None: self.assessed_resource_type = None +class AdditionalWorkspacesProperties(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: str=None, type="Sentinel", data_types=None, **kwargs) -> None: + super(AdditionalWorkspacesProperties, self).__init__(**kwargs) + self.workspace = workspace + self.type = type + self.data_types = data_types + + class AdvancedThreatProtectionSetting(Resource): """The Advanced Threat Protection resource. @@ -878,6 +904,87 @@ def __init__(self, *, additional_properties=None, **kwargs) -> None: self.type = None +class AlertSimulatorRequestProperties(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 this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _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=None, **kwargs) -> None: + super(AlertSimulatorRequestProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.kind = None + + +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 this collection + :type additional_properties: dict[str, object] + :param kind: Required. Constant filled by server. + :type kind: str + :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=None, bundles=None, **kwargs) -> None: + super(AlertSimulatorBundlesRequestProperties, self).__init__(additional_properties=additional_properties, **kwargs) + self.bundles = bundles + self.kind = 'Bundles' + + +class AlertSimulatorRequestBody(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=None, **kwargs) -> None: + super(AlertSimulatorRequestBody, self).__init__(**kwargs) + self.properties = properties + + class AlertsSuppressionRule(Resource): """Describes the suppression rule. @@ -947,6 +1054,93 @@ def __init__(self, *, alert_type: str, reason: str, state, expiration_date_utc=N self.suppression_alerts_scope = suppression_alerts_scope +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, AlertSyncSettings + + 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. Constant filled by server. + :type kind: str + """ + + _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', 'AlertSyncSettings': 'AlertSyncSettings'} + } + + def __init__(self, **kwargs) -> None: + super(Setting, self).__init__(**kwargs) + self.kind = None + self.kind = 'Setting' + + +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. Constant filled by server. + :type kind: str + :param enabled: Required. Is the alert sync setting enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'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: bool, **kwargs) -> None: + super(AlertSyncSettings, self).__init__(**kwargs) + self.enabled = enabled + self.kind = 'AlertSyncSettings' + + class AllowedConnectionsResource(Model): """The resource whose properties describes the allowed traffic between Azure resources. @@ -1053,8 +1247,8 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): 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: ConnectionToIpNotAllowed, ConnectionFromIpNotAllowed, + LocalUserNotAllowed, ProcessNotAllowed Variables are only populated by the server, and will be ignored when sending a request. @@ -1096,7 +1290,7 @@ class AllowlistCustomAlertRule(ListCustomAlertRule): } _subtype_map = { - 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} + 'rule_type': {'ConnectionToIpNotAllowed': 'ConnectionToIpNotAllowed', 'ConnectionFromIpNotAllowed': 'ConnectionFromIpNotAllowed', 'LocalUserNotAllowed': 'LocalUserNotAllowed', 'ProcessNotAllowed': 'ProcessNotAllowed'} } def __init__(self, *, is_enabled: bool, allowlist_values, **kwargs) -> None: @@ -1797,7 +1991,10 @@ class AutomationSource(Model): https://aka.ms/ASCAutomationSchemas. :param event_source: A valid event source type. Possible values include: - 'Assessments', 'SubAssessments', 'Alerts' + 'Assessments', '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'). @@ -2335,33 +2532,49 @@ def __init__(self, *, additional_properties=None, device_vendor: str=None, devic class CloudError(Model): - """Error response structure. + """Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: An identifier for the error. Codes are invariant and are - intended to be consumed programmatically. + :ivar code: The error code. :vartype code: str - :ivar message: A message describing the error, intended to be suitable for - display in a user interface. + :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': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'error.additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs) -> None: super(CloudError, self).__init__(**kwargs) self.code = None self.message = None + self.target = None + self.details = None + self.additional_info = None class CloudErrorException(HttpOperationError): @@ -2376,6 +2589,50 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +class CloudErrorBody(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) -> None: + 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. @@ -2580,6 +2837,76 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id +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. + + 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. 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, **kwargs) -> None: + super(ConnectionFromIpNotAllowed, self).__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) + self.rule_type = 'ConnectionFromIpNotAllowed' + + +class ConnectionStrings(Model): + """Connection string for ingesting security data and logs. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Connection strings + :type value: list[~azure.mgmt.security.models.IngestionConnectionString] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IngestionConnectionString]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + 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. @@ -2789,95 +3116,6 @@ def __init__(self, **kwargs) -> None: self.base = None -class SettingResource(Resource): - """The kind of the security setting. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: 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. Constant filled by server. - :type kind: str - """ - - _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': {'Setting': 'Setting'} - } - - def __init__(self, **kwargs) -> None: - super(SettingResource, self).__init__(**kwargs) - self.kind = None - self.kind = 'SettingResource' - - -class Setting(SettingResource): - """Represents a security setting in Azure Security Center. - - 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. Constant filled by server. - :type kind: str - """ - - _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) -> None: - super(Setting, self).__init__(**kwargs) - self.kind = 'Setting' - - class DataExportSettings(Setting): """Represents a data export setting. @@ -2894,7 +3132,7 @@ class DataExportSettings(Setting): :vartype type: str :param kind: Required. Constant filled by server. :type kind: str - :param enabled: Required. Is the data export setting is enabled + :param enabled: Required. Is the data export setting enabled :type enabled: bool """ @@ -3309,6 +3547,34 @@ def __init__(self, *, network_interface: str=None, network_security_groups=None, self.network_security_groups = network_security_groups +class ErrorAdditionalInfo(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: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ETag(Model): """Entity tag is used for comparing two or more entities from the same requested resource. @@ -3922,68 +4188,106 @@ def __init__(self, *, display_name: str=None, description: str=None, order: int= self.keywords = keywords -class IotAlert(Model): - """IoT alert. +class IngestionConnectionString(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 = { + 'location': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + 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: object + """ + + _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, *, properties=None, **kwargs) -> None: + super(IngestionSetting, self).__init__(**kwargs) + self.properties = properties + + +class IngestionSettingToken(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 = { - 'system_alert_id': {'readonly': True}, - 'compromised_entity': {'readonly': True}, - 'alert_type': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, + 'token': {'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'}, + 'token': {'key': 'token', 'type': 'str'}, } - def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None: - 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 + def __init__(self, **kwargs) -> None: + super(IngestionSettingToken, self).__init__(**kwargs) + self.token = None -class IotAlertModel(Model): +class IotAlertModel(Resource): """IoT alert. 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 system_alert_id: Holds the product canonical identifier of the alert within the scope of a product :vartype system_alert_id: str @@ -4006,6 +4310,9 @@ class IotAlertModel(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -4014,6 +4321,9 @@ class IotAlertModel(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'}, @@ -4177,6 +4487,13 @@ class IotDefenderSettingsModel(Resource): :param sentinel_workspace_resource_ids: Required. Sentinel Workspace Resource Ids :type sentinel_workspace_resource_ids: list[str] + :param onboarding_kind: Required. 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 """ _validation = { @@ -4185,6 +4502,8 @@ class IotDefenderSettingsModel(Resource): 'type': {'readonly': True}, 'device_quota': {'required': True, 'minimum': 1000}, 'sentinel_workspace_resource_ids': {'required': True}, + 'onboarding_kind': {'required': True}, + 'evaluation_end_time': {'readonly': True}, } _attribute_map = { @@ -4193,62 +4512,16 @@ 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__(self, *, device_quota: int, sentinel_workspace_resource_ids, **kwargs) -> None: + def __init__(self, *, device_quota: int, sentinel_workspace_resource_ids, onboarding_kind, **kwargs) -> None: 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=None, **kwargs) -> None: - 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 + self.onboarding_kind = onboarding_kind + self.evaluation_end_time = None class IotRecommendationModel(Resource): @@ -4430,7 +4703,7 @@ class IoTSecurityAggregatedAlert(Model): :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 @@ -4478,7 +4751,7 @@ class IoTSecurityAggregatedAlert(Model): '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'}, @@ -4516,7 +4789,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): :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 @@ -4530,7 +4803,7 @@ class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(Model): _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'}, } @@ -4574,10 +4847,10 @@ class IoTSecurityAggregatedRecommendation(Model): ~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 @@ -4610,8 +4883,8 @@ class IoTSecurityAggregatedRecommendation(Model): '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'}, } @@ -4643,7 +4916,7 @@ class IoTSecurityAlertedDevice(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 = { @@ -4653,7 +4926,7 @@ class IoTSecurityAlertedDevice(Model): _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, - 'alerts_count': {'key': 'alertsCount', 'type': 'int'}, + 'alerts_count': {'key': 'alertsCount', 'type': 'long'}, } def __init__(self, **kwargs) -> None: @@ -4676,7 +4949,7 @@ class IoTSecurityDeviceAlert(Model): :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 = { @@ -4688,7 +4961,7 @@ class IoTSecurityDeviceAlert(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__(self, **kwargs) -> None: @@ -4712,7 +4985,7 @@ class IoTSecurityDeviceRecommendation(Model): :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 = { @@ -4724,7 +4997,7 @@ class IoTSecurityDeviceRecommendation(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__(self, **kwargs) -> None: @@ -4750,7 +5023,7 @@ class IoTSecuritySolutionAnalyticsModel(Resource): :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] @@ -4781,7 +5054,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]'}, @@ -4899,6 +5172,12 @@ class IoTSecuritySolutionModel(Model): . :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] + :ivar system_data: Azure Resource Manager metadata containing createdBy + and modifiedBy information. + :vartype system_data: ~azure.mgmt.security.models.SystemData """ _validation = { @@ -4908,6 +5187,7 @@ class IoTSecuritySolutionModel(Model): 'display_name': {'required': True}, 'iot_hubs': {'required': True}, 'auto_discovered_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -4926,9 +5206,11 @@ class IoTSecuritySolutionModel(Model): '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]'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", **kwargs) -> None: + def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None, workspace: str=None, status="Enabled", export=None, disabled_data_sources=None, user_defined_resources=None, recommendations_configuration=None, unmasked_ip_logging_status="Disabled", additional_workspaces=None, **kwargs) -> None: super(IoTSecuritySolutionModel, self).__init__(**kwargs) self.id = None self.name = None @@ -4945,10 +5227,35 @@ def __init__(self, *, display_name: str, iot_hubs, tags=None, location: str=None 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.system_data = None + + +class IotSensorsList(Model): + """List of IoT sensors. + + 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.IotSensorsModel] + """ + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs) -> None: + super(IotSensorsList, self).__init__(**kwargs) + self.value = None -class IotSensor(Resource): - """IoT sensor. + +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5266,111 @@ class IotSensor(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param properties: IoT sensor properties - :type properties: object + :ivar connectivity_time: Last connectivity time of the IoT sensor + :vartype connectivity_time: str + :ivar creation_time: Creation time of the IoT sensor + :vartype creation_time: str + :ivar dynamic_learning: Dynamic mode status of the IoT sensor + :vartype dynamic_learning: bool + :ivar learning_mode: Learning mode status of the IoT sensor + :vartype learning_mode: bool + :ivar sensor_status: Status of the IoT sensor. Possible values include: + 'Ok', 'Disconnected', 'Unavailable' + :vartype sensor_status: str or ~azure.mgmt.security.models.SensorStatus + :ivar sensor_version: Version of the IoT sensor + :vartype sensor_version: str + :param ti_automatic_updates: TI Automatic mode status of the IoT sensor + :type ti_automatic_updates: bool + :ivar ti_status: TI Status of the IoT sensor. Possible values include: + 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + :vartype ti_status: str or ~azure.mgmt.security.models.TiStatus + :ivar ti_version: TI Version of the IoT sensor + :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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'connectivity_time': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'dynamic_learning': {'readonly': True}, + 'learning_mode': {'readonly': True}, + 'sensor_status': {'readonly': True}, + 'sensor_version': {'readonly': True}, + 'ti_status': {'readonly': True}, + 'ti_version': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'connectivity_time': {'key': 'properties.connectivityTime', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'dynamic_learning': {'key': 'properties.dynamicLearning', 'type': 'bool'}, + 'learning_mode': {'key': 'properties.learningMode', 'type': 'bool'}, + 'sensor_status': {'key': 'properties.sensorStatus', 'type': 'str'}, + 'sensor_version': {'key': 'properties.sensorVersion', 'type': 'str'}, + 'ti_automatic_updates': {'key': 'properties.tiAutomaticUpdates', 'type': 'bool'}, + '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__(self, *, ti_automatic_updates: bool=None, zone: str=None, sensor_type=None, **kwargs) -> None: + super(IotSensorsModel, self).__init__(**kwargs) + self.connectivity_time = None + self.creation_time = None + self.dynamic_learning = None + self.learning_mode = None + self.sensor_status = None + self.sensor_version = None + self.ti_automatic_updates = ti_automatic_updates + self.ti_status = None + self.ti_version = None + self.zone = zone + self.sensor_type = sensor_type + + +class IoTSeverityMetrics(Model): + """IoT Security solution analytics severity metrics. + + :param high: Count of high severity alerts/recommendations. + :type high: long + :param medium: Count of medium severity alerts/recommendations. + :type medium: long + :param low: Count of low severity alerts/recommendations. + :type low: long + """ + + _attribute_map = { + 'high': {'key': 'high', 'type': 'long'}, + 'medium': {'key': 'medium', 'type': 'long'}, + 'low': {'key': 'low', 'type': 'long'}, } - def __init__(self, *, properties=None, **kwargs) -> None: - super(IotSensor, self).__init__(**kwargs) - self.properties = properties + def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: + super(IoTSeverityMetrics, self).__init__(**kwargs) + self.high = high + self.medium = medium + self.low = low -class IotSensorsList(Model): - """List of IoT sensors. +class IotSitesList(Model): + """List of IoT sites. 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.IotSensor] + :vartype value: list[~azure.mgmt.security.models.IotSitesModel] """ _validation = { @@ -4996,36 +5378,53 @@ class IotSensorsList(Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSensor]'}, + 'value': {'key': 'value', 'type': '[IotSitesModel]'}, } def __init__(self, **kwargs) -> None: - super(IotSensorsList, self).__init__(**kwargs) + super(IotSitesList, self).__init__(**kwargs) self.value = None -class IoTSeverityMetrics(Model): - """IoT Security solution analytics severity metrics. +class IotSitesModel(Resource): + """IoT site model. - :param high: Count of high severity alerts/recommendations. - :type high: int - :param medium: Count of medium severity alerts/recommendations. - :type medium: int - :param low: Count of low severity alerts/recommendations. - :type low: int + 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 display_name: Required. Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'required': True}, + } + _attribute_map = { - 'high': {'key': 'high', 'type': 'int'}, - 'medium': {'key': 'medium', 'type': 'int'}, - 'low': {'key': 'low', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } - def __init__(self, *, high: int=None, medium: int=None, low: int=None, **kwargs) -> None: - super(IoTSeverityMetrics, self).__init__(**kwargs) - self.high = high - self.medium = medium - self.low = low + def __init__(self, *, display_name: str, tags=None, **kwargs) -> None: + super(IotSitesModel, self).__init__(**kwargs) + self.display_name = display_name + self.tags = tags class IpAddress(Model): @@ -6054,19 +6453,39 @@ class PackageDownloads(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManager :ivar threat_intelligence: All downloads for threat intelligence :vartype threat_intelligence: - ~azure.mgmt.security.models.PackageDownloadsThreatIntelligence + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar snmp: SNMP Server file + :vartype snmp: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar wmi_tool: Used for local configuration export + :vartype wmi_tool: list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar authorized_devices_import_template: Authorized devices import + template + :vartype authorized_devices_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] + :ivar device_information_update_import_template: Authorized devices import + template + :vartype device_information_update_import_template: + list[~azure.mgmt.security.models.PackageDownloadInfo] """ _validation = { 'sensor': {'readonly': True}, 'central_manager': {'readonly': True}, 'threat_intelligence': {'readonly': True}, + 'snmp': {'readonly': True}, + 'wmi_tool': {'readonly': True}, + 'authorized_devices_import_template': {'readonly': True}, + 'device_information_update_import_template': {'readonly': True}, } _attribute_map = { 'sensor': {'key': 'sensor', 'type': 'PackageDownloadsSensor'}, 'central_manager': {'key': 'centralManager', 'type': 'PackageDownloadsCentralManager'}, - 'threat_intelligence': {'key': 'threatIntelligence', 'type': 'PackageDownloadsThreatIntelligence'}, + 'threat_intelligence': {'key': 'threatIntelligence', 'type': '[PackageDownloadInfo]'}, + 'snmp': {'key': 'snmp', 'type': '[PackageDownloadInfo]'}, + 'wmi_tool': {'key': 'wmiTool', 'type': '[PackageDownloadInfo]'}, + 'authorized_devices_import_template': {'key': 'authorizedDevicesImportTemplate', 'type': '[PackageDownloadInfo]'}, + 'device_information_update_import_template': {'key': 'deviceInformationUpdateImportTemplate', 'type': '[PackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6074,6 +6493,10 @@ def __init__(self, **kwargs) -> None: self.sensor = None self.central_manager = None self.threat_intelligence = None + self.snmp = None + self.wmi_tool = None + self.authorized_devices_import_template = None + self.device_information_update_import_template = None class PackageDownloadsCentralManager(Model): @@ -6087,7 +6510,8 @@ class PackageDownloadsCentralManager(Model): ~azure.mgmt.security.models.PackageDownloadsCentralManagerFull :ivar upgrade: Central Manager upgrade package downloads (on existing installations) - :vartype upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :vartype upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6097,7 +6521,7 @@ class PackageDownloadsCentralManager(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsCentralManagerFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, **kwargs) -> None: @@ -6187,7 +6611,8 @@ class PackageDownloadsSensor(Model): :vartype full: ~azure.mgmt.security.models.PackageDownloadsSensorFull :param upgrade: Sensor upgrade package downloads (on existing installations) - :type upgrade: list[~azure.mgmt.security.models.PackageDownloadInfo] + :type upgrade: + list[~azure.mgmt.security.models.UpgradePackageDownloadInfo] """ _validation = { @@ -6196,7 +6621,7 @@ class PackageDownloadsSensor(Model): _attribute_map = { 'full': {'key': 'full', 'type': 'PackageDownloadsSensorFull'}, - 'upgrade': {'key': 'upgrade', 'type': '[PackageDownloadInfo]'}, + 'upgrade': {'key': 'upgrade', 'type': '[UpgradePackageDownloadInfo]'}, } def __init__(self, *, upgrade=None, **kwargs) -> None: @@ -6266,22 +6691,6 @@ def __init__(self, **kwargs) -> None: self.line = None -class PackageDownloadsThreatIntelligence(Model): - """All downloads for threat intelligence. - - :param link: Download link - :type link: str - """ - - _attribute_map = { - 'link': {'key': 'link', 'type': 'str'}, - } - - def __init__(self, *, link: str=None, **kwargs) -> None: - super(PackageDownloadsThreatIntelligence, self).__init__(**kwargs) - self.link = link - - class PathRecommendation(Model): """Represents a path that is recommended to be allowed and its properties. @@ -6909,6 +7318,22 @@ def __init__(self, *, description: str=None, scripts=None, automated: bool=None, self.portal_link = portal_link +class ResetPasswordInput(Model): + """Reset password input. + + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + """ + + _attribute_map = { + 'appliance_id': {'key': 'applianceId', 'type': 'str'}, + } + + def __init__(self, *, appliance_id: str=None, **kwargs) -> None: + super(ResetPasswordInput, self).__init__(**kwargs) + self.appliance_id = appliance_id + + class Rule(Model): """Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). All other remote @@ -7630,8 +8055,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: Required. The severity level of the assessment. Possible values include: 'Low', 'Medium', 'High' :type severity: str or ~azure.mgmt.security.models.Severity @@ -7675,7 +8100,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'}, @@ -7685,13 +8110,13 @@ class SecurityAssessmentMetadata(Resource): 'partner_data': {'key': 'properties.partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadata, self).__init__(**kwargs) self.display_name = display_name 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 @@ -7753,8 +8178,8 @@ class SecurityAssessmentMetadataProperties(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 @@ -7792,7 +8217,7 @@ class SecurityAssessmentMetadataProperties(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'}, @@ -7802,13 +8227,13 @@ class SecurityAssessmentMetadataProperties(Model): 'partner_data': {'key': 'partnerData', 'type': 'SecurityAssessmentMetadataPartnerData'}, } - def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, category=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: + def __init__(self, *, display_name: str, severity, assessment_type, description: str=None, remediation_description: str=None, categories=None, user_impact=None, implementation_effort=None, threats=None, preview: bool=None, partner_data=None, **kwargs) -> None: super(SecurityAssessmentMetadataProperties, self).__init__(**kwargs) self.display_name = display_name 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 @@ -8441,6 +8866,78 @@ def __init__(self, **kwargs) -> None: 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: str=None, os_platform: str=None, vendor: str=None, software_name: str=None, version: str=None, end_of_support_status=None, end_of_support_date: str=None, number_of_known_vulnerabilities: int=None, first_seen_at: str=None, **kwargs) -> None: + 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 SqlServerVulnerabilityProperties(AdditionalData): """Details of the resource that was assessed. @@ -8541,6 +9038,46 @@ def __init__(self, *, all_of, **kwargs) -> None: self.all_of = all_of +class SystemData(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 + :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 + """ + + _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: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + 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 Tags(Model): """A list of key value pairs that describe the resource. @@ -8860,6 +9397,41 @@ def __init__(self, *, tags=None, user_defined_resources=None, recommendations_co self.recommendations_configuration = recommendations_configuration +class UpgradePackageDownloadInfo(PackageDownloadInfo): + """Information on a specific package upgrade download. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar version: Version number + :vartype version: str + :param link: Download link + :type link: str + :ivar version_kind: Kind of the version. Possible values include: + 'Latest', 'Previous', 'Preview' + :vartype version_kind: str or ~azure.mgmt.security.models.VersionKind + :ivar from_version: Minimum base version for upgrade + :vartype from_version: str + """ + + _validation = { + 'version': {'readonly': True}, + 'version_kind': {'readonly': True}, + 'from_version': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'link': {'key': 'link', 'type': 'str'}, + 'version_kind': {'key': 'versionKind', 'type': 'str'}, + 'from_version': {'key': 'fromVersion', 'type': 'str'}, + } + + def __init__(self, *, link: str=None, **kwargs) -> None: + super(UpgradePackageDownloadInfo, self).__init__(link=link, **kwargs) + self.from_version = None + + class UserDefinedResourcesProperties(Model): """Properties of the IoT Security solution's user defined resources. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py index 5dcf2e2766af..ca9379b489a6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_paged_models.py @@ -25,19 +25,6 @@ class ComplianceResultPaged(Paged): def __init__(self, *args, **kwargs): super(ComplianceResultPaged, self).__init__(*args, **kwargs) -class SettingPaged(Paged): - """ - A paging container for iterating over a list of :class:`Setting ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Setting]'} - } - - def __init__(self, *args, **kwargs): - - super(SettingPaged, self).__init__(*args, **kwargs) class DeviceSecurityGroupPaged(Paged): """ A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object @@ -90,58 +77,6 @@ class IoTSecurityAggregatedRecommendationPaged(Paged): def __init__(self, *args, **kwargs): super(IoTSecurityAggregatedRecommendationPaged, self).__init__(*args, **kwargs) -class IotAlertPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotAlert ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotAlert]'} - } - - def __init__(self, *args, **kwargs): - - super(IotAlertPaged, self).__init__(*args, **kwargs) -class IotAlertModelPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotAlertModel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotAlertModel]'} - } - - def __init__(self, *args, **kwargs): - - super(IotAlertModelPaged, self).__init__(*args, **kwargs) -class IotRecommendationPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotRecommendation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotRecommendation]'} - } - - def __init__(self, *args, **kwargs): - - super(IotRecommendationPaged, self).__init__(*args, **kwargs) -class IotRecommendationModelPaged(Paged): - """ - A paging container for iterating over a list of :class:`IotRecommendationModel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[IotRecommendationModel]'} - } - - def __init__(self, *args, **kwargs): - - super(IotRecommendationModelPaged, self).__init__(*args, **kwargs) class AscLocationPaged(Paged): """ A paging container for iterating over a list of :class:`AscLocation ` object @@ -389,19 +324,6 @@ class TopologyResourcePaged(Paged): def __init__(self, *args, **kwargs): super(TopologyResourcePaged, self).__init__(*args, **kwargs) -class AlertPaged(Paged): - """ - A paging container for iterating over a list of :class:`Alert ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Alert]'} - } - - def __init__(self, *args, **kwargs): - - super(AlertPaged, self).__init__(*args, **kwargs) class JitNetworkAccessPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`JitNetworkAccessPolicy ` object @@ -519,3 +441,81 @@ class DevicePaged(Paged): def __init__(self, *args, **kwargs): super(DevicePaged, self).__init__(*args, **kwargs) +class IotAlertModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotAlertModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotAlertModel]'} + } + + def __init__(self, *args, **kwargs): + + super(IotAlertModelPaged, self).__init__(*args, **kwargs) +class IotRecommendationModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`IotRecommendationModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IotRecommendationModel]'} + } + + def __init__(self, *args, **kwargs): + + super(IotRecommendationModelPaged, self).__init__(*args, **kwargs) +class AlertPaged(Paged): + """ + A paging container for iterating over a list of :class:`Alert ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Alert]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertPaged, self).__init__(*args, **kwargs) +class SettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Setting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Setting]'} + } + + def __init__(self, *args, **kwargs): + + super(SettingPaged, self).__init__(*args, **kwargs) +class IngestionSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`IngestionSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[IngestionSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(IngestionSettingPaged, self).__init__(*args, **kwargs) +class SoftwarePaged(Paged): + """ + A paging container for iterating over a list of :class:`Software ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Software]'} + } + + def __init__(self, *args, **kwargs): + + super(SoftwarePaged, self).__init__(*args, **kwargs) 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 651c39085b1f..2fb8b42c41ef 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 @@ -80,48 +80,28 @@ class UnmaskedIpLoggingStatus(str, Enum): enabled = "Enabled" #: Unmasked IP logging is enabled -class ReportedSeverity(str, Enum): +class AdditionalWorkspaceType(str, Enum): - informational = "Informational" - low = "Low" - medium = "Medium" - high = "High" + sentinel = "Sentinel" -class AlertSeverity(str, Enum): +class AdditionalWorkspaceDataType(str, Enum): - informational = "Informational" - low = "Low" - medium = "Medium" - high = "High" + alerts = "Alerts" + raw_events = "RawEvents" -class AlertIntent(str, Enum): +class CreatedByType(str, Enum): - unknown = "Unknown" - pre_attack = "PreAttack" - initial_access = "InitialAccess" - persistence = "Persistence" - privilege_escalation = "PrivilegeEscalation" - defense_evasion = "DefenseEvasion" - credential_access = "CredentialAccess" - discovery = "Discovery" - lateral_movement = "LateralMovement" - execution = "Execution" - collection = "Collection" - exfiltration = "Exfiltration" - command_and_control = "CommandAndControl" - impact = "Impact" - probing = "Probing" - exploitation = "Exploitation" + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" -class RecommendationSeverity(str, Enum): +class ReportedSeverity(str, Enum): - unknown = "Unknown" - not_applicable = "NotApplicable" - healthy = "Healthy" - off_by_policy = "OffByPolicy" + informational = "Informational" low = "Low" medium = "Medium" high = "High" @@ -181,6 +161,12 @@ class EventSource(str, Enum): assessments = "Assessments" 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 PropertyType(str, Enum): @@ -193,15 +179,15 @@ class PropertyType(str, Enum): class Operator(str, Enum): - equals = "Equals" - greater_than = "GreaterThan" - greater_than_or_equal_to = "GreaterThanOrEqualTo" - lesser_than = "LesserThan" - lesser_than_or_equal_to = "LesserThanOrEqualTo" - not_equals = "NotEquals" - contains = "Contains" - starts_with = "StartsWith" - ends_with = "EndsWith" + equals = "Equals" #: Applies for decimal and non-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 only for decimal operands + not_equals = "NotEquals" #: Applies for decimal and non-decimal operands + contains = "Contains" #: Applies only for non-decimal operands + starts_with = "StartsWith" #: Applies only for non-decimal operands + ends_with = "EndsWith" #: Applies only for non-decimal operands class RuleState(str, Enum): @@ -211,7 +197,7 @@ class RuleState(str, Enum): expired = "Expired" -class Category(str, Enum): +class Categories(str, Enum): compute = "Compute" networking = "Networking" @@ -273,33 +259,6 @@ class TransportProtocol(str, Enum): udp = "UDP" -class Intent(str, Enum): - - 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](https://attack.mitre.org/matrices/pre/). - 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. - - -class AlertStatus(str, Enum): - - 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 - - class Protocol(str, Enum): tcp = "TCP" @@ -416,6 +375,14 @@ class RuleType(str, Enum): negative_list = "NegativeList" #: NegativeList +class OnboardingKind(str, Enum): + + default = "Default" + migrated_to_azure = "MigratedToAzure" + evaluation = "Evaluation" + purchased = "Purchased" + + class VersionKind(str, Enum): latest = "Latest" @@ -423,6 +390,27 @@ class VersionKind(str, Enum): preview = "Preview" +class SensorStatus(str, Enum): + + ok = "Ok" + disconnected = "Disconnected" + unavailable = "Unavailable" + + +class TiStatus(str, Enum): + + ok = "Ok" + failed = "Failed" + in_progress = "InProgress" + update_available = "UpdateAvailable" + + +class SensorType(str, Enum): + + ot = "Ot" + enterprise = "Enterprise" + + class MacSignificance(str, Enum): primary = "Primary" @@ -478,6 +466,93 @@ class DeviceStatus(str, Enum): removed = "Removed" +class AlertSeverity(str, Enum): + + informational = "Informational" + low = "Low" + medium = "Medium" + high = "High" + + +class AlertIntent(str, Enum): + + unknown = "Unknown" + pre_attack = "PreAttack" + initial_access = "InitialAccess" + persistence = "Persistence" + privilege_escalation = "PrivilegeEscalation" + defense_evasion = "DefenseEvasion" + credential_access = "CredentialAccess" + discovery = "Discovery" + lateral_movement = "LateralMovement" + execution = "Execution" + collection = "Collection" + exfiltration = "Exfiltration" + command_and_control = "CommandAndControl" + impact = "Impact" + probing = "Probing" + exploitation = "Exploitation" + + +class RecommendationSeverity(str, Enum): + + unknown = "Unknown" + not_applicable = "NotApplicable" + healthy = "Healthy" + off_by_policy = "OffByPolicy" + low = "Low" + medium = "Medium" + high = "High" + + +class Intent(str, Enum): + + 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](https://attack.mitre.org/matrices/pre/). + 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. + + +class AlertStatus(str, Enum): + + 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 + + +class BundleType(str, Enum): + + app_services = "AppServices" + dns = "DNS" + key_vaults = "KeyVaults" + kubernetes_service = "KubernetesService" + resource_manager = "ResourceManager" + sql_servers = "SqlServers" + storage_accounts = "StorageAccounts" + virtual_machines = "VirtualMachines" + + +class EndOfSupportStatus(str, Enum): + + none = "None" + no_longer_supported = "noLongerSupported" + version_no_longer_supported = "versionNoLongerSupported" + upcoming_no_longer_supported = "upcomingNoLongerSupported" + upcoming_version_no_longer_supported = "upcomingVersionNoLongerSupported" + + class ExpandEnum(str, Enum): links = "links" #: All links associated with an assessment 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 751d0d5098d5..b2d82cbcb14d 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 @@ -11,17 +11,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 @@ -43,7 +38,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 @@ -62,21 +56,25 @@ from ._devices_for_hub_operations import DevicesForHubOperations 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', @@ -98,7 +96,6 @@ 'AdaptiveNetworkHardeningsOperations', 'AllowedConnectionsOperations', 'TopologyOperations', - 'AlertsOperations', 'JitNetworkAccessPoliciesOperations', 'DiscoveredSecuritySolutionsOperations', 'SecuritySolutionsReferenceDataOperations', @@ -117,4 +114,13 @@ 'DevicesForHubOperations', 'DeviceOperations', 'OnPremiseIotSensorsOperations', + 'IotSitesOperations', + 'IotAlertsOperations', + 'IotAlertTypesOperations', + 'IotRecommendationsOperations', + 'IotRecommendationTypesOperations', + 'AlertsOperations', + 'SettingsOperations', + 'IngestionSettingsOperations', + 'SoftwareInventoriesOperations', ] 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 3c069f9610fb..e15d81e6e575 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,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -25,7 +27,7 @@ class AlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2020-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-01-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" + self.api_version = "2021-01-01" self.config = config @@ -175,7 +177,7 @@ def internal_paging(next_link=None): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} - def list_subscription_level_alerts_by_region( + def list_subscription_level_by_region( self, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the subscription that are stored in a specific location. @@ -193,7 +195,7 @@ def list_subscription_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_subscription_level_alerts_by_region.metadata['url'] + url = self.list_subscription_level_by_region.metadata['url'] 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') @@ -241,9 +243,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_subscription_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def list_resource_group_level_alerts_by_region( + def list_resource_group_level_by_region( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """List all the alerts that are associated with the resource group that are stored in a specific location. @@ -264,7 +266,7 @@ def list_resource_group_level_alerts_by_region( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_resource_group_level_alerts_by_region.metadata['url'] + url = self.list_resource_group_level_by_region.metadata['url'] 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'), @@ -313,9 +315,9 @@ def internal_paging(next_link=None): deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + list_resource_group_level_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} - def get_subscription_level_alert( + def get_subscription_level( self, alert_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated with a subscription. @@ -332,7 +334,7 @@ def get_subscription_level_alert( :raises: :class:`CloudError` """ # Construct URL - url = self.get_subscription_level_alert.metadata['url'] + url = self.get_subscription_level.metadata['url'] 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,9 +374,9 @@ def get_subscription_level_alert( return client_raw_response return deserialized - get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_subscription_level.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def get_resource_group_level_alerts( + def get_resource_group_level( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Get an alert that is associated a resource group or a resource in a resource group. @@ -395,7 +397,7 @@ def get_resource_group_level_alerts( :raises: :class:`CloudError` """ # Construct URL - url = self.get_resource_group_level_alerts.metadata['url'] + url = self.get_resource_group_level.metadata['url'] 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'), @@ -436,9 +438,9 @@ def get_resource_group_level_alerts( return client_raw_response return deserialized - get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + get_resource_group_level.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} - def update_subscription_level_alert_state_to_dismiss( + def update_subscription_level_state_to_dismiss( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -454,7 +456,7 @@ def update_subscription_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_dismiss.metadata['url'] + url = self.update_subscription_level_state_to_dismiss.metadata['url'] 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'), @@ -487,7 +489,7 @@ def update_subscription_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_subscription_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} def update_subscription_level_state_to_resolve( self, alert_name, custom_headers=None, raw=False, **operation_config): @@ -540,7 +542,7 @@ def update_subscription_level_state_to_resolve( return client_raw_response update_subscription_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_subscription_level_alert_state_to_reactivate( + def update_subscription_level_state_to_activate( self, alert_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -556,7 +558,7 @@ def update_subscription_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_subscription_level_alert_state_to_reactivate.metadata['url'] + url = self.update_subscription_level_state_to_activate.metadata['url'] 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'), @@ -589,7 +591,7 @@ def update_subscription_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_subscription_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_subscription_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} def update_resource_group_level_state_to_resolve( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -646,7 +648,7 @@ def update_resource_group_level_state_to_resolve( return client_raw_response update_resource_group_level_state_to_resolve.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve'} - def update_resource_group_level_alert_state_to_dismiss( + def update_resource_group_level_state_to_dismiss( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -665,7 +667,7 @@ def update_resource_group_level_alert_state_to_dismiss( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_dismiss.metadata['url'] + url = self.update_resource_group_level_state_to_dismiss.metadata['url'] 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'), @@ -699,9 +701,9 @@ def update_resource_group_level_alert_state_to_dismiss( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} + update_resource_group_level_state_to_dismiss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss'} - def update_resource_group_level_alert_state_to_reactivate( + def update_resource_group_level_state_to_activate( self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): """Update the alert's state. @@ -720,7 +722,7 @@ def update_resource_group_level_alert_state_to_reactivate( :raises: :class:`CloudError` """ # Construct URL - url = self.update_resource_group_level_alert_state_to_reactivate.metadata['url'] + url = self.update_resource_group_level_state_to_activate.metadata['url'] 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'), @@ -754,4 +756,86 @@ def update_resource_group_level_alert_state_to_reactivate( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - update_resource_group_level_alert_state_to_reactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + update_resource_group_level_state_to_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate'} + + + def _simulate_initial( + self, properties=None, custom_headers=None, raw=False, **operation_config): + alert_simulator_request_body = models.AlertSimulatorRequestBody(properties=properties) + + # Construct URL + url = self.simulate.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(alert_simulator_request_body, 'AlertSimulatorRequestBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def simulate( + self, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Simulate security alerts. + + :param properties: Alert Simulator request body data. + :type properties: + ~azure.mgmt.security.models.AlertSimulatorRequestProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._simulate_initial( + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + simulate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate'} 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..67f6ce4ea26d --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_ingestion_settings_operations.py @@ -0,0 +1,400 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class IngestionSettingsOperations(object): + """IngestionSettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2021-01-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings for ingesting security data and logs to correlate with + resources associated with the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of IngestionSetting + :rtype: + ~azure.mgmt.security.models.IngestionSettingPaged[~azure.mgmt.security.models.IngestionSetting] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.IngestionSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings'} + + def get( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IngestionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IngestionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def create( + self, ingestion_setting_name, properties=None, custom_headers=None, raw=False, **operation_config): + """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 properties: Ingestion setting data + :type properties: object + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IngestionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + ingestion_setting = models.IngestionSetting(properties=properties) + + # Construct URL + url = self.create.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(ingestion_setting, 'IngestionSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IngestionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def delete( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Deletes the ingestion settings for this subscription. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}'} + + def list_tokens( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IngestionSettingToken or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IngestionSettingToken or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_tokens.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IngestionSettingToken', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_tokens.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens'} + + def list_connection_strings( + self, ingestion_setting_name, custom_headers=None, raw=False, **operation_config): + """Connection strings for ingesting security scan logs and data. + + :param ingestion_setting_name: Name of the ingestion setting + :type ingestion_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionStrings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ConnectionStrings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_connection_strings.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConnectionStrings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings'} 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 68a582e8109d..95c336efe29b 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 @@ -25,6 +25,7 @@ class IotAlertTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,141 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotAlertTypeList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlertTypeList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.list.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotAlertTypeList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes'} - - def get( - self, resource_group_name, solution_name, iot_alert_type_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotAlertType or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlertType or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.get.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotAlertType', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}'} - - def list1( self, custom_headers=None, raw=False, **operation_config): """List IoT alert types. @@ -182,10 +53,8 @@ def list1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] 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}$') } @@ -193,7 +62,7 @@ def list1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -223,9 +92,9 @@ def list1( return client_raw_response return deserialized - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes'} - def get1( + def get( self, iot_alert_type_name, custom_headers=None, raw=False, **operation_config): """Get IoT alert type. @@ -241,10 +110,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] 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') @@ -253,7 +120,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -283,4 +150,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}'} 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 8f4e3128008b..e3bac72a7994 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 @@ -25,6 +25,7 @@ class IotAlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,178 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, min_start_time_utc=None, max_start_time_utc=None, alert_type=None, compromised_entity=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IotAlert - :rtype: - ~azure.mgmt.security.models.IotAlertPaged[~azure.mgmt.security.models.IotAlert] - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - 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 = {} - 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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IotAlertPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts'} - - def get( - self, resource_group_name, solution_name, iot_alert_id, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotAlert or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotAlert or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.get.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotAlert', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}'} - - def list1( self, scope, min_start_time_utc=None, max_start_time_utc=None, alert_type=None, device_management_type=None, compromised_entity=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): """List IoT alerts. @@ -241,12 +75,10 @@ def list1( ~azure.mgmt.security.models.IotAlertModelPaged[~azure.mgmt.security.models.IotAlertModel] :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } @@ -254,7 +86,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.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: @@ -307,9 +139,9 @@ def internal_paging(next_link=None): deserialized = models.IotAlertModelPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts'} - def get1( + def get( self, scope, iot_alert_id, custom_headers=None, raw=False, **operation_config): """Get IoT alert. @@ -329,10 +161,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotAlertId': self._serialize.url("iot_alert_id", iot_alert_id, 'str') @@ -341,7 +171,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -371,4 +201,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py index 679341957e37..4c796db0a056 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_defender_settings_operations.py @@ -150,16 +150,12 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default'} def create_or_update( - self, device_quota, sentinel_workspace_resource_ids, custom_headers=None, raw=False, **operation_config): + self, iot_defender_settings_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT Defender settings. - :param device_quota: Size of the device quota (as a opposed to a Pay - as You Go billing model). Value is required to be in multiples of - 1000. - :type device_quota: int - :param sentinel_workspace_resource_ids: Sentinel Workspace Resource - Ids - :type sentinel_workspace_resource_ids: list[str] + :param iot_defender_settings_model: The IoT defender settings model + :type iot_defender_settings_model: + ~azure.mgmt.security.models.IotDefenderSettingsModel :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -170,8 +166,6 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - iot_defender_settings_model = models.IotDefenderSettingsModel(device_quota=device_quota, sentinel_workspace_resource_ids=sentinel_workspace_resource_ids) - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -320,3 +314,60 @@ def package_downloads_method( return deserialized package_downloads_method.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads'} + + def download_manager_activation( + self, custom_headers=None, raw=False, callback=None, **operation_config): + """Download manager activation data defined for this subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.download_manager_activation.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_manager_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/downloadManagerActivation'} 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 2ac1dadc2e86..bab2575515cb 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 @@ -25,6 +25,7 @@ class IotRecommendationTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,141 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotRecommendationTypeList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendationTypeList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.list.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotRecommendationTypeList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes'} - - def get( - self, resource_group_name, solution_name, iot_recommendation_type_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotRecommendationType or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendationType or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.get.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotRecommendationType', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes/{iotRecommendationTypeName}'} - - def list1( self, custom_headers=None, raw=False, **operation_config): """List IoT recommendation types. @@ -182,10 +53,8 @@ def list1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] 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}$') } @@ -193,7 +62,7 @@ def list1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -223,9 +92,9 @@ def list1( return client_raw_response return deserialized - list1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes'} - def get1( + def get( self, iot_recommendation_type_name, custom_headers=None, raw=False, **operation_config): """Get IoT recommendation type. @@ -241,10 +110,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] 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') @@ -253,7 +120,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -283,4 +150,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}'} 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 36af51bc0cdf..962b4ab04cbe 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 @@ -25,6 +25,7 @@ class IotRecommendationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". """ models = models @@ -34,168 +35,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2020-08-06-preview" self.config = config def list( - self, resource_group_name, solution_name, recommendation_type=None, device_id=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of IotRecommendation - :rtype: - ~azure.mgmt.security.models.IotRecommendationPaged[~azure.mgmt.security.models.IotRecommendation] - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - 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 = {} - 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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.IotRecommendationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations'} - - def get( - self, resource_group_name, solution_name, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: IotRecommendation or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotRecommendation or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-08-01" - - # Construct URL - url = self.get.metadata['url'] - 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 = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IotRecommendation', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations/{iotRecommendationId}'} - - def list1( self, scope, recommendation_type=None, device_id=None, limit=None, skip_token=None, custom_headers=None, raw=False, **operation_config): """List IoT recommendations. @@ -221,12 +65,10 @@ def list1( ~azure.mgmt.security.models.IotRecommendationModelPaged[~azure.mgmt.security.models.IotRecommendationModel] :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list1.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } @@ -234,7 +76,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.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: @@ -281,9 +123,9 @@ def internal_paging(next_link=None): deserialized = models.IotRecommendationModelPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations'} - def get1( + def get( self, scope, iot_recommendation_id, custom_headers=None, raw=False, **operation_config): """Get IoT recommendation. @@ -303,10 +145,8 @@ def get1( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-06-preview" - # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'iotRecommendationId': self._serialize.url("iot_recommendation_id", iot_recommendation_id, 'str') @@ -315,7 +155,7 @@ def get1( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -345,4 +185,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py index 0565ee6ba734..5557bba21f9d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py @@ -111,8 +111,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -149,7 +149,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -159,7 +159,7 @@ def get( get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}'} def create_or_update( - self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + self, scope, iot_sensor_name, iot_sensors_model, custom_headers=None, raw=False, **operation_config): """Create or update IoT sensor. :param scope: Scope of the query (IoT Hub, @@ -167,13 +167,15 @@ def create_or_update( :type scope: str :param iot_sensor_name: Name of the IoT sensor :type iot_sensor_name: str + :param iot_sensors_model: The IoT sensor model + :type iot_sensors_model: ~azure.mgmt.security.models.IotSensorsModel :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSensor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSensor or + :return: IotSensorsModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSensorsModel or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -192,6 +194,7 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -199,8 +202,11 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(iot_sensors_model, 'IotSensorsModel') + # Construct and send request - request = self._client.put(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: @@ -210,9 +216,9 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if response.status_code == 201: - deserialized = self._deserialize('IotSensor', response) + deserialized = self._deserialize('IotSensorsModel', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -336,3 +342,127 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation'} + + def download_reset_password( + self, scope, iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword'} + + def trigger_ti_package_update( + self, scope, iot_sensor_name, custom_headers=None, raw=False, **operation_config): + """Trigger threat intelligence package update. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param iot_sensor_name: Name of the IoT sensor + :type iot_sensor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.trigger_ti_package_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'iotSensorName': self._serialize.url("iot_sensor_name", iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + trigger_ti_package_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py new file mode 100644 index 000000000000..3f275513d948 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py @@ -0,0 +1,276 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class IotSitesOperations(object): + """IotSitesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2020-08-06-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-06-preview" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """List IoT sites. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites'} + + def get( + self, scope, custom_headers=None, raw=False, **operation_config): + """Get IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def create_or_update( + self, scope, display_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Create or update IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param display_name: Display name of the IoT site + :type display_name: str + :param tags: Tags of the IoT site + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IotSitesModel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSitesModel or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + iot_sites_model = models.IotSitesModel(display_name=display_name, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(iot_sites_model, 'IotSitesModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IotSitesModel', response) + if response.status_code == 201: + deserialized = self._deserialize('IotSitesModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} + + def delete( + self, scope, custom_headers=None, raw=False, **operation_config): + """Delete IoT site. + + :param scope: Scope of the query (IoT Hub, + /providers/Microsoft.Devices/iotHubs/myHub) + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/{scope}/providers/Microsoft.Security/iotSites/default'} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py index bd5c73f7dcd8..234ea698cd85 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_on_premise_iot_sensors_operations.py @@ -321,3 +321,71 @@ def download_activation( return deserialized download_activation.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation'} + + def download_reset_password( + self, on_premise_iot_sensor_name, appliance_id=None, custom_headers=None, raw=False, callback=None, **operation_config): + """Download file for reset password of the sensor. + + :param on_premise_iot_sensor_name: Name of the on-premise IoT sensor + :type on_premise_iot_sensor_name: str + :param appliance_id: The appliance id of the sensor. + :type appliance_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param callback: When specified, will be called with each chunk of + data that is streamed. The callback should take two arguments, the + bytes of the current chunk of data and the response object. If the + data is uploading, response will be None. + :type callback: Callable[Bytes, response=None] + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: Generator or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ResetPasswordInput(appliance_id=appliance_id) + + # Construct URL + url = self.download_reset_password.metadata['url'] + 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}$'), + 'onPremiseIotSensorName': self._serialize.url("on_premise_iot_sensor_name", on_premise_iot_sensor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/zip' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'ResetPasswordInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=True, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._client.stream_download(response, callback) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + download_reset_password.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadResetPassword'} 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 b3e51771853c..841109ee0ce6 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 @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -253,28 +255,9 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} - def delete( - self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -304,7 +287,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -312,4 +295,51 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_namespace=resource_namespace, + resource_type=resource_type, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}'} 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 0fd17bfc35f6..68ca91260b72 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 @@ -25,7 +25,7 @@ class SettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2019-01-01". + :ivar api_version: API version for the operation. Constant value: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01" + self.api_version = "2021-06-01" self.config = config @@ -109,8 +109,8 @@ def get( self, setting_name, custom_headers=None, raw=False, **operation_config): """Settings of different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' + :param setting_name: The name of the setting. Possible values include: + 'MCAS', 'WDATP', 'Sentinel' :type setting_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -168,8 +168,8 @@ def update( self, setting_name, setting, custom_headers=None, raw=False, **operation_config): """updating settings about different configurations in security center. - :param setting_name: Name of setting: (MCAS/WDATP). Possible values - include: 'MCAS', 'WDATP' + :param setting_name: The name of the setting. Possible values include: + 'MCAS', 'WDATP', 'Sentinel' :type setting_name: str :param setting: Setting object :type setting: ~azure.mgmt.security.models.Setting 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..94624a4c5cdd --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_software_inventories_operations.py @@ -0,0 +1,257 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SoftwareInventoriesOperations(object): + """SoftwareInventoriesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "2021-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-01-preview" + + self.config = config + + def list_by_extended_resource( + self, resource_group_name, resource_namespace, resource_type, resource_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Software + :rtype: + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_extended_resource.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_extended_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets the software inventory of all virtual machines in the + subscriptions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Software + :rtype: + ~azure.mgmt.security.models.SoftwarePaged[~azure.mgmt.security.models.Software] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SoftwarePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories'} + + def get( + self, resource_group_name, resource_namespace, resource_type, resource_name, software_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Software or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Software or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Software', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}'}