From 5d3486e52fb1a56d0b92bf919031046294b03977 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 30 Dec 2018 15:16:40 +0000 Subject: [PATCH 1/6] Generated from c55343d67df9f202ebbfdc2670f167350fe265ea Some fixes after validation --- .../azure/mgmt/security/models/__init__.py | 21 ++ .../models/allowlist_custom_alert_rule.py | 55 ++++ .../models/allowlist_custom_alert_rule_py3.py | 55 ++++ .../mgmt/security/models/custom_alert_rule.py | 52 ++++ .../security/models/custom_alert_rule_py3.py | 52 ++++ .../models/denylist_custom_alert_rule.py | 55 ++++ .../models/denylist_custom_alert_rule_py3.py | 55 ++++ .../security/models/iot_security_group.py | 62 ++++ .../models/iot_security_group_list.py | 28 ++ .../models/iot_security_group_list_py3.py | 28 ++ .../security/models/iot_security_group_py3.py | 62 ++++ .../models/threshold_custom_alert_rule.py | 59 ++++ .../models/threshold_custom_alert_rule_py3.py | 59 ++++ .../models/time_window_custom_alert_rule.py | 68 +++++ .../time_window_custom_alert_rule_py3.py | 68 +++++ .../mgmt/security/operations/__init__.py | 2 + .../iot_security_groups_operations.py | 281 ++++++++++++++++++ .../azure/mgmt/security/security_center.py | 5 + 18 files changed, 1067 insertions(+) create mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index 47bdff08e273..6ed6aea2c2c2 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -26,6 +26,13 @@ from .information_protection_keyword_py3 import InformationProtectionKeyword from .information_type_py3 import InformationType from .information_protection_policy_py3 import InformationProtectionPolicy + from .threshold_custom_alert_rule_py3 import ThresholdCustomAlertRule + from .time_window_custom_alert_rule_py3 import TimeWindowCustomAlertRule + from .allowlist_custom_alert_rule_py3 import AllowlistCustomAlertRule + from .denylist_custom_alert_rule_py3 import DenylistCustomAlertRule + from .iot_security_group_py3 import IotSecurityGroup + from .iot_security_group_list_py3 import IotSecurityGroupList + from .custom_alert_rule_py3 import CustomAlertRule from .location_py3 import Location from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation @@ -80,6 +87,13 @@ from .information_protection_keyword import InformationProtectionKeyword from .information_type import InformationType from .information_protection_policy import InformationProtectionPolicy + from .threshold_custom_alert_rule import ThresholdCustomAlertRule + from .time_window_custom_alert_rule import TimeWindowCustomAlertRule + from .allowlist_custom_alert_rule import AllowlistCustomAlertRule + from .denylist_custom_alert_rule import DenylistCustomAlertRule + from .iot_security_group import IotSecurityGroup + from .iot_security_group_list import IotSecurityGroupList + from .custom_alert_rule import CustomAlertRule from .location import Location from .operation_display import OperationDisplay from .operation import Operation @@ -165,6 +179,13 @@ 'InformationProtectionKeyword', 'InformationType', 'InformationProtectionPolicy', + 'ThresholdCustomAlertRule', + 'TimeWindowCustomAlertRule', + 'AllowlistCustomAlertRule', + 'DenylistCustomAlertRule', + 'IotSecurityGroup', + 'IotSecurityGroupList', + 'CustomAlertRule', 'Location', 'OperationDisplay', 'Operation', diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py new file mode 100644 index 000000000000..0574a1140a46 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py @@ -0,0 +1,55 @@ +# 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 .custom_alert_rule import CustomAlertRule + + +class AllowlistCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AllowlistCustomAlertRule, self).__init__(**kwargs) + self.allowlist_values = kwargs.get('allowlist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py new file mode 100644 index 000000000000..366d07c66184 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py @@ -0,0 +1,55 @@ +# 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 .custom_alert_rule_py3 import CustomAlertRule + + +class AllowlistCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, allowlist_values, **kwargs) -> None: + super(AllowlistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.allowlist_values = allowlist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py new file mode 100644 index 000000000000..7b8bbed4659f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py @@ -0,0 +1,52 @@ +# 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 CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py new file mode 100644 index 000000000000..8ecf4bf163cb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py @@ -0,0 +1,52 @@ +# 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 CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py new file mode 100644 index 000000000000..8452494ea8bd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py @@ -0,0 +1,55 @@ +# 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 .custom_alert_rule import CustomAlertRule + + +class DenylistCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DenylistCustomAlertRule, self).__init__(**kwargs) + self.denylist_values = kwargs.get('denylist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py new file mode 100644 index 000000000000..79ab0e305d40 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py @@ -0,0 +1,55 @@ +# 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 .custom_alert_rule_py3 import CustomAlertRule + + +class DenylistCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, denylist_values, **kwargs) -> None: + super(DenylistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.denylist_values = denylist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py new file mode 100644 index 000000000000..be7d4408426f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group.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 IotSecurityGroup(Resource): + """The IoT security group 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 threshold_rules: A list of threshold custom alert rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: A list of time window custom alert rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: A list of allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: A list of deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _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'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, **kwargs): + super(IotSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = kwargs.get('threshold_rules', None) + self.time_window_rules = kwargs.get('time_window_rules', None) + self.allowlist_rules = kwargs.get('allowlist_rules', None) + self.denylist_rules = kwargs.get('denylist_rules', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py new file mode 100644 index 000000000000..3c90ef748278 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.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 IotSecurityGroupList(Model): + """List of IoT security groups. + + :param value: List of IoT security group objects + :type value: list[~azure.mgmt.security.models.IotSecurityGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSecurityGroup]'}, + } + + def __init__(self, **kwargs): + super(IotSecurityGroupList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py new file mode 100644 index 000000000000..b753b794f339 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_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 IotSecurityGroupList(Model): + """List of IoT security groups. + + :param value: List of IoT security group objects + :type value: list[~azure.mgmt.security.models.IotSecurityGroup] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IotSecurityGroup]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(IotSecurityGroupList, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py new file mode 100644 index 000000000000..d355c98bac8e --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_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 IotSecurityGroup(Resource): + """The IoT security group 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 threshold_rules: A list of threshold custom alert rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: A list of time window custom alert rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: A list of allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: A list of deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _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'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: + super(IotSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = threshold_rules + self.time_window_rules = time_window_rules + self.allowlist_rules = allowlist_rules + self.denylist_rules = denylist_rules diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py new file mode 100644 index 000000000000..4e6306190e2b --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.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 .custom_alert_rule import CustomAlertRule + + +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ThresholdCustomAlertRule, self).__init__(**kwargs) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py new file mode 100644 index 000000000000..63c5567caceb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_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 .custom_alert_rule_py3 import CustomAlertRule + + +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, **kwargs) -> None: + super(ThresholdCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.min_threshold = min_threshold + self.max_threshold = max_threshold diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py new file mode 100644 index 000000000000..224d5a3dc0ea --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.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 msrest.serialization import Model + + +class TimeWindowCustomAlertRule(Model): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) + self.time_window_size = kwargs.get('time_window_size', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py new file mode 100644 index 000000000000..0a2962dddb94 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_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 msrest.serialization import Model + + +class TimeWindowCustomAlertRule(Model): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, time_window_size, **kwargs) -> None: + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type + self.min_threshold = min_threshold + self.max_threshold = max_threshold + self.time_window_size = time_window_size diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index cc451ba3dd54..3a5fc03d2e02 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -15,6 +15,7 @@ from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .compliances_operations import CompliancesOperations from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .iot_security_groups_operations import IotSecurityGroupsOperations from .settings_operations import SettingsOperations from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations @@ -34,6 +35,7 @@ 'AutoProvisioningSettingsOperations', 'CompliancesOperations', 'AdvancedThreatProtectionOperations', + 'IotSecurityGroupsOperations', 'SettingsOperations', 'InformationProtectionPoliciesOperations', 'Operations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py new file mode 100644 index 000000000000..49e384267418 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py @@ -0,0 +1,281 @@ +# 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 IotSecurityGroupsOperations(object): + """IotSecurityGroupsOperations 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, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the list of security groups for the specified IoT hub 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: IotSecurityGroupList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSecurityGroupList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, '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('IotSecurityGroupList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups'} + + def get( + self, resource_id, iot_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets the security group for the specified IoT hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param iot_security_group_name: The name of the security group. Please + notice that the name is case insensitive. + :type iot_security_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: IotSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSecurityGroup 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'), + 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_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('IotSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} + + def create_or_update( + self, resource_id, iot_security_group_name, iot_security_group, custom_headers=None, raw=False, **operation_config): + """Creates or updates the security group on a specified IoT hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param iot_security_group_name: The name of the security group. Please + notice that the name is case insensitive. + :type iot_security_group_name: str + :param iot_security_group: Security group object. + :type iot_security_group: ~azure.mgmt.security.models.IotSecurityGroup + :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: IotSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.IotSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_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(iot_security_group, 'IotSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IotSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('IotSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} + + def delete( + self, resource_id, iot_security_group_name, custom_headers=None, raw=False, **operation_config): + """Deletes the security group. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param iot_security_group_name: The name of the security group. Please + notice that the name is case insensitive. + :type iot_security_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.delete.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_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': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index 4a70b5762f4f..ad3f2129631d 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -19,6 +19,7 @@ from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .operations.compliances_operations import CompliancesOperations from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .operations.iot_security_groups_operations import IotSecurityGroupsOperations from .operations.settings_operations import SettingsOperations from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations @@ -89,6 +90,8 @@ class SecurityCenter(SDKClient): :vartype compliances: azure.mgmt.security.operations.CompliancesOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations + :ivar iot_security_groups: IotSecurityGroups operations + :vartype iot_security_groups: azure.mgmt.security.operations.IotSecurityGroupsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar information_protection_policies: InformationProtectionPolicies operations @@ -145,6 +148,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self.config, self._serialize, self._deserialize) + self.iot_security_groups = IotSecurityGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) self.information_protection_policies = InformationProtectionPoliciesOperations( From 3111d35284393e2a340a112a0d5d19c268179bb4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 14 Jan 2019 14:35:09 +0000 Subject: [PATCH 2/6] Generated from d6824620292538df997c2da42c9deda14ee9a90f Change resource name, add x-ms-pagable --- .../azure/mgmt/security/models/__init__.py | 17 +- .../security/models/data_export_setting.py | 7 +- .../models/data_export_setting_py3.py | 11 +- ...rity_group.py => device_security_group.py} | 6 +- ...ind1.py => device_security_group_paged.py} | 20 +-- ...up_py3.py => device_security_group_py3.py} | 6 +- .../models/iot_security_group_list.py | 28 ---- .../models/iot_security_group_list_py3.py | 28 ---- .../security/models/security_center_enums.py | 1 + .../azure/mgmt/security/models/setting.py | 21 +-- .../mgmt/security/models/setting_kind1_py3.py | 29 ---- .../azure/mgmt/security/models/setting_py3.py | 25 +-- .../mgmt/security/models/setting_resource.py | 51 ++++++ .../security/models/setting_resource_py3.py | 51 ++++++ .../mgmt/security/operations/__init__.py | 4 +- ...y => device_security_groups_operations.py} | 157 ++++++++++-------- .../operations/settings_operations.py | 18 +- .../azure/mgmt/security/security_center.py | 8 +- 18 files changed, 251 insertions(+), 237 deletions(-) rename azure-mgmt-security/azure/mgmt/security/models/{iot_security_group.py => device_security_group.py} (94%) rename azure-mgmt-security/azure/mgmt/security/models/{setting_kind1.py => device_security_group_paged.py} (52%) rename azure-mgmt-security/azure/mgmt/security/models/{iot_security_group_py3.py => device_security_group_py3.py} (94%) delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py rename azure-mgmt-security/azure/mgmt/security/operations/{iot_security_groups_operations.py => device_security_groups_operations.py} (63%) diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index 6ed6aea2c2c2..57f5d5ea3708 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -21,7 +21,7 @@ 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 .setting_resource_py3 import SettingResource from .sensitivity_label_py3 import SensitivityLabel from .information_protection_keyword_py3 import InformationProtectionKeyword from .information_type_py3 import InformationType @@ -30,8 +30,7 @@ from .time_window_custom_alert_rule_py3 import TimeWindowCustomAlertRule from .allowlist_custom_alert_rule_py3 import AllowlistCustomAlertRule from .denylist_custom_alert_rule_py3 import DenylistCustomAlertRule - from .iot_security_group_py3 import IotSecurityGroup - from .iot_security_group_list_py3 import IotSecurityGroupList + from .device_security_group_py3 import DeviceSecurityGroup from .custom_alert_rule_py3 import CustomAlertRule from .location_py3 import Location from .operation_display_py3 import OperationDisplay @@ -82,7 +81,7 @@ from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting from .setting import Setting from .data_export_setting import DataExportSetting - from .setting_kind1 import SettingKind1 + from .setting_resource import SettingResource from .sensitivity_label import SensitivityLabel from .information_protection_keyword import InformationProtectionKeyword from .information_type import InformationType @@ -91,8 +90,7 @@ from .time_window_custom_alert_rule import TimeWindowCustomAlertRule from .allowlist_custom_alert_rule import AllowlistCustomAlertRule from .denylist_custom_alert_rule import DenylistCustomAlertRule - from .iot_security_group import IotSecurityGroup - from .iot_security_group_list import IotSecurityGroupList + from .device_security_group import DeviceSecurityGroup from .custom_alert_rule import CustomAlertRule from .location import Location from .operation_display import OperationDisplay @@ -136,6 +134,7 @@ from .workspace_setting_paged import WorkspaceSettingPaged from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged from .compliance_paged import CompliancePaged +from .device_security_group_paged import DeviceSecurityGroupPaged from .setting_paged import SettingPaged from .information_protection_policy_paged import InformationProtectionPolicyPaged from .operation_paged import OperationPaged @@ -174,7 +173,7 @@ 'AdvancedThreatProtectionSetting', 'Setting', 'DataExportSetting', - 'SettingKind1', + 'SettingResource', 'SensitivityLabel', 'InformationProtectionKeyword', 'InformationType', @@ -183,8 +182,7 @@ 'TimeWindowCustomAlertRule', 'AllowlistCustomAlertRule', 'DenylistCustomAlertRule', - 'IotSecurityGroup', - 'IotSecurityGroupList', + 'DeviceSecurityGroup', 'CustomAlertRule', 'Location', 'OperationDisplay', @@ -228,6 +226,7 @@ 'WorkspaceSettingPaged', 'AutoProvisioningSettingPaged', 'CompliancePaged', + 'DeviceSecurityGroupPaged', 'SettingPaged', 'InformationProtectionPolicyPaged', 'OperationPaged', 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 index c2eb09c8bebe..8c355e50e6ff 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py +++ b/azure-mgmt-security/azure/mgmt/security/models/data_export_setting.py @@ -26,8 +26,10 @@ class DataExportSetting(Setting): :vartype name: str :ivar type: Resource type :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind :param enabled: Required. Is the data export setting is enabled :type enabled: bool """ @@ -51,4 +53,3 @@ class DataExportSetting(Setting): 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 index adab9fae1f04..05d8e11208fc 100644 --- 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 @@ -26,8 +26,10 @@ class DataExportSetting(Setting): :vartype name: str :ivar type: Resource type :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind :param enabled: Required. Is the data export setting is enabled :type enabled: bool """ @@ -48,7 +50,6 @@ class DataExportSetting(Setting): 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: - super(DataExportSetting, self).__init__(**kwargs) + def __init__(self, *, kind, enabled: bool, **kwargs) -> None: + super(DataExportSetting, self).__init__(kind=kind, **kwargs) self.enabled = enabled - self.kind = 'DataExportSetting' diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py similarity index 94% rename from azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py rename to azure-mgmt-security/azure/mgmt/security/models/device_security_group.py index be7d4408426f..a213758a98c6 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group.py +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py @@ -12,8 +12,8 @@ from .resource import Resource -class IotSecurityGroup(Resource): - """The IoT security group resource. +class DeviceSecurityGroup(Resource): + """The device security group resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -55,7 +55,7 @@ class IotSecurityGroup(Resource): } def __init__(self, **kwargs): - super(IotSecurityGroup, self).__init__(**kwargs) + super(DeviceSecurityGroup, self).__init__(**kwargs) self.threshold_rules = kwargs.get('threshold_rules', None) self.time_window_rules = kwargs.get('time_window_rules', None) self.allowlist_rules = kwargs.get('allowlist_rules', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py similarity index 52% rename from azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py rename to azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py index 4f3753aae68d..cf7fcb32eed7 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_kind1.py +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py @@ -9,21 +9,19 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from msrest.paging import Paged -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 +class DeviceSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object """ _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeviceSecurityGroup]'} } - def __init__(self, **kwargs): - super(SettingKind1, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) + def __init__(self, *args, **kwargs): + + super(DeviceSecurityGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py similarity index 94% rename from azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py rename to azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py index d355c98bac8e..9e2a2015d800 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_py3.py +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py @@ -12,8 +12,8 @@ from .resource_py3 import Resource -class IotSecurityGroup(Resource): - """The IoT security group resource. +class DeviceSecurityGroup(Resource): + """The device security group resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -55,7 +55,7 @@ class IotSecurityGroup(Resource): } def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: - super(IotSecurityGroup, self).__init__(**kwargs) + super(DeviceSecurityGroup, self).__init__(**kwargs) self.threshold_rules = threshold_rules self.time_window_rules = time_window_rules self.allowlist_rules = allowlist_rules diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py deleted file mode 100644 index 3c90ef748278..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 IotSecurityGroupList(Model): - """List of IoT security groups. - - :param value: List of IoT security group objects - :type value: list[~azure.mgmt.security.models.IotSecurityGroup] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSecurityGroup]'}, - } - - def __init__(self, **kwargs): - super(IotSecurityGroupList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py b/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py deleted file mode 100644 index b753b794f339..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/iot_security_group_list_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 IotSecurityGroupList(Model): - """List of IoT security groups. - - :param value: List of IoT security group objects - :type value: list[~azure.mgmt.security.models.IotSecurityGroup] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[IotSecurityGroup]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(IotSecurityGroupList, self).__init__(**kwargs) - self.value = value 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 index 951d2c9525c7..fc73b5aaf5d9 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -39,6 +39,7 @@ class AutoProvision(str, Enum): class SettingKind(str, Enum): data_export_setting = "DataExportSetting" + alert_suppression_setting = "AlertSuppressionSetting" class SecurityFamily(str, Enum): diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting.py b/azure-mgmt-security/azure/mgmt/security/models/setting.py index 6d9a06822f41..9dd2c8f9944c 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/setting.py +++ b/azure-mgmt-security/azure/mgmt/security/models/setting.py @@ -9,15 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .setting_resource import SettingResource -class Setting(Model): +class Setting(SettingResource): """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSetting - Variables are only populated by the server, and will be ignored when sending a request. @@ -29,8 +26,10 @@ class Setting(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind """ _validation = { @@ -47,13 +46,5 @@ class Setting(Model): '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_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py deleted file mode 100644 index 33f8f077ff41..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_kind1_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py index fa644684fb2f..0611d4ebdd49 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_py3.py @@ -9,15 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .setting_resource_py3 import SettingResource -class Setting(Model): +class Setting(SettingResource): """Represents a security setting in Azure Security Center. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DataExportSetting - Variables are only populated by the server, and will be ignored when sending a request. @@ -29,8 +26,10 @@ class Setting(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :param kind: Required. Constant filled by server. - :type kind: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind """ _validation = { @@ -47,13 +46,5 @@ class Setting(Model): '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 + def __init__(self, *, kind, **kwargs) -> None: + super(Setting, self).__init__(kind=kind, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py new file mode 100644 index 000000000000..d20bda7cab66 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_resource.py @@ -0,0 +1,51 @@ +# 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 SettingResource(Resource): + """The kind of the security setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SettingResource, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py b/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py new file mode 100644 index 000000000000..4feeff7166c5 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/setting_resource_py3.py @@ -0,0 +1,51 @@ +# 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 SettingResource(Resource): + """The kind of the security setting. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param kind: Required. the kind of the settings string + (DataExportSetting). Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind, **kwargs) -> None: + super(SettingResource, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 3a5fc03d2e02..5fd7a2dd9c0f 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -15,7 +15,7 @@ from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .compliances_operations import CompliancesOperations from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .iot_security_groups_operations import IotSecurityGroupsOperations +from .device_security_groups_operations import DeviceSecurityGroupsOperations from .settings_operations import SettingsOperations from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations @@ -35,7 +35,7 @@ 'AutoProvisioningSettingsOperations', 'CompliancesOperations', 'AdvancedThreatProtectionOperations', - 'IotSecurityGroupsOperations', + 'DeviceSecurityGroupsOperations', 'SettingsOperations', 'InformationProtectionPoliciesOperations', 'Operations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py similarity index 63% rename from azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py rename to azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py index 49e384267418..a55f1ed2f3c9 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/iot_security_groups_operations.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py @@ -16,8 +16,8 @@ from .. import models -class IotSecurityGroupsOperations(object): - """IotSecurityGroupsOperations operations. +class DeviceSecurityGroupsOperations(object): + """DeviceSecurityGroupsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -39,7 +39,8 @@ def __init__(self, client, config, serializer, deserializer): def list( self, resource_id, custom_headers=None, raw=False, **operation_config): - """Gets the list of security groups for the specified IoT hub resource. + """Gets the list of device security groups for the specified IoT hub + resource. :param resource_id: The identifier of the resource. :type resource_id: str @@ -48,69 +49,77 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: IotSecurityGroupList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSecurityGroupList or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of DeviceSecurityGroup + :rtype: + ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] :raises: :class:`CloudError` """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, '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('IotSecurityGroupList', response) + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, '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.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies) if raw: - client_raw_response = ClientRawResponse(deserialized, response) + header_dict = {} + client_raw_response = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups'} + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} def get( - self, resource_id, iot_security_group_name, custom_headers=None, raw=False, **operation_config): - """Gets the security group for the specified IoT hub resource. + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets the device security group for the specified IoT hub resource. :param resource_id: The identifier of the resource. :type resource_id: str - :param iot_security_group_name: The name of the security group. Please - notice that the name is case insensitive. - :type iot_security_group_name: str + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_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: IotSecurityGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSecurityGroup or + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -118,7 +127,7 @@ def get( url = self.get.metadata['url'] path_format_arguments = { 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_name, 'str') + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -148,33 +157,35 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSecurityGroup', response) + deserialized = self._deserialize('DeviceSecurityGroup', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} def create_or_update( - self, resource_id, iot_security_group_name, iot_security_group, custom_headers=None, raw=False, **operation_config): - """Creates or updates the security group on a specified IoT hub resource. + self, resource_id, device_security_group_name, device_security_group, custom_headers=None, raw=False, **operation_config): + """Creates or updates the device security group on a specified IoT hub + resource. :param resource_id: The identifier of the resource. :type resource_id: str - :param iot_security_group_name: The name of the security group. Please - notice that the name is case insensitive. - :type iot_security_group_name: str - :param iot_security_group: Security group object. - :type iot_security_group: ~azure.mgmt.security.models.IotSecurityGroup + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_group_name: str + :param device_security_group: Security group object. + :type device_security_group: + ~azure.mgmt.security.models.DeviceSecurityGroup :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: IotSecurityGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.IotSecurityGroup or + :return: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -182,7 +193,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_name, 'str') + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -202,7 +213,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(iot_security_group, 'IotSecurityGroup') + body_content = self._serialize.body(device_security_group, 'DeviceSecurityGroup') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -216,26 +227,26 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('IotSecurityGroup', response) + deserialized = self._deserialize('DeviceSecurityGroup', response) if response.status_code == 201: - deserialized = self._deserialize('IotSecurityGroup', response) + deserialized = self._deserialize('DeviceSecurityGroup', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} def delete( - self, resource_id, iot_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): """Deletes the security group. :param resource_id: The identifier of the resource. :type resource_id: str - :param iot_security_group_name: The name of the security group. Please - notice that the name is case insensitive. - :type iot_security_group_name: str + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_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 @@ -249,7 +260,7 @@ def delete( url = self.delete.metadata['url'] path_format_arguments = { 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'iotSecurityGroupName': self._serialize.url("iot_security_group_name", iot_security_group_name, 'str') + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -270,7 +281,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -278,4 +289,4 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/iotSecurityGroups/{iotSecurityGroupName}'} + delete.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py index 47b9c1b6d7f5..6aef42b410e1 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/settings_operations.py @@ -105,8 +105,8 @@ def get( self, setting_name, custom_headers=None, raw=False, **operation_config): """Settings of different configurations in security center. - :param setting_name: Name of setting. Possible values include: 'MCAS', - 'WDATP' + :param setting_name: Name of setting: (MCAS/WDATP). 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 @@ -162,14 +162,16 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}'} def update( - self, setting_name, setting, custom_headers=None, raw=False, **operation_config): + self, setting_name, kind, 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' + :param setting_name: Name of setting: (MCAS/WDATP). Possible values + include: 'MCAS', 'WDATP' :type setting_name: str - :param setting: Setting object - :type setting: ~azure.mgmt.security.models.Setting + :param kind: the kind of the settings string (DataExportSetting). + Possible values include: 'DataExportSetting', + 'AlertSuppressionSetting' + :type kind: str or ~azure.mgmt.security.models.SettingKind :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -180,6 +182,8 @@ def update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + setting = models.Setting(kind=kind) + # Construct URL url = self.update.metadata['url'] path_format_arguments = { diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index ad3f2129631d..c5f524539c53 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -19,7 +19,7 @@ from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .operations.compliances_operations import CompliancesOperations from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .operations.iot_security_groups_operations import IotSecurityGroupsOperations +from .operations.device_security_groups_operations import DeviceSecurityGroupsOperations from .operations.settings_operations import SettingsOperations from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations @@ -90,8 +90,8 @@ class SecurityCenter(SDKClient): :vartype compliances: azure.mgmt.security.operations.CompliancesOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations - :ivar iot_security_groups: IotSecurityGroups operations - :vartype iot_security_groups: azure.mgmt.security.operations.IotSecurityGroupsOperations + :ivar device_security_groups: DeviceSecurityGroups operations + :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar information_protection_policies: InformationProtectionPolicies operations @@ -148,7 +148,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self.config, self._serialize, self._deserialize) - self.iot_security_groups = IotSecurityGroupsOperations( + self.device_security_groups = DeviceSecurityGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) From 0ca595fd553771b9c79b78a4bdda19af0a98d215 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 24 Mar 2019 19:20:19 +0000 Subject: [PATCH 3/6] Generated from 0cfbd83907e23a9364669f804e9442d771ad088b Sync with master (split files by resource type), add value type --- .../azure/mgmt/security/models/__init__.py | 79 ++--- .../azure/mgmt/security/models/alert.py | 18 +- .../azure/mgmt/security/models/alert_py3.py | 18 +- .../models/allowlist_custom_alert_rule.py | 55 ---- .../models/allowlist_custom_alert_rule_py3.py | 55 ---- .../mgmt/security/models/custom_alert_rule.py | 52 ---- .../security/models/custom_alert_rule_py3.py | 52 ---- .../models/denylist_custom_alert_rule.py | 55 ---- .../models/denylist_custom_alert_rule_py3.py | 55 ---- .../security/models/device_security_group.py | 62 ---- .../models/device_security_group_paged.py | 27 -- .../models/device_security_group_py3.py | 62 ---- .../azure/mgmt/security/models/pricing.py | 10 +- .../mgmt/security/models/pricing_list.py | 34 ++ .../mgmt/security/models/pricing_list_py3.py | 34 ++ .../mgmt/security/models/pricing_paged.py | 27 -- .../azure/mgmt/security/models/pricing_py3.py | 10 +- .../security/models/security_center_enums.py | 20 +- .../models/threshold_custom_alert_rule.py | 59 ---- .../models/threshold_custom_alert_rule_py3.py | 59 ---- .../models/time_window_custom_alert_rule.py | 68 ---- .../time_window_custom_alert_rule_py3.py | 68 ---- .../mgmt/security/operations/__init__.py | 2 - .../security/operations/alerts_operations.py | 4 +- .../device_security_groups_operations.py | 292 ------------------ .../operations/pricings_operations.py | 248 ++------------- .../workspace_settings_operations.py | 8 +- .../azure/mgmt/security/security_center.py | 5 - 28 files changed, 187 insertions(+), 1351 deletions(-) delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_list.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_list_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py delete mode 100644 azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index 57f5d5ea3708..b72e7878ab32 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -10,10 +10,11 @@ # -------------------------------------------------------------------------- try: + from .pricing_py3 import Pricing + from .pricing_list_py3 import PricingList + from .asc_location_py3 import AscLocation 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 @@ -26,26 +27,15 @@ from .information_protection_keyword_py3 import InformationProtectionKeyword from .information_type_py3 import InformationType from .information_protection_policy_py3 import InformationProtectionPolicy - from .threshold_custom_alert_rule_py3 import ThresholdCustomAlertRule - from .time_window_custom_alert_rule_py3 import TimeWindowCustomAlertRule - from .allowlist_custom_alert_rule_py3 import AllowlistCustomAlertRule - from .denylist_custom_alert_rule_py3 import DenylistCustomAlertRule - from .device_security_group_py3 import DeviceSecurityGroup - from .custom_alert_rule_py3 import CustomAlertRule - 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 .location_py3 import Location 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 @@ -55,6 +45,7 @@ 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 .kind_py3 import Kind from .external_security_solution_py3 import ExternalSecuritySolution from .cef_solution_properties_py3 import CefSolutionProperties from .cef_external_security_solution_py3 import CefExternalSecuritySolution @@ -66,14 +57,19 @@ from .external_security_solution_kind1_py3 import ExternalSecuritySolutionKind1 from .external_security_solution_properties_py3 import ExternalSecuritySolutionProperties from .aad_connectivity_state1_py3 import AadConnectivityState1 + 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 .connected_resource_py3 import ConnectedResource from .connectable_resource_py3 import ConnectableResource from .allowed_connections_resource_py3 import AllowedConnectionsResource except (SyntaxError, ImportError): + from .pricing import Pricing + from .pricing_list import PricingList + from .asc_location import AscLocation 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 @@ -86,26 +82,15 @@ from .information_protection_keyword import InformationProtectionKeyword from .information_type import InformationType from .information_protection_policy import InformationProtectionPolicy - from .threshold_custom_alert_rule import ThresholdCustomAlertRule - from .time_window_custom_alert_rule import TimeWindowCustomAlertRule - from .allowlist_custom_alert_rule import AllowlistCustomAlertRule - from .denylist_custom_alert_rule import DenylistCustomAlertRule - from .device_security_group import DeviceSecurityGroup - from .custom_alert_rule import CustomAlertRule - 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 .location import Location 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 @@ -115,6 +100,7 @@ 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 .kind import Kind from .external_security_solution import ExternalSecuritySolution from .cef_solution_properties import CefSolutionProperties from .cef_external_security_solution import CefExternalSecuritySolution @@ -126,15 +112,17 @@ from .external_security_solution_kind1 import ExternalSecuritySolutionKind1 from .external_security_solution_properties import ExternalSecuritySolutionProperties from .aad_connectivity_state1 import AadConnectivityState1 + 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 .connected_resource import ConnectedResource from .connectable_resource import ConnectableResource from .allowed_connections_resource import AllowedConnectionsResource -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 .device_security_group_paged import DeviceSecurityGroupPaged from .setting_paged import SettingPaged from .information_protection_policy_paged import InformationProtectionPolicyPaged from .operation_paged import OperationPaged @@ -147,11 +135,12 @@ from .topology_resource_paged import TopologyResourcePaged from .allowed_connections_resource_paged import AllowedConnectionsResourcePaged from .security_center_enums import ( + PricingTier, AlertNotifications, AlertsToAdmins, - PricingTier, AutoProvision, SettingKind, + ReportedSeverity, SecurityFamily, Protocol, Status, @@ -162,10 +151,11 @@ ) __all__ = [ + 'Pricing', + 'PricingList', + 'AscLocation', 'Resource', - 'Kind', 'SecurityContact', - 'Pricing', 'WorkspaceSetting', 'AutoProvisioningSetting', 'ComplianceSegment', @@ -178,26 +168,15 @@ 'InformationProtectionKeyword', 'InformationType', 'InformationProtectionPolicy', - 'ThresholdCustomAlertRule', - 'TimeWindowCustomAlertRule', - 'AllowlistCustomAlertRule', - 'DenylistCustomAlertRule', - 'DeviceSecurityGroup', - 'CustomAlertRule', - 'Location', 'OperationDisplay', 'Operation', 'SecurityTaskParameters', 'SecurityTask', - 'AscLocation', 'AlertEntity', 'AlertConfidenceReason', 'Alert', 'DiscoveredSecuritySolution', - 'TopologySingleResourceParent', - 'TopologySingleResourceChild', - 'TopologySingleResource', - 'TopologyResource', + 'Location', 'JitNetworkAccessPortRule', 'JitNetworkAccessPolicyVirtualMachine', 'JitNetworkAccessRequestPort', @@ -207,6 +186,7 @@ 'JitNetworkAccessPolicyInitiatePort', 'JitNetworkAccessPolicyInitiateVirtualMachine', 'JitNetworkAccessPolicyInitiateRequest', + 'Kind', 'ExternalSecuritySolution', 'CefSolutionProperties', 'CefExternalSecuritySolution', @@ -218,15 +198,17 @@ 'ExternalSecuritySolutionKind1', 'ExternalSecuritySolutionProperties', 'AadConnectivityState1', + 'TopologySingleResourceParent', + 'TopologySingleResourceChild', + 'TopologySingleResource', + 'TopologyResource', 'ConnectedResource', 'ConnectableResource', 'AllowedConnectionsResource', - 'PricingPaged', 'SecurityContactPaged', 'WorkspaceSettingPaged', 'AutoProvisioningSettingPaged', 'CompliancePaged', - 'DeviceSecurityGroupPaged', 'SettingPaged', 'InformationProtectionPolicyPaged', 'OperationPaged', @@ -238,11 +220,12 @@ 'ExternalSecuritySolutionPaged', 'TopologyResourcePaged', 'AllowedConnectionsResourcePaged', + 'PricingTier', 'AlertNotifications', 'AlertsToAdmins', - 'PricingTier', 'AutoProvision', 'SettingKind', + 'ReportedSeverity', 'SecurityFamily', 'Protocol', 'Status', diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert.py b/azure-mgmt-security/azure/mgmt/security/models/alert.py index bdd5963a2b38..a467fe8ffcbb 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/alert.py +++ b/azure-mgmt-security/azure/mgmt/security/models/alert.py @@ -44,8 +44,10 @@ class Alert(Resource): :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 reported_severity: Estimated severity of this alert. Possible values + include: 'Informational', 'Low', 'Medium', 'High' + :vartype reported_severity: str or + ~azure.mgmt.security.models.ReportedSeverity :ivar compromised_entity: The entity that the incident happened on :vartype compromised_entity: str :ivar associated_resource: Azure resource ID of the associated resource @@ -57,6 +59,9 @@ class Alert(Resource): :ivar can_be_investigated: Whether this alert can be investigated with Azure Security Center :vartype can_be_investigated: bool + :ivar is_incident: Whether this alert is for incident type or not + (otherwise - single alert) + :vartype is_incident: 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 @@ -73,6 +78,9 @@ class Alert(Resource): :ivar workspace_arm_id: Azure resource ID of the workspace that the alert was reported to. :vartype workspace_arm_id: str + :ivar correlation_key: Alerts with the same CorrelationKey will be grouped + together in Ibiza. + :vartype correlation_key: str """ _validation = { @@ -93,10 +101,12 @@ class Alert(Resource): 'associated_resource': {'readonly': True}, 'system_source': {'readonly': True}, 'can_be_investigated': {'readonly': True}, + 'is_incident': {'readonly': True}, 'confidence_score': {'readonly': True, 'maximum': 1, 'minimum': 0}, 'subscription_id': {'readonly': True}, 'instance_id': {'readonly': True}, 'workspace_arm_id': {'readonly': True}, + 'correlation_key': {'readonly': True}, } _attribute_map = { @@ -118,12 +128,14 @@ class Alert(Resource): 'extended_properties': {'key': 'properties.extendedProperties', 'type': '{object}'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'can_be_investigated': {'key': 'properties.canBeInvestigated', 'type': 'bool'}, + 'is_incident': {'key': 'properties.isIncident', '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'}, + 'correlation_key': {'key': 'properties.correlationKey', 'type': 'str'}, } def __init__(self, **kwargs): @@ -143,9 +155,11 @@ def __init__(self, **kwargs): self.extended_properties = kwargs.get('extended_properties', None) self.system_source = None self.can_be_investigated = None + self.is_incident = 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 + self.correlation_key = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py b/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py index b5c9aff63df5..95007f9bb77a 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py +++ b/azure-mgmt-security/azure/mgmt/security/models/alert_py3.py @@ -44,8 +44,10 @@ class Alert(Resource): :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 reported_severity: Estimated severity of this alert. Possible values + include: 'Informational', 'Low', 'Medium', 'High' + :vartype reported_severity: str or + ~azure.mgmt.security.models.ReportedSeverity :ivar compromised_entity: The entity that the incident happened on :vartype compromised_entity: str :ivar associated_resource: Azure resource ID of the associated resource @@ -57,6 +59,9 @@ class Alert(Resource): :ivar can_be_investigated: Whether this alert can be investigated with Azure Security Center :vartype can_be_investigated: bool + :ivar is_incident: Whether this alert is for incident type or not + (otherwise - single alert) + :vartype is_incident: 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 @@ -73,6 +78,9 @@ class Alert(Resource): :ivar workspace_arm_id: Azure resource ID of the workspace that the alert was reported to. :vartype workspace_arm_id: str + :ivar correlation_key: Alerts with the same CorrelationKey will be grouped + together in Ibiza. + :vartype correlation_key: str """ _validation = { @@ -93,10 +101,12 @@ class Alert(Resource): 'associated_resource': {'readonly': True}, 'system_source': {'readonly': True}, 'can_be_investigated': {'readonly': True}, + 'is_incident': {'readonly': True}, 'confidence_score': {'readonly': True, 'maximum': 1, 'minimum': 0}, 'subscription_id': {'readonly': True}, 'instance_id': {'readonly': True}, 'workspace_arm_id': {'readonly': True}, + 'correlation_key': {'readonly': True}, } _attribute_map = { @@ -118,12 +128,14 @@ class Alert(Resource): 'extended_properties': {'key': 'properties.extendedProperties', 'type': '{object}'}, 'system_source': {'key': 'properties.systemSource', 'type': 'str'}, 'can_be_investigated': {'key': 'properties.canBeInvestigated', 'type': 'bool'}, + 'is_incident': {'key': 'properties.isIncident', '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'}, + 'correlation_key': {'key': 'properties.correlationKey', 'type': 'str'}, } def __init__(self, *, extended_properties=None, entities=None, confidence_reasons=None, **kwargs) -> None: @@ -143,9 +155,11 @@ def __init__(self, *, extended_properties=None, entities=None, confidence_reason self.extended_properties = extended_properties self.system_source = None self.can_be_investigated = None + self.is_incident = 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 + self.correlation_key = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py deleted file mode 100644 index 0574a1140a46..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .custom_alert_rule import CustomAlertRule - - -class AllowlistCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is allowed. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param allowlist_values: Required. The values to allow. The format of the - values depends on the rule type. - :type allowlist_values: list[str] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'allowlist_values': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(AllowlistCustomAlertRule, self).__init__(**kwargs) - self.allowlist_values = kwargs.get('allowlist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py deleted file mode 100644 index 366d07c66184..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .custom_alert_rule_py3 import CustomAlertRule - - -class AllowlistCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is allowed. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param allowlist_values: Required. The values to allow. The format of the - values depends on the rule type. - :type allowlist_values: list[str] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'allowlist_values': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, - } - - def __init__(self, *, is_enabled: bool, rule_type: str, allowlist_values, **kwargs) -> None: - super(AllowlistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) - self.allowlist_values = allowlist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py deleted file mode 100644 index 7b8bbed4659f..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 CustomAlertRule(Model): - """A custom alert rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CustomAlertRule, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.is_enabled = kwargs.get('is_enabled', None) - self.rule_type = kwargs.get('rule_type', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py deleted file mode 100644 index 8ecf4bf163cb..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 CustomAlertRule(Model): - """A custom alert rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - } - - def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: - super(CustomAlertRule, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.is_enabled = is_enabled - self.rule_type = rule_type diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py deleted file mode 100644 index 8452494ea8bd..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .custom_alert_rule import CustomAlertRule - - -class DenylistCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is denied. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param denylist_values: Required. The values to deny. The format of the - values depends on the rule type. - :type denylist_values: list[str] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'denylist_values': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(DenylistCustomAlertRule, self).__init__(**kwargs) - self.denylist_values = kwargs.get('denylist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py deleted file mode 100644 index 79ab0e305d40..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 .custom_alert_rule_py3 import CustomAlertRule - - -class DenylistCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is denied. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param denylist_values: Required. The values to deny. The format of the - values depends on the rule type. - :type denylist_values: list[str] - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'denylist_values': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, - } - - def __init__(self, *, is_enabled: bool, rule_type: str, denylist_values, **kwargs) -> None: - super(DenylistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) - self.denylist_values = denylist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py deleted file mode 100644 index a213758a98c6..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 DeviceSecurityGroup(Resource): - """The device security group 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 threshold_rules: A list of threshold custom alert rules. - :type threshold_rules: - list[~azure.mgmt.security.models.ThresholdCustomAlertRule] - :param time_window_rules: A list of time window custom alert rules. - :type time_window_rules: - list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] - :param allowlist_rules: A list of allow-list custom alert rules. - :type allowlist_rules: - list[~azure.mgmt.security.models.AllowlistCustomAlertRule] - :param denylist_rules: A list of deny-list custom alert rules. - :type denylist_rules: - list[~azure.mgmt.security.models.DenylistCustomAlertRule] - """ - - _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'}, - 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, - 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, - 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, - 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, - } - - def __init__(self, **kwargs): - super(DeviceSecurityGroup, self).__init__(**kwargs) - self.threshold_rules = kwargs.get('threshold_rules', None) - self.time_window_rules = kwargs.get('time_window_rules', None) - self.allowlist_rules = kwargs.get('allowlist_rules', None) - self.denylist_rules = kwargs.get('denylist_rules', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py deleted file mode 100644 index cf7fcb32eed7..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 DeviceSecurityGroupPaged(Paged): - """ - A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DeviceSecurityGroup]'} - } - - def __init__(self, *args, **kwargs): - - super(DeviceSecurityGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py deleted file mode 100644 index 9e2a2015d800..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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 DeviceSecurityGroup(Resource): - """The device security group 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 threshold_rules: A list of threshold custom alert rules. - :type threshold_rules: - list[~azure.mgmt.security.models.ThresholdCustomAlertRule] - :param time_window_rules: A list of time window custom alert rules. - :type time_window_rules: - list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] - :param allowlist_rules: A list of allow-list custom alert rules. - :type allowlist_rules: - list[~azure.mgmt.security.models.AllowlistCustomAlertRule] - :param denylist_rules: A list of deny-list custom alert rules. - :type denylist_rules: - list[~azure.mgmt.security.models.DenylistCustomAlertRule] - """ - - _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'}, - 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, - 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, - 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, - 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, - } - - def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: - super(DeviceSecurityGroup, self).__init__(**kwargs) - self.threshold_rules = threshold_rules - self.time_window_rules = time_window_rules - self.allowlist_rules = allowlist_rules - self.denylist_rules = denylist_rules diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing.py b/azure-mgmt-security/azure/mgmt/security/models/pricing.py index 320e3dc9e4dc..8201c965f0a5 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing.py +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing.py @@ -26,9 +26,12 @@ class Pricing(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param pricing_tier: Required. Pricing tier type. Possible values include: - 'Free', 'Standard' + :param pricing_tier: Required. The pricing tier value. Possible values + include: 'Free', 'Standard' :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :ivar free_trial_remaining_time: The duration left for the subscriptions + free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). + :vartype free_trial_remaining_time: timedelta """ _validation = { @@ -36,6 +39,7 @@ class Pricing(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'pricing_tier': {'required': True}, + 'free_trial_remaining_time': {'readonly': True}, } _attribute_map = { @@ -43,8 +47,10 @@ class Pricing(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + 'free_trial_remaining_time': {'key': 'properties.freeTrialRemainingTime', 'type': 'duration'}, } def __init__(self, **kwargs): super(Pricing, self).__init__(**kwargs) self.pricing_tier = kwargs.get('pricing_tier', None) + self.free_trial_remaining_time = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_list.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_list.py new file mode 100644 index 000000000000..5c461c74609d --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_list.py @@ -0,0 +1,34 @@ +# 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 PricingList(Model): + """List of pricing configurations response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of pricing configurations + :type value: list[~azure.mgmt.security.models.Pricing] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Pricing]'}, + } + + def __init__(self, **kwargs): + super(PricingList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_list_py3.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_list_py3.py new file mode 100644 index 000000000000..564f6bab68b9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_list_py3.py @@ -0,0 +1,34 @@ +# 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 PricingList(Model): + """List of pricing configurations response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. List of pricing configurations + :type value: list[~azure.mgmt.security.models.Pricing] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Pricing]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(PricingList, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py b/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py deleted file mode 100644 index 09eee4ab69dd..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 index 25001e835a78..cab29e683d39 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py +++ b/azure-mgmt-security/azure/mgmt/security/models/pricing_py3.py @@ -26,9 +26,12 @@ class Pricing(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :param pricing_tier: Required. Pricing tier type. Possible values include: - 'Free', 'Standard' + :param pricing_tier: Required. The pricing tier value. Possible values + include: 'Free', 'Standard' :type pricing_tier: str or ~azure.mgmt.security.models.PricingTier + :ivar free_trial_remaining_time: The duration left for the subscriptions + free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). + :vartype free_trial_remaining_time: timedelta """ _validation = { @@ -36,6 +39,7 @@ class Pricing(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'pricing_tier': {'required': True}, + 'free_trial_remaining_time': {'readonly': True}, } _attribute_map = { @@ -43,8 +47,10 @@ class Pricing(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'pricing_tier': {'key': 'properties.pricingTier', 'type': 'str'}, + 'free_trial_remaining_time': {'key': 'properties.freeTrialRemainingTime', 'type': 'duration'}, } def __init__(self, *, pricing_tier, **kwargs) -> None: super(Pricing, self).__init__(**kwargs) self.pricing_tier = pricing_tier + self.free_trial_remaining_time = 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 index fc73b5aaf5d9..6c105302e027 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -12,6 +12,12 @@ from enum import Enum +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 AlertNotifications(str, Enum): on = "On" #: Get notifications on new alerts @@ -24,12 +30,6 @@ class AlertsToAdmins(str, Enum): 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 @@ -42,6 +42,14 @@ class SettingKind(str, Enum): alert_suppression_setting = "AlertSuppressionSetting" +class ReportedSeverity(str, Enum): + + informational = "Informational" + low = "Low" + medium = "Medium" + high = "High" + + class SecurityFamily(str, Enum): waf = "Waf" diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py deleted file mode 100644 index 4e6306190e2b..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 .custom_alert_rule import CustomAlertRule - - -class ThresholdCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is within the given range. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param min_threshold: Required. The minimum threshold. - :type min_threshold: int - :param max_threshold: Required. The maximum threshold. - :type max_threshold: int - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'min_threshold': {'required': True}, - 'max_threshold': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(ThresholdCustomAlertRule, self).__init__(**kwargs) - self.min_threshold = kwargs.get('min_threshold', None) - self.max_threshold = kwargs.get('max_threshold', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py deleted file mode 100644 index 63c5567caceb..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 .custom_alert_rule_py3 import CustomAlertRule - - -class ThresholdCustomAlertRule(CustomAlertRule): - """A custom alert rule that checks if a value (depends on the custom alert - type) is within the given range. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param min_threshold: Required. The minimum threshold. - :type min_threshold: int - :param max_threshold: Required. The maximum threshold. - :type max_threshold: int - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'min_threshold': {'required': True}, - 'max_threshold': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, - } - - def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, **kwargs) -> None: - super(ThresholdCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) - self.min_threshold = min_threshold - self.max_threshold = max_threshold diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py deleted file mode 100644 index 224d5a3dc0ea..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 TimeWindowCustomAlertRule(Model): - """A custom alert rule that checks if the number of activities (depends on the - custom alert type) in a time window is within the given range. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param min_threshold: Required. The minimum threshold. - :type min_threshold: int - :param max_threshold: Required. The maximum threshold. - :type max_threshold: int - :param time_window_size: Required. The time window size in iso8601 format. - :type time_window_size: timedelta - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'min_threshold': {'required': True}, - 'max_threshold': {'required': True}, - 'time_window_size': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, - 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, - } - - def __init__(self, **kwargs): - super(TimeWindowCustomAlertRule, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.is_enabled = kwargs.get('is_enabled', None) - self.rule_type = kwargs.get('rule_type', None) - self.min_threshold = kwargs.get('min_threshold', None) - self.max_threshold = kwargs.get('max_threshold', None) - self.time_window_size = kwargs.get('time_window_size', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py deleted file mode 100644 index 0a2962dddb94..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 TimeWindowCustomAlertRule(Model): - """A custom alert rule that checks if the number of activities (depends on the - custom alert type) in a time window is within the given range. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_name: The display name of the custom alert. - :vartype display_name: str - :ivar description: The description of the custom alert. - :vartype description: str - :param is_enabled: Required. Whether the custom alert is enabled. - :type is_enabled: bool - :param rule_type: Required. The type of the custom alert rule. - :type rule_type: str - :param min_threshold: Required. The minimum threshold. - :type min_threshold: int - :param max_threshold: Required. The maximum threshold. - :type max_threshold: int - :param time_window_size: Required. The time window size in iso8601 format. - :type time_window_size: timedelta - """ - - _validation = { - 'display_name': {'readonly': True}, - 'description': {'readonly': True}, - 'is_enabled': {'required': True}, - 'rule_type': {'required': True}, - 'min_threshold': {'required': True}, - 'max_threshold': {'required': True}, - 'time_window_size': {'required': True}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'rule_type': {'key': 'ruleType', 'type': 'str'}, - 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, - 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, - 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, - } - - def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, time_window_size, **kwargs) -> None: - super(TimeWindowCustomAlertRule, self).__init__(**kwargs) - self.display_name = None - self.description = None - self.is_enabled = is_enabled - self.rule_type = rule_type - self.min_threshold = min_threshold - self.max_threshold = max_threshold - self.time_window_size = time_window_size diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 5fd7a2dd9c0f..cc451ba3dd54 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -15,7 +15,6 @@ from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .compliances_operations import CompliancesOperations from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .device_security_groups_operations import DeviceSecurityGroupsOperations from .settings_operations import SettingsOperations from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations @@ -35,7 +34,6 @@ 'AutoProvisioningSettingsOperations', 'CompliancesOperations', 'AdvancedThreatProtectionOperations', - 'DeviceSecurityGroupsOperations', 'SettingsOperations', 'InformationProtectionPoliciesOperations', 'Operations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py index 9d7f01c1b7c6..d0d86845ded3 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/alerts_operations.py @@ -23,7 +23,7 @@ class AlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2015-06-01-preview". + :ivar api_version: API version for the operation. Constant value: "2019-01-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-06-01-preview" + self.api_version = "2019-01-01" self.config = config diff --git a/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py deleted file mode 100644 index a55f1ed2f3c9..000000000000 --- a/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py +++ /dev/null @@ -1,292 +0,0 @@ -# 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 DeviceSecurityGroupsOperations(object): - """DeviceSecurityGroupsOperations 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, resource_id, custom_headers=None, raw=False, **operation_config): - """Gets the list of device security groups for the specified IoT hub - 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: An iterator like instance of DeviceSecurityGroup - :rtype: - ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] - :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 = { - 'resourceId': self._serialize.url("resource_id", resource_id, '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.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} - - def get( - self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): - """Gets the device security group for the specified IoT hub resource. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param device_security_group_name: The name of the security group. - Please notice that the name is case insensitive. - :type device_security_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: DeviceSecurityGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup 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'), - 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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('DeviceSecurityGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} - - def create_or_update( - self, resource_id, device_security_group_name, device_security_group, custom_headers=None, raw=False, **operation_config): - """Creates or updates the device security group on a specified IoT hub - resource. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param device_security_group_name: The name of the security group. - Please notice that the name is case insensitive. - :type device_security_group_name: str - :param device_security_group: Security group object. - :type device_security_group: - ~azure.mgmt.security.models.DeviceSecurityGroup - :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: DeviceSecurityGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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(device_security_group, 'DeviceSecurityGroup') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('DeviceSecurityGroup', response) - if response.status_code == 201: - deserialized = self._deserialize('DeviceSecurityGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} - - def delete( - self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): - """Deletes the security group. - - :param resource_id: The identifier of the resource. - :type resource_id: str - :param device_security_group_name: The name of the security group. - Please notice that the name is case insensitive. - :type device_security_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.delete.metadata['url'] - path_format_arguments = { - 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), - 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py index 60cc30172f7e..85177f446714 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/pricings_operations.py @@ -23,7 +23,7 @@ class PricingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: API version for the operation. Constant value: "2017-08-01-preview". + :ivar api_version: API version for the operation. Constant value: "2018-06-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-08-01-preview" + self.api_version = "2018-06-01" self.config = config @@ -46,151 +46,15 @@ def list( 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 + :return: PricingList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.PricingList or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_subscription_pricing.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - 'pricingName': self._serialize.url("pricing_name", pricing_name, 'str') + '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) @@ -220,90 +84,19 @@ def get_subscription_pricing( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Pricing', response) + deserialized = self._deserialize('PricingList', 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}'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings'} - def update_subscription_pricing( - self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + def get( + self, pricing_name, 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 @@ -317,10 +110,9 @@ def get_resource_group_pricing( :raises: :class:`CloudError` """ # Construct URL - url = self.get_resource_group_pricing.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), - '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) @@ -358,18 +150,15 @@ def get_resource_group_pricing( return client_raw_response return deserialized - get_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/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. + def update( + self, pricing_name, pricing_tier, custom_headers=None, raw=False, **operation_config): + """Security pricing configuration in the subscription. - :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: + :param pricing_tier: The pricing tier value. 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 @@ -385,10 +174,9 @@ def create_or_update_resource_group_pricing( pricing = models.Pricing(pricing_tier=pricing_tier) # Construct URL - url = self.create_or_update_resource_group_pricing.metadata['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}$'), - '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) @@ -430,4 +218,4 @@ def create_or_update_resource_group_pricing( return client_raw_response return deserialized - create_or_update_resource_group_pricing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}'} 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 index d92f1831e26a..7c25fa3c51ab 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/workspace_settings_operations.py @@ -39,7 +39,9 @@ def __init__(self, client, config, serializer, deserializer): def list( self, custom_headers=None, raw=False, **operation_config): - """Settings about where we should store your security data and logs. + """Settings about where we should store your security data and logs. If + the result is empty, it means that no custom-workspace configuration + was set. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -103,7 +105,9 @@ def internal_paging(next_link=None, raw=False): def get( self, workspace_setting_name, custom_headers=None, raw=False, **operation_config): - """Settings about where we should store your security data and logs. + """Settings about where we should store your security data and logs. If + the result is empty, it means that no custom-workspace configuration + was set. :param workspace_setting_name: Name of the security setting :type workspace_setting_name: str diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index c5f524539c53..4a70b5762f4f 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -19,7 +19,6 @@ from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .operations.compliances_operations import CompliancesOperations from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations -from .operations.device_security_groups_operations import DeviceSecurityGroupsOperations from .operations.settings_operations import SettingsOperations from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations @@ -90,8 +89,6 @@ class SecurityCenter(SDKClient): :vartype compliances: azure.mgmt.security.operations.CompliancesOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations - :ivar device_security_groups: DeviceSecurityGroups operations - :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar information_protection_policies: InformationProtectionPolicies operations @@ -148,8 +145,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self.config, self._serialize, self._deserialize) - self.device_security_groups = DeviceSecurityGroupsOperations( - self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) self.information_protection_policies = InformationProtectionPoliciesOperations( From 57c8b41fafc0e7fceae30f1d4f2f87de0691d7f5 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Sun, 24 Mar 2019 19:23:51 +0000 Subject: [PATCH 4/6] Packaging update of azure-mgmt-security --- azure-mgmt-security/MANIFEST.in | 1 + azure-mgmt-security/README.rst | 22 +++------------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/azure-mgmt-security/MANIFEST.in b/azure-mgmt-security/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-security/MANIFEST.in +++ b/azure-mgmt-security/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml 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 index b2ad14672aa9..1c169fa017e4 100644 --- a/azure-mgmt-security/README.rst +++ b/azure-mgmt-security/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see 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 ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-security%2FREADME.png From c90df99fb12c34e798c9ed1e9948e1e60348769a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 24 Mar 2019 19:28:43 +0000 Subject: [PATCH 5/6] Generated from 45af2dd2143cc9b695ea876a68496401cb37acb9 Fix readme file --- .../azure/mgmt/security/models/__init__.py | 25 ++ .../models/allowlist_custom_alert_rule.py | 60 ++++ .../models/allowlist_custom_alert_rule_py3.py | 60 ++++ .../mgmt/security/models/custom_alert_rule.py | 52 ++++ .../security/models/custom_alert_rule_py3.py | 52 ++++ .../models/denylist_custom_alert_rule.py | 60 ++++ .../models/denylist_custom_alert_rule_py3.py | 60 ++++ .../security/models/device_security_group.py | 62 ++++ .../models/device_security_group_paged.py | 27 ++ .../models/device_security_group_py3.py | 62 ++++ .../security/models/list_custom_alert_rule.py | 54 ++++ .../models/list_custom_alert_rule_py3.py | 54 ++++ .../security/models/security_center_enums.py | 6 + .../models/threshold_custom_alert_rule.py | 59 ++++ .../models/threshold_custom_alert_rule_py3.py | 59 ++++ .../models/time_window_custom_alert_rule.py | 68 ++++ .../time_window_custom_alert_rule_py3.py | 68 ++++ .../mgmt/security/operations/__init__.py | 2 + .../device_security_groups_operations.py | 292 ++++++++++++++++++ .../azure/mgmt/security/security_center.py | 5 + 20 files changed, 1187 insertions(+) create mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index b72e7878ab32..3b167a03c93b 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -20,6 +20,13 @@ from .compliance_segment_py3 import ComplianceSegment from .compliance_py3 import Compliance from .advanced_threat_protection_setting_py3 import AdvancedThreatProtectionSetting + from .threshold_custom_alert_rule_py3 import ThresholdCustomAlertRule + from .time_window_custom_alert_rule_py3 import TimeWindowCustomAlertRule + from .allowlist_custom_alert_rule_py3 import AllowlistCustomAlertRule + from .denylist_custom_alert_rule_py3 import DenylistCustomAlertRule + from .device_security_group_py3 import DeviceSecurityGroup + from .custom_alert_rule_py3 import CustomAlertRule + from .list_custom_alert_rule_py3 import ListCustomAlertRule from .setting_py3 import Setting from .data_export_setting_py3 import DataExportSetting from .setting_resource_py3 import SettingResource @@ -75,6 +82,13 @@ from .compliance_segment import ComplianceSegment from .compliance import Compliance from .advanced_threat_protection_setting import AdvancedThreatProtectionSetting + from .threshold_custom_alert_rule import ThresholdCustomAlertRule + from .time_window_custom_alert_rule import TimeWindowCustomAlertRule + from .allowlist_custom_alert_rule import AllowlistCustomAlertRule + from .denylist_custom_alert_rule import DenylistCustomAlertRule + from .device_security_group import DeviceSecurityGroup + from .custom_alert_rule import CustomAlertRule + from .list_custom_alert_rule import ListCustomAlertRule from .setting import Setting from .data_export_setting import DataExportSetting from .setting_resource import SettingResource @@ -123,6 +137,7 @@ from .workspace_setting_paged import WorkspaceSettingPaged from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged from .compliance_paged import CompliancePaged +from .device_security_group_paged import DeviceSecurityGroupPaged from .setting_paged import SettingPaged from .information_protection_policy_paged import InformationProtectionPolicyPaged from .operation_paged import OperationPaged @@ -139,6 +154,7 @@ AlertNotifications, AlertsToAdmins, AutoProvision, + ValueType, SettingKind, ReportedSeverity, SecurityFamily, @@ -161,6 +177,13 @@ 'ComplianceSegment', 'Compliance', 'AdvancedThreatProtectionSetting', + 'ThresholdCustomAlertRule', + 'TimeWindowCustomAlertRule', + 'AllowlistCustomAlertRule', + 'DenylistCustomAlertRule', + 'DeviceSecurityGroup', + 'CustomAlertRule', + 'ListCustomAlertRule', 'Setting', 'DataExportSetting', 'SettingResource', @@ -209,6 +232,7 @@ 'WorkspaceSettingPaged', 'AutoProvisioningSettingPaged', 'CompliancePaged', + 'DeviceSecurityGroupPaged', 'SettingPaged', 'InformationProtectionPolicyPaged', 'OperationPaged', @@ -224,6 +248,7 @@ 'AlertNotifications', 'AlertsToAdmins', 'AutoProvision', + 'ValueType', 'SettingKind', 'ReportedSeverity', 'SecurityFamily', diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py new file mode 100644 index 000000000000..58275b4e2fbb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule.py @@ -0,0 +1,60 @@ +# 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 .list_custom_alert_rule import ListCustomAlertRule + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AllowlistCustomAlertRule, self).__init__(**kwargs) + self.allowlist_values = kwargs.get('allowlist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py new file mode 100644 index 000000000000..7f8772c3dbbd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/allowlist_custom_alert_rule_py3.py @@ -0,0 +1,60 @@ +# 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 .list_custom_alert_rule_py3 import ListCustomAlertRule + + +class AllowlistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is allowed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param allowlist_values: Required. The values to allow. The format of the + values depends on the rule type. + :type allowlist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'allowlist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'allowlist_values': {'key': 'allowlistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, allowlist_values, **kwargs) -> None: + super(AllowlistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.allowlist_values = allowlist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py new file mode 100644 index 000000000000..7b8bbed4659f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule.py @@ -0,0 +1,52 @@ +# 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 CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py new file mode 100644 index 000000000000..8ecf4bf163cb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/custom_alert_rule_py3.py @@ -0,0 +1,52 @@ +# 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 CustomAlertRule(Model): + """A custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(CustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py new file mode 100644 index 000000000000..976650ae94b9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule.py @@ -0,0 +1,60 @@ +# 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 .list_custom_alert_rule import ListCustomAlertRule + + +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DenylistCustomAlertRule, self).__init__(**kwargs) + self.denylist_values = kwargs.get('denylist_values', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py new file mode 100644 index 000000000000..9813e72eea68 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/denylist_custom_alert_rule_py3.py @@ -0,0 +1,60 @@ +# 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 .list_custom_alert_rule_py3 import ListCustomAlertRule + + +class DenylistCustomAlertRule(ListCustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is denied. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + :param denylist_values: Required. The values to deny. The format of the + values depends on the rule type. + :type denylist_values: list[str] + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + 'denylist_values': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + 'denylist_values': {'key': 'denylistValues', 'type': '[str]'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, denylist_values, **kwargs) -> None: + super(DenylistCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.denylist_values = denylist_values diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group.py new file mode 100644 index 000000000000..a213758a98c6 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group.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 DeviceSecurityGroup(Resource): + """The device security group 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 threshold_rules: A list of threshold custom alert rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: A list of time window custom alert rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: A list of allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: A list of deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _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'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, **kwargs): + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = kwargs.get('threshold_rules', None) + self.time_window_rules = kwargs.get('time_window_rules', None) + self.allowlist_rules = kwargs.get('allowlist_rules', None) + self.denylist_rules = kwargs.get('denylist_rules', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_paged.py new file mode 100644 index 000000000000..cf7fcb32eed7 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_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 DeviceSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeviceSecurityGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeviceSecurityGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(DeviceSecurityGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_py3.py new file mode 100644 index 000000000000..9e2a2015d800 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/device_security_group_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 DeviceSecurityGroup(Resource): + """The device security group 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 threshold_rules: A list of threshold custom alert rules. + :type threshold_rules: + list[~azure.mgmt.security.models.ThresholdCustomAlertRule] + :param time_window_rules: A list of time window custom alert rules. + :type time_window_rules: + list[~azure.mgmt.security.models.TimeWindowCustomAlertRule] + :param allowlist_rules: A list of allow-list custom alert rules. + :type allowlist_rules: + list[~azure.mgmt.security.models.AllowlistCustomAlertRule] + :param denylist_rules: A list of deny-list custom alert rules. + :type denylist_rules: + list[~azure.mgmt.security.models.DenylistCustomAlertRule] + """ + + _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'}, + 'threshold_rules': {'key': 'properties.thresholdRules', 'type': '[ThresholdCustomAlertRule]'}, + 'time_window_rules': {'key': 'properties.timeWindowRules', 'type': '[TimeWindowCustomAlertRule]'}, + 'allowlist_rules': {'key': 'properties.allowlistRules', 'type': '[AllowlistCustomAlertRule]'}, + 'denylist_rules': {'key': 'properties.denylistRules', 'type': '[DenylistCustomAlertRule]'}, + } + + def __init__(self, *, threshold_rules=None, time_window_rules=None, allowlist_rules=None, denylist_rules=None, **kwargs) -> None: + super(DeviceSecurityGroup, self).__init__(**kwargs) + self.threshold_rules = threshold_rules + self.time_window_rules = time_window_rules + self.allowlist_rules = allowlist_rules + self.denylist_rules = denylist_rules diff --git a/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule.py new file mode 100644 index 000000000000..83ac0df72267 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule.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 .custom_alert_rule import CustomAlertRule + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListCustomAlertRule, self).__init__(**kwargs) + self.value_type = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule_py3.py new file mode 100644 index 000000000000..ae713623de5f --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/list_custom_alert_rule_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 .custom_alert_rule_py3 import CustomAlertRule + + +class ListCustomAlertRule(CustomAlertRule): + """A List custom alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :ivar value_type: The value type of the items in the list. Possible values + include: 'IpCidr', 'String' + :vartype value_type: str or ~azure.mgmt.security.models.ValueType + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'value_type': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'value_type': {'key': 'valueType', 'type': 'str'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, **kwargs) -> None: + super(ListCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.value_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 index 6c105302e027..984cb17db8cc 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -36,6 +36,12 @@ class AutoProvision(str, Enum): off = "Off" #: Do not install security agent on the VMs automatically +class ValueType(str, Enum): + + ip_cidr = "IpCidr" #: An IP range in CIDR format (e.g. '192.168.0.1/8'). + string = "String" #: Any string value. + + class SettingKind(str, Enum): data_export_setting = "DataExportSetting" diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.py new file mode 100644 index 000000000000..4e6306190e2b --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule.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 .custom_alert_rule import CustomAlertRule + + +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ThresholdCustomAlertRule, self).__init__(**kwargs) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_py3.py new file mode 100644 index 000000000000..63c5567caceb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/threshold_custom_alert_rule_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 .custom_alert_rule_py3 import CustomAlertRule + + +class ThresholdCustomAlertRule(CustomAlertRule): + """A custom alert rule that checks if a value (depends on the custom alert + type) is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, **kwargs) -> None: + super(ThresholdCustomAlertRule, self).__init__(is_enabled=is_enabled, rule_type=rule_type, **kwargs) + self.min_threshold = min_threshold + self.max_threshold = max_threshold diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.py new file mode 100644 index 000000000000..224d5a3dc0ea --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule.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 msrest.serialization import Model + + +class TimeWindowCustomAlertRule(Model): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = kwargs.get('is_enabled', None) + self.rule_type = kwargs.get('rule_type', None) + self.min_threshold = kwargs.get('min_threshold', None) + self.max_threshold = kwargs.get('max_threshold', None) + self.time_window_size = kwargs.get('time_window_size', None) diff --git a/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_py3.py new file mode 100644 index 000000000000..0a2962dddb94 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/time_window_custom_alert_rule_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 msrest.serialization import Model + + +class TimeWindowCustomAlertRule(Model): + """A custom alert rule that checks if the number of activities (depends on the + custom alert type) in a time window is within the given range. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar display_name: The display name of the custom alert. + :vartype display_name: str + :ivar description: The description of the custom alert. + :vartype description: str + :param is_enabled: Required. Whether the custom alert is enabled. + :type is_enabled: bool + :param rule_type: Required. The type of the custom alert rule. + :type rule_type: str + :param min_threshold: Required. The minimum threshold. + :type min_threshold: int + :param max_threshold: Required. The maximum threshold. + :type max_threshold: int + :param time_window_size: Required. The time window size in iso8601 format. + :type time_window_size: timedelta + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'is_enabled': {'required': True}, + 'rule_type': {'required': True}, + 'min_threshold': {'required': True}, + 'max_threshold': {'required': True}, + 'time_window_size': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'rule_type': {'key': 'ruleType', 'type': 'str'}, + 'min_threshold': {'key': 'minThreshold', 'type': 'int'}, + 'max_threshold': {'key': 'maxThreshold', 'type': 'int'}, + 'time_window_size': {'key': 'timeWindowSize', 'type': 'duration'}, + } + + def __init__(self, *, is_enabled: bool, rule_type: str, min_threshold: int, max_threshold: int, time_window_size, **kwargs) -> None: + super(TimeWindowCustomAlertRule, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.is_enabled = is_enabled + self.rule_type = rule_type + self.min_threshold = min_threshold + self.max_threshold = max_threshold + self.time_window_size = time_window_size diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index cc451ba3dd54..5fd7a2dd9c0f 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -15,6 +15,7 @@ from .auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .compliances_operations import CompliancesOperations from .advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .device_security_groups_operations import DeviceSecurityGroupsOperations from .settings_operations import SettingsOperations from .information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations import Operations @@ -34,6 +35,7 @@ 'AutoProvisioningSettingsOperations', 'CompliancesOperations', 'AdvancedThreatProtectionOperations', + 'DeviceSecurityGroupsOperations', 'SettingsOperations', 'InformationProtectionPoliciesOperations', 'Operations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py new file mode 100644 index 000000000000..a55f1ed2f3c9 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/device_security_groups_operations.py @@ -0,0 +1,292 @@ +# 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 DeviceSecurityGroupsOperations(object): + """DeviceSecurityGroupsOperations 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, resource_id, custom_headers=None, raw=False, **operation_config): + """Gets the list of device security groups for the specified IoT hub + 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: An iterator like instance of DeviceSecurityGroup + :rtype: + ~azure.mgmt.security.models.DeviceSecurityGroupPaged[~azure.mgmt.security.models.DeviceSecurityGroup] + :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 = { + 'resourceId': self._serialize.url("resource_id", resource_id, '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.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeviceSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups'} + + def get( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets the device security group for the specified IoT hub resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_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: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup 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'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def create_or_update( + self, resource_id, device_security_group_name, device_security_group, custom_headers=None, raw=False, **operation_config): + """Creates or updates the device security group on a specified IoT hub + resource. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_group_name: str + :param device_security_group: Security group object. + :type device_security_group: + ~azure.mgmt.security.models.DeviceSecurityGroup + :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: DeviceSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.DeviceSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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(device_security_group, 'DeviceSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeviceSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('DeviceSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} + + def delete( + self, resource_id, device_security_group_name, custom_headers=None, raw=False, **operation_config): + """Deletes the security group. + + :param resource_id: The identifier of the resource. + :type resource_id: str + :param device_security_group_name: The name of the security group. + Please notice that the name is case insensitive. + :type device_security_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.delete.metadata['url'] + path_format_arguments = { + 'resourceId': self._serialize.url("resource_id", resource_id, 'str'), + 'deviceSecurityGroupName': self._serialize.url("device_security_group_name", device_security_group_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': '/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index 4a70b5762f4f..c5f524539c53 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -19,6 +19,7 @@ from .operations.auto_provisioning_settings_operations import AutoProvisioningSettingsOperations from .operations.compliances_operations import CompliancesOperations from .operations.advanced_threat_protection_operations import AdvancedThreatProtectionOperations +from .operations.device_security_groups_operations import DeviceSecurityGroupsOperations from .operations.settings_operations import SettingsOperations from .operations.information_protection_policies_operations import InformationProtectionPoliciesOperations from .operations.operations import Operations @@ -89,6 +90,8 @@ class SecurityCenter(SDKClient): :vartype compliances: azure.mgmt.security.operations.CompliancesOperations :ivar advanced_threat_protection: AdvancedThreatProtection operations :vartype advanced_threat_protection: azure.mgmt.security.operations.AdvancedThreatProtectionOperations + :ivar device_security_groups: DeviceSecurityGroups operations + :vartype device_security_groups: azure.mgmt.security.operations.DeviceSecurityGroupsOperations :ivar settings: Settings operations :vartype settings: azure.mgmt.security.operations.SettingsOperations :ivar information_protection_policies: InformationProtectionPolicies operations @@ -145,6 +148,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.advanced_threat_protection = AdvancedThreatProtectionOperations( self._client, self.config, self._serialize, self._deserialize) + self.device_security_groups = DeviceSecurityGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) self.settings = SettingsOperations( self._client, self.config, self._serialize, self._deserialize) self.information_protection_policies = InformationProtectionPoliciesOperations( From f911f1591fb9a4f129023a65c15d38c17006ae03 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 25 Mar 2019 16:31:10 +0000 Subject: [PATCH 6/6] Generated from 67d905e193967e7a8c35511c87239b4f052314a1 delete unreferenced example file --- .../azure/mgmt/security/models/__init__.py | 29 ++- .../regulatory_compliance_assessment.py | 89 ++++++++ .../regulatory_compliance_assessment_paged.py | 27 +++ .../regulatory_compliance_assessment_py3.py | 89 ++++++++ .../models/regulatory_compliance_control.py | 71 +++++++ .../regulatory_compliance_control_paged.py | 27 +++ .../regulatory_compliance_control_py3.py | 71 +++++++ .../models/regulatory_compliance_standard.py | 72 +++++++ .../regulatory_compliance_standard_paged.py | 27 +++ .../regulatory_compliance_standard_py3.py | 72 +++++++ .../security/models/security_center_enums.py | 8 + .../mgmt/security/operations/__init__.py | 6 + ...atory_compliance_assessments_operations.py | 193 ++++++++++++++++++ ...gulatory_compliance_controls_operations.py | 183 +++++++++++++++++ ...ulatory_compliance_standards_operations.py | 174 ++++++++++++++++ .../azure/mgmt/security/security_center.py | 15 ++ 16 files changed, 1147 insertions(+), 6 deletions(-) create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_paged.py create mode 100644 azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_py3.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_assessments_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_controls_operations.py create mode 100644 azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_standards_operations.py diff --git a/azure-mgmt-security/azure/mgmt/security/models/__init__.py b/azure-mgmt-security/azure/mgmt/security/models/__init__.py index 3b167a03c93b..2134e4db7dd1 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/models/__init__.py @@ -10,10 +10,13 @@ # -------------------------------------------------------------------------- try: - from .pricing_py3 import Pricing - from .pricing_list_py3 import PricingList + from .regulatory_compliance_standard_py3 import RegulatoryComplianceStandard + from .regulatory_compliance_control_py3 import RegulatoryComplianceControl + from .regulatory_compliance_assessment_py3 import RegulatoryComplianceAssessment from .asc_location_py3 import AscLocation from .resource_py3 import Resource + from .pricing_py3 import Pricing + from .pricing_list_py3 import PricingList from .security_contact_py3 import SecurityContact from .workspace_setting_py3 import WorkspaceSetting from .auto_provisioning_setting_py3 import AutoProvisioningSetting @@ -72,10 +75,13 @@ from .connectable_resource_py3 import ConnectableResource from .allowed_connections_resource_py3 import AllowedConnectionsResource except (SyntaxError, ImportError): - from .pricing import Pricing - from .pricing_list import PricingList + from .regulatory_compliance_standard import RegulatoryComplianceStandard + from .regulatory_compliance_control import RegulatoryComplianceControl + from .regulatory_compliance_assessment import RegulatoryComplianceAssessment from .asc_location import AscLocation from .resource import Resource + from .pricing import Pricing + from .pricing_list import PricingList from .security_contact import SecurityContact from .workspace_setting import WorkspaceSetting from .auto_provisioning_setting import AutoProvisioningSetting @@ -133,6 +139,9 @@ from .connected_resource import ConnectedResource from .connectable_resource import ConnectableResource from .allowed_connections_resource import AllowedConnectionsResource +from .regulatory_compliance_standard_paged import RegulatoryComplianceStandardPaged +from .regulatory_compliance_control_paged import RegulatoryComplianceControlPaged +from .regulatory_compliance_assessment_paged import RegulatoryComplianceAssessmentPaged from .security_contact_paged import SecurityContactPaged from .workspace_setting_paged import WorkspaceSettingPaged from .auto_provisioning_setting_paged import AutoProvisioningSettingPaged @@ -150,6 +159,7 @@ from .topology_resource_paged import TopologyResourcePaged from .allowed_connections_resource_paged import AllowedConnectionsResourcePaged from .security_center_enums import ( + State, PricingTier, AlertNotifications, AlertsToAdmins, @@ -167,10 +177,13 @@ ) __all__ = [ - 'Pricing', - 'PricingList', + 'RegulatoryComplianceStandard', + 'RegulatoryComplianceControl', + 'RegulatoryComplianceAssessment', 'AscLocation', 'Resource', + 'Pricing', + 'PricingList', 'SecurityContact', 'WorkspaceSetting', 'AutoProvisioningSetting', @@ -228,6 +241,9 @@ 'ConnectedResource', 'ConnectableResource', 'AllowedConnectionsResource', + 'RegulatoryComplianceStandardPaged', + 'RegulatoryComplianceControlPaged', + 'RegulatoryComplianceAssessmentPaged', 'SecurityContactPaged', 'WorkspaceSettingPaged', 'AutoProvisioningSettingPaged', @@ -244,6 +260,7 @@ 'ExternalSecuritySolutionPaged', 'TopologyResourcePaged', 'AllowedConnectionsResourcePaged', + 'State', 'PricingTier', 'AlertNotifications', 'AlertsToAdmins', diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment.py new file mode 100644 index 000000000000..471302606092 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment.py @@ -0,0 +1,89 @@ +# 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 RegulatoryComplianceAssessment(Resource): + """Regulatory compliance assessment details and state. + + 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 description: The description of the regulatory compliance assessment + :vartype description: str + :ivar assessment_type: The expected type of assessment contained in the + AssessmentDetailsLink + :vartype assessment_type: str + :ivar assessment_details_link: Link to more detailed assessment results + data. The response type will be according to the assessmentType field + :vartype assessment_details_link: str + :param state: Aggregative state based on the assessment's scanned + resources states. Possible values include: 'Passed', 'Failed', 'Skipped', + 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_resources: The given assessment's related resources count + with passed state. + :vartype passed_resources: int + :ivar failed_resources: The given assessment's related resources count + with failed state. + :vartype failed_resources: int + :ivar skipped_resources: The given assessment's related resources count + with skipped state. + :vartype skipped_resources: int + :ivar unsupported_resources: The given assessment's related resources + count with unsupported state. + :vartype unsupported_resources: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'assessment_type': {'readonly': True}, + 'assessment_details_link': {'readonly': True}, + 'passed_resources': {'readonly': True}, + 'failed_resources': {'readonly': True}, + 'skipped_resources': {'readonly': True}, + 'unsupported_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'assessment_details_link': {'key': 'properties.assessmentDetailsLink', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'passed_resources': {'key': 'properties.passedResources', 'type': 'int'}, + 'failed_resources': {'key': 'properties.failedResources', 'type': 'int'}, + 'skipped_resources': {'key': 'properties.skippedResources', 'type': 'int'}, + 'unsupported_resources': {'key': 'properties.unsupportedResources', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RegulatoryComplianceAssessment, self).__init__(**kwargs) + self.description = None + self.assessment_type = None + self.assessment_details_link = None + self.state = kwargs.get('state', None) + self.passed_resources = None + self.failed_resources = None + self.skipped_resources = None + self.unsupported_resources = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_paged.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_paged.py new file mode 100644 index 000000000000..f5661a66b539 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_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 RegulatoryComplianceAssessmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegulatoryComplianceAssessment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegulatoryComplianceAssessment]'} + } + + def __init__(self, *args, **kwargs): + + super(RegulatoryComplianceAssessmentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_py3.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_py3.py new file mode 100644 index 000000000000..92bad19c1805 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_assessment_py3.py @@ -0,0 +1,89 @@ +# 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 RegulatoryComplianceAssessment(Resource): + """Regulatory compliance assessment details and state. + + 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 description: The description of the regulatory compliance assessment + :vartype description: str + :ivar assessment_type: The expected type of assessment contained in the + AssessmentDetailsLink + :vartype assessment_type: str + :ivar assessment_details_link: Link to more detailed assessment results + data. The response type will be according to the assessmentType field + :vartype assessment_details_link: str + :param state: Aggregative state based on the assessment's scanned + resources states. Possible values include: 'Passed', 'Failed', 'Skipped', + 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_resources: The given assessment's related resources count + with passed state. + :vartype passed_resources: int + :ivar failed_resources: The given assessment's related resources count + with failed state. + :vartype failed_resources: int + :ivar skipped_resources: The given assessment's related resources count + with skipped state. + :vartype skipped_resources: int + :ivar unsupported_resources: The given assessment's related resources + count with unsupported state. + :vartype unsupported_resources: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'assessment_type': {'readonly': True}, + 'assessment_details_link': {'readonly': True}, + 'passed_resources': {'readonly': True}, + 'failed_resources': {'readonly': True}, + 'skipped_resources': {'readonly': True}, + 'unsupported_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'assessment_type': {'key': 'properties.assessmentType', 'type': 'str'}, + 'assessment_details_link': {'key': 'properties.assessmentDetailsLink', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'passed_resources': {'key': 'properties.passedResources', 'type': 'int'}, + 'failed_resources': {'key': 'properties.failedResources', 'type': 'int'}, + 'skipped_resources': {'key': 'properties.skippedResources', 'type': 'int'}, + 'unsupported_resources': {'key': 'properties.unsupportedResources', 'type': 'int'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(RegulatoryComplianceAssessment, self).__init__(**kwargs) + self.description = None + self.assessment_type = None + self.assessment_details_link = None + self.state = state + self.passed_resources = None + self.failed_resources = None + self.skipped_resources = None + self.unsupported_resources = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control.py new file mode 100644 index 000000000000..ab7accd57683 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control.py @@ -0,0 +1,71 @@ +# 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 RegulatoryComplianceControl(Resource): + """Regulatory compliance control details and state. + + 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 description: The description of the regulatory compliance control + :vartype description: str + :param state: Aggregative state based on the control's supported + assessments states. Possible values include: 'Passed', 'Failed', + 'Skipped', 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_assessments: The number of supported regulatory compliance + assessments of the given control with a passed state + :vartype passed_assessments: int + :ivar failed_assessments: The number of supported regulatory compliance + assessments of the given control with a failed state + :vartype failed_assessments: int + :ivar skipped_assessments: The number of supported regulatory compliance + assessments of the given control with a skipped state + :vartype skipped_assessments: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'passed_assessments': {'readonly': True}, + 'failed_assessments': {'readonly': True}, + 'skipped_assessments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'passed_assessments': {'key': 'properties.passedAssessments', 'type': 'int'}, + 'failed_assessments': {'key': 'properties.failedAssessments', 'type': 'int'}, + 'skipped_assessments': {'key': 'properties.skippedAssessments', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RegulatoryComplianceControl, self).__init__(**kwargs) + self.description = None + self.state = kwargs.get('state', None) + self.passed_assessments = None + self.failed_assessments = None + self.skipped_assessments = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_paged.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_paged.py new file mode 100644 index 000000000000..22210d83bc43 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_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 RegulatoryComplianceControlPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegulatoryComplianceControl ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegulatoryComplianceControl]'} + } + + def __init__(self, *args, **kwargs): + + super(RegulatoryComplianceControlPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_py3.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_py3.py new file mode 100644 index 000000000000..0eaf9208895c --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_control_py3.py @@ -0,0 +1,71 @@ +# 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 RegulatoryComplianceControl(Resource): + """Regulatory compliance control details and state. + + 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 description: The description of the regulatory compliance control + :vartype description: str + :param state: Aggregative state based on the control's supported + assessments states. Possible values include: 'Passed', 'Failed', + 'Skipped', 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_assessments: The number of supported regulatory compliance + assessments of the given control with a passed state + :vartype passed_assessments: int + :ivar failed_assessments: The number of supported regulatory compliance + assessments of the given control with a failed state + :vartype failed_assessments: int + :ivar skipped_assessments: The number of supported regulatory compliance + assessments of the given control with a skipped state + :vartype skipped_assessments: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'passed_assessments': {'readonly': True}, + 'failed_assessments': {'readonly': True}, + 'skipped_assessments': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'passed_assessments': {'key': 'properties.passedAssessments', 'type': 'int'}, + 'failed_assessments': {'key': 'properties.failedAssessments', 'type': 'int'}, + 'skipped_assessments': {'key': 'properties.skippedAssessments', 'type': 'int'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(RegulatoryComplianceControl, self).__init__(**kwargs) + self.description = None + self.state = state + self.passed_assessments = None + self.failed_assessments = None + self.skipped_assessments = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard.py new file mode 100644 index 000000000000..052a8a90edbc --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard.py @@ -0,0 +1,72 @@ +# 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 RegulatoryComplianceStandard(Resource): + """Regulatory compliance standard details and state. + + 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 state: Aggregative state based on the standard's supported controls + states. Possible values include: 'Passed', 'Failed', 'Skipped', + 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_controls: The number of supported regulatory compliance + controls of the given standard with a passed state + :vartype passed_controls: int + :ivar failed_controls: The number of supported regulatory compliance + controls of the given standard with a failed state + :vartype failed_controls: int + :ivar skipped_controls: The number of supported regulatory compliance + controls of the given standard with a skipped state + :vartype skipped_controls: int + :ivar unsupported_controls: The number of regulatory compliance controls + of the given standard which are unsupported by automated assessments + :vartype unsupported_controls: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'passed_controls': {'readonly': True}, + 'failed_controls': {'readonly': True}, + 'skipped_controls': {'readonly': True}, + 'unsupported_controls': {'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'}, + 'passed_controls': {'key': 'properties.passedControls', 'type': 'int'}, + 'failed_controls': {'key': 'properties.failedControls', 'type': 'int'}, + 'skipped_controls': {'key': 'properties.skippedControls', 'type': 'int'}, + 'unsupported_controls': {'key': 'properties.unsupportedControls', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RegulatoryComplianceStandard, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.passed_controls = None + self.failed_controls = None + self.skipped_controls = None + self.unsupported_controls = None diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_paged.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_paged.py new file mode 100644 index 000000000000..8f091eee07be --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_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 RegulatoryComplianceStandardPaged(Paged): + """ + A paging container for iterating over a list of :class:`RegulatoryComplianceStandard ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RegulatoryComplianceStandard]'} + } + + def __init__(self, *args, **kwargs): + + super(RegulatoryComplianceStandardPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_py3.py b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_py3.py new file mode 100644 index 000000000000..9abfdccc46f2 --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/models/regulatory_compliance_standard_py3.py @@ -0,0 +1,72 @@ +# 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 RegulatoryComplianceStandard(Resource): + """Regulatory compliance standard details and state. + + 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 state: Aggregative state based on the standard's supported controls + states. Possible values include: 'Passed', 'Failed', 'Skipped', + 'Unsupported' + :type state: str or ~azure.mgmt.security.models.State + :ivar passed_controls: The number of supported regulatory compliance + controls of the given standard with a passed state + :vartype passed_controls: int + :ivar failed_controls: The number of supported regulatory compliance + controls of the given standard with a failed state + :vartype failed_controls: int + :ivar skipped_controls: The number of supported regulatory compliance + controls of the given standard with a skipped state + :vartype skipped_controls: int + :ivar unsupported_controls: The number of regulatory compliance controls + of the given standard which are unsupported by automated assessments + :vartype unsupported_controls: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'passed_controls': {'readonly': True}, + 'failed_controls': {'readonly': True}, + 'skipped_controls': {'readonly': True}, + 'unsupported_controls': {'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'}, + 'passed_controls': {'key': 'properties.passedControls', 'type': 'int'}, + 'failed_controls': {'key': 'properties.failedControls', 'type': 'int'}, + 'skipped_controls': {'key': 'properties.skippedControls', 'type': 'int'}, + 'unsupported_controls': {'key': 'properties.unsupportedControls', 'type': 'int'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(RegulatoryComplianceStandard, self).__init__(**kwargs) + self.state = state + self.passed_controls = None + self.failed_controls = None + self.skipped_controls = None + self.unsupported_controls = 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 index 984cb17db8cc..39b8772f9c3a 100644 --- a/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py +++ b/azure-mgmt-security/azure/mgmt/security/models/security_center_enums.py @@ -12,6 +12,14 @@ from enum import Enum +class State(str, Enum): + + passed = "Passed" #: All supported regulatory compliance controls in the given standard have a passed state + failed = "Failed" #: At least one supported regulatory compliance control in the given standard has a state of failed + skipped = "Skipped" #: All supported regulatory compliance controls in the given standard have a state of skipped + unsupported = "Unsupported" #: No supported regulatory compliance data for the given standard + + class PricingTier(str, Enum): free = "Free" #: Get free Azure security center experience with basic security features diff --git a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py index 5fd7a2dd9c0f..d16a4df3422e 100644 --- a/azure-mgmt-security/azure/mgmt/security/operations/__init__.py +++ b/azure-mgmt-security/azure/mgmt/security/operations/__init__.py @@ -9,6 +9,9 @@ # regenerated. # -------------------------------------------------------------------------- +from .regulatory_compliance_standards_operations import RegulatoryComplianceStandardsOperations +from .regulatory_compliance_controls_operations import RegulatoryComplianceControlsOperations +from .regulatory_compliance_assessments_operations import RegulatoryComplianceAssessmentsOperations from .pricings_operations import PricingsOperations from .security_contacts_operations import SecurityContactsOperations from .workspace_settings_operations import WorkspaceSettingsOperations @@ -29,6 +32,9 @@ from .allowed_connections_operations import AllowedConnectionsOperations __all__ = [ + 'RegulatoryComplianceStandardsOperations', + 'RegulatoryComplianceControlsOperations', + 'RegulatoryComplianceAssessmentsOperations', 'PricingsOperations', 'SecurityContactsOperations', 'WorkspaceSettingsOperations', diff --git a/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_assessments_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_assessments_operations.py new file mode 100644 index 000000000000..afc2c6d0adfd --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_assessments_operations.py @@ -0,0 +1,193 @@ +# 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 RegulatoryComplianceAssessmentsOperations(object): + """RegulatoryComplianceAssessmentsOperations 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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, resource_group_name, regulatory_compliance_standard_name, regulatory_compliance_control_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Details and state of assessments mapped to selected regulatory + compliance 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 regulatory_compliance_standard_name: Name of the regulatory + compliance standard object + :type regulatory_compliance_standard_name: str + :param regulatory_compliance_control_name: Name of the regulatory + compliance control object + :type regulatory_compliance_control_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 RegulatoryComplianceAssessment + :rtype: + ~azure.mgmt.security.models.RegulatoryComplianceAssessmentPaged[~azure.mgmt.security.models.RegulatoryComplianceAssessment] + :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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'regulatoryComplianceStandardName': self._serialize.url("regulatory_compliance_standard_name", regulatory_compliance_standard_name, 'str'), + 'regulatoryComplianceControlName': self._serialize.url("regulatory_compliance_control_name", regulatory_compliance_control_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') + 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.RegulatoryComplianceAssessmentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegulatoryComplianceAssessmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments'} + + def get( + self, resource_group_name, regulatory_compliance_standard_name, regulatory_compliance_control_name, regulatory_compliance_assessment_name, custom_headers=None, raw=False, **operation_config): + """Supported regulatory compliance details and state for selected + assessment. + + :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 regulatory_compliance_standard_name: Name of the regulatory + compliance standard object + :type regulatory_compliance_standard_name: str + :param regulatory_compliance_control_name: Name of the regulatory + compliance control object + :type regulatory_compliance_control_name: str + :param regulatory_compliance_assessment_name: Name of the regulatory + compliance assessment object + :type regulatory_compliance_assessment_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: RegulatoryComplianceAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.security.models.RegulatoryComplianceAssessment 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\._\(\)]+$'), + 'regulatoryComplianceStandardName': self._serialize.url("regulatory_compliance_standard_name", regulatory_compliance_standard_name, 'str'), + 'regulatoryComplianceControlName': self._serialize.url("regulatory_compliance_control_name", regulatory_compliance_control_name, 'str'), + 'regulatoryComplianceAssessmentName': self._serialize.url("regulatory_compliance_assessment_name", regulatory_compliance_assessment_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('RegulatoryComplianceAssessment', 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/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_controls_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_controls_operations.py new file mode 100644 index 000000000000..9b5db20ec2eb --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_controls_operations.py @@ -0,0 +1,183 @@ +# 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 RegulatoryComplianceControlsOperations(object): + """RegulatoryComplianceControlsOperations 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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, resource_group_name, regulatory_compliance_standard_name, filter=None, custom_headers=None, raw=False, **operation_config): + """All supported regulatory compliance controls details and state for + selected standard. + + :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 regulatory_compliance_standard_name: Name of the regulatory + compliance standard object + :type regulatory_compliance_standard_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 RegulatoryComplianceControl + :rtype: + ~azure.mgmt.security.models.RegulatoryComplianceControlPaged[~azure.mgmt.security.models.RegulatoryComplianceControl] + :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}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'regulatoryComplianceStandardName': self._serialize.url("regulatory_compliance_standard_name", regulatory_compliance_standard_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') + 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.RegulatoryComplianceControlPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegulatoryComplianceControlPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls'} + + def get( + self, resource_group_name, regulatory_compliance_standard_name, regulatory_compliance_control_name, custom_headers=None, raw=False, **operation_config): + """Selected regulatory compliance control details and state. + + :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 regulatory_compliance_standard_name: Name of the regulatory + compliance standard object + :type regulatory_compliance_standard_name: str + :param regulatory_compliance_control_name: Name of the regulatory + compliance control object + :type regulatory_compliance_control_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: RegulatoryComplianceControl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RegulatoryComplianceControl 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\._\(\)]+$'), + 'regulatoryComplianceStandardName': self._serialize.url("regulatory_compliance_standard_name", regulatory_compliance_standard_name, 'str'), + 'regulatoryComplianceControlName': self._serialize.url("regulatory_compliance_control_name", regulatory_compliance_control_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('RegulatoryComplianceControl', 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/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_standards_operations.py b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_standards_operations.py new file mode 100644 index 000000000000..43a9ce7a73ce --- /dev/null +++ b/azure-mgmt-security/azure/mgmt/security/operations/regulatory_compliance_standards_operations.py @@ -0,0 +1,174 @@ +# 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 RegulatoryComplianceStandardsOperations(object): + """RegulatoryComplianceStandardsOperations 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: "2019-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-01-01-preview" + + self.config = config + + def list( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Supported regulatory compliance standards details and state. + + :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 RegulatoryComplianceStandard + :rtype: + ~azure.mgmt.security.models.RegulatoryComplianceStandardPaged[~azure.mgmt.security.models.RegulatoryComplianceStandard] + :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}$'), + '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') + + 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.RegulatoryComplianceStandardPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RegulatoryComplianceStandardPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/regulatoryComplianceStandards'} + + def get( + self, resource_group_name, regulatory_compliance_standard_name, custom_headers=None, raw=False, **operation_config): + """Supported regulatory compliance details state for selected standard. + + :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 regulatory_compliance_standard_name: Name of the regulatory + compliance standard object + :type regulatory_compliance_standard_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: RegulatoryComplianceStandard or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.security.models.RegulatoryComplianceStandard 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\._\(\)]+$'), + 'regulatoryComplianceStandardName': self._serialize.url("regulatory_compliance_standard_name", regulatory_compliance_standard_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('RegulatoryComplianceStandard', 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/regulatoryComplianceStandards/{regulatoryComplianceStandardName}'} diff --git a/azure-mgmt-security/azure/mgmt/security/security_center.py b/azure-mgmt-security/azure/mgmt/security/security_center.py index c5f524539c53..43de544dc1eb 100644 --- a/azure-mgmt-security/azure/mgmt/security/security_center.py +++ b/azure-mgmt-security/azure/mgmt/security/security_center.py @@ -13,6 +13,9 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from .operations.regulatory_compliance_standards_operations import RegulatoryComplianceStandardsOperations +from .operations.regulatory_compliance_controls_operations import RegulatoryComplianceControlsOperations +from .operations.regulatory_compliance_assessments_operations import RegulatoryComplianceAssessmentsOperations from .operations.pricings_operations import PricingsOperations from .operations.security_contacts_operations import SecurityContactsOperations from .operations.workspace_settings_operations import WorkspaceSettingsOperations @@ -78,6 +81,12 @@ class SecurityCenter(SDKClient): :ivar config: Configuration for client. :vartype config: SecurityCenterConfiguration + :ivar regulatory_compliance_standards: RegulatoryComplianceStandards operations + :vartype regulatory_compliance_standards: azure.mgmt.security.operations.RegulatoryComplianceStandardsOperations + :ivar regulatory_compliance_controls: RegulatoryComplianceControls operations + :vartype regulatory_compliance_controls: azure.mgmt.security.operations.RegulatoryComplianceControlsOperations + :ivar regulatory_compliance_assessments: RegulatoryComplianceAssessments operations + :vartype regulatory_compliance_assessments: azure.mgmt.security.operations.RegulatoryComplianceAssessmentsOperations :ivar pricings: Pricings operations :vartype pricings: azure.mgmt.security.operations.PricingsOperations :ivar security_contacts: SecurityContacts operations @@ -136,6 +145,12 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.regulatory_compliance_standards = RegulatoryComplianceStandardsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.regulatory_compliance_controls = RegulatoryComplianceControlsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.regulatory_compliance_assessments = RegulatoryComplianceAssessmentsOperations( + self._client, self.config, self._serialize, self._deserialize) self.pricings = PricingsOperations( self._client, self.config, self._serialize, self._deserialize) self.security_contacts = SecurityContactsOperations(