From 436d36b4f77a4e6a0b48f67d4fc1eb89ef65aa3b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Jan 2021 17:59:36 +0000 Subject: [PATCH] CodeGen from PR 12289 in Azure/azure-rest-api-specs Get latest master (#12289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Hub Generated] Review request for Microsoft.AlertsManagement to add version stable/2019-06-01 (#11833) * Changing Swagger file * Changing examples * Fixing tags example * Fixing tags example * Fixing tags example * prettier fix for white spaces * Enable azure-sdk-for-net-track2 (#12169) * Updating existing CRR APIs with zone restore feature (#12157) * - Added change for support of cross zone restores. * - updating example json * - Fixing prettier * lastUpdatedDate for templates (#11900) * lastUpdatedDate for templates * fix * [Hub Generated] Review request for Microsoft.AppPlatform to add version preview/2020-11-01-preview (#11823) * Adds base for updating Microsoft.AppPlatform from version stable/2020-07-01 to version 2020-11-01-preview * Updates readme * Updates API version in new specs and examples * Introduce additional change to 2020-11-01-preview. * Additional properties to monitoringSettings. * Readonly properties to requiredTraffics. Signed-off-by: Pan Li * Make credscan happy. Signed-off-by: Pan Li * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 (#12113) * Fix linter and swagger warnings * Fix errors * Removed unneeded change * [ASC.Automations] Add new data type "RegulatoryComplianceAssessment" (#12185) * Add SubAssessment event source type and add more automations examples * Change Location isReadOnlu to false * Test * Add new read/write location and add new type TrackedResourceLocation * Minor * minor * prettier fixes * Change variable name to TrackedResourceLocation * Change type name TrackedResourceLocation to AzureTrackedResourceLocation * Update automations example * Add SecureScores & SecureScoreControls as new supported datatypes in Automations resource * [ASC.Automations] add new data type RegulatoryComplianceAssessment * add datalake store track2 config (#12186) * cleanup old pipeline dependencies (#11889) * cleanup pipeline deps * add rest-api-specs-scripts * Extending recovery network input in replication intent API to support new network creation (#12191) * [Hub Generated] Review request for Microsoft.Maps to add version preview/2020-02-01-preview (#12172) * Adding operations for Maps Creator resource. * Fixing typo. * Adds suppression to readme * Adds suppression to readme * Adds suppression to readme * Adds suppression to readme * Resolving linter errors. * Minor update. * Updating all reference to v2 schema. * Marked private atlas as deprecated in description. * add operationsmanagement track2 config (#12141) * Update comment.yml (#12202) Add ARM traffic query link. When add breakingChangeReviewRequired * Adding new properties to response body (#12201) * adding new properties * updating examples * prettier fix * [Hub Generated] Review request for Microsoft.ContainerService to add version stable/2020-12-01 (#12064) * Add autorest.az configurations for azure monitor control service (#12090) * add AMCS config for codegen * reorganize command group * rename command group * Codegen modify try to rename DataCollectionRules create parameters * hide DataCollectionRules Create & Update commands and DataCollectionRuleAssociations Create command * use alias instand of rename in code-gen * use monitor-control-service as the extension name * Update readme.python.md * add logic track2 config (#12166) * add alertsmanagement track2 config (#11759) * Update comment.yml (#12213) * add mixedreality track2 confi (#12070) * add signalr track2 config (#11892) * add cognitiveservice track2 config (#11498) * add machinglearningservices track2 config (#12183) * add apimanagement track2 config (#12187) * add serialconsole track2 config (#12046) * Update TransparentDataEncryption Group Name (#12160) * update TransparentDataEncryption Group name * update reference of TransparentDataEncryption * Update readme.python.md (#12216) * Required changes for Azure HealthBot swagger (#12124) * Fixes for SDK generation files. * Fixes for SDK generation files. * Added GO. * Change Healthcare bot to Healthbot. * 1. Remove unused properties of SKU. 2. Removed unused CheckNameAvailability.json 3. Remove subgroup. * Sku is required. * [Hub Generated] Review request for Microsoft.IoTCentral to add version stable/2018-09-01 (#12224) * update to name * update * add api-version of guest configuration to go SDK (#12217) * add api-version for templatespecs (#12197) * Update specificationRepositoryConfiguration.json (#12218) * Adding new api version to devops RP (#11585) * Initial commit as per PR review * Actual changes to api spec for new version * Switching to multi-api build for python * Fix python spec to correct namespaces in multiapi mode * Revert changes to python generation * Add systemdata * Fix the path for sys data reference * Fix path once more * remove additional properties after including systemdata * Remove more addtional properties * Move system data to root * Fix wrong output-folder (#12229) * Remove swagger and examples because the controller will be used for private preview. (#12177) * Update pull_request_assignment.yml (#12230) * [Hub Generated] Review request for Microsoft.StorageCache to add version stable/2020-10-01 (#11407) * Init the next version so diffs can work better. * Updates readme * Updates API version in new specs and examples * Updates to StorageTargetProperties and added examples of cmk, mtu Add 202 to the storage cache and storage target create/update and update examples Fix ST no junction example's 202 response. add properties for nfs extended groups fix issues with extended groups properties found with autorest add properties and objects for Active Directory username download undo unintended change changes from comments in pull request AccessPolicy support. Example fixes for Access Policies. Fix attribute names to match latest RP. update to credential properties for LDAP and Active Directory marking password properties with x-ms-secret tag minor changes on extended groups and add examples Added blob NFS and some other validation fixes. Update required property for domainName from dnsName Updated blobNfs examples and some kpi fixes. Correct validation errors in examples. Added systemdata to resources. Remove x-ms-secret in keyvault reference due to linter error and common types not using it. Remove blobNfs from this version. Remove blobNfs from spec file. Remove x-ms-secret due to linter errors. Fix certificate spelling. Updating prettier and spell check errors. Used prettier on main spec file. Readded x-ms-secret that open api hub failed on but the PR pipeline allows. * Add prettier fix after rebase * Remove 202 bodies and add systemData to examples. * Update spec with prettier. * Address comments on spec for descriptions, readmes, and extendedGroupsEnabled. * Updating to address addition ldap and pattern comments. * Update version tag to include 01 * Restore changes that would be considered breaking changes matching 2020-03-01 * Address a few other comments. * Update netbios field names and some descriptions. * Fix s360 for missing debugInfo operation. * Fix credscan error in example file. * Update required fields, new validator failure on debugInfo return codes, and bindPassword example value. * Update debug info example with new return codes. * Update other credscan password errors. * Update Semantic-and-Model-Violations-Reference.md (#12199) Adding secret_property code, update some other codes. * ADP - add system metadata to dataPool (#12179) * Swagger Linting Fix (#12162) * Fix Linting Issuing * no message * fix description * add description and object back * test to resolve model validation test (cherry picked from commit ab273dfc0d5897683c128ee15da4babafa7a85ba) * [SQL][V20180601] Updating LocationCapabilities spec (#12032) * [SQL][V20180601] Updating LocationCapabilities spec * Fill 2020 versions * Rollback V2018 changes and bump LocationCapabilities in V4 to 2020-08-01-preview * update order for CI-FixRequiredOnFailure (#12227) * update rdbms track2 config (#12245) * ADT: refix path (#12161) * python track2 configure (#12150) * Add and remove owner for service principals (#12081) * [Hub Generated] Review request for Microsoft.MixedReality to add version stable/2020-05-01 (#11810) * fix spec * fix prettier * [Hub Generated] Review request for Microsoft.MixedReality to add version preview/2019-12-02-preview (#11769) * fix for swagger completeness * forgot curly brace * fix example * Api Management - make /tenant endpoints ARM compliant in 2020-06-01-preview version (#11549) * Adds base for updating Microsoft.ApiManagement from version stable/2019-12-01 to version 2020-06-01-preview * Updates readme * Updates API version in new specs and examples * Add support in API Management for Availability Zones (#10284) * apim in azs * fix prettier check * PATCH should return 200 OK (#10328) * add support for PATCH returning 200 OK * CI fixes prettier fix CI fixes part 2 * Password no longer a mandatory property when uploading Certificates * add missing x-ms-odata extension for filter support * +gatewayhostnameconfiguration protocol changes (#10292) * [2020-06-01-preview] Update Oauth Server secrets Contract (#10602) * Oauth server secrets contract * fix azureMonitor enum * API Management Service Deleted Services Resource (#10607) * API Management Service Deleted Services Resource * Path fix * Lint + custom-words fixes * Location URI parameter for deletedservices Resource * GET for deletedservices by service name * Remove resourceGroupName from resource path * fixes * schema for purge operation * perttier applied * 204 response code added Co-authored-by: REDMOND\glfeokti * OperationNameFormat property added to Diagnostic contract (#10641) * OperationNameFormat property added to Diagnostic contract * add azuremonitor to update contract Co-authored-by: REDMOND\glfeokti * [Microsoft.ApiManagement][2020-06-01-preview] Change Network Status response contract (#10331) * Change Network Status response contract * Update examples for network status contract * ApiManagement - tenant/settings endpoints * ApiManagement - tenant/settings endpoints fix * ApiManagement - tenant/settings endpoints fix prettier * ApiManagement - tenant/settings endpoints fix 3 * ApiManagement - tenant/settings endpoints fix 4 * ApiManagement - tenant/settings endpoints fix 5 Co-authored-by: Samir Solanki Co-authored-by: maksimkim Co-authored-by: promoisha Co-authored-by: REDMOND\glfeokti Co-authored-by: RupengLiu Co-authored-by: vfedonkin * Add "mail" parameter to UserUpdateParameters in graphrbac (#12127) This patch adds a single optional field "mail" to UserUpdateParameters schema. This makes it possible to update user's e-mail address using the (Go) Azure SDK. Currently this is not possible. I have curled the graphrbac API with the extra body parameter and it works as expected. Addition of the field will make it possible to support the mail property on the azuread_user resource in terraform-provider-azuread. Co-authored-by: David Čepelík * [Hub Generated] Review request for Microsoft.Advisor to add version stable/2020-01-01 (#12262) * add resourcegraph track2 config (#12122) * add reservations track2 config (#12027) * Removing a readonly tag from a property (#12254) * Fix swagger correctness errors (#12246) * Fix swagger correctness issues in Security for Iot service * changed int format from 32 to 64 * Add systemData to iotSecuritySolutions Co-authored-by: Liran Chen * [Hub Generated] Review request for Microsoft.Consumption to add version stable/2019-10-01 (#12196) * AAS - Swagger Linting and Correctness Fix (#12176) * Fix R4013 IntegerTypeMustHaveFormat * Fix R4010 RequiredDefaultResponse * Fix R4007 DefaultErrorResponseSchema * removed extra bracket * fix semantic issue * add type error * Fix linting issue * test to resolve model validation test * Revert "test to resolve model validation test" This reverts commit ab273dfc0d5897683c128ee15da4babafa7a85ba. * Resolve Model Validation Issue * Resolve Model Validation Issue v2 * test - add missing properties (cherry picked from commit 48ec27c51cc61f4b3c05b531618f40b7c2f77de6) * fix format * set default value * add x-ms-enum * fix nit * Add missing property * add missing properties * add missing bracket * change GatewayListStatusLive type * add missing "origin" property * fix model validation * Revert "change GatewayListStatusLive type" This reverts commit 4f3fa743d5ce91bea6bcf83474e6e3fc15bc3483. * Revert "fix model validation" This reverts commit 945bc233b9e623b2d90f7903b8b4dee94d873aa8. * add redhatopenshift track2 config (#12045) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-10-01 (#12194) * Adding nextLink and previousLink to Tags endpoint properties * moving properties out * prettier check fix Co-authored-by: Jorge Chavez Nieto * add relay track2 config (#11495) * update healthbot t2 config (#12269) * update healthbot t2 config * fix readme * add automation track2 config (#11628) * add automation track2 config * update config * Azure Remote Rendering REST API swagger file - for review (#12015) * Azure Remote Rendering API specifcation * fix schema issue * fix examples * fix request bodies integer values, :stop path * pointing readme.md to open api spec for ARR * fix typo, add custom words * add msvc to custom words * fix readme.md * ran prettifier * fix reference to json * reference sts from file as well * fix readme.md * changes to readme.md * remove example from error to fix error * add 200 OK status for retried PUT for conversions and sessiosn * ran prettier * make autorest linter not crash * fix casing of nextLinkName paramter * factor out conversion list response * add examples for conversions * adding examples for sessions, prettify files * [Hub Generated] Review request for Microsoft.Maps/Microsoft.Maps to add version preview/2.0 (#12175) * microsoft.imagery 512 not supported Adding micorosft.imagery to 512 tile not supported list * Updating Raster Tilesets to Have Max Zoom 22 Certain raster tilesets now support up to zoom level 22. * minor changes to swagger (#12253) * minor changes to swagger * reverting sdk definitions file * Add addons to AVS 2020-07-17-preview (#12236) * found missing AVS/privateclouds/addons commit, moving it to 2020-07-17-preview API from PR repo * fixed prettier errors * Fixed vladation warnings for x-ms-enum and missing description/title, related to addons * fixed validation error for missing systemData for addons responses * fixed prettier errors * fixed validation error for missing systemData for addons responses * systemData for any Resource * make sure systemData is readOnly * systemData needs to go in a new api version * suppress systemData error Co-authored-by: Cameron Taggart * Azs api bug fix (#12133) * Old api version for ComputeOperationResult * Api Bugfix for Azure Stack Fabric Admin * Fix for typo in readme * Add default reponse * Fix example issue for default error * Update comment.yml (#12273) * [Hub Generated] Review request for Microsoft.CostManagement to add version stable/2019-11-01 (#12031) * fix dataSet typo * fix dimensions and tags typo * more dimensions and tags to fix * one more miss on dimensions and tags * Add the includeMonetaryCommitment missing field * fix spell check error * make property read only * remove the not operation from query filters * New backup service api version (#12171) * Initial commit: adding new api version * - new api 2020-12-01 * updating the readme.md package reference * - adding the zone information for new api * - updating api-version in examples - added 'zone' in Get recoverypoint api example json * Fixing prettier issue * Revert "- updating api-version in examples" This reverts commit 80baa9fcec1293bd3a51875d793f2178964fce52. * - adding api-version in examples * adding new api version in package mds * [IotHub] Introducing networkRuleSets in IotHubProperties [2020-08-31 : preview and stable ] (#10853) * Adds base for updating Microsoft.Devices from version preview/2020-07-10-preview to version 2020-08-31-preview * Updates readme * Updates API version in new specs and examples * Adds base for updating Microsoft.Devices from version stable/2020-08-01 to version 2020-08-31 * Updates readme * Updates API version in new specs and examples * Adding networkRuleSets support for iothub * Adding networkRuleSets Support in preview version * Adding Examples, correcting order in iothub.json * Updating Readme to have stable and previe versions * Modifying Tag to package-2020-08-31 * Adding Arm identity properties from 2020-07-010-preview version * Removing creds * minor fix * swagger correctness fix (#12101) * swagger correctness fix * update preview version too * Revert change and add defaults (#12243) * Remove gallery preview version 2020-09-30 from stable release (#12222) * add managementpartner track2 config (#12043) * [Hub Generated] Review request for Microsoft.Insights to add version stable/2019-03-01 (#12232) * Fixed swagger validations for api version 2019 * reverted error response change and suppress * removed redundant error details * renamed suppression rule * fixed suppression Co-authored-by: napolish <67951636+napolish@users.noreply.github.com> Co-authored-by: Phoenix He Co-authored-by: arpja <46751982+arpja@users.noreply.github.com> Co-authored-by: ShaniFelig <74960756+ShaniFelig@users.noreply.github.com> Co-authored-by: Pan Li Co-authored-by: Zach Rathbun Co-authored-by: surashed <55134940+surashed@users.noreply.github.com> Co-authored-by: Kaihui (Kerwin) Sun Co-authored-by: Zhenglai Zhang Co-authored-by: om-nishant <50401171+om-nishant@users.noreply.github.com> Co-authored-by: Ihar Voitka Co-authored-by: Ruoxuan Wang <52271048+ruowan@users.noreply.github.com> Co-authored-by: Ju Hee Lee Co-authored-by: xiazhan Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com> Co-authored-by: Ji Wang Co-authored-by: Andy Zhang Co-authored-by: guy-microsoft <50947884+guy-microsoft@users.noreply.github.com> Co-authored-by: PoAn (Baron) Chen Co-authored-by: Arcturus Co-authored-by: suyash691 Co-authored-by: nemijato <68876730+nemijato@users.noreply.github.com> Co-authored-by: brpanask <64860651+brpanask@users.noreply.github.com> Co-authored-by: Ray Chen Co-authored-by: Eli Arbel Co-authored-by: David Han <76010854+david-msft@users.noreply.github.com> Co-authored-by: Roman Khotsyn Co-authored-by: David R. Williamson Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Xinyi Joffre Co-authored-by: roytan-microsoft <73565668+roytan-microsoft@users.noreply.github.com> Co-authored-by: Vitaliy Fedonkin Co-authored-by: Samir Solanki Co-authored-by: maksimkim Co-authored-by: promoisha Co-authored-by: REDMOND\glfeokti Co-authored-by: RupengLiu Co-authored-by: vfedonkin Co-authored-by: David Čepelík Co-authored-by: David Čepelík Co-authored-by: mudit794 <42189950+mudit794@users.noreply.github.com> Co-authored-by: Dhawal Jain <41853104+dhawal777@users.noreply.github.com> Co-authored-by: MichalHel <51286657+MichalHel@users.noreply.github.com> Co-authored-by: Liran Chen Co-authored-by: jochav <75458295+jochav@users.noreply.github.com> Co-authored-by: Jorge Chavez Nieto Co-authored-by: rikogeln <40666347+rikogeln@users.noreply.github.com> Co-authored-by: chgennar <56695749+chgennar@users.noreply.github.com> Co-authored-by: hivyas <61890270+hivyas@users.noreply.github.com> Co-authored-by: Douglas Lee <65295939+leedouglas@users.noreply.github.com> Co-authored-by: Cameron Taggart Co-authored-by: LingyunSu <33764806+LingyunSu@users.noreply.github.com> Co-authored-by: elabicha <61994320+elabicha@users.noreply.github.com> Co-authored-by: Nikhil Kumar Mengani <62704762+nimengan@users.noreply.github.com> Co-authored-by: Junbo Wang Co-authored-by: Daniel Orozco <64658732+dagoroz@users.noreply.github.com> Co-authored-by: Adam Sandor Co-authored-by: yashmuel <63585146+yashmuel@users.noreply.github.com> --- .../azure/mgmt/security/_security_center.py | 5 + .../azure/mgmt/security/models/__init__.py | 46 +- .../azure/mgmt/security/models/_models.py | 610 +++++++++++++---- .../azure/mgmt/security/models/_models_py3.py | 616 ++++++++++++++---- .../security/models/_security_center_enums.py | 37 ++ .../mgmt/security/operations/__init__.py | 2 + .../_iot_defender_settings_operations.py | 57 ++ .../operations/_iot_sensors_operations.py | 153 ++++- .../operations/_iot_sites_operations.py | 276 ++++++++ .../_on_premise_iot_sensors_operations.py | 68 ++ 10 files changed, 1605 insertions(+), 265 deletions(-) create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sites_operations.py 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..77962bb0dbf3 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 @@ -66,6 +66,7 @@ from .operations import DevicesForHubOperations from .operations import DeviceOperations from .operations import OnPremiseIotSensorsOperations +from .operations import IotSitesOperations from . import models @@ -181,6 +182,8 @@ 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 :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -309,3 +312,5 @@ 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) 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..6d1e491c4a9b 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,6 +20,7 @@ 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 @@ -63,6 +64,7 @@ from ._models_py3 import ConnectableResource from ._models_py3 import ConnectedResource from ._models_py3 import ConnectedWorkspace + from ._models_py3 import ConnectionFromIpNotAllowed from ._models_py3 import ConnectionToIpNotAllowed from ._models_py3 import ConnectorSetting from ._models_py3 import ContainerRegistryVulnerabilityProperties @@ -76,6 +78,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 @@ -111,9 +114,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 +153,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 +168,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 +209,11 @@ 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 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 +226,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,6 +244,7 @@ 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 @@ -281,6 +288,7 @@ from ._models import ConnectableResource from ._models import ConnectedResource from ._models import ConnectedWorkspace + from ._models import ConnectionFromIpNotAllowed from ._models import ConnectionToIpNotAllowed from ._models import ConnectorSetting from ._models import ContainerRegistryVulnerabilityProperties @@ -294,6 +302,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 @@ -329,9 +338,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 +377,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 +392,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 +433,11 @@ from ._models import ServerVulnerabilityProperties from ._models import ServicePrincipalProperties from ._models import Setting - from ._models import SettingResource from ._models import Site 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 +450,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 @@ -494,6 +506,9 @@ RecommendationType, RecommendationConfigStatus, UnmaskedIpLoggingStatus, + AdditionalWorkspaceType, + AdditionalWorkspaceDataType, + CreatedByType, ReportedSeverity, AlertSeverity, AlertIntent, @@ -536,6 +551,8 @@ RuleSeverity, RuleType, VersionKind, + SensorStatus, + TiStatus, MacSignificance, RelationToIpStatus, ManagementState, @@ -561,6 +578,7 @@ 'AdaptiveNetworkHardening', 'AdaptiveNetworkHardeningEnforceRequest', 'AdditionalData', + 'AdditionalWorkspacesProperties', 'AdvancedThreatProtectionSetting', 'Alert', 'AlertEntity', @@ -604,6 +622,7 @@ 'ConnectableResource', 'ConnectedResource', 'ConnectedWorkspace', + 'ConnectionFromIpNotAllowed', 'ConnectionToIpNotAllowed', 'ConnectorSetting', 'ContainerRegistryVulnerabilityProperties', @@ -617,6 +636,7 @@ 'DirectMethodInvokesNotInAllowedRange', 'DiscoveredSecuritySolution', 'EffectiveNetworkSecurityGroups', + 'ErrorAdditionalInfo', 'ETag', 'ExternalSecuritySolution', 'ExternalSecuritySolutionKind1', @@ -652,9 +672,11 @@ 'IoTSecuritySolutionAnalyticsModelList', 'IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem', 'IoTSecuritySolutionModel', - 'IotSensor', 'IotSensorsList', + 'IotSensorsModel', 'IoTSeverityMetrics', + 'IotSitesList', + 'IotSitesModel', 'IpAddress', 'JitNetworkAccessPolicy', 'JitNetworkAccessPolicyInitiatePort', @@ -689,7 +711,6 @@ 'PackageDownloadsSensor', 'PackageDownloadsSensorFull', 'PackageDownloadsSensorFullOvf', - 'PackageDownloadsThreatIntelligence', 'PathRecommendation', 'Pricing', 'PricingList', @@ -705,6 +726,7 @@ 'RegulatoryComplianceControl', 'RegulatoryComplianceStandard', 'Remediation', + 'ResetPasswordInput', 'Resource', 'ResourceDetails', 'ResourceIdentifier', @@ -745,11 +767,11 @@ 'ServerVulnerabilityProperties', 'ServicePrincipalProperties', 'Setting', - 'SettingResource', 'Site', 'SqlServerVulnerabilityProperties', 'SubAssessmentStatus', 'SuppressionAlertsScope', + 'SystemData', 'Tags', 'TagsResource', 'ThresholdCustomAlertRule', @@ -762,6 +784,7 @@ 'TwinUpdatesNotInAllowedRange', 'UnauthorizedOperationsNotInAllowedRange', 'UpdateIotSecuritySolutionData', + 'UpgradePackageDownloadInfo', 'UserDefinedResourcesProperties', 'UserRecommendation', 'VaRule', @@ -816,6 +839,9 @@ 'RecommendationType', 'RecommendationConfigStatus', 'UnmaskedIpLoggingStatus', + 'AdditionalWorkspaceType', + 'AdditionalWorkspaceDataType', + 'CreatedByType', 'ReportedSeverity', 'AlertSeverity', 'AlertIntent', @@ -858,6 +884,8 @@ 'RuleSeverity', 'RuleType', 'VersionKind', + 'SensorStatus', + 'TiStatus', 'MacSignificance', 'RelationToIpStatus', 'ManagementState', 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..913f8c5bbcf6 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. @@ -1053,8 +1079,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 +1122,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 +1823,8 @@ 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', + 'SecureScoreControls', 'RegulatoryComplianceAssessment' :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 +2362,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 +2419,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 +2667,54 @@ 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 ConnectionToIpNotAllowed(AllowlistCustomAlertRule): """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. @@ -2789,54 +2924,9 @@ def __init__(self, **kwargs): self.base = None -class SettingResource(Resource): +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: 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 @@ -2875,6 +2965,7 @@ class Setting(SettingResource): def __init__(self, **kwargs): super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -3309,6 +3400,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,12 +4041,18 @@ def __init__(self, **kwargs): self.keywords = kwargs.get('keywords', None) -class IotAlert(Model): +class IotAlert(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 @@ -3950,6 +4075,9 @@ class IotAlert(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -3958,6 +4086,9 @@ class IotAlert(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'}, @@ -3978,12 +4109,18 @@ def __init__(self, **kwargs): self.extended_properties = kwargs.get('extended_properties', 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 +4143,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 +4154,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'}, @@ -4430,7 +4573,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 +4621,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 +4659,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 +4673,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 +4717,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 +4753,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 +4786,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 +4796,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 +4819,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 +4831,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 +4855,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 +4867,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 +4893,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 +4924,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 +5042,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 +5057,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 +5076,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 +5097,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}, + } -class IotSensor(Resource): - """IoT sensor. + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs): + super(IotSensorsList, self).__init__(**kwargs) + self.value = None + + +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5136,106 @@ 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 """ _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'}, + } + + 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) + + +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 +5243,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 +6318,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 +6358,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 +6375,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 +6386,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 +6476,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 +6486,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 +6556,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 +7183,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 @@ -8541,6 +8831,47 @@ 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 type of identity that last modified the + resource. + :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 +9191,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..ee9f5cb9f767 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. @@ -1053,8 +1079,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 +1122,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 +1823,8 @@ 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', + 'SecureScoreControls', 'RegulatoryComplianceAssessment' :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 +2362,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 +2419,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 +2667,54 @@ 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 ConnectionToIpNotAllowed(AllowlistCustomAlertRule): """Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. @@ -2789,54 +2924,9 @@ def __init__(self, **kwargs) -> None: self.base = None -class SettingResource(Resource): +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: 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 @@ -2875,6 +2965,7 @@ class Setting(SettingResource): def __init__(self, **kwargs) -> None: super(Setting, self).__init__(**kwargs) + self.kind = None self.kind = 'Setting' @@ -3309,6 +3400,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,12 +4041,18 @@ def __init__(self, *, display_name: str=None, description: str=None, order: int= self.keywords = keywords -class IotAlert(Model): +class IotAlert(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 @@ -3950,6 +4075,9 @@ class IotAlert(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'system_alert_id': {'readonly': True}, 'compromised_entity': {'readonly': True}, 'alert_type': {'readonly': True}, @@ -3958,6 +4086,9 @@ class IotAlert(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'}, @@ -3978,12 +4109,18 @@ def __init__(self, *, entities=None, extended_properties=None, **kwargs) -> None self.extended_properties = extended_properties -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 +4143,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 +4154,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'}, @@ -4430,7 +4573,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 +4621,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 +4659,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 +4673,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 +4717,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 +4753,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 +4786,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 +4796,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 +4819,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 +4831,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 +4855,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 +4867,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 +4893,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 +4924,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 +5042,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 +5057,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 +5076,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 +5097,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}, + } -class IotSensor(Resource): - """IoT sensor. + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSensorsModel]'}, + } + + def __init__(self, **kwargs) -> None: + super(IotSensorsList, self).__init__(**kwargs) + self.value = None + + +class IotSensorsModel(Resource): + """IoT sensor model. Variables are only populated by the server, and will be ignored when sending a request. @@ -4959,36 +5136,106 @@ 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 """ _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'}, + } + + def __init__(self, *, ti_automatic_updates: bool=None, zone: str=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 + + +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 +5243,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 +6318,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 +6358,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 +6375,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 +6386,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 +6476,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 +6486,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 +6556,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 +7183,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 @@ -8541,6 +8831,47 @@ 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 type of identity that last modified the + resource. + :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 +9191,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/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/models/_security_center_enums.py index 651c39085b1f..1a260da204a6 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,6 +80,25 @@ class UnmaskedIpLoggingStatus(str, Enum): enabled = "Enabled" #: Unmasked IP logging is enabled +class AdditionalWorkspaceType(str, Enum): + + sentinel = "Sentinel" + + +class AdditionalWorkspaceDataType(str, Enum): + + alerts = "Alerts" + raw_events = "RawEvents" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + class ReportedSeverity(str, Enum): informational = "Informational" @@ -181,6 +200,9 @@ class EventSource(str, Enum): assessments = "Assessments" sub_assessments = "SubAssessments" alerts = "Alerts" + secure_scores = "SecureScores" + secure_score_controls = "SecureScoreControls" + regulatory_compliance_assessment = "RegulatoryComplianceAssessment" class PropertyType(str, Enum): @@ -423,6 +445,21 @@ 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 MacSignificance(str, Enum): primary = "Primary" 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..bc56e84ac3c9 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 @@ -62,6 +62,7 @@ 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 __all__ = [ 'ComplianceResultsOperations', @@ -117,4 +118,5 @@ 'DevicesForHubOperations', 'DeviceOperations', 'OnPremiseIotSensorsOperations', + 'IotSitesOperations', ] 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..e54adb272187 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 @@ -320,3 +320,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_sensors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/operations/_iot_sensors_operations.py index 0565ee6ba734..5f48cdd91310 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, ti_automatic_updates=None, zone=None, custom_headers=None, raw=False, **operation_config): """Create or update IoT sensor. :param scope: Scope of the query (IoT Hub, @@ -167,16 +167,23 @@ def create_or_update( :type scope: str :param iot_sensor_name: Name of the IoT sensor :type iot_sensor_name: str + :param ti_automatic_updates: TI Automatic mode status of the IoT + sensor + :type ti_automatic_updates: bool + :param zone: Zone of the IoT sensor + :type zone: 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: 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` """ + iot_sensors_model = models.IotSensorsModel(ti_automatic_updates=ti_automatic_updates, zone=zone) + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -192,6 +199,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 +207,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 +221,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 +347,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'}