diff --git a/azure-mgmt-security/HISTORY.rst b/azure-mgmt-security/HISTORY.rst new file mode 100644 index 000000000000..1e7b5a6824bd --- /dev/null +++ b/azure-mgmt-security/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2018-10-29) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-security/MANIFEST.in b/azure-mgmt-security/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-security/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-security/README.rst b/azure-mgmt-security/README.rst new file mode 100644 index 000000000000..b2ad14672aa9 --- /dev/null +++ b/azure-mgmt-security/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Secutiry Center Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `Secutiry Center Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-security/azure/__init__.py b/azure-mgmt-security/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-security/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-security/azure/mgmt/__init__.py b/azure-mgmt-security/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-security/azure/mgmt/security/__init__.py b/azure-mgmt-security/azure/mgmt/security/__init__.py new file mode 100644 index 000000000000..4a59cad125c7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .security_center import SecurityCenter +from .version import VERSION + +__all__ = ['SecurityCenter'] + +__version__ = VERSION + diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py new file mode 100644 index 000000000000..059deadbd310 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -0,0 +1,220 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .resource_py3 import Resource + from .kind_py3 import Kind + from .security_contact_py3 import SecurityContact + from .pricing_py3 import Pricing + from .workspace_setting_py3 import WorkspaceSetting + from .auto_provisioning_setting_py3 import AutoProvisioningSetting + from .compliance_segment_py3 import ComplianceSegment + from .compliance_py3 import Compliance + from .advanced_threat_protection_setting_py3 import AdvancedThreatProtectionSetting + from .setting_py3 import Setting + from .data_export_setting_py3 import DataExportSetting + from .setting_kind1_py3 import SettingKind1 + from .sensitivity_label_py3 import SensitivityLabel + from .information_protection_keyword_py3 import InformationProtectionKeyword + from .information_type_py3 import InformationType + from .information_protection_policy_py3 import InformationProtectionPolicy + from .location_py3 import Location + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .security_task_parameters_py3 import SecurityTaskParameters + from .security_task_py3 import SecurityTask + from .asc_location_py3 import AscLocation + from .alert_entity_py3 import AlertEntity + from .alert_confidence_reason_py3 import AlertConfidenceReason + from .alert_py3 import Alert + from .discovered_security_solution_py3 import DiscoveredSecuritySolution + from .topology_single_resource_parent_py3 import TopologySingleResourceParent + from .topology_single_resource_child_py3 import TopologySingleResourceChild + from .topology_single_resource_py3 import TopologySingleResource + from .topology_resource_py3 import TopologyResource + from .jit_network_access_port_rule_py3 import JitNetworkAccessPortRule + from .jit_network_access_policy_virtual_machine_py3 import JitNetworkAccessPolicyVirtualMachine + from .jit_network_access_request_port_py3 import JitNetworkAccessRequestPort + from .jit_network_access_request_virtual_machine_py3 import JitNetworkAccessRequestVirtualMachine + from .jit_network_access_request_py3 import JitNetworkAccessRequest + from .jit_network_access_policy_py3 import JitNetworkAccessPolicy + from .jit_network_access_policy_initiate_port_py3 import JitNetworkAccessPolicyInitiatePort + from .jit_network_access_policy_initiate_virtual_machine_py3 import JitNetworkAccessPolicyInitiateVirtualMachine + from .jit_network_access_policy_initiate_request_py3 import JitNetworkAccessPolicyInitiateRequest + from .external_security_solution_py3 import ExternalSecuritySolution + from .cef_solution_properties_py3 import CefSolutionProperties + from .cef_external_security_solution_py3 import CefExternalSecuritySolution + from .ata_solution_properties_py3 import AtaSolutionProperties + from .ata_external_security_solution_py3 import AtaExternalSecuritySolution + from .connected_workspace_py3 import ConnectedWorkspace + from .aad_solution_properties_py3 import AadSolutionProperties + from .aad_external_security_solution_py3 import AadExternalSecuritySolution + from .external_security_solution_kind1_py3 import ExternalSecuritySolutionKind1 + from .external_security_solution_properties_py3 import ExternalSecuritySolutionProperties + from .aad_connectivity_state1_py3 import AadConnectivityState1 +except (SyntaxError, ImportError): + from .resource import Resource + from .kind import Kind + from .security_contact import SecurityContact + from .pricing import Pricing + from .workspace_setting import WorkspaceSetting + from .auto_provisioning_setting import AutoProvisioningSetting + from .compliance_segment import ComplianceSegment + from .compliance import Compliance + from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting + from .setting import Setting + from .data_export_setting import DataExportSetting + from .setting_kind1 import SettingKind1 + from .sensitivity_label import SensitivityLabel + from .information_protection_keyword import InformationProtectionKeyword + from .information_type import InformationType + from .information_protection_policy import InformationProtectionPolicy + from .location import Location + from .operation_display import OperationDisplay + from .operation import Operation + from .security_task_parameters import SecurityTaskParameters + from .security_task import SecurityTask + from .asc_location import AscLocation + from .alert_entity import AlertEntity + from .alert_confidence_reason import AlertConfidenceReason + from .alert import Alert + from .discovered_security_solution import DiscoveredSecuritySolution + from .topology_single_resource_parent import TopologySingleResourceParent + from .topology_single_resource_child import TopologySingleResourceChild + from .topology_single_resource import TopologySingleResource + from .topology_resource import TopologyResource + from .jit_network_access_port_rule import JitNetworkAccessPortRule + from .jit_network_access_policy_virtual_machine import JitNetworkAccessPolicyVirtualMachine + from .jit_network_access_request_port import JitNetworkAccessRequestPort + from .jit_network_access_request_virtual_machine import JitNetworkAccessRequestVirtualMachine + from .jit_network_access_request import JitNetworkAccessRequest + from .jit_network_access_policy import JitNetworkAccessPolicy + from .jit_network_access_policy_initiate_port import JitNetworkAccessPolicyInitiatePort + from .jit_network_access_policy_initiate_virtual_machine import JitNetworkAccessPolicyInitiateVirtualMachine + from .jit_network_access_policy_initiate_request import JitNetworkAccessPolicyInitiateRequest + from .external_security_solution import ExternalSecuritySolution + from .cef_solution_properties import CefSolutionProperties + from .cef_external_security_solution import CefExternalSecuritySolution + from .ata_solution_properties import AtaSolutionProperties + from .ata_external_security_solution import AtaExternalSecuritySolution + from .connected_workspace import ConnectedWorkspace + from .aad_solution_properties import AadSolutionProperties + from .aad_external_security_solution import AadExternalSecuritySolution + from .external_security_solution_kind1 import ExternalSecuritySolutionKind1 + from .external_security_solution_properties import ExternalSecuritySolutionProperties + from .aad_connectivity_state1 import AadConnectivityState1 +from .pricing_paged import PricingPaged +from .security_contact_paged import SecurityContactPaged +from .workspace_setting_paged import WorkspaceSettingPaged +from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged +from .compliance_paged import CompliancePaged +from .setting_paged import SettingPaged +from .information_protection_policy_paged import InformationProtectionPolicyPaged +from .operation_paged import OperationPaged +from .asc_location_paged import AscLocationPaged +from .security_task_paged import SecurityTaskPaged +from .alert_paged import AlertPaged +from .discovered_security_solution_paged import DiscoveredSecuritySolutionPaged +from .jit_network_access_policy_paged import JitNetworkAccessPolicyPaged +from .external_security_solution_paged import ExternalSecuritySolutionPaged +from .topology_resource_paged import TopologyResourcePaged +from .security_center_enums import ( + AlertNotifications, + AlertsToAdmins, + PricingTier, + AutoProvision, + SettingKind, + SecurityFamily, + Protocol, + Status, + StatusReason, + AadConnectivityState, + ExternalSecuritySolutionKind, +) + +__all__ = [ + 'Resource', + 'Kind', + 'SecurityContact', + 'Pricing', + 'WorkspaceSetting', + 'AutoProvisioningSetting', + 'ComplianceSegment', + 'Compliance', + 'AdvancedThreatProtectionSetting', + 'Setting', + 'DataExportSetting', + 'SettingKind1', + 'SensitivityLabel', + 'InformationProtectionKeyword', + 'InformationType', + 'InformationProtectionPolicy', + 'Location', + 'OperationDisplay', + 'Operation', + 'SecurityTaskParameters', + 'SecurityTask', + 'AscLocation', + 'AlertEntity', + 'AlertConfidenceReason', + 'Alert', + 'DiscoveredSecuritySolution', + 'TopologySingleResourceParent', + 'TopologySingleResourceChild', + 'TopologySingleResource', + 'TopologyResource', + 'JitNetworkAccessPortRule', + 'JitNetworkAccessPolicyVirtualMachine', + 'JitNetworkAccessRequestPort', + 'JitNetworkAccessRequestVirtualMachine', + 'JitNetworkAccessRequest', + 'JitNetworkAccessPolicy', + 'JitNetworkAccessPolicyInitiatePort', + 'JitNetworkAccessPolicyInitiateVirtualMachine', + 'JitNetworkAccessPolicyInitiateRequest', + 'ExternalSecuritySolution', + 'CefSolutionProperties', + 'CefExternalSecuritySolution', + 'AtaSolutionProperties', + 'AtaExternalSecuritySolution', + 'ConnectedWorkspace', + 'AadSolutionProperties', + 'AadExternalSecuritySolution', + 'ExternalSecuritySolutionKind1', + 'ExternalSecuritySolutionProperties', + 'AadConnectivityState1', + 'PricingPaged', + 'SecurityContactPaged', + 'WorkspaceSettingPaged', + 'AutoProvisioningSettingPaged', + 'CompliancePaged', + 'SettingPaged', + 'InformationProtectionPolicyPaged', + 'OperationPaged', + 'AscLocationPaged', + 'SecurityTaskPaged', + 'AlertPaged', + 'DiscoveredSecuritySolutionPaged', + 'JitNetworkAccessPolicyPaged', + 'ExternalSecuritySolutionPaged', + 'TopologyResourcePaged', + 'AlertNotifications', + 'AlertsToAdmins', + 'PricingTier', + 'AutoProvision', + 'SettingKind', + 'SecurityFamily', + 'Protocol', + 'Status', + 'StatusReason', + 'AadConnectivityState', + 'ExternalSecuritySolutionKind', +] diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1.py b/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1.py new file mode 100644 index 000000000000..7feb6e549272 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AadConnectivityState1(Model): + """Describes an Azure resource with kind. + + :param connectivity_state: The connectivity state of the external AAD + solution . Possible values include: 'Discovered', 'NotLicensed', + 'Connected' + :type connectivity_state: str or + ~azure.mgmt.security.models.AadConnectivityState + """ + + _attribute_map = { + 'connectivity_state': {'key': 'connectivityState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AadConnectivityState1, self).__init__(**kwargs) + self.connectivity_state = kwargs.get('connectivity_state', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1_py3.py b/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1_py3.py new file mode 100644 index 000000000000..7c699ec9d77e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_connectivity_state1_py3.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AadConnectivityState1(Model): + """Describes an Azure resource with kind. + + :param connectivity_state: The connectivity state of the external AAD + solution . Possible values include: 'Discovered', 'NotLicensed', + 'Connected' + :type connectivity_state: str or + ~azure.mgmt.security.models.AadConnectivityState + """ + + _attribute_map = { + 'connectivity_state': {'key': 'connectivityState', 'type': 'str'}, + } + + def __init__(self, *, connectivity_state=None, **kwargs) -> None: + super(AadConnectivityState1, self).__init__(**kwargs) + self.connectivity_state = connectivity_state diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution.py b/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution.py new file mode 100644 index 000000000000..da55d84dfdad --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution import ExternalSecuritySolution + + +class AadExternalSecuritySolution(ExternalSecuritySolution): + """Represents an AAD identity protection solution which sends logs to an OMS + workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.AadSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AadSolutionProperties'}, + } + + def __init__(self, **kwargs): + super(AadExternalSecuritySolution, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.kind = 'AAD' diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution_py3.py b/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution_py3.py new file mode 100644 index 000000000000..893a2efac215 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_external_security_solution_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_py3 import ExternalSecuritySolution + + +class AadExternalSecuritySolution(ExternalSecuritySolution): + """Represents an AAD identity protection solution which sends logs to an OMS + workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.AadSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AadSolutionProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AadExternalSecuritySolution, self).__init__(**kwargs) + self.properties = properties + self.kind = 'AAD' diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties.py b/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties.py new file mode 100644 index 000000000000..44c62d15869c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AadSolutionProperties(Model): + """The external security solution properties for AAD solutions. + + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param connectivity_state: The connectivity state of the external AAD + solution . Possible values include: 'Discovered', 'NotLicensed', + 'Connected' + :type connectivity_state: str or + ~azure.mgmt.security.models.AadConnectivityState + """ + + _attribute_map = { + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'connectivity_state': {'key': 'connectivityState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AadSolutionProperties, self).__init__(**kwargs) + self.device_vendor = kwargs.get('device_vendor', None) + self.device_type = kwargs.get('device_type', None) + self.workspace = kwargs.get('workspace', None) + self.connectivity_state = kwargs.get('connectivity_state', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties_py3.py b/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties_py3.py new file mode 100644 index 000000000000..4acc4804aa08 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/aad_solution_properties_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AadSolutionProperties(Model): + """The external security solution properties for AAD solutions. + + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param connectivity_state: The connectivity state of the external AAD + solution . Possible values include: 'Discovered', 'NotLicensed', + 'Connected' + :type connectivity_state: str or + ~azure.mgmt.security.models.AadConnectivityState + """ + + _attribute_map = { + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'connectivity_state': {'key': 'connectivityState', 'type': 'str'}, + } + + def __init__(self, *, device_vendor: str=None, device_type: str=None, workspace=None, connectivity_state=None, **kwargs) -> None: + super(AadSolutionProperties, self).__init__(**kwargs) + self.device_vendor = device_vendor + self.device_type = device_type + self.workspace = workspace + self.connectivity_state = connectivity_state diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py new file mode 100644 index 000000000000..722352481320 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AdvancedThreatProtectionSetting(Resource): + """The Advanced Threat Protection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py new file mode 100644 index 000000000000..66ed9c5fe2ec --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/advanced_threat_protection_setting_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AdvancedThreatProtectionSetting(Resource): + """The Advanced Threat Protection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, is_enabled: bool=None, **kwargs) -> None: + super(AdvancedThreatProtectionSetting, self).__init__(**kwargs) + self.is_enabled = is_enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert.py b/azure-mgmt-security/azure/mgmt/security/models/alert.py new file mode 100644 index 000000000000..bdd5963a2b38 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert.py @@ -0,0 +1,151 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Alert(Resource): + """Security 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 state: State of the alert (Active, Dismissed etc.) + :vartype state: str + :ivar reported_time_utc: The time the incident was reported to + Microsoft.Security in UTC + :vartype reported_time_utc: datetime + :ivar vendor_name: Name of the vendor that discovered the incident + :vartype vendor_name: str + :ivar alert_name: Name of the alert type + :vartype alert_name: str + :ivar alert_display_name: Display name of the alert type + :vartype alert_display_name: str + :ivar detected_time_utc: The time the incident was detected by the vendor + :vartype detected_time_utc: datetime + :ivar description: Description of the incident and what it means + :vartype description: str + :ivar remediation_steps: Recommended steps to reradiate the incident + :vartype remediation_steps: str + :ivar action_taken: The action that was taken as a response to the alert + (Active, Blocked etc.) + :vartype action_taken: str + :ivar reported_severity: Estimated severity of this alert + :vartype reported_severity: str + :ivar compromised_entity: The entity that the incident happened on + :vartype compromised_entity: str + :ivar associated_resource: Azure resource ID of the associated resource + :vartype associated_resource: str + :param extended_properties: + :type extended_properties: dict[str, object] + :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :vartype system_source: str + :ivar can_be_investigated: Whether this alert can be investigated with + Azure Security Center + :vartype can_be_investigated: bool + :param entities: objects that are related to this alerts + :type entities: list[~azure.mgmt.security.models.AlertEntity] + :ivar confidence_score: level of confidence we have on the alert + :vartype confidence_score: float + :param confidence_reasons: reasons the alert got the confidenceScore value + :type confidence_reasons: + list[~azure.mgmt.security.models.AlertConfidenceReason] + :ivar subscription_id: Azure subscription ID of the resource that had the + security alert or the subscription ID of the workspace that this resource + reports to + :vartype subscription_id: str + :ivar instance_id: Instance ID of the alert. + :vartype instance_id: str + :ivar workspace_arm_id: Azure resource ID of the workspace that the alert + was reported to. + :vartype workspace_arm_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'reported_time_utc': {'readonly': True}, + 'vendor_name': {'readonly': True}, + 'alert_name': {'readonly': True}, + 'alert_display_name': {'readonly': True}, + 'detected_time_utc': {'readonly': True}, + 'description': {'readonly': True}, + 'remediation_steps': {'readonly': True}, + 'action_taken': {'readonly': True}, + 'reported_severity': {'readonly': True}, + 'compromised_entity': {'readonly': True}, + 'associated_resource': {'readonly': True}, + 'system_source': {'readonly': True}, + 'can_be_investigated': {'readonly': True}, + 'confidence_score': {'readonly': True, 'maximum': 1, 'minimum': 0}, + 'subscription_id': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'workspace_arm_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'reported_time_utc': {'key': 'properties.reportedTimeUtc', 'type': 'iso-8601'}, + 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, + 'alert_name': {'key': 'properties.alertName', 'type': 'str'}, + 'alert_display_name': {'key': 'properties.alertDisplayName', 'type': 'str'}, + 'detected_time_utc': {'key': 'properties.detectedTimeUtc', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, + 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, + 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, + 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, + 'associated_resource': {'key': 'properties.associatedResource', 'type': 'str'}, + 'extended_properties': {'key': 'properties.extendedProperties', 'type': '{object}'}, + 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, + 'can_be_investigated': {'key': 'properties.canBeInvestigated', 'type': 'bool'}, + 'entities': {'key': 'properties.entities', 'type': '[AlertEntity]'}, + 'confidence_score': {'key': 'properties.confidenceScore', 'type': 'float'}, + 'confidence_reasons': {'key': 'properties.confidenceReasons', 'type': '[AlertConfidenceReason]'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'workspace_arm_id': {'key': 'properties.workspaceArmId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Alert, self).__init__(**kwargs) + self.state = None + self.reported_time_utc = None + self.vendor_name = None + self.alert_name = None + self.alert_display_name = None + self.detected_time_utc = None + self.description = None + self.remediation_steps = None + self.action_taken = None + self.reported_severity = None + self.compromised_entity = None + self.associated_resource = None + self.extended_properties = kwargs.get('extended_properties', None) + self.system_source = None + self.can_be_investigated = None + self.entities = kwargs.get('entities', None) + self.confidence_score = None + self.confidence_reasons = kwargs.get('confidence_reasons', None) + self.subscription_id = None + self.instance_id = None + self.workspace_arm_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason.py b/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason.py new file mode 100644 index 000000000000..ddbfc3dae2ec --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertConfidenceReason(Model): + """Factors that increase our confidence that the alert is a true positive. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: Type of confidence factor + :vartype type: str + :ivar reason: description of the confidence reason + :vartype reason: str + """ + + _validation = { + 'type': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AlertConfidenceReason, self).__init__(**kwargs) + self.type = None + self.reason = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason_py3.py b/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason_py3.py new file mode 100644 index 000000000000..ff57f840a16d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_confidence_reason_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertConfidenceReason(Model): + """Factors that increase our confidence that the alert is a true positive. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: Type of confidence factor + :vartype type: str + :ivar reason: description of the confidence reason + :vartype reason: str + """ + + _validation = { + 'type': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AlertConfidenceReason, self).__init__(**kwargs) + self.type = None + self.reason = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_entity.py b/azure-mgmt-security/azure/mgmt/security/models/alert_entity.py new file mode 100644 index 000000000000..1dd8ca41529a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_entity.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertEntity(Model): + """Changing set of properties depending on the entity type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :ivar type: Type of entity + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AlertEntity, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.type = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_entity_py3.py b/azure-mgmt-security/azure/mgmt/security/models/alert_entity_py3.py new file mode 100644 index 000000000000..1f8de5415ff7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_entity_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertEntity(Model): + """Changing set of properties depending on the entity type. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :ivar type: Type of entity + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, **kwargs) -> None: + super(AlertEntity, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.type = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_paged.py b/azure-mgmt-security/azure/mgmt/security/models/alert_paged.py new file mode 100644 index 000000000000..8fd844916438 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AlertPaged(Paged): + """ + A paging container for iterating over a list of :class:`Alert ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Alert]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py b/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py new file mode 100644 index 000000000000..b5c9aff63df5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py @@ -0,0 +1,151 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Alert(Resource): + """Security 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 state: State of the alert (Active, Dismissed etc.) + :vartype state: str + :ivar reported_time_utc: The time the incident was reported to + Microsoft.Security in UTC + :vartype reported_time_utc: datetime + :ivar vendor_name: Name of the vendor that discovered the incident + :vartype vendor_name: str + :ivar alert_name: Name of the alert type + :vartype alert_name: str + :ivar alert_display_name: Display name of the alert type + :vartype alert_display_name: str + :ivar detected_time_utc: The time the incident was detected by the vendor + :vartype detected_time_utc: datetime + :ivar description: Description of the incident and what it means + :vartype description: str + :ivar remediation_steps: Recommended steps to reradiate the incident + :vartype remediation_steps: str + :ivar action_taken: The action that was taken as a response to the alert + (Active, Blocked etc.) + :vartype action_taken: str + :ivar reported_severity: Estimated severity of this alert + :vartype reported_severity: str + :ivar compromised_entity: The entity that the incident happened on + :vartype compromised_entity: str + :ivar associated_resource: Azure resource ID of the associated resource + :vartype associated_resource: str + :param extended_properties: + :type extended_properties: dict[str, object] + :ivar system_source: The type of the alerted resource (Azure, Non-Azure) + :vartype system_source: str + :ivar can_be_investigated: Whether this alert can be investigated with + Azure Security Center + :vartype can_be_investigated: bool + :param entities: objects that are related to this alerts + :type entities: list[~azure.mgmt.security.models.AlertEntity] + :ivar confidence_score: level of confidence we have on the alert + :vartype confidence_score: float + :param confidence_reasons: reasons the alert got the confidenceScore value + :type confidence_reasons: + list[~azure.mgmt.security.models.AlertConfidenceReason] + :ivar subscription_id: Azure subscription ID of the resource that had the + security alert or the subscription ID of the workspace that this resource + reports to + :vartype subscription_id: str + :ivar instance_id: Instance ID of the alert. + :vartype instance_id: str + :ivar workspace_arm_id: Azure resource ID of the workspace that the alert + was reported to. + :vartype workspace_arm_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'reported_time_utc': {'readonly': True}, + 'vendor_name': {'readonly': True}, + 'alert_name': {'readonly': True}, + 'alert_display_name': {'readonly': True}, + 'detected_time_utc': {'readonly': True}, + 'description': {'readonly': True}, + 'remediation_steps': {'readonly': True}, + 'action_taken': {'readonly': True}, + 'reported_severity': {'readonly': True}, + 'compromised_entity': {'readonly': True}, + 'associated_resource': {'readonly': True}, + 'system_source': {'readonly': True}, + 'can_be_investigated': {'readonly': True}, + 'confidence_score': {'readonly': True, 'maximum': 1, 'minimum': 0}, + 'subscription_id': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'workspace_arm_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'reported_time_utc': {'key': 'properties.reportedTimeUtc', 'type': 'iso-8601'}, + 'vendor_name': {'key': 'properties.vendorName', 'type': 'str'}, + 'alert_name': {'key': 'properties.alertName', 'type': 'str'}, + 'alert_display_name': {'key': 'properties.alertDisplayName', 'type': 'str'}, + 'detected_time_utc': {'key': 'properties.detectedTimeUtc', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'remediation_steps': {'key': 'properties.remediationSteps', 'type': 'str'}, + 'action_taken': {'key': 'properties.actionTaken', 'type': 'str'}, + 'reported_severity': {'key': 'properties.reportedSeverity', 'type': 'str'}, + 'compromised_entity': {'key': 'properties.compromisedEntity', 'type': 'str'}, + 'associated_resource': {'key': 'properties.associatedResource', 'type': 'str'}, + 'extended_properties': {'key': 'properties.extendedProperties', 'type': '{object}'}, + 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, + 'can_be_investigated': {'key': 'properties.canBeInvestigated', 'type': 'bool'}, + 'entities': {'key': 'properties.entities', 'type': '[AlertEntity]'}, + 'confidence_score': {'key': 'properties.confidenceScore', 'type': 'float'}, + 'confidence_reasons': {'key': 'properties.confidenceReasons', 'type': '[AlertConfidenceReason]'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'workspace_arm_id': {'key': 'properties.workspaceArmId', 'type': 'str'}, + } + + def __init__(self, *, extended_properties=None, entities=None, confidence_reasons=None, **kwargs) -> None: + super(Alert, self).__init__(**kwargs) + self.state = None + self.reported_time_utc = None + self.vendor_name = None + self.alert_name = None + self.alert_display_name = None + self.detected_time_utc = None + self.description = None + self.remediation_steps = None + self.action_taken = None + self.reported_severity = None + self.compromised_entity = None + self.associated_resource = None + self.extended_properties = extended_properties + self.system_source = None + self.can_be_investigated = None + self.entities = entities + self.confidence_score = None + self.confidence_reasons = confidence_reasons + self.subscription_id = None + self.instance_id = None + self.workspace_arm_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/asc_location.py b/azure-mgmt-security/azure/mgmt/security/models/asc_location.py new file mode 100644 index 000000000000..c665bef0469a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/asc_location.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AscLocation(Resource): + """The ASC location of the subscription is in the "name" field. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param properties: + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(AscLocation, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/asc_location_paged.py b/azure-mgmt-security/azure/mgmt/security/models/asc_location_paged.py new file mode 100644 index 000000000000..85394884079a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/asc_location_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AscLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`AscLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AscLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(AscLocationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/asc_location_py3.py b/azure-mgmt-security/azure/mgmt/security/models/asc_location_py3.py new file mode 100644 index 000000000000..8ee3de84094f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/asc_location_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AscLocation(Resource): + """The ASC location of the subscription is in the "name" field. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param properties: + :type properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AscLocation, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution.py b/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution.py new file mode 100644 index 000000000000..813dae68b0e1 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution import ExternalSecuritySolution + + +class AtaExternalSecuritySolution(ExternalSecuritySolution): + """Represents an ATA security solution which sends logs to an OMS workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.AtaSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AtaSolutionProperties'}, + } + + def __init__(self, **kwargs): + super(AtaExternalSecuritySolution, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.kind = 'ATA' diff --git a/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution_py3.py b/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution_py3.py new file mode 100644 index 000000000000..52b5e8b579a7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/ata_external_security_solution_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_py3 import ExternalSecuritySolution + + +class AtaExternalSecuritySolution(ExternalSecuritySolution): + """Represents an ATA security solution which sends logs to an OMS workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.AtaSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AtaSolutionProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AtaExternalSecuritySolution, self).__init__(**kwargs) + self.properties = properties + self.kind = 'ATA' diff --git a/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties.py b/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties.py new file mode 100644 index 000000000000..8067254e71fa --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_properties import ExternalSecuritySolutionProperties + + +class AtaSolutionProperties(ExternalSecuritySolutionProperties): + """The external security solution properties for ATA solutions. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param last_event_received: + :type last_event_received: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'last_event_received': {'key': 'lastEventReceived', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AtaSolutionProperties, self).__init__(**kwargs) + self.last_event_received = kwargs.get('last_event_received', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties_py3.py b/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties_py3.py new file mode 100644 index 000000000000..7314df45108c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/ata_solution_properties_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_properties_py3 import ExternalSecuritySolutionProperties + + +class AtaSolutionProperties(ExternalSecuritySolutionProperties): + """The external security solution properties for ATA solutions. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param last_event_received: + :type last_event_received: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'last_event_received': {'key': 'lastEventReceived', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, device_vendor: str=None, device_type: str=None, workspace=None, last_event_received: str=None, **kwargs) -> None: + super(AtaSolutionProperties, self).__init__(additional_properties=additional_properties, device_vendor=device_vendor, device_type=device_type, workspace=workspace, **kwargs) + self.last_event_received = last_event_received diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py new file mode 100644 index 000000000000..907869accb3d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AutoProvisioningSetting(Resource): + """Auto provisioning 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 auto_provision: Required. Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'auto_provision': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutoProvisioningSetting, self).__init__(**kwargs) + self.auto_provision = kwargs.get('auto_provision', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py new file mode 100644 index 000000000000..a618c42c075c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AutoProvisioningSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`AutoProvisioningSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AutoProvisioningSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(AutoProvisioningSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py new file mode 100644 index 000000000000..7c86b8da5c01 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/auto_provisioning_setting_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AutoProvisioningSetting(Resource): + """Auto provisioning 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 auto_provision: Required. Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'auto_provision': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'auto_provision': {'key': 'properties.autoProvision', 'type': 'str'}, + } + + def __init__(self, *, auto_provision, **kwargs) -> None: + super(AutoProvisioningSetting, self).__init__(**kwargs) + self.auto_provision = auto_provision diff --git a/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution.py b/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution.py new file mode 100644 index 000000000000..513fb6de5940 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution import ExternalSecuritySolution + + +class CefExternalSecuritySolution(ExternalSecuritySolution): + """Represents a security solution which sends CEF logs to an OMS workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.CefSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CefSolutionProperties'}, + } + + def __init__(self, **kwargs): + super(CefExternalSecuritySolution, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.kind = 'CEF' diff --git a/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution_py3.py b/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution_py3.py new file mode 100644 index 000000000000..930b453b72d8 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/cef_external_security_solution_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_py3 import ExternalSecuritySolution + + +class CefExternalSecuritySolution(ExternalSecuritySolution): + """Represents a security solution which sends CEF logs to an OMS workspace. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + :param properties: + :type properties: ~azure.mgmt.security.models.CefSolutionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CefSolutionProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CefExternalSecuritySolution, self).__init__(**kwargs) + self.properties = properties + self.kind = 'CEF' diff --git a/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties.py b/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties.py new file mode 100644 index 000000000000..b49610a04bb0 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_properties import ExternalSecuritySolutionProperties + + +class CefSolutionProperties(ExternalSecuritySolutionProperties): + """The external security solution properties for CEF solutions. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param hostname: + :type hostname: str + :param agent: + :type agent: str + :param last_event_received: + :type last_event_received: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'hostname': {'key': 'hostname', 'type': 'str'}, + 'agent': {'key': 'agent', 'type': 'str'}, + 'last_event_received': {'key': 'lastEventReceived', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CefSolutionProperties, self).__init__(**kwargs) + self.hostname = kwargs.get('hostname', None) + self.agent = kwargs.get('agent', None) + self.last_event_received = kwargs.get('last_event_received', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties_py3.py b/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties_py3.py new file mode 100644 index 000000000000..390c6acba5fb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/cef_solution_properties_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .external_security_solution_properties_py3 import ExternalSecuritySolutionProperties + + +class CefSolutionProperties(ExternalSecuritySolutionProperties): + """The external security solution properties for CEF solutions. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + :param hostname: + :type hostname: str + :param agent: + :type agent: str + :param last_event_received: + :type last_event_received: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + 'hostname': {'key': 'hostname', 'type': 'str'}, + 'agent': {'key': 'agent', 'type': 'str'}, + 'last_event_received': {'key': 'lastEventReceived', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, device_vendor: str=None, device_type: str=None, workspace=None, hostname: str=None, agent: str=None, last_event_received: str=None, **kwargs) -> None: + super(CefSolutionProperties, self).__init__(additional_properties=additional_properties, device_vendor=device_vendor, device_type=device_type, workspace=workspace, **kwargs) + self.hostname = hostname + self.agent = agent + self.last_event_received = last_event_received diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance.py b/azure-mgmt-security/azure/mgmt/security/models/compliance.py new file mode 100644 index 000000000000..f515b35211bd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Compliance(Resource): + """Compliance of a scope. + + 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 assessment_timestamp_utc_date: The timestamp when the Compliance + calculation was conducted. + :vartype assessment_timestamp_utc_date: datetime + :ivar resource_count: The resource count of the given subscription for + which the Compliance calculation was conducted (needed for Management + Group Compliance calculation). + :vartype resource_count: int + :ivar assessment_result: An array of segment, which is the actually the + compliance assessment. + :vartype assessment_result: + list[~azure.mgmt.security.models.ComplianceSegment] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'assessment_timestamp_utc_date': {'readonly': True}, + 'resource_count': {'readonly': True}, + 'assessment_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, + 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, + 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, + } + + def __init__(self, **kwargs): + super(Compliance, self).__init__(**kwargs) + self.assessment_timestamp_utc_date = None + self.resource_count = None + self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py new file mode 100644 index 000000000000..4e2030375270 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class CompliancePaged(Paged): + """ + A paging container for iterating over a list of :class:`Compliance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Compliance]'} + } + + def __init__(self, *args, **kwargs): + + super(CompliancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py new file mode 100644 index 000000000000..0e271a1351b4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Compliance(Resource): + """Compliance of a scope. + + 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 assessment_timestamp_utc_date: The timestamp when the Compliance + calculation was conducted. + :vartype assessment_timestamp_utc_date: datetime + :ivar resource_count: The resource count of the given subscription for + which the Compliance calculation was conducted (needed for Management + Group Compliance calculation). + :vartype resource_count: int + :ivar assessment_result: An array of segment, which is the actually the + compliance assessment. + :vartype assessment_result: + list[~azure.mgmt.security.models.ComplianceSegment] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'assessment_timestamp_utc_date': {'readonly': True}, + 'resource_count': {'readonly': True}, + 'assessment_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'assessment_timestamp_utc_date': {'key': 'properties.assessmentTimestampUtcDate', 'type': 'iso-8601'}, + 'resource_count': {'key': 'properties.resourceCount', 'type': 'int'}, + 'assessment_result': {'key': 'properties.assessmentResult', 'type': '[ComplianceSegment]'}, + } + + def __init__(self, **kwargs) -> None: + super(Compliance, self).__init__(**kwargs) + self.assessment_timestamp_utc_date = None + self.resource_count = None + self.assessment_result = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py new file mode 100644 index 000000000000..ea23dc49c079 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComplianceSegment(Model): + """A segment of a compliance assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar segment_type: The segment type, e.g. compliant, non-compliance, + insufficient coverage, N/A, etc. + :vartype segment_type: str + :ivar percentage: The size (%) of the segment. + :vartype percentage: float + """ + + _validation = { + 'segment_type': {'readonly': True}, + 'percentage': {'readonly': True}, + } + + _attribute_map = { + 'segment_type': {'key': 'segmentType', 'type': 'str'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ComplianceSegment, self).__init__(**kwargs) + self.segment_type = None + self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py new file mode 100644 index 000000000000..a819e7cde997 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/compliance_segment_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComplianceSegment(Model): + """A segment of a compliance assessment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar segment_type: The segment type, e.g. compliant, non-compliance, + insufficient coverage, N/A, etc. + :vartype segment_type: str + :ivar percentage: The size (%) of the segment. + :vartype percentage: float + """ + + _validation = { + 'segment_type': {'readonly': True}, + 'percentage': {'readonly': True}, + } + + _attribute_map = { + 'segment_type': {'key': 'segmentType', 'type': 'str'}, + 'percentage': {'key': 'percentage', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ComplianceSegment, self).__init__(**kwargs) + self.segment_type = None + self.percentage = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/connected_workspace.py b/azure-mgmt-security/azure/mgmt/security/models/connected_workspace.py new file mode 100644 index 000000000000..6ac3212eabd9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/connected_workspace.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectedWorkspace(Model): + """Represents an OMS workspace to which the solution is connected. + + :param id: Azure resource ID of the connected OMS workspace + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectedWorkspace, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/connected_workspace_py3.py b/azure-mgmt-security/azure/mgmt/security/models/connected_workspace_py3.py new file mode 100644 index 000000000000..5bc6960972d2 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/connected_workspace_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectedWorkspace(Model): + """Represents an OMS workspace to which the solution is connected. + + :param id: Azure resource ID of the connected OMS workspace + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ConnectedWorkspace, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py new file mode 100644 index 000000000000..c2eb09c8bebe --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting import Setting + + +class DataExportSetting(Setting): + """Represents a data export setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param enabled: Required. Is the data export setting is enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DataExportSetting, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.kind = 'DataExportSetting' diff --git a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py new file mode 100644 index 000000000000..adab9fae1f04 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .setting_py3 import Setting + + +class DataExportSetting(Setting): + """Represents a data export setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param enabled: Required. Is the data export setting is enabled + :type enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool, **kwargs) -> None: + super(DataExportSetting, self).__init__(**kwargs) + self.enabled = enabled + self.kind = 'DataExportSetting' diff --git a/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution.py b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution.py new file mode 100644 index 000000000000..fabb09226953 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DiscoveredSecuritySolution(Model): + """DiscoveredSecuritySolution. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param security_family: Required. The security family of the discovered + solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + :type security_family: str or ~azure.mgmt.security.models.SecurityFamily + :param offer: Required. The security solutions' image offer + :type offer: str + :param publisher: Required. The security solutions' image publisher + :type publisher: str + :param sku: Required. The security solutions' image sku + :type sku: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'security_family': {'required': True}, + 'offer': {'required': True}, + 'publisher': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'security_family': {'key': 'properties.securityFamily', 'type': 'str'}, + 'offer': {'key': 'properties.offer', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiscoveredSecuritySolution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.security_family = kwargs.get('security_family', None) + self.offer = kwargs.get('offer', None) + self.publisher = kwargs.get('publisher', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_paged.py b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_paged.py new file mode 100644 index 000000000000..9bfbb03c5409 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DiscoveredSecuritySolutionPaged(Paged): + """ + A paging container for iterating over a list of :class:`DiscoveredSecuritySolution ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DiscoveredSecuritySolution]'} + } + + def __init__(self, *args, **kwargs): + + super(DiscoveredSecuritySolutionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_py3.py b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_py3.py new file mode 100644 index 000000000000..33934cab24d5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/discovered_security_solution_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DiscoveredSecuritySolution(Model): + """DiscoveredSecuritySolution. + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param security_family: Required. The security family of the discovered + solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + :type security_family: str or ~azure.mgmt.security.models.SecurityFamily + :param offer: Required. The security solutions' image offer + :type offer: str + :param publisher: Required. The security solutions' image publisher + :type publisher: str + :param sku: Required. The security solutions' image sku + :type sku: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'security_family': {'required': True}, + 'offer': {'required': True}, + 'publisher': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'security_family': {'key': 'properties.securityFamily', 'type': 'str'}, + 'offer': {'key': 'properties.offer', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + } + + def __init__(self, *, security_family, offer: str, publisher: str, sku: str, **kwargs) -> None: + super(DiscoveredSecuritySolution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.security_family = security_family + self.offer = offer + self.publisher = publisher + self.sku = sku diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution.py new file mode 100644 index 000000000000..d9e655a91baa --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolution(Model): + """Represents a security solution external to Azure Security Center which + sends information to an OMS workspace and whos data is displayed by Azure + Security Center. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CefExternalSecuritySolution, AtaExternalSecuritySolution, + AadExternalSecuritySolution + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'CEF': 'CefExternalSecuritySolution', 'ATA': 'AtaExternalSecuritySolution', 'AAD': 'AadExternalSecuritySolution'} + } + + def __init__(self, **kwargs): + super(ExternalSecuritySolution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.kind = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1.py new file mode 100644 index 000000000000..7f736fcfc1ba --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolutionKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the external solution. Possible values include: + 'CEF', 'ATA', 'AAD' + :type kind: str or + ~azure.mgmt.security.models.ExternalSecuritySolutionKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExternalSecuritySolutionKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1_py3.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1_py3.py new file mode 100644 index 000000000000..0d1ef240b557 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_kind1_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolutionKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the external solution. Possible values include: + 'CEF', 'ATA', 'AAD' + :type kind: str or + ~azure.mgmt.security.models.ExternalSecuritySolutionKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(ExternalSecuritySolutionKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_paged.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_paged.py new file mode 100644 index 000000000000..a67047ce19c0 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExternalSecuritySolutionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExternalSecuritySolution ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExternalSecuritySolution]'} + } + + def __init__(self, *args, **kwargs): + + super(ExternalSecuritySolutionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties.py new file mode 100644 index 000000000000..9ccbb179d3e4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolutionProperties(Model): + """The solution properties (correspond to the solution kind). + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + } + + def __init__(self, **kwargs): + super(ExternalSecuritySolutionProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.device_vendor = kwargs.get('device_vendor', None) + self.device_type = kwargs.get('device_type', None) + self.workspace = kwargs.get('workspace', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties_py3.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties_py3.py new file mode 100644 index 000000000000..de53f50ae553 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_properties_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolutionProperties(Model): + """The solution properties (correspond to the solution kind). + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param device_vendor: + :type device_vendor: str + :param device_type: + :type device_type: str + :param workspace: + :type workspace: ~azure.mgmt.security.models.ConnectedWorkspace + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'device_vendor': {'key': 'deviceVendor', 'type': 'str'}, + 'device_type': {'key': 'deviceType', 'type': 'str'}, + 'workspace': {'key': 'workspace', 'type': 'ConnectedWorkspace'}, + } + + def __init__(self, *, additional_properties=None, device_vendor: str=None, device_type: str=None, workspace=None, **kwargs) -> None: + super(ExternalSecuritySolutionProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.device_vendor = device_vendor + self.device_type = device_type + self.workspace = workspace diff --git a/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_py3.py b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_py3.py new file mode 100644 index 000000000000..a7495db0f8a3 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/external_security_solution_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExternalSecuritySolution(Model): + """Represents a security solution external to Azure Security Center which + sends information to an OMS workspace and whos data is displayed by Azure + Security Center. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CefExternalSecuritySolution, AtaExternalSecuritySolution, + AadExternalSecuritySolution + + 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 + :ivar location: Location where the resource is stored + :vartype location: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'CEF': 'CefExternalSecuritySolution', 'ATA': 'AtaExternalSecuritySolution', 'AAD': 'AadExternalSecuritySolution'} + } + + def __init__(self, **kwargs) -> None: + super(ExternalSecuritySolution, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.kind = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py new file mode 100644 index 000000000000..b67a1d4cfbd1 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationProtectionKeyword(Model): + """The information type keyword. + + :param pattern: The keyword pattern. + :type pattern: str + :param custom: Indicates whether the keyword is custom or not. + :type custom: bool + :param can_be_numeric: Indicates whether the keyword can be applied on + numeric types or not. + :type can_be_numeric: bool + :param excluded: Indicates whether the keyword is excluded or not. + :type excluded: bool + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, + 'excluded': {'key': 'excluded', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(InformationProtectionKeyword, self).__init__(**kwargs) + self.pattern = kwargs.get('pattern', None) + self.custom = kwargs.get('custom', None) + self.can_be_numeric = kwargs.get('can_be_numeric', None) + self.excluded = kwargs.get('excluded', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py new file mode 100644 index 000000000000..52c424cd4452 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_keyword_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationProtectionKeyword(Model): + """The information type keyword. + + :param pattern: The keyword pattern. + :type pattern: str + :param custom: Indicates whether the keyword is custom or not. + :type custom: bool + :param can_be_numeric: Indicates whether the keyword can be applied on + numeric types or not. + :type can_be_numeric: bool + :param excluded: Indicates whether the keyword is excluded or not. + :type excluded: bool + """ + + _attribute_map = { + 'pattern': {'key': 'pattern', 'type': 'str'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'can_be_numeric': {'key': 'canBeNumeric', 'type': 'bool'}, + 'excluded': {'key': 'excluded', 'type': 'bool'}, + } + + def __init__(self, *, pattern: str=None, custom: bool=None, can_be_numeric: bool=None, excluded: bool=None, **kwargs) -> None: + super(InformationProtectionKeyword, self).__init__(**kwargs) + self.pattern = pattern + self.custom = custom + self.can_be_numeric = can_be_numeric + self.excluded = excluded diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py new file mode 100644 index 000000000000..c430a8605127 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class InformationProtectionPolicy(Resource): + """Information protection policy. + + 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 last_modified_utc: Describes the last UTC time the policy was + modified. + :vartype last_modified_utc: datetime + :param labels: Dictionary of sensitivity labels. + :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] + :param information_types: The sensitivity information types. + :type information_types: dict[str, + ~azure.mgmt.security.models.InformationType] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, + 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, + } + + def __init__(self, **kwargs): + super(InformationProtectionPolicy, self).__init__(**kwargs) + self.last_modified_utc = None + self.labels = kwargs.get('labels', None) + self.information_types = kwargs.get('information_types', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py new file mode 100644 index 000000000000..807d040d4f4b --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class InformationProtectionPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`InformationProtectionPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InformationProtectionPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(InformationProtectionPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py new file mode 100644 index 000000000000..e07676bb0d27 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_protection_policy_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class InformationProtectionPolicy(Resource): + """Information protection policy. + + 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 last_modified_utc: Describes the last UTC time the policy was + modified. + :vartype last_modified_utc: datetime + :param labels: Dictionary of sensitivity labels. + :type labels: dict[str, ~azure.mgmt.security.models.SensitivityLabel] + :param information_types: The sensitivity information types. + :type information_types: dict[str, + ~azure.mgmt.security.models.InformationType] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '{SensitivityLabel}'}, + 'information_types': {'key': 'properties.informationTypes', 'type': '{InformationType}'}, + } + + def __init__(self, *, labels=None, information_types=None, **kwargs) -> None: + super(InformationProtectionPolicy, self).__init__(**kwargs) + self.last_modified_utc = None + self.labels = labels + self.information_types = information_types diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type.py b/azure-mgmt-security/azure/mgmt/security/models/information_type.py new file mode 100644 index 000000000000..df77e7c1ff65 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_type.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationType(Model): + """The information type. + + :param display_name: The name of the information type. + :type display_name: str + :param order: The order of the information type. + :type order: float + :param recommended_label_id: The recommended label id to be associated + with this information type. + :type recommended_label_id: str + :param enabled: Indicates whether the information type is enabled or not. + :type enabled: bool + :param custom: Indicates whether the information type is custom or not. + :type custom: bool + :param keywords: The information type keywords. + :type keywords: + list[~azure.mgmt.security.models.InformationProtectionKeyword] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, + } + + def __init__(self, **kwargs): + super(InformationType, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.recommended_label_id = kwargs.get('recommended_label_id', None) + self.enabled = kwargs.get('enabled', None) + self.custom = kwargs.get('custom', None) + self.keywords = kwargs.get('keywords', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py b/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py new file mode 100644 index 000000000000..b8b1ab434c82 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/information_type_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InformationType(Model): + """The information type. + + :param display_name: The name of the information type. + :type display_name: str + :param order: The order of the information type. + :type order: float + :param recommended_label_id: The recommended label id to be associated + with this information type. + :type recommended_label_id: str + :param enabled: Indicates whether the information type is enabled or not. + :type enabled: bool + :param custom: Indicates whether the information type is custom or not. + :type custom: bool + :param keywords: The information type keywords. + :type keywords: + list[~azure.mgmt.security.models.InformationProtectionKeyword] + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'recommended_label_id': {'key': 'recommendedLabelId', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'custom': {'key': 'custom', 'type': 'bool'}, + 'keywords': {'key': 'keywords', 'type': '[InformationProtectionKeyword]'}, + } + + def __init__(self, *, display_name: str=None, order: float=None, recommended_label_id: str=None, enabled: bool=None, custom: bool=None, keywords=None, **kwargs) -> None: + super(InformationType, self).__init__(**kwargs) + self.display_name = display_name + self.order = order + self.recommended_label_id = recommended_label_id + self.enabled = enabled + self.custom = custom + self.keywords = keywords diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy.py new file mode 100644 index 000000000000..281b6e07c25d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicy(Model): + """JitNetworkAccessPolicy. + + 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: Kind of the resource + :type kind: str + :ivar location: Location where the resource is stored + :vartype location: str + :param virtual_machines: Required. Configurations for + Microsoft.Compute/virtualMachines resource type. + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyVirtualMachine] + :param requests: + :type requests: list[~azure.mgmt.security.models.JitNetworkAccessRequest] + :ivar provisioning_state: Gets the provisioning state of the Just-in-Time + policy. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'virtual_machines': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[JitNetworkAccessPolicyVirtualMachine]'}, + 'requests': {'key': 'properties.requests', 'type': '[JitNetworkAccessRequest]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPolicy, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kwargs.get('kind', None) + self.location = None + self.virtual_machines = kwargs.get('virtual_machines', None) + self.requests = kwargs.get('requests', None) + self.provisioning_state = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port.py new file mode 100644 index 000000000000..b0829c87c01b --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiatePort(Model): + """JitNetworkAccessPolicyInitiatePort. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param allowed_source_address_prefix: Source of the allowed traffic. If + omitted, the request will be for the source IP address of the initiate + request. + :type allowed_source_address_prefix: str + :param end_time_utc: Required. The time to close the request in UTC + :type end_time_utc: datetime + """ + + _validation = { + 'number': {'required': True}, + 'end_time_utc': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPolicyInitiatePort, self).__init__(**kwargs) + self.number = kwargs.get('number', None) + self.allowed_source_address_prefix = kwargs.get('allowed_source_address_prefix', None) + self.end_time_utc = kwargs.get('end_time_utc', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port_py3.py new file mode 100644 index 000000000000..65ae97d30788 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_port_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiatePort(Model): + """JitNetworkAccessPolicyInitiatePort. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param allowed_source_address_prefix: Source of the allowed traffic. If + omitted, the request will be for the source IP address of the initiate + request. + :type allowed_source_address_prefix: str + :param end_time_utc: Required. The time to close the request in UTC + :type end_time_utc: datetime + """ + + _validation = { + 'number': {'required': True}, + 'end_time_utc': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, + } + + def __init__(self, *, number: int, end_time_utc, allowed_source_address_prefix: str=None, **kwargs) -> None: + super(JitNetworkAccessPolicyInitiatePort, self).__init__(**kwargs) + self.number = number + self.allowed_source_address_prefix = allowed_source_address_prefix + self.end_time_utc = end_time_utc diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request.py new file mode 100644 index 000000000000..6d567c7aee30 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiateRequest(Model): + """JitNetworkAccessPolicyInitiateRequest. + + All required parameters must be populated in order to send to Azure. + + :param virtual_machines: Required. A list of virtual machines & ports to + open access for + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + """ + + _validation = { + 'virtual_machines': {'required': True}, + } + + _attribute_map = { + 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessPolicyInitiateVirtualMachine]'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPolicyInitiateRequest, self).__init__(**kwargs) + self.virtual_machines = kwargs.get('virtual_machines', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request_py3.py new file mode 100644 index 000000000000..ba6c6cbf2f93 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiateRequest(Model): + """JitNetworkAccessPolicyInitiateRequest. + + All required parameters must be populated in order to send to Azure. + + :param virtual_machines: Required. A list of virtual machines & ports to + open access for + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + """ + + _validation = { + 'virtual_machines': {'required': True}, + } + + _attribute_map = { + 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessPolicyInitiateVirtualMachine]'}, + } + + def __init__(self, *, virtual_machines, **kwargs) -> None: + super(JitNetworkAccessPolicyInitiateRequest, self).__init__(**kwargs) + self.virtual_machines = virtual_machines diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine.py new file mode 100644 index 000000000000..e8581019f64d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiateVirtualMachine(Model): + """JitNetworkAccessPolicyInitiateVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. The ports to open for the resource with the `id` + :type ports: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiatePort] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPolicyInitiatePort]'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPolicyInitiateVirtualMachine, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.ports = kwargs.get('ports', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine_py3.py new file mode 100644 index 000000000000..bdae532a9308 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_initiate_virtual_machine_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyInitiateVirtualMachine(Model): + """JitNetworkAccessPolicyInitiateVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. The ports to open for the resource with the `id` + :type ports: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiatePort] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPolicyInitiatePort]'}, + } + + def __init__(self, *, id: str, ports, **kwargs) -> None: + super(JitNetworkAccessPolicyInitiateVirtualMachine, self).__init__(**kwargs) + self.id = id + self.ports = ports diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_paged.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_paged.py new file mode 100644 index 000000000000..87c684afb92e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class JitNetworkAccessPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`JitNetworkAccessPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JitNetworkAccessPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(JitNetworkAccessPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_py3.py new file mode 100644 index 000000000000..4e719184b290 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicy(Model): + """JitNetworkAccessPolicy. + + 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: Kind of the resource + :type kind: str + :ivar location: Location where the resource is stored + :vartype location: str + :param virtual_machines: Required. Configurations for + Microsoft.Compute/virtualMachines resource type. + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyVirtualMachine] + :param requests: + :type requests: list[~azure.mgmt.security.models.JitNetworkAccessRequest] + :ivar provisioning_state: Gets the provisioning state of the Just-in-Time + policy. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'virtual_machines': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[JitNetworkAccessPolicyVirtualMachine]'}, + 'requests': {'key': 'properties.requests', 'type': '[JitNetworkAccessRequest]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, virtual_machines, kind: str=None, requests=None, **kwargs) -> None: + super(JitNetworkAccessPolicy, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kind + self.location = None + self.virtual_machines = virtual_machines + self.requests = requests + self.provisioning_state = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py new file mode 100644 index 000000000000..49ce31c7f04e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyVirtualMachine(Model): + """JitNetworkAccessPolicyVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. Port configurations for the virtual machine + :type ports: list[~azure.mgmt.security.models.JitNetworkAccessPortRule] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPortRule]'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPolicyVirtualMachine, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.ports = kwargs.get('ports', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py new file mode 100644 index 000000000000..f315044fbc70 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_policy_virtual_machine_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPolicyVirtualMachine(Model): + """JitNetworkAccessPolicyVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. Port configurations for the virtual machine + :type ports: list[~azure.mgmt.security.models.JitNetworkAccessPortRule] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessPortRule]'}, + } + + def __init__(self, *, id: str, ports, **kwargs) -> None: + super(JitNetworkAccessPolicyVirtualMachine, self).__init__(**kwargs) + self.id = id + self.ports = ports diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule.py new file mode 100644 index 000000000000..4be40bf43b69 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPortRule(Model): + """JitNetworkAccessPortRule. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param protocol: Required. Possible values include: 'TCP', 'UDP', 'All' + :type protocol: str or ~azure.mgmt.security.models.Protocol + :param allowed_source_address_prefix: Mutually exclusive with the + "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, + for example "192.168.0.3" or "192.168.0.0/16". + :type allowed_source_address_prefix: str + :param allowed_source_address_prefixes: Mutually exclusive with the + "allowedSourceAddressPrefix" parameter. + :type allowed_source_address_prefixes: list[str] + :param max_request_access_duration: Required. Maximum duration requests + can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 + day + :type max_request_access_duration: str + """ + + _validation = { + 'number': {'required': True}, + 'protocol': {'required': True}, + 'max_request_access_duration': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'allowed_source_address_prefixes': {'key': 'allowedSourceAddressPrefixes', 'type': '[str]'}, + 'max_request_access_duration': {'key': 'maxRequestAccessDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessPortRule, self).__init__(**kwargs) + self.number = kwargs.get('number', None) + self.protocol = kwargs.get('protocol', None) + self.allowed_source_address_prefix = kwargs.get('allowed_source_address_prefix', None) + self.allowed_source_address_prefixes = kwargs.get('allowed_source_address_prefixes', None) + self.max_request_access_duration = kwargs.get('max_request_access_duration', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule_py3.py new file mode 100644 index 000000000000..2d6c223bea49 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_port_rule_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessPortRule(Model): + """JitNetworkAccessPortRule. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param protocol: Required. Possible values include: 'TCP', 'UDP', 'All' + :type protocol: str or ~azure.mgmt.security.models.Protocol + :param allowed_source_address_prefix: Mutually exclusive with the + "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, + for example "192.168.0.3" or "192.168.0.0/16". + :type allowed_source_address_prefix: str + :param allowed_source_address_prefixes: Mutually exclusive with the + "allowedSourceAddressPrefix" parameter. + :type allowed_source_address_prefixes: list[str] + :param max_request_access_duration: Required. Maximum duration requests + can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 + day + :type max_request_access_duration: str + """ + + _validation = { + 'number': {'required': True}, + 'protocol': {'required': True}, + 'max_request_access_duration': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'allowed_source_address_prefixes': {'key': 'allowedSourceAddressPrefixes', 'type': '[str]'}, + 'max_request_access_duration': {'key': 'maxRequestAccessDuration', 'type': 'str'}, + } + + def __init__(self, *, number: int, protocol, max_request_access_duration: str, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, **kwargs) -> None: + super(JitNetworkAccessPortRule, self).__init__(**kwargs) + self.number = number + self.protocol = protocol + self.allowed_source_address_prefix = allowed_source_address_prefix + self.allowed_source_address_prefixes = allowed_source_address_prefixes + self.max_request_access_duration = max_request_access_duration diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request.py new file mode 100644 index 000000000000..4e3d22353b07 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequest(Model): + """JitNetworkAccessRequest. + + All required parameters must be populated in order to send to Azure. + + :param virtual_machines: Required. + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessRequestVirtualMachine] + :param start_time_utc: Required. The start time of the request in UTC + :type start_time_utc: datetime + :param requestor: Required. The identity of the person who made the + request + :type requestor: str + """ + + _validation = { + 'virtual_machines': {'required': True}, + 'start_time_utc': {'required': True}, + 'requestor': {'required': True}, + } + + _attribute_map = { + 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessRequestVirtualMachine]'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, + 'requestor': {'key': 'requestor', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessRequest, self).__init__(**kwargs) + self.virtual_machines = kwargs.get('virtual_machines', None) + self.start_time_utc = kwargs.get('start_time_utc', None) + self.requestor = kwargs.get('requestor', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py new file mode 100644 index 000000000000..63212f65aae1 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequestPort(Model): + """JitNetworkAccessRequestPort. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param allowed_source_address_prefix: Mutually exclusive with the + "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, + for example "192.168.0.3" or "192.168.0.0/16". + :type allowed_source_address_prefix: str + :param allowed_source_address_prefixes: Mutually exclusive with the + "allowedSourceAddressPrefix" parameter. + :type allowed_source_address_prefixes: list[str] + :param end_time_utc: Required. The date & time at which the request ends + in UTC + :type end_time_utc: datetime + :param status: Required. The status of the port. Possible values include: + 'Revoked', 'Initiated' + :type status: str or ~azure.mgmt.security.models.Status + :param status_reason: Required. A description of why the `status` has its + value. Possible values include: 'Expired', 'UserRequested', + 'NewerRequestInitiated' + :type status_reason: str or ~azure.mgmt.security.models.StatusReason + """ + + _validation = { + 'number': {'required': True}, + 'end_time_utc': {'required': True}, + 'status': {'required': True}, + 'status_reason': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'allowed_source_address_prefixes': {'key': 'allowedSourceAddressPrefixes', 'type': '[str]'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_reason': {'key': 'statusReason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessRequestPort, self).__init__(**kwargs) + self.number = kwargs.get('number', None) + self.allowed_source_address_prefix = kwargs.get('allowed_source_address_prefix', None) + self.allowed_source_address_prefixes = kwargs.get('allowed_source_address_prefixes', None) + self.end_time_utc = kwargs.get('end_time_utc', None) + self.status = kwargs.get('status', None) + self.status_reason = kwargs.get('status_reason', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py new file mode 100644 index 000000000000..957d7b08bb7a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_port_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequestPort(Model): + """JitNetworkAccessRequestPort. + + All required parameters must be populated in order to send to Azure. + + :param number: Required. + :type number: int + :param allowed_source_address_prefix: Mutually exclusive with the + "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, + for example "192.168.0.3" or "192.168.0.0/16". + :type allowed_source_address_prefix: str + :param allowed_source_address_prefixes: Mutually exclusive with the + "allowedSourceAddressPrefix" parameter. + :type allowed_source_address_prefixes: list[str] + :param end_time_utc: Required. The date & time at which the request ends + in UTC + :type end_time_utc: datetime + :param status: Required. The status of the port. Possible values include: + 'Revoked', 'Initiated' + :type status: str or ~azure.mgmt.security.models.Status + :param status_reason: Required. A description of why the `status` has its + value. Possible values include: 'Expired', 'UserRequested', + 'NewerRequestInitiated' + :type status_reason: str or ~azure.mgmt.security.models.StatusReason + """ + + _validation = { + 'number': {'required': True}, + 'end_time_utc': {'required': True}, + 'status': {'required': True}, + 'status_reason': {'required': True}, + } + + _attribute_map = { + 'number': {'key': 'number', 'type': 'int'}, + 'allowed_source_address_prefix': {'key': 'allowedSourceAddressPrefix', 'type': 'str'}, + 'allowed_source_address_prefixes': {'key': 'allowedSourceAddressPrefixes', 'type': '[str]'}, + 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_reason': {'key': 'statusReason', 'type': 'str'}, + } + + def __init__(self, *, number: int, end_time_utc, status, status_reason, allowed_source_address_prefix: str=None, allowed_source_address_prefixes=None, **kwargs) -> None: + super(JitNetworkAccessRequestPort, self).__init__(**kwargs) + self.number = number + self.allowed_source_address_prefix = allowed_source_address_prefix + self.allowed_source_address_prefixes = allowed_source_address_prefixes + self.end_time_utc = end_time_utc + self.status = status + self.status_reason = status_reason diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_py3.py new file mode 100644 index 000000000000..4945c427dd93 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequest(Model): + """JitNetworkAccessRequest. + + All required parameters must be populated in order to send to Azure. + + :param virtual_machines: Required. + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessRequestVirtualMachine] + :param start_time_utc: Required. The start time of the request in UTC + :type start_time_utc: datetime + :param requestor: Required. The identity of the person who made the + request + :type requestor: str + """ + + _validation = { + 'virtual_machines': {'required': True}, + 'start_time_utc': {'required': True}, + 'requestor': {'required': True}, + } + + _attribute_map = { + 'virtual_machines': {'key': 'virtualMachines', 'type': '[JitNetworkAccessRequestVirtualMachine]'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, + 'requestor': {'key': 'requestor', 'type': 'str'}, + } + + def __init__(self, *, virtual_machines, start_time_utc, requestor: str, **kwargs) -> None: + super(JitNetworkAccessRequest, self).__init__(**kwargs) + self.virtual_machines = virtual_machines + self.start_time_utc = start_time_utc + self.requestor = requestor diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine.py new file mode 100644 index 000000000000..7c5ba66b2385 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequestVirtualMachine(Model): + """JitNetworkAccessRequestVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. The ports that were opened for the virtual machine + :type ports: list[~azure.mgmt.security.models.JitNetworkAccessRequestPort] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessRequestPort]'}, + } + + def __init__(self, **kwargs): + super(JitNetworkAccessRequestVirtualMachine, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.ports = kwargs.get('ports', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine_py3.py b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine_py3.py new file mode 100644 index 000000000000..7c9ddaa5a4a2 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/jit_network_access_request_virtual_machine_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JitNetworkAccessRequestVirtualMachine(Model): + """JitNetworkAccessRequestVirtualMachine. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource ID of the virtual machine that is linked to + this policy + :type id: str + :param ports: Required. The ports that were opened for the virtual machine + :type ports: list[~azure.mgmt.security.models.JitNetworkAccessRequestPort] + """ + + _validation = { + 'id': {'required': True}, + 'ports': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[JitNetworkAccessRequestPort]'}, + } + + def __init__(self, *, id: str, ports, **kwargs) -> None: + super(JitNetworkAccessRequestVirtualMachine, self).__init__(**kwargs) + self.id = id + self.ports = ports diff --git a/azure-mgmt-security/azure/mgmt/security/models/kind.py b/azure-mgmt-security/azure/mgmt/security/models/kind.py new file mode 100644 index 000000000000..dafce6cdd7cb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/kind.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Kind(Model): + """Describes an Azure resource with kind. + + :param kind: Kind of the resource + :type kind: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Kind, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/kind_py3.py b/azure-mgmt-security/azure/mgmt/security/models/kind_py3.py new file mode 100644 index 000000000000..d77a28e0c975 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/kind_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Kind(Model): + """Describes an Azure resource with kind. + + :param kind: Kind of the resource + :type kind: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, **kwargs) -> None: + super(Kind, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/models/location.py b/azure-mgmt-security/azure/mgmt/security/models/location.py new file mode 100644 index 000000000000..852cd020018d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/location.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Location(Model): + """Describes an Azure resource with location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: Location where the resource is stored + :vartype location: str + """ + + _validation = { + 'location': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) + self.location = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/location_py3.py b/azure-mgmt-security/azure/mgmt/security/models/location_py3.py new file mode 100644 index 000000000000..8203f9cdf30d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/location_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Location(Model): + """Describes an Azure resource with location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: Location where the resource is stored + :vartype location: str + """ + + _validation = { + 'location': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.location = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/operation.py b/azure-mgmt-security/azure/mgmt/security/models/operation.py new file mode 100644 index 000000000000..5b91bf6bccf4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/operation.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Possible operation in the REST API of Microsoft.Security. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the operation + :vartype name: str + :ivar origin: Where the operation is originated + :vartype origin: str + :param display: + :type display: ~azure.mgmt.security.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.origin = None + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/operation_display.py b/azure-mgmt-security/azure/mgmt/security/models/operation_display.py new file mode 100644 index 000000000000..624f831a4bfe --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/operation_display.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Security operation display. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider for the operation. + :vartype provider: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar operation: The display name of the security operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/operation_display_py3.py b/azure-mgmt-security/azure/mgmt/security/models/operation_display_py3.py new file mode 100644 index 000000000000..4403ea324a9f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/operation_display_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Security operation display. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The resource provider for the operation. + :vartype provider: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar operation: The display name of the security operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/operation_paged.py b/azure-mgmt-security/azure/mgmt/security/models/operation_paged.py new file mode 100644 index 000000000000..c9fc34cc5505 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/operation_py3.py b/azure-mgmt-security/azure/mgmt/security/models/operation_py3.py new file mode 100644 index 000000000000..927bf356676d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/operation_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Possible operation in the REST API of Microsoft.Security. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the operation + :vartype name: str + :ivar origin: Where the operation is originated + :vartype origin: str + :param display: + :type display: ~azure.mgmt.security.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.origin = None + self.display = display diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing.py b/azure-mgmt-security/azure/mgmt/security/models/pricing.py new file mode 100644 index 000000000000..320e3dc9e4dc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Pricing(Resource): + """Pricing tier will be applied for the scope based on the resource ID. + + 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 pricing_tier: Required. Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pricing_tier': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Pricing, self).__init__(**kwargs) + self.pricing_tier = kwargs.get('pricing_tier', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py new file mode 100644 index 000000000000..09eee4ab69dd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PricingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Pricing ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Pricing]'} + } + + def __init__(self, *args, **kwargs): + + super(PricingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py new file mode 100644 index 000000000000..25001e835a78 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Pricing(Resource): + """Pricing tier will be applied for the scope based on the resource ID. + + 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 pricing_tier: Required. Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'pricing_tier': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + } + + def __init__(self, *, pricing_tier, **kwargs) -> None: + super(Pricing, self).__init__(**kwargs) + self.pricing_tier = pricing_tier diff --git a/azure-mgmt-security/azure/mgmt/security/models/resource.py b/azure-mgmt-security/azure/mgmt/security/models/resource.py new file mode 100644 index 000000000000..9c6150ed498e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes an Azure resource. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/resource_py3.py new file mode 100644 index 000000000000..d19d439b8bc0 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Describes an Azure resource. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py new file mode 100644 index 000000000000..64f3905e4f14 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class AlertNotifications(str, Enum): + + on = "On" #: Get notifications on new alerts + off = "Off" #: Don't get notifications on new alerts + + +class AlertsToAdmins(str, Enum): + + on = "On" #: Send notification on new alerts to the subscription's admins + off = "Off" #: Don't send notification on new alerts to the subscription's admins + + +class PricingTier(str, Enum): + + free = "Free" #: Get free Azure security center experience with basic security features + standard = "Standard" #: Get the standard Azure security center experience with advanced security features + + +class AutoProvision(str, Enum): + + on = "On" #: Install missing security agent on VMs automatically + off = "Off" #: Do not install security agent on the VMs automatically + + +class SettingKind(str, Enum): + + data_export_setting = "DataExportSetting" + + +class SecurityFamily(str, Enum): + + waf = "Waf" + ngfw = "Ngfw" + saas_waf = "SaasWaf" + va = "Va" + + +class Protocol(str, Enum): + + tcp = "TCP" + udp = "UDP" + all = "*" + + +class Status(str, Enum): + + revoked = "Revoked" + initiated = "Initiated" + + +class StatusReason(str, Enum): + + expired = "Expired" + user_requested = "UserRequested" + newer_request_initiated = "NewerRequestInitiated" + + +class AadConnectivityState(str, Enum): + + discovered = "Discovered" + not_licensed = "NotLicensed" + connected = "Connected" + + +class ExternalSecuritySolutionKind(str, Enum): + + cef = "CEF" + ata = "ATA" + aad = "AAD" diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact.py new file mode 100644 index 000000000000..95f1211214fd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param email: Required. The email of this security contact + :type email: str + :param phone: Required. The phone number of this security contact + :type phone: str + :param alert_notifications: Required. Whether to send security alerts + notifications to the security contact. Possible values include: 'On', + 'Off' + :type alert_notifications: str or + ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Required. Whether to send security alerts + notifications to subscription admins. Possible values include: 'On', 'Off' + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'required': True}, + 'phone': {'required': True}, + 'alert_notifications': {'required': True}, + 'alerts_to_admins': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityContact, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + self.phone = kwargs.get('phone', None) + self.alert_notifications = kwargs.get('alert_notifications', None) + self.alerts_to_admins = kwargs.get('alerts_to_admins', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py new file mode 100644 index 000000000000..a422f9bd58b7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SecurityContactPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecurityContact ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecurityContact]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityContactPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py b/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py new file mode 100644 index 000000000000..5142ff09660c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_contact_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class SecurityContact(Resource): + """Contact details for security issues. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param email: Required. The email of this security contact + :type email: str + :param phone: Required. The phone number of this security contact + :type phone: str + :param alert_notifications: Required. Whether to send security alerts + notifications to the security contact. Possible values include: 'On', + 'Off' + :type alert_notifications: str or + ~azure.mgmt.security.models.AlertNotifications + :param alerts_to_admins: Required. Whether to send security alerts + notifications to subscription admins. Possible values include: 'On', 'Off' + :type alerts_to_admins: str or ~azure.mgmt.security.models.AlertsToAdmins + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'email': {'required': True}, + 'phone': {'required': True}, + 'alert_notifications': {'required': True}, + 'alerts_to_admins': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email': {'key': 'properties.email', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'alert_notifications': {'key': 'properties.alertNotifications', 'type': 'str'}, + 'alerts_to_admins': {'key': 'properties.alertsToAdmins', 'type': 'str'}, + } + + def __init__(self, *, email: str, phone: str, alert_notifications, alerts_to_admins, **kwargs) -> None: + super(SecurityContact, self).__init__(**kwargs) + self.email = email + self.phone = phone + self.alert_notifications = alert_notifications + self.alerts_to_admins = alerts_to_admins diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_task.py b/azure-mgmt-security/azure/mgmt/security/models/security_task.py new file mode 100644 index 000000000000..239a28c5e53e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_task.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class SecurityTask(Resource): + """Security task that we recommend to do in order to strengthen security. + + 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 state: State of the task (Active, Resolved etc.) + :vartype state: str + :ivar creation_time_utc: The time this task was discovered in UTC + :vartype creation_time_utc: datetime + :param security_task_parameters: + :type security_task_parameters: + ~azure.mgmt.security.models.SecurityTaskParameters + :ivar last_state_change_time_utc: The time this task's details were last + changed in UTC + :vartype last_state_change_time_utc: datetime + :ivar sub_state: Additional data on the state of the task + :vartype sub_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time_utc': {'readonly': True}, + 'last_state_change_time_utc': {'readonly': True}, + 'sub_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time_utc': {'key': 'properties.creationTimeUtc', 'type': 'iso-8601'}, + 'security_task_parameters': {'key': 'properties.securityTaskParameters', 'type': 'SecurityTaskParameters'}, + 'last_state_change_time_utc': {'key': 'properties.lastStateChangeTimeUtc', 'type': 'iso-8601'}, + 'sub_state': {'key': 'properties.subState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityTask, self).__init__(**kwargs) + self.state = None + self.creation_time_utc = None + self.security_task_parameters = kwargs.get('security_task_parameters', None) + self.last_state_change_time_utc = None + self.sub_state = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_task_paged.py b/azure-mgmt-security/azure/mgmt/security/models/security_task_paged.py new file mode 100644 index 000000000000..99856db41035 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_task_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SecurityTaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecurityTask ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecurityTask]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityTaskPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters.py b/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters.py new file mode 100644 index 000000000000..43150ace1c41 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityTaskParameters(Model): + """Changing set of properties, depending on the task type that is derived from + the name field. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :ivar name: Name of the task type + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityTaskParameters, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.name = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters_py3.py b/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters_py3.py new file mode 100644 index 000000000000..e7bbe4d7bbea --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_task_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityTaskParameters(Model): + """Changing set of properties, depending on the task type that is derived from + the name field. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :ivar name: Name of the task type + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, **kwargs) -> None: + super(SecurityTaskParameters, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.name = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/security_task_py3.py b/azure-mgmt-security/azure/mgmt/security/models/security_task_py3.py new file mode 100644 index 000000000000..d29d10479772 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/security_task_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class SecurityTask(Resource): + """Security task that we recommend to do in order to strengthen security. + + 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 state: State of the task (Active, Resolved etc.) + :vartype state: str + :ivar creation_time_utc: The time this task was discovered in UTC + :vartype creation_time_utc: datetime + :param security_task_parameters: + :type security_task_parameters: + ~azure.mgmt.security.models.SecurityTaskParameters + :ivar last_state_change_time_utc: The time this task's details were last + changed in UTC + :vartype last_state_change_time_utc: datetime + :ivar sub_state: Additional data on the state of the task + :vartype sub_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'creation_time_utc': {'readonly': True}, + 'last_state_change_time_utc': {'readonly': True}, + 'sub_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time_utc': {'key': 'properties.creationTimeUtc', 'type': 'iso-8601'}, + 'security_task_parameters': {'key': 'properties.securityTaskParameters', 'type': 'SecurityTaskParameters'}, + 'last_state_change_time_utc': {'key': 'properties.lastStateChangeTimeUtc', 'type': 'iso-8601'}, + 'sub_state': {'key': 'properties.subState', 'type': 'str'}, + } + + def __init__(self, *, security_task_parameters=None, **kwargs) -> None: + super(SecurityTask, self).__init__(**kwargs) + self.state = None + self.creation_time_utc = None + self.security_task_parameters = security_task_parameters + self.last_state_change_time_utc = None + self.sub_state = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py new file mode 100644 index 000000000000..09fd4a0bee30 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SensitivityLabel(Model): + """The sensitivity label. + + :param display_name: The name of the sensitivity label. + :type display_name: str + :param order: The order of the sensitivity label. + :type order: float + :param enabled: Indicates whether the label is enabled or not. + :type enabled: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SensitivityLabel, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py new file mode 100644 index 000000000000..79b0766f48c8 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/sensitivity_label_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SensitivityLabel(Model): + """The sensitivity label. + + :param display_name: The name of the sensitivity label. + :type display_name: str + :param order: The order of the sensitivity label. + :type order: float + :param enabled: Indicates whether the label is enabled or not. + :type enabled: bool + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, display_name: str=None, order: float=None, enabled: bool=None, **kwargs) -> None: + super(SensitivityLabel, self).__init__(**kwargs) + self.display_name = display_name + self.order = order + self.enabled = enabled diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting.py b/azure-mgmt-security/azure/mgmt/security/models/setting.py new file mode 100644 index 000000000000..6d9a06822f41 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Setting(Model): + """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: DataExportSetting + + 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': {'DataExportSetting': 'DataExportSetting'} + } + + def __init__(self, **kwargs): + super(Setting, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py b/azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py new file mode 100644 index 000000000000..4f3753aae68d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SettingKind1(Model): + """The kind of the security setting. + + :param kind: the kind of the settings string. Possible values include: + 'DataExportSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SettingKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py new file mode 100644 index 000000000000..33f8f077ff41 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SettingKind1(Model): + """The kind of the security setting. + + :param kind: the kind of the settings string. Possible values include: + 'DataExportSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(SettingKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py new file mode 100644 index 000000000000..5ab8b2585b4a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`Setting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Setting]'} + } + + def __init__(self, *args, **kwargs): + + super(SettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py new file mode 100644 index 000000000000..fa644684fb2f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Setting(Model): + """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: DataExportSetting + + 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': {'DataExportSetting': 'DataExportSetting'} + } + + def __init__(self, **kwargs) -> None: + super(Setting, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_resource.py b/azure-mgmt-security/azure/mgmt/security/models/topology_resource.py new file mode 100644 index 000000000000..6bf07b3d3164 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_resource.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """TopologyResource. + + 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 location: Location where the resource is stored + :vartype location: str + :ivar calculated_date_time: The UTC time on which the topology was + calculated + :vartype calculated_date_time: datetime + :ivar topology_resources: Azure resources which are part of this topology + resource + :vartype topology_resources: + list[~azure.mgmt.security.models.TopologySingleResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'calculated_date_time': {'readonly': True}, + 'topology_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'calculated_date_time': {'key': 'properties.calculatedDateTime', 'type': 'iso-8601'}, + 'topology_resources': {'key': 'properties.topologyResources', 'type': '[TopologySingleResource]'}, + } + + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.calculated_date_time = None + self.topology_resources = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_resource_paged.py b/azure-mgmt-security/azure/mgmt/security/models/topology_resource_paged.py new file mode 100644 index 000000000000..8c104aa5970a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_resource_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class TopologyResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`TopologyResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TopologyResource]'} + } + + def __init__(self, *args, **kwargs): + + super(TopologyResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/topology_resource_py3.py new file mode 100644 index 000000000000..00cca774a552 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_resource_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """TopologyResource. + + 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 location: Location where the resource is stored + :vartype location: str + :ivar calculated_date_time: The UTC time on which the topology was + calculated + :vartype calculated_date_time: datetime + :ivar topology_resources: Azure resources which are part of this topology + resource + :vartype topology_resources: + list[~azure.mgmt.security.models.TopologySingleResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'calculated_date_time': {'readonly': True}, + 'topology_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'calculated_date_time': {'key': 'properties.calculatedDateTime', 'type': 'iso-8601'}, + 'topology_resources': {'key': 'properties.topologyResources', 'type': '[TopologySingleResource]'}, + } + + def __init__(self, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.calculated_date_time = None + self.topology_resources = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource.py new file mode 100644 index 000000000000..f79f4c0f1a73 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResource(Model): + """TopologySingleResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id + :vartype resource_id: str + :ivar severity: The security severity of the resource + :vartype severity: str + :ivar recommendations_exist: Indicates if the resource has security + recommendations + :vartype recommendations_exist: bool + :ivar network_zones: Indicates the resource connectivity level to the + Internet (InternetFacing, Internal ,etc.) + :vartype network_zones: str + :ivar topology_score: Score of the resource based on its security severity + :vartype topology_score: int + :ivar location: The location of this resource + :vartype location: str + :ivar parents: Azure resources connected to this resource which are in + higher level in the topology view + :vartype parents: + list[~azure.mgmt.security.models.TopologySingleResourceParent] + :ivar children: Azure resources connected to this resource which are in + lower level in the topology view + :vartype children: + list[~azure.mgmt.security.models.TopologySingleResourceChild] + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'severity': {'readonly': True}, + 'recommendations_exist': {'readonly': True}, + 'network_zones': {'readonly': True}, + 'topology_score': {'readonly': True}, + 'location': {'readonly': True}, + 'parents': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'recommendations_exist': {'key': 'recommendationsExist', 'type': 'bool'}, + 'network_zones': {'key': 'networkZones', 'type': 'str'}, + 'topology_score': {'key': 'topologyScore', 'type': 'int'}, + 'location': {'key': 'location', 'type': 'str'}, + 'parents': {'key': 'parents', 'type': '[TopologySingleResourceParent]'}, + 'children': {'key': 'children', 'type': '[TopologySingleResourceChild]'}, + } + + def __init__(self, **kwargs): + super(TopologySingleResource, self).__init__(**kwargs) + self.resource_id = None + self.severity = None + self.recommendations_exist = None + self.network_zones = None + self.topology_score = None + self.location = None + self.parents = None + self.children = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child.py new file mode 100644 index 000000000000..257d81aab76d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResourceChild(Model): + """TopologySingleResourceChild. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id which serves as child resource in + topology view + :vartype resource_id: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TopologySingleResourceChild, self).__init__(**kwargs) + self.resource_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child_py3.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child_py3.py new file mode 100644 index 000000000000..a4e41c33fe64 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_child_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResourceChild(Model): + """TopologySingleResourceChild. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id which serves as child resource in + topology view + :vartype resource_id: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TopologySingleResourceChild, self).__init__(**kwargs) + self.resource_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent.py new file mode 100644 index 000000000000..c79aba299feb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResourceParent(Model): + """TopologySingleResourceParent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id which serves as parent resource in + topology view + :vartype resource_id: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TopologySingleResourceParent, self).__init__(**kwargs) + self.resource_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent_py3.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent_py3.py new file mode 100644 index 000000000000..6249dcea8849 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_parent_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResourceParent(Model): + """TopologySingleResourceParent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id which serves as parent resource in + topology view + :vartype resource_id: str + """ + + _validation = { + 'resource_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TopologySingleResourceParent, self).__init__(**kwargs) + self.resource_id = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_py3.py new file mode 100644 index 000000000000..529974e5619a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/topology_single_resource_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologySingleResource(Model): + """TopologySingleResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_id: Azure resource id + :vartype resource_id: str + :ivar severity: The security severity of the resource + :vartype severity: str + :ivar recommendations_exist: Indicates if the resource has security + recommendations + :vartype recommendations_exist: bool + :ivar network_zones: Indicates the resource connectivity level to the + Internet (InternetFacing, Internal ,etc.) + :vartype network_zones: str + :ivar topology_score: Score of the resource based on its security severity + :vartype topology_score: int + :ivar location: The location of this resource + :vartype location: str + :ivar parents: Azure resources connected to this resource which are in + higher level in the topology view + :vartype parents: + list[~azure.mgmt.security.models.TopologySingleResourceParent] + :ivar children: Azure resources connected to this resource which are in + lower level in the topology view + :vartype children: + list[~azure.mgmt.security.models.TopologySingleResourceChild] + """ + + _validation = { + 'resource_id': {'readonly': True}, + 'severity': {'readonly': True}, + 'recommendations_exist': {'readonly': True}, + 'network_zones': {'readonly': True}, + 'topology_score': {'readonly': True}, + 'location': {'readonly': True}, + 'parents': {'readonly': True}, + 'children': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'recommendations_exist': {'key': 'recommendationsExist', 'type': 'bool'}, + 'network_zones': {'key': 'networkZones', 'type': 'str'}, + 'topology_score': {'key': 'topologyScore', 'type': 'int'}, + 'location': {'key': 'location', 'type': 'str'}, + 'parents': {'key': 'parents', 'type': '[TopologySingleResourceParent]'}, + 'children': {'key': 'children', 'type': '[TopologySingleResourceChild]'}, + } + + def __init__(self, **kwargs) -> None: + super(TopologySingleResource, self).__init__(**kwargs) + self.resource_id = None + self.severity = None + self.recommendations_exist = None + self.network_zones = None + self.topology_score = None + self.location = None + self.parents = None + self.children = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py new file mode 100644 index 000000000000..327a5b9d8897 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class WorkspaceSetting(Resource): + """Configures where to store the OMS agent data for workspaces under a scope. + + 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 workspace_id: Required. The full Azure ID of the workspace to save + the data in + :type workspace_id: str + :param scope: Required. All the VMs in this scope will send their security + data to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workspace_id': {'required': True}, + 'scope': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceSetting, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.scope = kwargs.get('scope', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py new file mode 100644 index 000000000000..95122f57b90e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class WorkspaceSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkspaceSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkspaceSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkspaceSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py new file mode 100644 index 000000000000..aaa1be0b59a9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/workspace_setting_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class WorkspaceSetting(Resource): + """Configures where to store the OMS agent data for workspaces under a scope. + + 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 workspace_id: Required. The full Azure ID of the workspace to save + the data in + :type workspace_id: str + :param scope: Required. All the VMs in this scope will send their security + data to the mentioned workspace unless overridden by a setting with more + specific scope + :type scope: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workspace_id': {'required': True}, + 'scope': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__(self, *, workspace_id: str, scope: str, **kwargs) -> None: + super(WorkspaceSetting, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.scope = scope diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py new file mode 100644 index 000000000000..14d284151ba7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .pricings_operations import PricingsOperations +from .security_contacts_operations import SecurityContactsOperations +from .workspace_settings_operations import WorkspaceSettingsOperations +from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations +from .compliances_operations import CompliancesOperations +from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .settings_operations import SettingsOperations +from .information_protection_policies_operations import InformationProtectionPoliciesOperations +from .operations import Operations +from .locations_operations import LocationsOperations +from .tasks_operations import TasksOperations +from .alerts_operations import AlertsOperations +from .discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations +from .jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations +from .external_security_solutions_operations import ExternalSecuritySolutionsOperations +from .topology_operations import TopologyOperations + +__all__ = [ + 'PricingsOperations', + 'SecurityContactsOperations', + 'WorkspaceSettingsOperations', + 'AutoProvisioningSettingsOperations', + 'CompliancesOperations', + 'AdvancedThreatProtectionOperations', + 'SettingsOperations', + 'InformationProtectionPoliciesOperations', + 'Operations', + 'LocationsOperations', + 'TasksOperations', + 'AlertsOperations', + 'DiscoveredSecuritySolutionsOperations', + 'JitNetworkAccessPoliciesOperations', + 'ExternalSecuritySolutionsOperations', + 'TopologyOperations', +] diff --git a/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py new file mode 100644 index 000000000000..2bdef2916fbc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/advanced_threat_protection_operations.py @@ -0,0 +1,171 @@ +# 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 AdvancedThreatProtectionOperations(object): + """AdvancedThreatProtectionOperations operations. + + :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: "2017-08-01-preview". + :ivar setting_name: Advanced Threat Protection setting name. Constant value: "current". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + self.setting_name = "current" + + self.config = config + + def get( + self, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the Advanced Threat Protection settings for the specified + resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AdvancedThreatProtectionSetting or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} + + def create( + self, resource_id, is_enabled=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the Advanced Threat Protection settings on a + specified resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param is_enabled: Indicates whether Advanced Threat Protection is + enabled. + :type is_enabled: bool + :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: AdvancedThreatProtectionSetting or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.AdvancedThreatProtectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + advanced_threat_protection_setting = models.AdvancedThreatProtectionSetting(is_enabled=is_enabled) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'settingName': self._serialize.url("self.setting_name", self.setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(advanced_threat_protection_setting, 'AdvancedThreatProtectionSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AdvancedThreatProtectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py new file mode 100644 index 000000000000..5ce45a717eb5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py @@ -0,0 +1,593 @@ +# 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 AlertsOperations(object): + """AlertsOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """List all the alerts that are associated with the subscription. + + :param filter: OData filter. Optional. + :type filter: str + :param select: OData select. Optional. + :type select: str + :param expand: OData expand. Optional. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Alert + :rtype: + ~azure.mgmt.security.models.AlertPaged[~azure.mgmt.security.models.Alert] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts'} + + def list_by_resource_group( + self, resource_group_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """List all the alerts alerts that are associated with the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param filter: OData filter. Optional. + :type filter: str + :param select: OData select. Optional. + :type select: str + :param expand: OData expand. Optional. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Alert + :rtype: + ~azure.mgmt.security.models.AlertPaged[~azure.mgmt.security.models.Alert] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts'} + + def list_subscription_level_alerts_by_region( + self, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """List all the alerts that are associated with the subscription that are + stored in a specific location. + + :param filter: OData filter. Optional. + :type filter: str + :param select: OData select. Optional. + :type select: str + :param expand: OData expand. Optional. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Alert + :rtype: + ~azure.mgmt.security.models.AlertPaged[~azure.mgmt.security.models.Alert] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_subscription_level_alerts_by_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_subscription_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + + def list_resource_group_level_alerts_by_region( + self, resource_group_name, filter=None, select=None, expand=None, custom_headers=None, raw=False, **operation_config): + """List all the alerts that are associated with the resource group that + are stored in a specific location. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param filter: OData filter. Optional. + :type filter: str + :param select: OData select. Optional. + :type select: str + :param expand: OData expand. Optional. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Alert + :rtype: + ~azure.mgmt.security.models.AlertPaged[~azure.mgmt.security.models.Alert] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_resource_group_level_alerts_by_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AlertPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_resource_group_level_alerts_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts'} + + def get_subscription_level_alert( + self, alert_name, custom_headers=None, raw=False, **operation_config): + """Get an alert that is associated with a subscription. + + :param alert_name: Name of the alert object + :type alert_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: Alert or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Alert or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_subscription_level_alert.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'alertName': self._serialize.url("alert_name", alert_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Alert', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_level_alert.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + + def get_resource_group_level_alerts( + self, alert_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get an alert that is associated a resource group or a resource in a + resource group. + + :param alert_name: Name of the alert object + :type alert_name: str + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param 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: Alert or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Alert or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_group_level_alerts.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'alertName': self._serialize.url("alert_name", alert_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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('Alert', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_group_level_alerts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}'} + + def update_subscription_level_alert_state( + self, alert_name, alert_update_action_type, custom_headers=None, raw=False, **operation_config): + """Update the alert's state. + + :param alert_name: Name of the alert object + :type alert_name: str + :param alert_update_action_type: Type of the action to do on the + alert. Possible values include: 'Dismiss', 'Reactivate' + :type alert_update_action_type: 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.update_subscription_level_alert_state.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'alertName': self._serialize.url("alert_name", alert_name, 'str'), + 'alertUpdateActionType': self._serialize.url("alert_update_action_type", alert_update_action_type, '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 [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 + update_subscription_level_alert_state.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}'} + + def update_resource_group_level_alert_state( + self, alert_name, alert_update_action_type, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Update the alert's state. + + :param alert_name: Name of the alert object + :type alert_name: str + :param alert_update_action_type: Type of the action to do on the + alert. Possible values include: 'Dismiss', 'Reactivate' + :type alert_update_action_type: str + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param 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.update_resource_group_level_alert_state.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'alertName': self._serialize.url("alert_name", alert_name, 'str'), + 'alertUpdateActionType': self._serialize.url("alert_update_action_type", alert_update_action_type, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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 [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 + update_resource_group_level_alert_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py new file mode 100644 index 000000000000..9d6eccd8d530 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/auto_provisioning_settings_operations.py @@ -0,0 +1,229 @@ +# 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 AutoProvisioningSettingsOperations(object): + """AutoProvisioningSettingsOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Exposes the auto provisioning settings of the subscriptions. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AutoProvisioningSetting + :rtype: + ~azure.mgmt.security.models.AutoProvisioningSettingPaged[~azure.mgmt.security.models.AutoProvisioningSetting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AutoProvisioningSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings'} + + def get( + self, setting_name, custom_headers=None, raw=False, **operation_config): + """Details of a specific setting. + + :param setting_name: Auto provisioning setting key + :type setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AutoProvisioningSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutoProvisioningSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} + + def create( + self, setting_name, auto_provision, custom_headers=None, raw=False, **operation_config): + """Details of a specific setting. + + :param setting_name: Auto provisioning setting key + :type setting_name: str + :param auto_provision: Describes what kind of security agent + provisioning action to take. Possible values include: 'On', 'Off' + :type auto_provision: str or ~azure.mgmt.security.models.AutoProvision + :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: AutoProvisioningSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AutoProvisioningSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + setting = models.AutoProvisioningSetting(auto_provision=auto_provision) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(setting, 'AutoProvisioningSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AutoProvisioningSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py new file mode 100644 index 000000000000..3edc73a4fc32 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/compliances_operations.py @@ -0,0 +1,169 @@ +# 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 CompliancesOperations(object): + """CompliancesOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """The Compliance scores of the specific management group. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :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: An iterator like instance of Compliance + :rtype: + ~azure.mgmt.security.models.CompliancePaged[~azure.mgmt.security.models.Compliance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.CompliancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CompliancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances'} + + def get( + self, scope, compliance_name, custom_headers=None, raw=False, **operation_config): + """Details of a specific Compliance. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param compliance_name: name of the Compliance + :type compliance_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: Compliance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Compliance or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'complianceName': self._serialize.url("compliance_name", compliance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Compliance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/compliances/{complianceName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/discovered_security_solutions_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/discovered_security_solutions_operations.py new file mode 100644 index 000000000000..339bbfddd5bf --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/discovered_security_solutions_operations.py @@ -0,0 +1,233 @@ +# 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 DiscoveredSecuritySolutionsOperations(object): + """DiscoveredSecuritySolutionsOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of discovered Security Solutions for the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiscoveredSecuritySolution + :rtype: + ~azure.mgmt.security.models.DiscoveredSecuritySolutionPaged[~azure.mgmt.security.models.DiscoveredSecuritySolution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiscoveredSecuritySolutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiscoveredSecuritySolutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions'} + + def list_by_home_region( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of discovered Security Solutions for the subscription and + location. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DiscoveredSecuritySolution + :rtype: + ~azure.mgmt.security.models.DiscoveredSecuritySolutionPaged[~azure.mgmt.security.models.DiscoveredSecuritySolution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_home_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiscoveredSecuritySolutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiscoveredSecuritySolutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_home_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions'} + + def get( + self, resource_group_name, discovered_security_solution_name, custom_headers=None, raw=False, **operation_config): + """Gets a specific discovered Security Solution. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param discovered_security_solution_name: Name of a discovered + security solution. + :type discovered_security_solution_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DiscoveredSecuritySolution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DiscoveredSecuritySolution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'discoveredSecuritySolutionName': self._serialize.url("discovered_security_solution_name", discovered_security_solution_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DiscoveredSecuritySolution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/external_security_solutions_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/external_security_solutions_operations.py new file mode 100644 index 000000000000..3286ae570426 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/external_security_solutions_operations.py @@ -0,0 +1,233 @@ +# 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 ExternalSecuritySolutionsOperations(object): + """ExternalSecuritySolutionsOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of external security solutions for the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSecuritySolution + :rtype: + ~azure.mgmt.security.models.ExternalSecuritySolutionPaged[~azure.mgmt.security.models.ExternalSecuritySolution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExternalSecuritySolutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSecuritySolutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions'} + + def list_by_home_region( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of external Security Solutions for the subscription and + location. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExternalSecuritySolution + :rtype: + ~azure.mgmt.security.models.ExternalSecuritySolutionPaged[~azure.mgmt.security.models.ExternalSecuritySolution] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_home_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExternalSecuritySolutionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExternalSecuritySolutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_home_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions'} + + def get( + self, resource_group_name, external_security_solutions_name, custom_headers=None, raw=False, **operation_config): + """Gets a specific external Security Solution. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param external_security_solutions_name: Name of an external security + solution. + :type external_security_solutions_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: ExternalSecuritySolution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.ExternalSecuritySolution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'externalSecuritySolutionsName': self._serialize.url("external_security_solutions_name", external_security_solutions_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExternalSecuritySolution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py new file mode 100644 index 000000000000..d4c5fe7329b4 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/information_protection_policies_operations.py @@ -0,0 +1,236 @@ +# 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 InformationProtectionPoliciesOperations(object): + """InformationProtectionPoliciesOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def get( + self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): + """Details of the information protection policy. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param information_protection_policy_name: Name of the information + protection policy. Possible values include: 'effective', 'custom' + :type information_protection_policy_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: InformationProtectionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InformationProtectionPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} + + def create_or_update( + self, scope, information_protection_policy_name, custom_headers=None, raw=False, **operation_config): + """Details of the information protection policy. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :type scope: str + :param information_protection_policy_name: Name of the information + protection policy. Possible values include: 'effective', 'custom' + :type information_protection_policy_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: InformationProtectionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.InformationProtectionPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str'), + 'informationProtectionPolicyName': self._serialize.url("information_protection_policy_name", information_protection_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + 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('InformationProtectionPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('InformationProtectionPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}'} + + def list( + self, scope, custom_headers=None, raw=False, **operation_config): + """Information protection policies of a specific management group. + + :param scope: Scope of the query, can be subscription + (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management + group (/providers/Microsoft.Management/managementGroups/mgName). + :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: An iterator like instance of InformationProtectionPolicy + :rtype: + ~azure.mgmt.security.models.InformationProtectionPolicyPaged[~azure.mgmt.security.models.InformationProtectionPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InformationProtectionPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{scope}/providers/Microsoft.Security/informationProtectionPolicies'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/jit_network_access_policies_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/jit_network_access_policies_operations.py new file mode 100644 index 000000000000..a8b9c88bed35 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/jit_network_access_policies_operations.py @@ -0,0 +1,580 @@ +# 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 JitNetworkAccessPoliciesOperations(object): + """JitNetworkAccessPoliciesOperations operations. + + :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: "2015-06-01-preview". + :ivar jit_network_access_policy_initiate_type: Type of the action to do on the Just-in-Time access policy. Constant value: "initiate". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + self.jit_network_access_policy_initiate_type = "initiate" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Policies for protecting resources using Just-in-Time access control. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JitNetworkAccessPolicy + :rtype: + ~azure.mgmt.security.models.JitNetworkAccessPolicyPaged[~azure.mgmt.security.models.JitNetworkAccessPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies'} + + def list_by_region( + self, custom_headers=None, raw=False, **operation_config): + """Policies for protecting resources using Just-in-Time access control for + the subscription, location. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JitNetworkAccessPolicy + :rtype: + ~azure.mgmt.security.models.JitNetworkAccessPolicyPaged[~azure.mgmt.security.models.JitNetworkAccessPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Policies for protecting resources using Just-in-Time access control for + the subscription, location. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JitNetworkAccessPolicy + :rtype: + ~azure.mgmt.security.models.JitNetworkAccessPolicyPaged[~azure.mgmt.security.models.JitNetworkAccessPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies'} + + def list_by_resource_group_and_region( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Policies for protecting resources using Just-in-Time access control for + the subscription, location. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of JitNetworkAccessPolicy + :rtype: + ~azure.mgmt.security.models.JitNetworkAccessPolicyPaged[~azure.mgmt.security.models.JitNetworkAccessPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group_and_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.JitNetworkAccessPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group_and_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies'} + + def get( + self, resource_group_name, jit_network_access_policy_name, custom_headers=None, raw=False, **operation_config): + """Policies for protecting resources using Just-in-Time access control for + the subscription, location. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param jit_network_access_policy_name: Name of a Just-in-Time access + configuration policy. + :type jit_network_access_policy_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: JitNetworkAccessPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.JitNetworkAccessPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'jitNetworkAccessPolicyName': self._serialize.url("jit_network_access_policy_name", jit_network_access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JitNetworkAccessPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}'} + + def create_or_update( + self, resource_group_name, jit_network_access_policy_name, body, custom_headers=None, raw=False, **operation_config): + """Create a policy for protecting resources using Just-in-Time access + control. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param jit_network_access_policy_name: Name of a Just-in-Time access + configuration policy. + :type jit_network_access_policy_name: str + :param body: + :type body: ~azure.mgmt.security.models.JitNetworkAccessPolicy + :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: JitNetworkAccessPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.JitNetworkAccessPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'jitNetworkAccessPolicyName': self._serialize.url("jit_network_access_policy_name", jit_network_access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'JitNetworkAccessPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('JitNetworkAccessPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}'} + + def delete( + self, resource_group_name, jit_network_access_policy_name, custom_headers=None, raw=False, **operation_config): + """Delete a Just-in-Time access control policy. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param jit_network_access_policy_name: Name of a Just-in-Time access + configuration policy. + :type jit_network_access_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'jitNetworkAccessPolicyName': self._serialize.url("jit_network_access_policy_name", jit_network_access_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}'} + + def initiate( + self, resource_group_name, jit_network_access_policy_name, virtual_machines, custom_headers=None, raw=False, **operation_config): + """Initiate a JIT access from a specific Just-in-Time policy + configuration. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param jit_network_access_policy_name: Name of a Just-in-Time access + configuration policy. + :type jit_network_access_policy_name: str + :param virtual_machines: A list of virtual machines & ports to open + access for + :type virtual_machines: + list[~azure.mgmt.security.models.JitNetworkAccessPolicyInitiateVirtualMachine] + :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: JitNetworkAccessRequest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.JitNetworkAccessRequest or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.JitNetworkAccessPolicyInitiateRequest(virtual_machines=virtual_machines) + + # Construct URL + url = self.initiate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'jitNetworkAccessPolicyName': self._serialize.url("jit_network_access_policy_name", jit_network_access_policy_name, 'str'), + 'jitNetworkAccessPolicyInitiateType': self._serialize.url("self.jit_network_access_policy_initiate_type", self.jit_network_access_policy_initiate_type, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'JitNetworkAccessPolicyInitiateRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('JitNetworkAccessRequest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + initiate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/locations_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/locations_operations.py new file mode 100644 index 000000000000..5aa7ba17569f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/locations_operations.py @@ -0,0 +1,162 @@ +# 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 LocationsOperations(object): + """LocationsOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """The location of the responsible ASC of the specific subscription (home + region). For each subscription there is only one responsible location. + The location in the response should be used to read or write other + resources in ASC according to their ID. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AscLocation + :rtype: + ~azure.mgmt.security.models.AscLocationPaged[~azure.mgmt.security.models.AscLocation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AscLocationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AscLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations'} + + def get( + self, custom_headers=None, raw=False, **operation_config): + """Details of a specific location. + + :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: AscLocation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.AscLocation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('AscLocation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/operations.py b/azure-mgmt-security/azure/mgmt/security/operations/operations.py new file mode 100644 index 000000000000..5a2cacc56e2f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/operations.py @@ -0,0 +1,98 @@ +# 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 Operations(object): + """Operations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Exposes all available operations for discovery purposes. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.security.models.OperationPaged[~azure.mgmt.security.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Security/operations'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py new file mode 100644 index 000000000000..60cc30172f7e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py @@ -0,0 +1,433 @@ +# 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 PricingsOperations(object): + """PricingsOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Security pricing configurations in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Pricing + :rtype: + ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configurations in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Pricing + :rtype: + ~azure.mgmt.security.models.PricingPaged[~azure.mgmt.security.models.Pricing] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PricingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PricingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings'} + + def get_subscription_pricing( + self, pricing_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the subscriptionSecurity pricing + configuration in the subscription. + + :param pricing_name: name of the pricing configuration + :type pricing_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: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_subscription_pricing.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}$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} + + def update_subscription_pricing( + self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the subscription. + + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param pricing_tier: Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :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: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + pricing = models.Pricing(pricing_tier=pricing_tier) + + # Construct URL + url = self.update_subscription_pricing.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}$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(pricing, 'Pricing') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_subscription_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} + + def get_resource_group_pricing( + self, resource_group_name, pricing_name, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param pricing_name: name of the pricing configuration + :type pricing_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: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_group_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} + + def create_or_update_resource_group_pricing( + self, resource_group_name, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param pricing_name: name of the pricing configuration + :type pricing_name: str + :param pricing_tier: Pricing tier type. Possible values include: + 'Free', 'Standard' + :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :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: Pricing or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Pricing or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + pricing = models.Pricing(pricing_tier=pricing_tier) + + # Construct URL + url = self.create_or_update_resource_group_pricing.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(pricing, 'Pricing') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Pricing', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py new file mode 100644 index 000000000000..9a1c12a66205 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/security_contacts_operations.py @@ -0,0 +1,341 @@ +# 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 SecurityContactsOperations(object): + """SecurityContactsOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityContact + :rtype: + ~azure.mgmt.security.models.SecurityContactPaged[~azure.mgmt.security.models.SecurityContact] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityContactPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts'} + + def get( + self, security_contact_name, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_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: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def create( + self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param security_contact: Security contact object + :type security_contact: ~azure.mgmt.security.models.SecurityContact + :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: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(security_contact, 'SecurityContact') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def delete( + self, security_contact_name, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} + + def update( + self, security_contact_name, security_contact, custom_headers=None, raw=False, **operation_config): + """Security contact configurations for the subscription. + + :param security_contact_name: Name of the security contact object + :type security_contact_name: str + :param security_contact: Security contact object + :type security_contact: ~azure.mgmt.security.models.SecurityContact + :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: SecurityContact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityContact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.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}$'), + 'securityContactName': self._serialize.url("security_contact_name", security_contact_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(security_contact, 'SecurityContact') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityContact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py new file mode 100644 index 000000000000..47b9c1b6d7f5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py @@ -0,0 +1,228 @@ +# 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 SettingsOperations(object): + """SettingsOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings about different configurations in security center. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Setting + :rtype: + ~azure.mgmt.security.models.SettingPaged[~azure.mgmt.security.models.Setting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings'} + + def get( + self, setting_name, custom_headers=None, raw=False, **operation_config): + """Settings of different configurations in security center. + + :param setting_name: Name of setting. Possible values include: 'MCAS', + 'WDATP' + :type setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Setting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Setting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Setting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} + + def update( + self, setting_name, setting, custom_headers=None, raw=False, **operation_config): + """updating settings about different configurations in security center. + + :param setting_name: Name of setting. Possible values include: 'MCAS', + 'WDATP' + :type setting_name: str + :param setting: Setting object + :type setting: ~azure.mgmt.security.models.Setting + :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: Setting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.Setting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.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}$'), + 'settingName': self._serialize.url("setting_name", setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(setting, 'Setting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Setting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/tasks_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/tasks_operations.py new file mode 100644 index 000000000000..fc002b8368ed --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/tasks_operations.py @@ -0,0 +1,495 @@ +# 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 TasksOperations(object): + """TasksOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param filter: OData filter. Optional. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityTask + :rtype: + ~azure.mgmt.security.models.SecurityTaskPaged[~azure.mgmt.security.models.SecurityTask] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks'} + + def list_by_home_region( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param filter: OData filter. Optional. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityTask + :rtype: + ~azure.mgmt.security.models.SecurityTaskPaged[~azure.mgmt.security.models.SecurityTask] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_home_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_home_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks'} + + def get_subscription_level_task( + self, task_name, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param task_name: Name of the task object, will be a GUID + :type task_name: str + :param 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: SecurityTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityTask or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_subscription_level_task.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'taskName': self._serialize.url("task_name", task_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_subscription_level_task.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}'} + + def update_subscription_level_task_state( + self, task_name, task_update_action_type, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param task_name: Name of the task object, will be a GUID + :type task_name: str + :param task_update_action_type: Type of the action to do on the task. + Possible values include: 'Activate', 'Dismiss', 'Start', 'Resolve', + 'Close' + :type task_update_action_type: 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.update_subscription_level_task_state.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'taskName': self._serialize.url("task_name", task_name, 'str'), + 'taskUpdateActionType': self._serialize.url("task_update_action_type", task_update_action_type, '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 [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 + update_subscription_level_task_state.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param filter: OData filter. Optional. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityTask + :rtype: + ~azure.mgmt.security.models.SecurityTaskPaged[~azure.mgmt.security.models.SecurityTask] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks'} + + def get_resource_group_level_task( + self, resource_group_name, task_name, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param task_name: Name of the task object, will be a GUID + :type task_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: SecurityTask or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.SecurityTask or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_group_level_task.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'taskName': self._serialize.url("task_name", task_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityTask', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_group_level_task.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}'} + + def update_resource_group_level_task_state( + self, resource_group_name, task_name, task_update_action_type, custom_headers=None, raw=False, **operation_config): + """Recommended tasks that will help improve the security of the + subscription proactively. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param task_name: Name of the task object, will be a GUID + :type task_name: str + :param task_update_action_type: Type of the action to do on the task. + Possible values include: 'Activate', 'Dismiss', 'Start', 'Resolve', + 'Close' + :type task_update_action_type: 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.update_resource_group_level_task_state.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'taskName': self._serialize.url("task_name", task_name, 'str'), + 'taskUpdateActionType': self._serialize.url("task_update_action_type", task_update_action_type, '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 [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 + update_resource_group_level_task_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/topology_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/topology_operations.py new file mode 100644 index 000000000000..75ba584c21f7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/topology_operations.py @@ -0,0 +1,233 @@ +# 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 TopologyOperations(object): + """TopologyOperations operations. + + :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: "2015-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list that allows to build a topology view of a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TopologyResource + :rtype: + ~azure.mgmt.security.models.TopologyResourcePaged[~azure.mgmt.security.models.TopologyResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopologyResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopologyResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies'} + + def list_by_home_region( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list that allows to build a topology view of a subscription and + location. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TopologyResource + :rtype: + ~azure.mgmt.security.models.TopologyResourcePaged[~azure.mgmt.security.models.TopologyResource] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_home_region.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopologyResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopologyResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_home_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies'} + + def get( + self, resource_group_name, topology_resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a specific topology component. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param topology_resource_name: Name of a topology resources + collection. + :type topology_resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopologyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.TopologyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'ascLocation': self._serialize.url("self.config.asc_location", self.config.asc_location, 'str'), + 'topologyResourceName': self._serialize.url("topology_resource_name", topology_resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('TopologyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py new file mode 100644 index 000000000000..d92f1831e26a --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py @@ -0,0 +1,357 @@ +# 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 WorkspaceSettingsOperations(object): + """WorkspaceSettingsOperations operations. + + :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: "2017-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkspaceSetting + :rtype: + ~azure.mgmt.security.models.WorkspaceSettingPaged[~azure.mgmt.security.models.WorkspaceSetting] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkspaceSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings'} + + def get( + self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def create( + self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): + """creating settings about where we should store your security data and + logs. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param workspace_id: The full Azure ID of the workspace to save the + data in + :type workspace_id: str + :param scope: All the VMs in this scope will send their security data + to the mentioned workspace unless overridden by a setting with more + specific scope + :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: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def update( + self, workspace_setting_name, workspace_id, scope, custom_headers=None, raw=False, **operation_config): + """Settings about where we should store your security data and logs. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param workspace_id: The full Azure ID of the workspace to save the + data in + :type workspace_id: str + :param scope: All the VMs in this scope will send their security data + to the mentioned workspace unless overridden by a setting with more + specific scope + :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: WorkspaceSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.WorkspaceSetting or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + workspace_setting = models.WorkspaceSetting(workspace_id=workspace_id, scope=scope) + + # Construct URL + url = self.update.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}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workspace_setting, 'WorkspaceSetting') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} + + def delete( + self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): + """Deletes the custom workspace settings for this subscription. new VMs + will report to the default workspace. + + :param workspace_setting_name: Name of the security setting + :type workspace_setting_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'workspaceSettingName': self._serialize.url("workspace_setting_name", workspace_setting_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py new file mode 100644 index 000000000000..a51e73196e67 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -0,0 +1,164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.pricings_operations import PricingsOperations +from .operations.security_contacts_operations import SecurityContactsOperations +from .operations.workspace_settings_operations import WorkspaceSettingsOperations +from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations +from .operations.compliances_operations import CompliancesOperations +from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .operations.settings_operations import SettingsOperations +from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations +from .operations.operations import Operations +from .operations.locations_operations import LocationsOperations +from .operations.tasks_operations import TasksOperations +from .operations.alerts_operations import AlertsOperations +from .operations.discovered_security_solutions_operations import DiscoveredSecuritySolutionsOperations +from .operations.jit_network_access_policies_operations import JitNetworkAccessPoliciesOperations +from .operations.external_security_solutions_operations import ExternalSecuritySolutionsOperations +from .operations.topology_operations import TopologyOperations +from . import models + + +class SecurityCenterConfiguration(AzureConfiguration): + """Configuration for SecurityCenter + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure subscription ID + :type subscription_id: str + :param asc_location: The location where ASC stores the data of the + subscription. can be retrieved from Get locations + :type asc_location: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, asc_location, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if asc_location is None: + raise ValueError("Parameter 'asc_location' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SecurityCenterConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-security/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + self.asc_location = asc_location + + +class SecurityCenter(SDKClient): + """API spec for Microsoft.Security (Azure Security Center) resource provider + + :ivar config: Configuration for client. + :vartype config: SecurityCenterConfiguration + + :ivar pricings: Pricings operations + :vartype pricings: azure.mgmt.security.operations.PricingsOperations + :ivar security_contacts: SecurityContacts operations + :vartype security_contacts: azure.mgmt.security.operations.SecurityContactsOperations + :ivar workspace_settings: WorkspaceSettings operations + :vartype workspace_settings: azure.mgmt.security.operations.WorkspaceSettingsOperations + :ivar auto_provisioning_settings: AutoProvisioningSettings operations + :vartype auto_provisioning_settings: azure.mgmt.security.operations.AutoProvisioningSettingsOperations + :ivar compliances: Compliances operations + :vartype compliances: azure.mgmt.security.operations.CompliancesOperations + :ivar advanced_threat_protection: AdvancedThreatProtection operations + :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations + :ivar settings: Settings operations + :vartype settings: azure.mgmt.security.operations.SettingsOperations + :ivar information_protection_policies: InformationProtectionPolicies operations + :vartype information_protection_policies: azure.mgmt.security.operations.InformationProtectionPoliciesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.security.operations.Operations + :ivar locations: Locations operations + :vartype locations: azure.mgmt.security.operations.LocationsOperations + :ivar tasks: Tasks operations + :vartype tasks: azure.mgmt.security.operations.TasksOperations + :ivar alerts: Alerts operations + :vartype alerts: azure.mgmt.security.operations.AlertsOperations + :ivar discovered_security_solutions: DiscoveredSecuritySolutions operations + :vartype discovered_security_solutions: azure.mgmt.security.operations.DiscoveredSecuritySolutionsOperations + :ivar jit_network_access_policies: JitNetworkAccessPolicies operations + :vartype jit_network_access_policies: azure.mgmt.security.operations.JitNetworkAccessPoliciesOperations + :ivar external_security_solutions: ExternalSecuritySolutions operations + :vartype external_security_solutions: azure.mgmt.security.operations.ExternalSecuritySolutionsOperations + :ivar topology: Topology operations + :vartype topology: azure.mgmt.security.operations.TopologyOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure subscription ID + :type subscription_id: str + :param asc_location: The location where ASC stores the data of the + subscription. can be retrieved from Get locations + :type asc_location: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, asc_location, base_url=None): + + self.config = SecurityCenterConfiguration(credentials, subscription_id, asc_location, base_url) + super(SecurityCenter, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.pricings = PricingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.security_contacts = SecurityContactsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_settings = WorkspaceSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.auto_provisioning_settings = AutoProvisioningSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.compliances = CompliancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.advanced_threat_protection = AdvancedThreatProtectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.settings = SettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.information_protection_policies = InformationProtectionPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.locations = LocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tasks = TasksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.alerts = AlertsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.discovered_security_solutions = DiscoveredSecuritySolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.jit_network_access_policies = JitNetworkAccessPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.external_security_solutions = ExternalSecuritySolutionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.topology = TopologyOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-security/azure/mgmt/security/version.py b/azure-mgmt-security/azure/mgmt/security/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-security/sdk_packaging.toml b/azure-mgmt-security/sdk_packaging.toml new file mode 100644 index 000000000000..c03e2b8e2e26 --- /dev/null +++ b/azure-mgmt-security/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-security" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Secutiry Center Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-security/setup.cfg b/azure-mgmt-security/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-security/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-security/setup.py b/azure-mgmt-security/setup.py new file mode 100644 index 000000000000..0a11aadda73b --- /dev/null +++ b/azure-mgmt-security/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-security" +PACKAGE_PPRINT_NAME = "Secutiry Center Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)