From 6c10925887f399492aea3c072d1bde9dadd86e98 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 30 Jan 2019 10:41:44 -0800 Subject: [PATCH 1/6] [AutoPR securityinsights/resource-manager] Creates the "real" API for Scheduled Alert Rules (#4229) * Generated from b63cbf7f7de110a9611e2c0d1f0b077920963104 Merge branch 'master' of https://github.com/nirgfani/azure-rest-api-specs * Packaging update of azure-mgmt-securityinsight * Generated from 1d1029b373596e1dfe05b66fce115d5fd4b5ea57 Fixing comments from PR- * Changing durations to fit standards * Changing operators to fit other RPs * Align naming to scheduledAlertRules * Adding 200 response to DeleteScheduledAlertRule * Generated from 573869de582350c81ae8c39877c2a170ac85cbfd Adding kind to AlertRule and making Scheduled as a specific kind * Generated from 27d8376898b34d8f7a3c1a0f31ba53ca217afa57 Fix some errors * Generated from 0f74576d2fa0ae3526c5f42c39de849ddce62396 Trying to solve the model validator issues --- azure-mgmt-securityinsight/HISTORY.rst | 9 + azure-mgmt-securityinsight/MANIFEST.in | 4 + azure-mgmt-securityinsight/README.rst | 49 +++ azure-mgmt-securityinsight/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/securityinsight/__init__.py | 18 + .../mgmt/securityinsight/models/__init__.py | 46 +++ .../mgmt/securityinsight/models/alert_rule.py | 63 ++++ .../models/alert_rule_kind1.py | 29 ++ .../models/alert_rule_kind1_py3.py | 29 ++ .../models/alert_rule_paged.py | 27 ++ .../securityinsight/models/alert_rule_py3.py | 63 ++++ .../mgmt/securityinsight/models/operation.py | 32 ++ .../models/operation_display.py | 40 +++ .../models/operation_display_py3.py | 40 +++ .../securityinsight/models/operation_paged.py | 27 ++ .../securityinsight/models/operation_py3.py | 32 ++ .../mgmt/securityinsight/models/resource.py | 45 +++ .../securityinsight/models/resource_py3.py | 45 +++ .../models/scheduled_alert_rule.py | 123 +++++++ .../models/scheduled_alert_rule_py3.py | 123 +++++++ .../models/security_insights_enums.py | 33 ++ .../securityinsight/operations/__init__.py | 18 + .../operations/alert_rules_operations.py | 322 ++++++++++++++++++ .../securityinsight/operations/operations.py | 99 ++++++ .../mgmt/securityinsight/security_insights.py | 86 +++++ .../azure/mgmt/securityinsight/version.py | 13 + azure-mgmt-securityinsight/sdk_packaging.toml | 8 + azure-mgmt-securityinsight/setup.cfg | 2 + azure-mgmt-securityinsight/setup.py | 87 +++++ 30 files changed, 1514 insertions(+) create mode 100644 azure-mgmt-securityinsight/HISTORY.rst create mode 100644 azure-mgmt-securityinsight/MANIFEST.in create mode 100644 azure-mgmt-securityinsight/README.rst create mode 100644 azure-mgmt-securityinsight/azure/__init__.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/__init__.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/version.py create mode 100644 azure-mgmt-securityinsight/sdk_packaging.toml create mode 100644 azure-mgmt-securityinsight/setup.cfg create mode 100644 azure-mgmt-securityinsight/setup.py diff --git a/azure-mgmt-securityinsight/HISTORY.rst b/azure-mgmt-securityinsight/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-securityinsight/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-securityinsight/MANIFEST.in b/azure-mgmt-securityinsight/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-securityinsight/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-securityinsight/README.rst b/azure-mgmt-securityinsight/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-securityinsight/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-securityinsight/azure/__init__.py b/azure-mgmt-securityinsight/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-securityinsight/azure/mgmt/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py new file mode 100644 index 000000000000..59c5d0a0e375 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .security_insights import SecurityInsights +from .version import VERSION + +__all__ = ['SecurityInsights'] + +__version__ = VERSION + diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py new file mode 100644 index 000000000000..4269289ed2ad --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .alert_rule_py3 import AlertRule + from .alert_rule_kind1_py3 import AlertRuleKind1 + from .scheduled_alert_rule_py3 import ScheduledAlertRule + from .resource_py3 import Resource +except (SyntaxError, ImportError): + from .operation_display import OperationDisplay + from .operation import Operation + from .alert_rule import AlertRule + from .alert_rule_kind1 import AlertRuleKind1 + from .scheduled_alert_rule import ScheduledAlertRule + from .resource import Resource +from .operation_paged import OperationPaged +from .alert_rule_paged import AlertRulePaged +from .security_insights_enums import ( + AlertRuleKind, + Severity, + TriggerOperator, +) + +__all__ = [ + 'OperationDisplay', + 'Operation', + 'AlertRule', + 'AlertRuleKind1', + 'ScheduledAlertRule', + 'Resource', + 'OperationPaged', + 'AlertRulePaged', + 'AlertRuleKind', + 'Severity', + 'TriggerOperator', +] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule.py new file mode 100644 index 000000000000..da97ab6a6f50 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertRule(Model): + """Alert rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledAlertRule + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Scheduled': 'ScheduledAlertRule'} + } + + def __init__(self, **kwargs): + super(AlertRule, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = kwargs.get('etag', None) + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1.py new file mode 100644 index 000000000000..204fa1ddf932 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertRuleKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the alert rule. Possible values include: + 'Scheduled' + :type kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AlertRuleKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1_py3.py new file mode 100644 index 000000000000..aff9133b36c9 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_kind1_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertRuleKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the alert rule. Possible values include: + 'Scheduled' + :type kind: str or ~azure.mgmt.securityinsight.models.AlertRuleKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(AlertRuleKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py new file mode 100644 index 000000000000..765456eff7ec --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_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 AlertRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`AlertRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AlertRule]'} + } + + def __init__(self, *args, **kwargs): + + super(AlertRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_py3.py new file mode 100644 index 000000000000..0bd3aa93133d --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertRule(Model): + """Alert rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledAlertRule + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Scheduled': 'ScheduledAlertRule'} + } + + def __init__(self, *, etag: str=None, **kwargs) -> None: + super(AlertRule, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = etag + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation.py new file mode 100644 index 000000000000..3bee7e1dac48 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation provided by provider. + + :param name: Name of the operation + :type name: str + :param display: Properties of the operation + :type display: ~azure.mgmt.securityinsight.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display.py new file mode 100644 index 000000000000..89c4bdd6ccb6 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Properties of the operation. + + :param provider: Provider name + :type provider: str + :param resource: Resource name + :type resource: str + :param operation: Operation name + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display_py3.py new file mode 100644 index 000000000000..fa3740dfc655 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Properties of the operation. + + :param provider: Provider name + :type provider: str + :param resource: Resource name + :type resource: str + :param operation: Operation name + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_paged.py new file mode 100644 index 000000000000..a1b03b8047b8 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_py3.py new file mode 100644 index 000000000000..d77122a675e5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/operation_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation provided by provider. + + :param name: Name of the operation + :type name: str + :param display: Properties of the operation + :type display: ~azure.mgmt.securityinsight.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource.py new file mode 100644 index 000000000000..7454d56b9033 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource_py3.py new file mode 100644 index 000000000000..83ff9951fb91 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py new file mode 100644 index 000000000000..fecadd7e4213 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py @@ -0,0 +1,123 @@ +# 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 .alert_rule import AlertRule + + +class ScheduledAlertRule(AlertRule): + """Represents scheduled 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 id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param rule_name: Required. The name for alerts created by this alert + rule. + :type rule_name: str + :param description: Required. The description of the alert rule. + :type description: str + :param severity: Required. The severity for alerts created by this alert + rule. Possible values include: 'Low', 'Medium', 'High', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.Severity + :param enabled: Required. Determines whether this alert rule is enabled or + disabled. + :type enabled: bool + :param query: Required. The query that creates alerts for this rule. + :type query: str + :param query_frequency: Required. The frequency (in ISO 8601 duration + format) for this alert rule to run. + :type query_frequency: timedelta + :param query_period: Required. The period (in ISO 8601 duration format) + that this alert rule looks at. + :type query_period: timedelta + :param trigger_operator: Required. The operation against the threshold + that triggers alert rule. Possible values include: 'GreaterThan', + 'LessThan', 'Equal', 'NotEqual' + :type trigger_operator: str or + ~azure.mgmt.securityinsight.models.TriggerOperator + :param trigger_threshold: Required. The threshold triggers this alert + rule. + :type trigger_threshold: int + :param suppression_enabled: Required. Determines whether the suppression + for this alert rule is enabled or disabled. + :type suppression_enabled: bool + :param suppression_duration: Required. The suppression (in ISO 8601 + duration format) to wait since last time this alert rule been triggered. + :type suppression_duration: timedelta + :ivar last_modified_utc: The last time that this alert has been modified. + :vartype last_modified_utc: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'rule_name': {'required': True}, + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'query': {'required': True}, + 'query_frequency': {'required': True}, + 'query_period': {'required': True}, + 'trigger_operator': {'required': True}, + 'trigger_threshold': {'required': True}, + 'suppression_enabled': {'required': True}, + 'suppression_duration': {'required': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'Severity'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'query': {'key': 'properties.query', 'type': 'str'}, + 'query_frequency': {'key': 'properties.queryFrequency', 'type': 'duration'}, + 'query_period': {'key': 'properties.queryPeriod', 'type': 'duration'}, + 'trigger_operator': {'key': 'properties.triggerOperator', 'type': 'TriggerOperator'}, + 'trigger_threshold': {'key': 'properties.triggerThreshold', 'type': 'int'}, + 'suppression_enabled': {'key': 'properties.suppressionEnabled', 'type': 'bool'}, + 'suppression_duration': {'key': 'properties.suppressionDuration', 'type': 'duration'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduledAlertRule, self).__init__(**kwargs) + self.rule_name = kwargs.get('rule_name', None) + self.description = kwargs.get('description', None) + self.severity = kwargs.get('severity', None) + self.enabled = kwargs.get('enabled', None) + self.query = kwargs.get('query', None) + self.query_frequency = kwargs.get('query_frequency', None) + self.query_period = kwargs.get('query_period', None) + self.trigger_operator = kwargs.get('trigger_operator', None) + self.trigger_threshold = kwargs.get('trigger_threshold', None) + self.suppression_enabled = kwargs.get('suppression_enabled', None) + self.suppression_duration = kwargs.get('suppression_duration', None) + self.last_modified_utc = None + self.kind = 'Scheduled' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py new file mode 100644 index 000000000000..b3eac8ccc2d8 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py @@ -0,0 +1,123 @@ +# 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 .alert_rule_py3 import AlertRule + + +class ScheduledAlertRule(AlertRule): + """Represents scheduled 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 id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param rule_name: Required. The name for alerts created by this alert + rule. + :type rule_name: str + :param description: Required. The description of the alert rule. + :type description: str + :param severity: Required. The severity for alerts created by this alert + rule. Possible values include: 'Low', 'Medium', 'High', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.Severity + :param enabled: Required. Determines whether this alert rule is enabled or + disabled. + :type enabled: bool + :param query: Required. The query that creates alerts for this rule. + :type query: str + :param query_frequency: Required. The frequency (in ISO 8601 duration + format) for this alert rule to run. + :type query_frequency: timedelta + :param query_period: Required. The period (in ISO 8601 duration format) + that this alert rule looks at. + :type query_period: timedelta + :param trigger_operator: Required. The operation against the threshold + that triggers alert rule. Possible values include: 'GreaterThan', + 'LessThan', 'Equal', 'NotEqual' + :type trigger_operator: str or + ~azure.mgmt.securityinsight.models.TriggerOperator + :param trigger_threshold: Required. The threshold triggers this alert + rule. + :type trigger_threshold: int + :param suppression_enabled: Required. Determines whether the suppression + for this alert rule is enabled or disabled. + :type suppression_enabled: bool + :param suppression_duration: Required. The suppression (in ISO 8601 + duration format) to wait since last time this alert rule been triggered. + :type suppression_duration: timedelta + :ivar last_modified_utc: The last time that this alert has been modified. + :vartype last_modified_utc: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'rule_name': {'required': True}, + 'description': {'required': True}, + 'severity': {'required': True}, + 'enabled': {'required': True}, + 'query': {'required': True}, + 'query_frequency': {'required': True}, + 'query_period': {'required': True}, + 'trigger_operator': {'required': True}, + 'trigger_threshold': {'required': True}, + 'suppression_enabled': {'required': True}, + 'suppression_duration': {'required': True}, + 'last_modified_utc': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'severity': {'key': 'properties.severity', 'type': 'Severity'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'query': {'key': 'properties.query', 'type': 'str'}, + 'query_frequency': {'key': 'properties.queryFrequency', 'type': 'duration'}, + 'query_period': {'key': 'properties.queryPeriod', 'type': 'duration'}, + 'trigger_operator': {'key': 'properties.triggerOperator', 'type': 'TriggerOperator'}, + 'trigger_threshold': {'key': 'properties.triggerThreshold', 'type': 'int'}, + 'suppression_enabled': {'key': 'properties.suppressionEnabled', 'type': 'bool'}, + 'suppression_duration': {'key': 'properties.suppressionDuration', 'type': 'duration'}, + 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'str'}, + } + + def __init__(self, *, rule_name: str, description: str, severity, enabled: bool, query: str, query_frequency, query_period, trigger_operator, trigger_threshold: int, suppression_enabled: bool, suppression_duration, etag: str=None, **kwargs) -> None: + super(ScheduledAlertRule, self).__init__(etag=etag, **kwargs) + self.rule_name = rule_name + self.description = description + self.severity = severity + self.enabled = enabled + self.query = query + self.query_frequency = query_frequency + self.query_period = query_period + self.trigger_operator = trigger_operator + self.trigger_threshold = trigger_threshold + self.suppression_enabled = suppression_enabled + self.suppression_duration = suppression_duration + self.last_modified_utc = None + self.kind = 'Scheduled' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py new file mode 100644 index 000000000000..1d640838c0da --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class AlertRuleKind(str, Enum): + + scheduled = "Scheduled" + + +class Severity(str, Enum): + + low = "Low" + medium = "Medium" + high = "High" + informational = "Informational" + + +class TriggerOperator(str, Enum): + + greater_than = "GreaterThan" + less_than = "LessThan" + equal = "Equal" + not_equal = "NotEqual" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py new file mode 100644 index 000000000000..fccf5dd12dbe --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .operations import Operations +from .alert_rules_operations import AlertRulesOperations + +__all__ = [ + 'Operations', + 'AlertRulesOperations', +] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py new file mode 100644 index 000000000000..ad49f712b1be --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py @@ -0,0 +1,322 @@ +# 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 AlertRulesOperations(object): + """AlertRulesOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all alert rules. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 AlertRule + :rtype: + ~azure.mgmt.securityinsight.models.AlertRulePaged[~azure.mgmt.securityinsight.models.AlertRule] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.AlertRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AlertRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers=None, raw=False, **operation_config): + """Gets a alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_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: AlertRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.AlertRule 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/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('AlertRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} + + def create( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers=None, raw=False, **operation_config): + """Creates or updates the alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_id: str + :param alert_rule: The alert rule + :type alert_rule: ~azure.mgmt.securityinsight.models.AlertRule + :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: AlertRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.AlertRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/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(alert_rule, 'AlertRule') + + # 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('AlertRule', response) + if response.status_code == 201: + deserialized = self._deserialize('AlertRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers=None, raw=False, **operation_config): + """Delete the alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/operations.py new file mode 100644 index 000000000000..4779a6e237a0 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version for the operation. Constant value: "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, custom_headers=None, raw=False, **operation_config): + """Lists all operations available Azure Security Insights Resource + Provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.securityinsight.models.OperationPaged[~azure.mgmt.securityinsight.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.SecurityInsights/operations'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py new file mode 100644 index 000000000000..76cf6b21f37f --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.alert_rules_operations import AlertRulesOperations +from . import models + + +class SecurityInsightsConfiguration(AzureConfiguration): + """Configuration for SecurityInsights + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure subscription ID + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SecurityInsightsConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-securityinsight/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class SecurityInsights(SDKClient): + """API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider + + :ivar config: Configuration for client. + :vartype config: SecurityInsightsConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.securityinsight.operations.Operations + :ivar alert_rules: AlertRules operations + :vartype alert_rules: azure.mgmt.securityinsight.operations.AlertRulesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure subscription ID + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = SecurityInsightsConfiguration(credentials, subscription_id, base_url) + super(SecurityInsights, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-01-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.alert_rules = AlertRulesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/version.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/azure-mgmt-securityinsight/sdk_packaging.toml b/azure-mgmt-securityinsight/sdk_packaging.toml new file mode 100644 index 000000000000..74ac4f701334 --- /dev/null +++ b/azure-mgmt-securityinsight/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-securityinsight" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/azure-mgmt-securityinsight/setup.cfg b/azure-mgmt-securityinsight/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-securityinsight/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-securityinsight/setup.py b/azure-mgmt-securityinsight/setup.py new file mode 100644 index 000000000000..0f1737e027b2 --- /dev/null +++ b/azure-mgmt-securityinsight/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-securityinsight" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) From 61c78ccb45d58a9e5abcc3481fe1fa3d38395d85 Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Wed, 30 Jan 2019 18:46:16 +0000 Subject: [PATCH 2/6] Packaging update of azure-mgmt-securityinsight --- azure-mgmt-securityinsight/README.rst | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/azure-mgmt-securityinsight/README.rst b/azure-mgmt-securityinsight/README.rst index 45de4e6b43dd..d0429ebc7565 100644 --- a/azure-mgmt-securityinsight/README.rst +++ b/azure-mgmt-securityinsight/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 ===== From 9a6449e51619d2bebae52a6219f119c9622e2088 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 5 Feb 2019 12:42:34 -0800 Subject: [PATCH 3/6] [AutoPR securityinsights/resource-manager] Adding data connectors APIs (#4279) * Generated from 1a6ebaa4e0f6627020df1cb8706b481ba4aef7c6 Try to fix some checks issues * Generated from 852097272ac674f1b2931aa299767468407eed51 Try to fix issues once again * Generated from c69c6aa9b511b58e14d2711c23c607476f4da35b Fixing typos --- .../mgmt/securityinsight/models/__init__.py | 57 ++++ .../models/aad_data_connector.py | 60 ++++ .../models/aad_data_connector_py3.py | 60 ++++ .../alerts_data_type_of_data_connector.py | 29 ++ ...erts_data_type_of_data_connector_alerts.py | 28 ++ ..._data_type_of_data_connector_alerts_py3.py | 28 ++ .../alerts_data_type_of_data_connector_py3.py | 29 ++ .../models/asc_data_connector.py | 60 ++++ .../models/asc_data_connector_py3.py | 60 ++++ .../securityinsight/models/data_connector.py | 64 ++++ .../models/data_connector_context_id.py | 29 ++ .../models/data_connector_context_id_py3.py | 29 ++ .../models/data_connector_data_type_common.py | 29 ++ .../data_connector_data_type_common_py3.py | 29 ++ .../models/data_connector_kind1.py | 30 ++ .../models/data_connector_kind1_py3.py | 30 ++ .../models/data_connector_paged.py | 27 ++ .../models/data_connector_py3.py | 64 ++++ .../models/data_connector_with_alerts.py | 69 ++++ .../models/data_connector_with_alerts_py3.py | 69 ++++ .../models/mcas_data_connector.py | 60 ++++ .../models/mcas_data_connector_py3.py | 60 ++++ .../models/office_data_connector.py | 62 ++++ .../office_data_connector_data_types.py | 34 ++ ...fice_data_connector_data_types_exchange.py | 28 ++ ..._data_connector_data_types_exchange_py3.py | 28 ++ .../office_data_connector_data_types_py3.py | 34 ++ ...e_data_connector_data_types_share_point.py | 28 ++ ...ta_connector_data_types_share_point_py3.py | 28 ++ .../models/office_data_connector_py3.py | 62 ++++ .../models/security_insights_enums.py | 15 + .../models/ti_data_connector.py | 62 ++++ .../models/ti_data_connector_data_types.py | 29 ++ ...ti_data_connector_data_types_indicators.py | 28 ++ ...ata_connector_data_types_indicators_py3.py | 28 ++ .../ti_data_connector_data_types_py3.py | 29 ++ .../models/ti_data_connector_py3.py | 62 ++++ .../securityinsight/operations/__init__.py | 2 + .../operations/data_connectors_operations.py | 322 ++++++++++++++++++ .../mgmt/securityinsight/security_insights.py | 5 + 40 files changed, 1886 insertions(+) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index 4269289ed2ad..394ab63dd677 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -15,6 +15,23 @@ from .alert_rule_py3 import AlertRule from .alert_rule_kind1_py3 import AlertRuleKind1 from .scheduled_alert_rule_py3 import ScheduledAlertRule + from .data_connector_py3 import DataConnector + from .data_connector_kind1_py3 import DataConnectorKind1 + from .data_connector_context_id_py3 import DataConnectorContextId + from .office_data_connector_data_types_share_point_py3 import OfficeDataConnectorDataTypesSharePoint + from .office_data_connector_data_types_exchange_py3 import OfficeDataConnectorDataTypesExchange + from .office_data_connector_data_types_py3 import OfficeDataConnectorDataTypes + from .office_data_connector_py3 import OfficeDataConnector + from .ti_data_connector_data_types_indicators_py3 import TIDataConnectorDataTypesIndicators + from .ti_data_connector_data_types_py3 import TIDataConnectorDataTypes + from .ti_data_connector_py3 import TIDataConnector + from .aad_data_connector_py3 import AADDataConnector + from .asc_data_connector_py3 import ASCDataConnector + from .mcas_data_connector_py3 import MCASDataConnector + from .alerts_data_type_of_data_connector_alerts_py3 import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector_py3 import AlertsDataTypeOfDataConnector + from .data_connector_with_alerts_py3 import DataConnectorWithAlerts + from .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon from .resource_py3 import Resource except (SyntaxError, ImportError): from .operation_display import OperationDisplay @@ -22,13 +39,33 @@ from .alert_rule import AlertRule from .alert_rule_kind1 import AlertRuleKind1 from .scheduled_alert_rule import ScheduledAlertRule + from .data_connector import DataConnector + from .data_connector_kind1 import DataConnectorKind1 + from .data_connector_context_id import DataConnectorContextId + from .office_data_connector_data_types_share_point import OfficeDataConnectorDataTypesSharePoint + from .office_data_connector_data_types_exchange import OfficeDataConnectorDataTypesExchange + from .office_data_connector_data_types import OfficeDataConnectorDataTypes + from .office_data_connector import OfficeDataConnector + from .ti_data_connector_data_types_indicators import TIDataConnectorDataTypesIndicators + from .ti_data_connector_data_types import TIDataConnectorDataTypes + from .ti_data_connector import TIDataConnector + from .aad_data_connector import AADDataConnector + from .asc_data_connector import ASCDataConnector + from .mcas_data_connector import MCASDataConnector + from .alerts_data_type_of_data_connector_alerts import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector import AlertsDataTypeOfDataConnector + from .data_connector_with_alerts import DataConnectorWithAlerts + from .data_connector_data_type_common import DataConnectorDataTypeCommon from .resource import Resource from .operation_paged import OperationPaged from .alert_rule_paged import AlertRulePaged +from .data_connector_paged import DataConnectorPaged from .security_insights_enums import ( AlertRuleKind, Severity, TriggerOperator, + DataConnectorKind, + DataTypeState, ) __all__ = [ @@ -37,10 +74,30 @@ 'AlertRule', 'AlertRuleKind1', 'ScheduledAlertRule', + 'DataConnector', + 'DataConnectorKind1', + 'DataConnectorContextId', + 'OfficeDataConnectorDataTypesSharePoint', + 'OfficeDataConnectorDataTypesExchange', + 'OfficeDataConnectorDataTypes', + 'OfficeDataConnector', + 'TIDataConnectorDataTypesIndicators', + 'TIDataConnectorDataTypes', + 'TIDataConnector', + 'AADDataConnector', + 'ASCDataConnector', + 'MCASDataConnector', + 'AlertsDataTypeOfDataConnectorAlerts', + 'AlertsDataTypeOfDataConnector', + 'DataConnectorWithAlerts', + 'DataConnectorDataTypeCommon', 'Resource', 'OperationPaged', 'AlertRulePaged', + 'DataConnectorPaged', 'AlertRuleKind', 'Severity', 'TriggerOperator', + 'DataConnectorKind', + 'DataTypeState', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py new file mode 100644 index 000000000000..0af5abc053ab --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class AADDataConnector(DataConnectorWithAlerts): + """Represents AAD (Azure Active Directory) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(AADDataConnector, self).__init__(**kwargs) + self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py new file mode 100644 index 000000000000..2d2a0a618e3b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class AADDataConnector(DataConnectorWithAlerts): + """Represents AAD (Azure Active Directory) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(AADDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py new file mode 100644 index 000000000000..36a5e58a48ad --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertsDataTypeOfDataConnector(Model): + """Alerts data type for data connectors. + + :param alerts: Alerts data type connection. + :type alerts: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnectorAlerts + """ + + _attribute_map = { + 'alerts': {'key': 'alerts', 'type': 'AlertsDataTypeOfDataConnectorAlerts'}, + } + + def __init__(self, **kwargs): + super(AlertsDataTypeOfDataConnector, self).__init__(**kwargs) + self.alerts = kwargs.get('alerts', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.py new file mode 100644 index 000000000000..534735b5faef --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts.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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class AlertsDataTypeOfDataConnectorAlerts(DataConnectorDataTypeCommon): + """Alerts data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AlertsDataTypeOfDataConnectorAlerts, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_py3.py new file mode 100644 index 000000000000..9ab513e28b34 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_alerts_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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class AlertsDataTypeOfDataConnectorAlerts(DataConnectorDataTypeCommon): + """Alerts data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(AlertsDataTypeOfDataConnectorAlerts, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py new file mode 100644 index 000000000000..df40d726ad58 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alerts_data_type_of_data_connector_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AlertsDataTypeOfDataConnector(Model): + """Alerts data type for data connectors. + + :param alerts: Alerts data type connection. + :type alerts: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnectorAlerts + """ + + _attribute_map = { + 'alerts': {'key': 'alerts', 'type': 'AlertsDataTypeOfDataConnectorAlerts'}, + } + + def __init__(self, *, alerts=None, **kwargs) -> None: + super(AlertsDataTypeOfDataConnector, self).__init__(**kwargs) + self.alerts = alerts diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py new file mode 100644 index 000000000000..326c886fe8b6 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class ASCDataConnector(DataConnectorWithAlerts): + """Represents ASC (Azure Security Center) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(ASCDataConnector, self).__init__(**kwargs) + self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py new file mode 100644 index 000000000000..c74146245a1d --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class ASCDataConnector(DataConnectorWithAlerts): + """Represents ASC (Azure Security Center) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(ASCDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py new file mode 100644 index 000000000000..d6c8634a338d --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnector(Model): + """Data connector. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OfficeDataConnector, TIDataConnector, + DataConnectorWithAlerts + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + } + + def __init__(self, **kwargs): + super(DataConnector, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = kwargs.get('etag', None) + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py new file mode 100644 index 000000000000..593f5cddcfe5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorContextId(Model): + """Describes an Azure resource with kind. + + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + """ + + _attribute_map = { + 'context_id': {'key': 'contextId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorContextId, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py new file mode 100644 index 000000000000..7b26fbf253cb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorContextId(Model): + """Describes an Azure resource with kind. + + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + """ + + _attribute_map = { + 'context_id': {'key': 'contextId', 'type': 'str'}, + } + + def __init__(self, *, context_id: str=None, **kwargs) -> None: + super(DataConnectorContextId, self).__init__(**kwargs) + self.context_id = context_id diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py new file mode 100644 index 000000000000..91c0a49613f9 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorDataTypeCommon(Model): + """Common field for data type in data connectors. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorDataTypeCommon, self).__init__(**kwargs) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py new file mode 100644 index 000000000000..33866464f222 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_data_type_common_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorDataTypeCommon(Model): + """Common field for data type in data connectors. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(DataConnectorDataTypeCommon, self).__init__(**kwargs) + self.state = state diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py new file mode 100644 index 000000000000..acb1391b716b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the data connector. Possible values include: + 'AzureActiveDirectory', 'AzureSecurityCenter', + 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + :type kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py new file mode 100644 index 000000000000..1fc79470d356 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_kind1_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the data connector. Possible values include: + 'AzureActiveDirectory', 'AzureSecurityCenter', + 'MicrosoftCloudAppSecurity', 'ThreatIntelligence', 'Office365' + :type kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(DataConnectorKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_paged.py new file mode 100644 index 000000000000..b3929c84ac01 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_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 DataConnectorPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataConnector ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataConnector]'} + } + + def __init__(self, *args, **kwargs): + + super(DataConnectorPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py new file mode 100644 index 000000000000..8b8782ff6de5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnector(Model): + """Data connector. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OfficeDataConnector, TIDataConnector, + DataConnectorWithAlerts + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + } + + def __init__(self, *, etag: str=None, **kwargs) -> None: + super(DataConnector, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.etag = etag + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py new file mode 100644 index 000000000000..1b35258799b1 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py @@ -0,0 +1,69 @@ +# 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 .data_connector import DataConnector + + +class DataConnectorWithAlerts(DataConnector): + """Data connector with alerts data type. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + _subtype_map = { + 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + } + + def __init__(self, **kwargs): + super(DataConnectorWithAlerts, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'DataConnectorWithAlerts' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py new file mode 100644 index 000000000000..962cae013763 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py @@ -0,0 +1,69 @@ +# 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 .data_connector_py3 import DataConnector + + +class DataConnectorWithAlerts(DataConnector): + """Data connector with alerts data type. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + _subtype_map = { + 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(DataConnectorWithAlerts, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'DataConnectorWithAlerts' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py new file mode 100644 index 000000000000..47e35b96e22e --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.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 .data_connector_with_alerts import DataConnectorWithAlerts + + +class MCASDataConnector(DataConnectorWithAlerts): + """Represents MCAS (Microsoft Cloud App Security) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(MCASDataConnector, self).__init__(**kwargs) + self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py new file mode 100644 index 000000000000..f7d3007b934b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_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 .data_connector_with_alerts_py3 import DataConnectorWithAlerts + + +class MCASDataConnector(DataConnectorWithAlerts): + """Represents MCAS (Microsoft Cloud App Security) data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(MCASDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py new file mode 100644 index 000000000000..d27ac1ced326 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.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 .data_connector import DataConnector + + +class OfficeDataConnector(DataConnector): + """Represents office data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnector, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.py new file mode 100644 index 000000000000..31885bab93ce --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types.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 OfficeDataConnectorDataTypes(Model): + """The available data types for office data connector. + + :param share_point: SharePoint data type connection. + :type share_point: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint + :param exchange: Exchange data type connection. + :type exchange: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange + """ + + _attribute_map = { + 'share_point': {'key': 'sharePoint', 'type': 'OfficeDataConnectorDataTypesSharePoint'}, + 'exchange': {'key': 'exchange', 'type': 'OfficeDataConnectorDataTypesExchange'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypes, self).__init__(**kwargs) + self.share_point = kwargs.get('share_point', None) + self.exchange = kwargs.get('exchange', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.py new file mode 100644 index 000000000000..0f0d4e362449 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange.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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon): + """Exchange data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypesExchange, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_py3.py new file mode 100644 index 000000000000..a538d5111466 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_exchange_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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon): + """Exchange data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypesExchange, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_py3.py new file mode 100644 index 000000000000..a0a81ab29652 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_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 OfficeDataConnectorDataTypes(Model): + """The available data types for office data connector. + + :param share_point: SharePoint data type connection. + :type share_point: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesSharePoint + :param exchange: Exchange data type connection. + :type exchange: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypesExchange + """ + + _attribute_map = { + 'share_point': {'key': 'sharePoint', 'type': 'OfficeDataConnectorDataTypesSharePoint'}, + 'exchange': {'key': 'exchange', 'type': 'OfficeDataConnectorDataTypesExchange'}, + } + + def __init__(self, *, share_point=None, exchange=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypes, self).__init__(**kwargs) + self.share_point = share_point + self.exchange = exchange diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.py new file mode 100644 index 000000000000..55dfd4350ed5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point.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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon): + """SharePoint data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OfficeDataConnectorDataTypesSharePoint, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_py3.py new file mode 100644 index 000000000000..5e12e920d2c5 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_data_types_share_point_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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon): + """SharePoint data type connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(OfficeDataConnectorDataTypesSharePoint, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py new file mode 100644 index 000000000000..7302bf453ecf --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_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 .data_connector_py3 import DataConnector + + +class OfficeDataConnector(DataConnector): + """Represents office data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(OfficeDataConnector, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 1d640838c0da..71f4acc7853b 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -31,3 +31,18 @@ class TriggerOperator(str, Enum): less_than = "LessThan" equal = "Equal" not_equal = "NotEqual" + + +class DataConnectorKind(str, Enum): + + azure_active_directory = "AzureActiveDirectory" + azure_security_center = "AzureSecurityCenter" + microsoft_cloud_app_security = "MicrosoftCloudAppSecurity" + threat_intelligence = "ThreatIntelligence" + office365 = "Office365" + + +class DataTypeState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py new file mode 100644 index 000000000000..8a5d5362da47 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.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 .data_connector import DataConnector + + +class TIDataConnector(DataConnector): + """Represents threat intelligence data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, + } + + def __init__(self, **kwargs): + super(TIDataConnector, self).__init__(**kwargs) + self.context_id = kwargs.get('context_id', None) + self.data_types = kwargs.get('data_types', None) + self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py new file mode 100644 index 000000000000..8109ed18495b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TIDataConnectorDataTypes(Model): + """The available data types for TI data connector. + + :param indicators: Data type for indicators connection. + :type indicators: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators + """ + + _attribute_map = { + 'indicators': {'key': 'indicators', 'type': 'TIDataConnectorDataTypesIndicators'}, + } + + def __init__(self, **kwargs): + super(TIDataConnectorDataTypes, self).__init__(**kwargs) + self.indicators = kwargs.get('indicators', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.py new file mode 100644 index 000000000000..6208e7113219 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators.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 .data_connector_data_type_common import DataConnectorDataTypeCommon + + +class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon): + """Data type for indicators connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TIDataConnectorDataTypesIndicators, self).__init__(**kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_py3.py new file mode 100644 index 000000000000..f53b3e0b2dfd --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_indicators_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 .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + + +class TIDataConnectorDataTypesIndicators(DataConnectorDataTypeCommon): + """Data type for indicators connection. + + :param state: Describe whether this data type connection is enabled or + not. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.securityinsight.models.DataTypeState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(TIDataConnectorDataTypesIndicators, self).__init__(state=state, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py new file mode 100644 index 000000000000..c96a8d6db3b4 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TIDataConnectorDataTypes(Model): + """The available data types for TI data connector. + + :param indicators: Data type for indicators connection. + :type indicators: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators + """ + + _attribute_map = { + 'indicators': {'key': 'indicators', 'type': 'TIDataConnectorDataTypesIndicators'}, + } + + def __init__(self, *, indicators=None, **kwargs) -> None: + super(TIDataConnectorDataTypes, self).__init__(**kwargs) + self.indicators = indicators diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py new file mode 100644 index 000000000000..3e2cb053bb05 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_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 .data_connector_py3 import DataConnector + + +class TIDataConnector(DataConnector): + """Represents threat intelligence data connector. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the data connector. + :type etag: str + :param kind: Required. Constant filled by server. + :type kind: str + :param context_id: The context id of the origin data source (Like + tenantID, SubscriptionID etc.). + :type context_id: str + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, + } + + def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + super(TIDataConnector, self).__init__(etag=etag, **kwargs) + self.context_id = context_id + self.data_types = data_types + self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py index fccf5dd12dbe..d2ed4a88c33a 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -11,8 +11,10 @@ from .operations import Operations from .alert_rules_operations import AlertRulesOperations +from .data_connectors_operations import DataConnectorsOperations __all__ = [ 'Operations', 'AlertRulesOperations', + 'DataConnectorsOperations', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py new file mode 100644 index 000000000000..408213b64719 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py @@ -0,0 +1,322 @@ +# 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 DataConnectorsOperations(object): + """DataConnectorsOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all data connectors. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 DataConnector + :rtype: + ~azure.mgmt.securityinsight.models.DataConnectorPaged[~azure.mgmt.securityinsight.models.DataConnector] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.DataConnectorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DataConnectorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, custom_headers=None, raw=False, **operation_config): + """Gets a data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_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: DataConnector or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.DataConnector 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_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('DataConnector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} + + def create( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, data_connector, custom_headers=None, raw=False, **operation_config): + """Creates or updates the data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_id: str + :param data_connector: The data connector + :type data_connector: ~azure.mgmt.securityinsight.models.DataConnector + :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: DataConnector or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.DataConnector or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_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' + 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(data_connector, 'DataConnector') + + # 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('DataConnector', response) + if response.status_code == 201: + deserialized = self._deserialize('DataConnector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, custom_headers=None, raw=False, **operation_config): + """Delete the data connector. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param data_connector_id: Connector ID + :type data_connector_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'dataConnectorId': self._serialize.url("data_connector_id", data_connector_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py index 76cf6b21f37f..b32b1e4ee1ee 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.operations import Operations from .operations.alert_rules_operations import AlertRulesOperations +from .operations.data_connectors_operations import DataConnectorsOperations from . import models @@ -60,6 +61,8 @@ class SecurityInsights(SDKClient): :vartype operations: azure.mgmt.securityinsight.operations.Operations :ivar alert_rules: AlertRules operations :vartype alert_rules: azure.mgmt.securityinsight.operations.AlertRulesOperations + :ivar data_connectors: DataConnectors operations + :vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -84,3 +87,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.alert_rules = AlertRulesOperations( self._client, self.config, self._serialize, self._deserialize) + self.data_connectors = DataConnectorsOperations( + self._client, self.config, self._serialize, self._deserialize) From 2e96558fc63c3bd7e72ffb40c5d0cd4a9c3a5759 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 13 Feb 2019 12:18:23 -0800 Subject: [PATCH 4/6] [AutoPR securityinsights/resource-manager] Adding all ASI RP APIs (#4342) * Generated from 36b0f2d1546045298331a242d98069c0e6af3c0c fixed the CloseReason x-ms-enum name * Generated from ceed8746e2edeaf5c211e6490bc89c52712b0f34 Fixing comments from PR * Generated from 04b7d638ff87ca0ade886655d1965ba363ce0dc7 Change in dataConnectors from contextId to the relevant ID * Generated from 8af921b0a21d3980f99401044c4f84d4467dc5a8 Fixing the code according to discussion. Actions will be only nested resource at the moment, so ruleId is not needed currently. Patterns will be removed so Guid will not be mandatory as parameter. ruleName will be cahanged to displayName in AlertRules * Generated from 455c9b456a849ede16da071ad6da7bb3ed0bfd4e Fixing validation error * Generated from 22bf30282758b6cd3f4ebb2bf535946a1851bec0 updating the operationIds to be more precise --- .../mgmt/securityinsight/models/__init__.py | 94 ++++- .../models/aad_data_connector.py | 13 +- .../models/aad_data_connector_py3.py | 17 +- .../securityinsight/models/account_entity.py | 99 ++++++ .../models/account_entity_py3.py | 99 ++++++ .../mgmt/securityinsight/models/action.py | 50 +++ .../securityinsight/models/action_paged.py | 27 ++ .../mgmt/securityinsight/models/action_py3.py | 50 +++ .../models/asc_data_connector.py | 14 +- .../models/asc_data_connector_py3.py | 18 +- .../mgmt/securityinsight/models/bookmark.py | 82 +++++ .../securityinsight/models/bookmark_paged.py | 27 ++ .../securityinsight/models/bookmark_py3.py | 82 +++++ .../azure/mgmt/securityinsight/models/case.py | 98 ++++++ .../mgmt/securityinsight/models/case_paged.py | 27 ++ .../mgmt/securityinsight/models/case_py3.py | 98 ++++++ .../securityinsight/models/data_connector.py | 6 +- .../models/data_connector_py3.py | 6 +- .../models/data_connector_tenant_id.py | 28 ++ .../models/data_connector_tenant_id_py3.py | 28 ++ .../data_connector_with_alerts_properties.py | 29 ++ ...ta_connector_with_alerts_properties_py3.py | 29 ++ ...ata_connector_with_alerts.py => entity.py} | 30 +- ...onnector_context_id.py => entity_kind1.py} | 14 +- .../models/entity_kind1_py3.py | 29 ++ .../securityinsight/models/entity_paged.py | 27 ++ ...ector_with_alerts_py3.py => entity_py3.py} | 32 +- .../securityinsight/models/file_entity.py | 60 ++++ .../securityinsight/models/file_entity_py3.py | 60 ++++ .../securityinsight/models/host_entity.py | 97 ++++++ .../securityinsight/models/host_entity_py3.py | 97 ++++++ .../models/mcas_data_connector.py | 13 +- .../models/mcas_data_connector_py3.py | 17 +- .../securityinsight/models/office_consent.py | 51 +++ .../models/office_consent_paged.py | 27 ++ .../models/office_consent_py3.py | 51 +++ .../models/office_data_connector.py | 9 +- .../models/office_data_connector_py3.py | 11 +- .../models/scheduled_alert_rule.py | 18 +- .../models/scheduled_alert_rule_py3.py | 20 +- .../models/security_insights_enums.py | 61 +++- .../mgmt/securityinsight/models/settings.py | 59 ++++ ...tor_context_id_py3.py => settings_kind.py} | 16 +- .../models/settings_kind_py3.py | 29 ++ .../securityinsight/models/settings_py3.py | 59 ++++ .../models/ti_data_connector.py | 9 +- .../models/ti_data_connector_data_types.py | 2 +- .../ti_data_connector_data_types_py3.py | 2 +- .../models/ti_data_connector_py3.py | 11 +- .../securityinsight/models/toggle_settings.py | 53 +++ .../models/toggle_settings_py3.py | 53 +++ .../securityinsight/models/ueba_settings.py | 68 ++++ .../models/ueba_settings_py3.py | 68 ++++ .../mgmt/securityinsight/models/user_info.py | 36 ++ .../securityinsight/models/user_info_py3.py | 36 ++ .../securityinsight/operations/__init__.py | 12 + .../operations/actions_operations.py | 116 +++++++ .../operations/alert_rules_operations.py | 236 ++++++++++++- .../operations/bookmarks_operations.py | 322 ++++++++++++++++++ .../operations/cases_operations.py | 322 ++++++++++++++++++ .../operations/data_connectors_operations.py | 6 +- .../operations/entities_operations.py | 183 ++++++++++ .../operations/office_consents_operations.py | 244 +++++++++++++ .../operations/product_settings_operations.py | 184 ++++++++++ .../mgmt/securityinsight/security_insights.py | 30 ++ 65 files changed, 3725 insertions(+), 176 deletions(-) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties_py3.py rename azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/{data_connector_with_alerts.py => entity.py} (55%) rename azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/{data_connector_context_id.py => entity_kind1.py} (64%) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_paged.py rename azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/{data_connector_with_alerts_py3.py => entity_py3.py} (53%) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_paged.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings.py rename azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/{data_connector_context_id_py3.py => settings_kind.py} (60%) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/actions_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/bookmarks_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/entities_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/office_consents_operations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index 394ab63dd677..f44962a7aeb5 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -15,9 +15,13 @@ from .alert_rule_py3 import AlertRule from .alert_rule_kind1_py3 import AlertRuleKind1 from .scheduled_alert_rule_py3 import ScheduledAlertRule + from .action_py3 import Action + from .user_info_py3 import UserInfo + from .case_py3 import Case + from .bookmark_py3 import Bookmark from .data_connector_py3 import DataConnector from .data_connector_kind1_py3 import DataConnectorKind1 - from .data_connector_context_id_py3 import DataConnectorContextId + from .data_connector_tenant_id_py3 import DataConnectorTenantId from .office_data_connector_data_types_share_point_py3 import OfficeDataConnectorDataTypesSharePoint from .office_data_connector_data_types_exchange_py3 import OfficeDataConnectorDataTypesExchange from .office_data_connector_data_types_py3 import OfficeDataConnectorDataTypes @@ -25,23 +29,37 @@ from .ti_data_connector_data_types_indicators_py3 import TIDataConnectorDataTypesIndicators from .ti_data_connector_data_types_py3 import TIDataConnectorDataTypes from .ti_data_connector_py3 import TIDataConnector + from .alerts_data_type_of_data_connector_alerts_py3 import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector_py3 import AlertsDataTypeOfDataConnector from .aad_data_connector_py3 import AADDataConnector from .asc_data_connector_py3 import ASCDataConnector from .mcas_data_connector_py3 import MCASDataConnector - from .alerts_data_type_of_data_connector_alerts_py3 import AlertsDataTypeOfDataConnectorAlerts - from .alerts_data_type_of_data_connector_py3 import AlertsDataTypeOfDataConnector - from .data_connector_with_alerts_py3 import DataConnectorWithAlerts + from .data_connector_with_alerts_properties_py3 import DataConnectorWithAlertsProperties from .data_connector_data_type_common_py3 import DataConnectorDataTypeCommon + from .entity_py3 import Entity + from .entity_kind1_py3 import EntityKind1 + from .account_entity_py3 import AccountEntity + from .host_entity_py3 import HostEntity + from .file_entity_py3 import FileEntity + from .office_consent_py3 import OfficeConsent from .resource_py3 import Resource + from .settings_py3 import Settings + from .settings_kind_py3 import SettingsKind + from .ueba_settings_py3 import UebaSettings + from .toggle_settings_py3 import ToggleSettings except (SyntaxError, ImportError): from .operation_display import OperationDisplay from .operation import Operation from .alert_rule import AlertRule from .alert_rule_kind1 import AlertRuleKind1 from .scheduled_alert_rule import ScheduledAlertRule + from .action import Action + from .user_info import UserInfo + from .case import Case + from .bookmark import Bookmark from .data_connector import DataConnector from .data_connector_kind1 import DataConnectorKind1 - from .data_connector_context_id import DataConnectorContextId + from .data_connector_tenant_id import DataConnectorTenantId from .office_data_connector_data_types_share_point import OfficeDataConnectorDataTypesSharePoint from .office_data_connector_data_types_exchange import OfficeDataConnectorDataTypesExchange from .office_data_connector_data_types import OfficeDataConnectorDataTypes @@ -49,23 +67,45 @@ from .ti_data_connector_data_types_indicators import TIDataConnectorDataTypesIndicators from .ti_data_connector_data_types import TIDataConnectorDataTypes from .ti_data_connector import TIDataConnector + from .alerts_data_type_of_data_connector_alerts import AlertsDataTypeOfDataConnectorAlerts + from .alerts_data_type_of_data_connector import AlertsDataTypeOfDataConnector from .aad_data_connector import AADDataConnector from .asc_data_connector import ASCDataConnector from .mcas_data_connector import MCASDataConnector - from .alerts_data_type_of_data_connector_alerts import AlertsDataTypeOfDataConnectorAlerts - from .alerts_data_type_of_data_connector import AlertsDataTypeOfDataConnector - from .data_connector_with_alerts import DataConnectorWithAlerts + from .data_connector_with_alerts_properties import DataConnectorWithAlertsProperties from .data_connector_data_type_common import DataConnectorDataTypeCommon + from .entity import Entity + from .entity_kind1 import EntityKind1 + from .account_entity import AccountEntity + from .host_entity import HostEntity + from .file_entity import FileEntity + from .office_consent import OfficeConsent from .resource import Resource + from .settings import Settings + from .settings_kind import SettingsKind + from .ueba_settings import UebaSettings + from .toggle_settings import ToggleSettings from .operation_paged import OperationPaged from .alert_rule_paged import AlertRulePaged +from .action_paged import ActionPaged +from .case_paged import CasePaged +from .bookmark_paged import BookmarkPaged from .data_connector_paged import DataConnectorPaged +from .entity_paged import EntityPaged +from .office_consent_paged import OfficeConsentPaged from .security_insights_enums import ( AlertRuleKind, - Severity, + AlertSeverity, TriggerOperator, + CaseSeverity, + CaseStatus, + CloseReason, DataConnectorKind, DataTypeState, + EntityKind, + OSFamily, + SettingKind, + StatusInMcas, ) __all__ = [ @@ -74,9 +114,13 @@ 'AlertRule', 'AlertRuleKind1', 'ScheduledAlertRule', + 'Action', + 'UserInfo', + 'Case', + 'Bookmark', 'DataConnector', 'DataConnectorKind1', - 'DataConnectorContextId', + 'DataConnectorTenantId', 'OfficeDataConnectorDataTypesSharePoint', 'OfficeDataConnectorDataTypesExchange', 'OfficeDataConnectorDataTypes', @@ -84,20 +128,42 @@ 'TIDataConnectorDataTypesIndicators', 'TIDataConnectorDataTypes', 'TIDataConnector', + 'AlertsDataTypeOfDataConnectorAlerts', + 'AlertsDataTypeOfDataConnector', 'AADDataConnector', 'ASCDataConnector', 'MCASDataConnector', - 'AlertsDataTypeOfDataConnectorAlerts', - 'AlertsDataTypeOfDataConnector', - 'DataConnectorWithAlerts', + 'DataConnectorWithAlertsProperties', 'DataConnectorDataTypeCommon', + 'Entity', + 'EntityKind1', + 'AccountEntity', + 'HostEntity', + 'FileEntity', + 'OfficeConsent', 'Resource', + 'Settings', + 'SettingsKind', + 'UebaSettings', + 'ToggleSettings', 'OperationPaged', 'AlertRulePaged', + 'ActionPaged', + 'CasePaged', + 'BookmarkPaged', 'DataConnectorPaged', + 'EntityPaged', + 'OfficeConsentPaged', 'AlertRuleKind', - 'Severity', + 'AlertSeverity', 'TriggerOperator', + 'CaseSeverity', + 'CaseStatus', + 'CloseReason', 'DataConnectorKind', 'DataTypeState', + 'EntityKind', + 'OSFamily', + 'SettingKind', + 'StatusInMcas', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py index 0af5abc053ab..d4e920262e9c 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts import DataConnectorWithAlerts +from .data_connector import DataConnector -class AADDataConnector(DataConnectorWithAlerts): +class AADDataConnector(DataConnector): """Represents AAD (Azure Active Directory) data connector. Variables are only populated by the server, and will be ignored when @@ -30,9 +30,8 @@ class AADDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector @@ -51,10 +50,12 @@ class AADDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } def __init__(self, **kwargs): super(AADDataConnector, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.data_types = kwargs.get('data_types', None) self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py index 2d2a0a618e3b..c0b906524928 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aad_data_connector_py3.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts_py3 import DataConnectorWithAlerts +from .data_connector_py3 import DataConnector -class AADDataConnector(DataConnectorWithAlerts): +class AADDataConnector(DataConnector): """Represents AAD (Azure Active Directory) data connector. Variables are only populated by the server, and will be ignored when @@ -30,9 +30,8 @@ class AADDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector @@ -51,10 +50,12 @@ class AADDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: - super(AADDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + def __init__(self, *, etag: str=None, tenant_id: str=None, data_types=None, **kwargs) -> None: + super(AADDataConnector, self).__init__(etag=etag, **kwargs) + self.tenant_id = tenant_id + self.data_types = data_types self.kind = 'AzureActiveDirectory' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py new file mode 100644 index 000000000000..89c273d5013e --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py @@ -0,0 +1,99 @@ +# 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 .entity import Entity + + +class AccountEntity(Entity): + """Represents an account entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar account_name: The name of the account. This field should hold only + the name without any domain added to it, i.e. administrator. + :vartype account_name: str + :ivar nt_domain: The NETBIOS domain name as it appears in the alert format + – domain\\username. Examples: NT AUTHORITY. + :vartype nt_domain: str + :ivar upn_suffix: The user principal name suffix for the account, in some + cases it is also the domain name. Examples: contoso.com. + :vartype upn_suffix: str + :ivar sid: The account security identifier, e.g. S-1-5-18. + :vartype sid: str + :ivar aad_tenant_id: The Azure Active Directory tenant id. + :vartype aad_tenant_id: str + :ivar aad_user_id: The Azure Active Directory user id. + :vartype aad_user_id: str + :ivar puid: The Azure Active Directory Passport User ID. + :vartype puid: str + :ivar is_domain_joined: Determines whether this is a domain account. + :vartype is_domain_joined: bool + :ivar object_guid: The objectGUID attribute is a single-value attribute + that is the unique identifier for the object, assigned by active + directory. + :vartype object_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'readonly': True}, + 'nt_domain': {'readonly': True}, + 'upn_suffix': {'readonly': True}, + 'sid': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'aad_user_id': {'readonly': True}, + 'puid': {'readonly': True}, + 'is_domain_joined': {'readonly': True}, + 'object_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'nt_domain': {'key': 'properties.ntDomain', 'type': 'str'}, + 'upn_suffix': {'key': 'properties.upnSuffix', 'type': 'str'}, + 'sid': {'key': 'properties.sid', 'type': 'str'}, + 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'aad_user_id': {'key': 'properties.aadUserId', 'type': 'str'}, + 'puid': {'key': 'properties.puid', 'type': 'str'}, + 'is_domain_joined': {'key': 'properties.isDomainJoined', 'type': 'bool'}, + 'object_guid': {'key': 'properties.objectGuid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountEntity, self).__init__(**kwargs) + self.account_name = None + self.nt_domain = None + self.upn_suffix = None + self.sid = None + self.aad_tenant_id = None + self.aad_user_id = None + self.puid = None + self.is_domain_joined = None + self.object_guid = None + self.kind = 'Account' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py new file mode 100644 index 000000000000..ec5e903ae655 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py @@ -0,0 +1,99 @@ +# 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 .entity_py3 import Entity + + +class AccountEntity(Entity): + """Represents an account entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar account_name: The name of the account. This field should hold only + the name without any domain added to it, i.e. administrator. + :vartype account_name: str + :ivar nt_domain: The NETBIOS domain name as it appears in the alert format + – domain\\username. Examples: NT AUTHORITY. + :vartype nt_domain: str + :ivar upn_suffix: The user principal name suffix for the account, in some + cases it is also the domain name. Examples: contoso.com. + :vartype upn_suffix: str + :ivar sid: The account security identifier, e.g. S-1-5-18. + :vartype sid: str + :ivar aad_tenant_id: The Azure Active Directory tenant id. + :vartype aad_tenant_id: str + :ivar aad_user_id: The Azure Active Directory user id. + :vartype aad_user_id: str + :ivar puid: The Azure Active Directory Passport User ID. + :vartype puid: str + :ivar is_domain_joined: Determines whether this is a domain account. + :vartype is_domain_joined: bool + :ivar object_guid: The objectGUID attribute is a single-value attribute + that is the unique identifier for the object, assigned by active + directory. + :vartype object_guid: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'readonly': True}, + 'nt_domain': {'readonly': True}, + 'upn_suffix': {'readonly': True}, + 'sid': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'aad_user_id': {'readonly': True}, + 'puid': {'readonly': True}, + 'is_domain_joined': {'readonly': True}, + 'object_guid': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'nt_domain': {'key': 'properties.ntDomain', 'type': 'str'}, + 'upn_suffix': {'key': 'properties.upnSuffix', 'type': 'str'}, + 'sid': {'key': 'properties.sid', 'type': 'str'}, + 'aad_tenant_id': {'key': 'properties.aadTenantId', 'type': 'str'}, + 'aad_user_id': {'key': 'properties.aadUserId', 'type': 'str'}, + 'puid': {'key': 'properties.puid', 'type': 'str'}, + 'is_domain_joined': {'key': 'properties.isDomainJoined', 'type': 'bool'}, + 'object_guid': {'key': 'properties.objectGuid', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccountEntity, self).__init__(**kwargs) + self.account_name = None + self.nt_domain = None + self.upn_suffix = None + self.sid = None + self.aad_tenant_id = None + self.aad_user_id = None + self.puid = None + self.is_domain_joined = None + self.object_guid = None + self.kind = 'Account' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action.py new file mode 100644 index 000000000000..496358cee439 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Action(Resource): + """Action for alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the action. + :type etag: str + :param trigger_uri: The uri for the action to trigger. + :type trigger_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'trigger_uri': {'key': 'properties.triggerUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.trigger_uri = kwargs.get('trigger_uri', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_paged.py new file mode 100644 index 000000000000..2aff45e3393b --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_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 ActionPaged(Paged): + """ + A paging container for iterating over a list of :class:`Action ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Action]'} + } + + def __init__(self, *args, **kwargs): + + super(ActionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_py3.py new file mode 100644 index 000000000000..33cccb5190d6 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/action_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Action(Resource): + """Action for alert rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the action. + :type etag: str + :param trigger_uri: The uri for the action to trigger. + :type trigger_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'trigger_uri': {'key': 'properties.triggerUri', 'type': 'str'}, + } + + def __init__(self, *, etag: str=None, trigger_uri: str=None, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.etag = etag + self.trigger_uri = trigger_uri diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py index 326c886fe8b6..ef5c6c670e74 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts import DataConnectorWithAlerts +from .data_connector import DataConnector -class ASCDataConnector(DataConnectorWithAlerts): +class ASCDataConnector(DataConnector): """Represents ASC (Azure Security Center) data connector. Variables are only populated by the server, and will be ignored when @@ -30,12 +30,12 @@ class ASCDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + :param subscription_id: The subscription id to connect to, and get the + data from. + :type subscription_id: str """ _validation = { @@ -51,10 +51,12 @@ class ASCDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, } def __init__(self, **kwargs): super(ASCDataConnector, self).__init__(**kwargs) + self.data_types = kwargs.get('data_types', None) + self.subscription_id = kwargs.get('subscription_id', None) self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py index c74146245a1d..c0dcbae59d36 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/asc_data_connector_py3.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts_py3 import DataConnectorWithAlerts +from .data_connector_py3 import DataConnector -class ASCDataConnector(DataConnectorWithAlerts): +class ASCDataConnector(DataConnector): """Represents ASC (Azure Security Center) data connector. Variables are only populated by the server, and will be ignored when @@ -30,12 +30,12 @@ class ASCDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + :param subscription_id: The subscription id to connect to, and get the + data from. + :type subscription_id: str """ _validation = { @@ -51,10 +51,12 @@ class ASCDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: - super(ASCDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + def __init__(self, *, etag: str=None, data_types=None, subscription_id: str=None, **kwargs) -> None: + super(ASCDataConnector, self).__init__(etag=etag, **kwargs) + self.data_types = data_types + self.subscription_id = subscription_id self.kind = 'AzureSecurityCenter' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark.py new file mode 100644 index 000000000000..58230219559e --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark.py @@ -0,0 +1,82 @@ +# 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 Bookmark(Resource): + """Represents a bookmark in Azure Security Insights. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the bookmark. + :type etag: str + :param display_name: Required. The display name of the bookmark + :type display_name: str + :param last_updated_time_utc: The last time the bookmark was updated + :type last_updated_time_utc: datetime + :param created_time_utc: The time the bookmark was created + :type created_time_utc: datetime + :param created_by: Describes a user that created the bookmark + :type created_by: ~azure.mgmt.securityinsight.models.UserInfo + :param updated_by: Describes a user that updated the bookmark + :type updated_by: ~azure.mgmt.securityinsight.models.UserInfo + :param notes: The notes of the bookmark + :type notes: str + :param labels: List of labels relevant to this bookmark + :type labels: list[str] + :param query: Required. The query of the bookmark. + :type query: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'required': True}, + 'query': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'last_updated_time_utc': {'key': 'properties.lastUpdatedTimeUtc', 'type': 'iso-8601'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'UserInfo'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'UserInfo'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'query': {'key': 'properties.query', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Bookmark, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.display_name = kwargs.get('display_name', None) + self.last_updated_time_utc = kwargs.get('last_updated_time_utc', None) + self.created_time_utc = kwargs.get('created_time_utc', None) + self.created_by = kwargs.get('created_by', None) + self.updated_by = kwargs.get('updated_by', None) + self.notes = kwargs.get('notes', None) + self.labels = kwargs.get('labels', None) + self.query = kwargs.get('query', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_paged.py new file mode 100644 index 000000000000..cc150beecede --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_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 BookmarkPaged(Paged): + """ + A paging container for iterating over a list of :class:`Bookmark ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Bookmark]'} + } + + def __init__(self, *args, **kwargs): + + super(BookmarkPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_py3.py new file mode 100644 index 000000000000..c051b561db38 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/bookmark_py3.py @@ -0,0 +1,82 @@ +# 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 Bookmark(Resource): + """Represents a bookmark in Azure Security Insights. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the bookmark. + :type etag: str + :param display_name: Required. The display name of the bookmark + :type display_name: str + :param last_updated_time_utc: The last time the bookmark was updated + :type last_updated_time_utc: datetime + :param created_time_utc: The time the bookmark was created + :type created_time_utc: datetime + :param created_by: Describes a user that created the bookmark + :type created_by: ~azure.mgmt.securityinsight.models.UserInfo + :param updated_by: Describes a user that updated the bookmark + :type updated_by: ~azure.mgmt.securityinsight.models.UserInfo + :param notes: The notes of the bookmark + :type notes: str + :param labels: List of labels relevant to this bookmark + :type labels: list[str] + :param query: Required. The query of the bookmark. + :type query: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'required': True}, + 'query': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'last_updated_time_utc': {'key': 'properties.lastUpdatedTimeUtc', 'type': 'iso-8601'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'UserInfo'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'UserInfo'}, + 'notes': {'key': 'properties.notes', 'type': 'str'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'query': {'key': 'properties.query', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, query: str, etag: str=None, last_updated_time_utc=None, created_time_utc=None, created_by=None, updated_by=None, notes: str=None, labels=None, **kwargs) -> None: + super(Bookmark, self).__init__(**kwargs) + self.etag = etag + self.display_name = display_name + self.last_updated_time_utc = last_updated_time_utc + self.created_time_utc = created_time_utc + self.created_by = created_by + self.updated_by = updated_by + self.notes = notes + self.labels = labels + self.query = query diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py new file mode 100644 index 000000000000..11c77bf387cb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Case(Resource): + """Represents a case in Azure Security Insights. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param last_updated_time_utc: The last time the case was updated + :type last_updated_time_utc: datetime + :param created_time_utc: The time the case was created + :type created_time_utc: datetime + :param end_time_utc: The end time of the case + :type end_time_utc: datetime + :param start_time_utc: The start time of the case + :type start_time_utc: datetime + :param labels: List of labels relevant to this case + :type labels: list[str] + :param description: The description of the case + :type description: str + :param title: Required. The title of the case + :type title: str + :param assigned_to: Describes a user that the case is assigned to + :type assigned_to: ~azure.mgmt.securityinsight.models.UserInfo + :param severity: Required. The severity of the case. Possible values + include: 'Critical', 'High', 'Medium', 'Low', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.CaseSeverity + :param status: Required. The status of the case. Possible values include: + 'Draft', 'Open', 'InProgress', 'Closed' + :type status: str or ~azure.mgmt.securityinsight.models.CaseStatus + :param close_reason: The reason the case was closed. Possible values + include: 'Resolved', 'Dismissed', 'Other' + :type close_reason: str or ~azure.mgmt.securityinsight.models.CloseReason + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'title': {'required': True}, + 'severity': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_updated_time_utc': {'key': 'properties.lastUpdatedTimeUtc', 'type': 'iso-8601'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'iso-8601'}, + 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'assigned_to': {'key': 'properties.assignedTo', 'type': 'UserInfo'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'close_reason': {'key': 'properties.closeReason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Case, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.last_updated_time_utc = kwargs.get('last_updated_time_utc', None) + self.created_time_utc = kwargs.get('created_time_utc', None) + self.end_time_utc = kwargs.get('end_time_utc', None) + self.start_time_utc = kwargs.get('start_time_utc', None) + self.labels = kwargs.get('labels', None) + self.description = kwargs.get('description', None) + self.title = kwargs.get('title', None) + self.assigned_to = kwargs.get('assigned_to', None) + self.severity = kwargs.get('severity', None) + self.status = kwargs.get('status', None) + self.close_reason = kwargs.get('close_reason', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_paged.py new file mode 100644 index 000000000000..bf2bf64e9a7f --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_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 CasePaged(Paged): + """ + A paging container for iterating over a list of :class:`Case ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Case]'} + } + + def __init__(self, *args, **kwargs): + + super(CasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py new file mode 100644 index 000000000000..f76402bae134 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class Case(Resource): + """Represents a case in Azure Security Insights. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param etag: Etag of the alert rule. + :type etag: str + :param last_updated_time_utc: The last time the case was updated + :type last_updated_time_utc: datetime + :param created_time_utc: The time the case was created + :type created_time_utc: datetime + :param end_time_utc: The end time of the case + :type end_time_utc: datetime + :param start_time_utc: The start time of the case + :type start_time_utc: datetime + :param labels: List of labels relevant to this case + :type labels: list[str] + :param description: The description of the case + :type description: str + :param title: Required. The title of the case + :type title: str + :param assigned_to: Describes a user that the case is assigned to + :type assigned_to: ~azure.mgmt.securityinsight.models.UserInfo + :param severity: Required. The severity of the case. Possible values + include: 'Critical', 'High', 'Medium', 'Low', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.CaseSeverity + :param status: Required. The status of the case. Possible values include: + 'Draft', 'Open', 'InProgress', 'Closed' + :type status: str or ~azure.mgmt.securityinsight.models.CaseStatus + :param close_reason: The reason the case was closed. Possible values + include: 'Resolved', 'Dismissed', 'Other' + :type close_reason: str or ~azure.mgmt.securityinsight.models.CloseReason + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'title': {'required': True}, + 'severity': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_updated_time_utc': {'key': 'properties.lastUpdatedTimeUtc', 'type': 'iso-8601'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'end_time_utc': {'key': 'properties.endTimeUtc', 'type': 'iso-8601'}, + 'start_time_utc': {'key': 'properties.startTimeUtc', 'type': 'iso-8601'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'assigned_to': {'key': 'properties.assignedTo', 'type': 'UserInfo'}, + 'severity': {'key': 'properties.severity', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'close_reason': {'key': 'properties.closeReason', 'type': 'str'}, + } + + def __init__(self, *, title: str, severity, status, etag: str=None, last_updated_time_utc=None, created_time_utc=None, end_time_utc=None, start_time_utc=None, labels=None, description: str=None, assigned_to=None, close_reason=None, **kwargs) -> None: + super(Case, self).__init__(**kwargs) + self.etag = etag + self.last_updated_time_utc = last_updated_time_utc + self.created_time_utc = created_time_utc + self.end_time_utc = end_time_utc + self.start_time_utc = start_time_utc + self.labels = labels + self.description = description + self.title = title + self.assigned_to = assigned_to + self.severity = severity + self.status = status + self.close_reason = close_reason diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py index d6c8634a338d..c07a06bee266 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector.py @@ -16,8 +16,8 @@ class DataConnector(Model): """Data connector. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OfficeDataConnector, TIDataConnector, - DataConnectorWithAlerts + sub-classes are: OfficeDataConnector, TIDataConnector, AADDataConnector, + ASCDataConnector, MCASDataConnector Variables are only populated by the server, and will be ignored when sending a request. @@ -52,7 +52,7 @@ class DataConnector(Model): } _subtype_map = { - 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py index 8b8782ff6de5..bbbcd62d3065 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_py3.py @@ -16,8 +16,8 @@ class DataConnector(Model): """Data connector. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: OfficeDataConnector, TIDataConnector, - DataConnectorWithAlerts + sub-classes are: OfficeDataConnector, TIDataConnector, AADDataConnector, + ASCDataConnector, MCASDataConnector Variables are only populated by the server, and will be ignored when sending a request. @@ -52,7 +52,7 @@ class DataConnector(Model): } _subtype_map = { - 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'DataConnectorWithAlerts': 'DataConnectorWithAlerts'} + 'kind': {'Office365': 'OfficeDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} } def __init__(self, *, etag: str=None, **kwargs) -> None: diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id.py new file mode 100644 index 000000000000..66b07808b6aa --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id.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 DataConnectorTenantId(Model): + """Properties data connector on tenant level. + + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataConnectorTenantId, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id_py3.py new file mode 100644 index 000000000000..27997416eb33 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_tenant_id_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 DataConnectorTenantId(Model): + """Properties data connector on tenant level. + + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, **kwargs) -> None: + super(DataConnectorTenantId, self).__init__(**kwargs) + self.tenant_id = tenant_id diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties.py new file mode 100644 index 000000000000..a38001750f3f --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorWithAlertsProperties(Model): + """Data connector properties. + + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _attribute_map = { + 'data_types': {'key': 'dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, **kwargs): + super(DataConnectorWithAlertsProperties, self).__init__(**kwargs) + self.data_types = kwargs.get('data_types', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties_py3.py new file mode 100644 index 000000000000..e2234f75d9b3 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_properties_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DataConnectorWithAlertsProperties(Model): + """Data connector properties. + + :param data_types: The available data types for the connector. + :type data_types: + ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector + """ + + _attribute_map = { + 'data_types': {'key': 'dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, + } + + def __init__(self, *, data_types=None, **kwargs) -> None: + super(DataConnectorWithAlertsProperties, self).__init__(**kwargs) + self.data_types = data_types diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity.py similarity index 55% rename from azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py rename to azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity.py index 1b35258799b1..6ff63f9545c4 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity.py @@ -9,14 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector import DataConnector +from msrest.serialization import Model -class DataConnectorWithAlerts(DataConnector): - """Data connector with alerts data type. +class Entity(Model): + """Specific entity. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + sub-classes are: AccountEntity, HostEntity, FileEntity Variables are only populated by the server, and will be ignored when sending a request. @@ -29,16 +29,8 @@ class DataConnectorWithAlerts(DataConnector): :vartype type: str :ivar name: Azure resource name :vartype name: str - :param etag: Etag of the data connector. - :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str - :param data_types: The available data types for the connector. - :type data_types: - ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector """ _validation = { @@ -52,18 +44,16 @@ class DataConnectorWithAlerts(DataConnector): 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, - 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } _subtype_map = { - 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + 'kind': {'Account': 'AccountEntity', 'Host': 'HostEntity', 'File': 'FileEntity'} } def __init__(self, **kwargs): - super(DataConnectorWithAlerts, self).__init__(**kwargs) - self.context_id = kwargs.get('context_id', None) - self.data_types = kwargs.get('data_types', None) - self.kind = 'DataConnectorWithAlerts' + super(Entity, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1.py similarity index 64% rename from azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py rename to azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1.py index 593f5cddcfe5..ba90815c9d83 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1.py @@ -12,18 +12,18 @@ from msrest.serialization import Model -class DataConnectorContextId(Model): +class EntityKind1(Model): """Describes an Azure resource with kind. - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param kind: The kind of the entity. Possible values include: 'Account', + 'Host', 'File' + :type kind: str or ~azure.mgmt.securityinsight.models.EntityKind """ _attribute_map = { - 'context_id': {'key': 'contextId', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, } def __init__(self, **kwargs): - super(DataConnectorContextId, self).__init__(**kwargs) - self.context_id = kwargs.get('context_id', None) + super(EntityKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1_py3.py new file mode 100644 index 000000000000..f318be914961 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_kind1_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EntityKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the entity. Possible values include: 'Account', + 'Host', 'File' + :type kind: str or ~azure.mgmt.securityinsight.models.EntityKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(EntityKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_paged.py new file mode 100644 index 000000000000..1cc3027ddd60 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_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 EntityPaged(Paged): + """ + A paging container for iterating over a list of :class:`Entity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Entity]'} + } + + def __init__(self, *args, **kwargs): + + super(EntityPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_py3.py similarity index 53% rename from azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py rename to azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_py3.py index 962cae013763..a3dae2ccad17 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_with_alerts_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/entity_py3.py @@ -9,14 +9,14 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_py3 import DataConnector +from msrest.serialization import Model -class DataConnectorWithAlerts(DataConnector): - """Data connector with alerts data type. +class Entity(Model): + """Specific entity. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AADDataConnector, ASCDataConnector, MCASDataConnector + sub-classes are: AccountEntity, HostEntity, FileEntity Variables are only populated by the server, and will be ignored when sending a request. @@ -29,16 +29,8 @@ class DataConnectorWithAlerts(DataConnector): :vartype type: str :ivar name: Azure resource name :vartype name: str - :param etag: Etag of the data connector. - :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str - :param data_types: The available data types for the connector. - :type data_types: - ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector """ _validation = { @@ -52,18 +44,16 @@ class DataConnectorWithAlerts(DataConnector): 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, - 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } _subtype_map = { - 'kind': {'AzureActiveDirectory': 'AADDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector'} + 'kind': {'Account': 'AccountEntity', 'Host': 'HostEntity', 'File': 'FileEntity'} } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: - super(DataConnectorWithAlerts, self).__init__(etag=etag, **kwargs) - self.context_id = context_id - self.data_types = data_types - self.kind = 'DataConnectorWithAlerts' + def __init__(self, **kwargs) -> None: + super(Entity, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity.py new file mode 100644 index 000000000000..a05b2798f09e --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity.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 .entity import Entity + + +class FileEntity(Entity): + """Represents a file entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar directory: The full path to the file. + :vartype directory: str + :ivar file_name: The file name without path (some alerts might not include + path). + :vartype file_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'directory': {'readonly': True}, + 'file_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FileEntity, self).__init__(**kwargs) + self.directory = None + self.file_name = None + self.kind = 'File' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity_py3.py new file mode 100644 index 000000000000..c60c5da36071 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/file_entity_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 .entity_py3 import Entity + + +class FileEntity(Entity): + """Represents a file entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar directory: The full path to the file. + :vartype directory: str + :ivar file_name: The file name without path (some alerts might not include + path). + :vartype file_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'directory': {'readonly': True}, + 'file_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(FileEntity, self).__init__(**kwargs) + self.directory = None + self.file_name = None + self.kind = 'File' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py new file mode 100644 index 000000000000..550383353480 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py @@ -0,0 +1,97 @@ +# 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 .entity import Entity + + +class HostEntity(Entity): + """Represents a host entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar dns_domain: The DNS domain that this host belongs to. Should contain + the compete DNS suffix for the domain + :vartype dns_domain: str + :ivar nt_domain: The NT domain that this host belongs to. + :vartype nt_domain: str + :ivar host_name: The hostname without the domain suffix. + :vartype host_name: str + :ivar net_bios_name: The host name (pre-windows2000). + :vartype net_bios_name: str + :ivar azure_id: The azure resource id of the VM. + :vartype azure_id: str + :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed. + :vartype oms_agent_id: str + :param os_family: The operartion system type. Possible values include: + 'Linux', 'Windows', 'Android', 'IOS' + :type os_family: str or ~azure.mgmt.securityinsight.models.OSFamily + :ivar os_version: A free text representation of the operating system. This + field is meant to hold specific versions the are more fine grained than + OSFamily or future values not supported by OSFamily enumeration + :vartype os_version: str + :ivar is_domain_joined: Determines whether this host belongs to a domain. + :vartype is_domain_joined: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'dns_domain': {'readonly': True}, + 'nt_domain': {'readonly': True}, + 'host_name': {'readonly': True}, + 'net_bios_name': {'readonly': True}, + 'azure_id': {'readonly': True}, + 'oms_agent_id': {'readonly': True}, + 'os_version': {'readonly': True}, + 'is_domain_joined': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'dns_domain': {'key': 'properties.dnsDomain', 'type': 'str'}, + 'nt_domain': {'key': 'properties.ntDomain', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'net_bios_name': {'key': 'properties.netBiosName', 'type': 'str'}, + 'azure_id': {'key': 'properties.azureID', 'type': 'str'}, + 'oms_agent_id': {'key': 'properties.omsAgentID', 'type': 'str'}, + 'os_family': {'key': 'properties.osFamily', 'type': 'OSFamily'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'is_domain_joined': {'key': 'properties.isDomainJoined', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(HostEntity, self).__init__(**kwargs) + self.dns_domain = None + self.nt_domain = None + self.host_name = None + self.net_bios_name = None + self.azure_id = None + self.oms_agent_id = None + self.os_family = kwargs.get('os_family', None) + self.os_version = None + self.is_domain_joined = None + self.kind = 'Host' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py new file mode 100644 index 000000000000..75dd6e81efdb --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py @@ -0,0 +1,97 @@ +# 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 .entity_py3 import Entity + + +class HostEntity(Entity): + """Represents a host entity. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar dns_domain: The DNS domain that this host belongs to. Should contain + the compete DNS suffix for the domain + :vartype dns_domain: str + :ivar nt_domain: The NT domain that this host belongs to. + :vartype nt_domain: str + :ivar host_name: The hostname without the domain suffix. + :vartype host_name: str + :ivar net_bios_name: The host name (pre-windows2000). + :vartype net_bios_name: str + :ivar azure_id: The azure resource id of the VM. + :vartype azure_id: str + :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed. + :vartype oms_agent_id: str + :param os_family: The operartion system type. Possible values include: + 'Linux', 'Windows', 'Android', 'IOS' + :type os_family: str or ~azure.mgmt.securityinsight.models.OSFamily + :ivar os_version: A free text representation of the operating system. This + field is meant to hold specific versions the are more fine grained than + OSFamily or future values not supported by OSFamily enumeration + :vartype os_version: str + :ivar is_domain_joined: Determines whether this host belongs to a domain. + :vartype is_domain_joined: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'dns_domain': {'readonly': True}, + 'nt_domain': {'readonly': True}, + 'host_name': {'readonly': True}, + 'net_bios_name': {'readonly': True}, + 'azure_id': {'readonly': True}, + 'oms_agent_id': {'readonly': True}, + 'os_version': {'readonly': True}, + 'is_domain_joined': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'dns_domain': {'key': 'properties.dnsDomain', 'type': 'str'}, + 'nt_domain': {'key': 'properties.ntDomain', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'net_bios_name': {'key': 'properties.netBiosName', 'type': 'str'}, + 'azure_id': {'key': 'properties.azureID', 'type': 'str'}, + 'oms_agent_id': {'key': 'properties.omsAgentID', 'type': 'str'}, + 'os_family': {'key': 'properties.osFamily', 'type': 'OSFamily'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'is_domain_joined': {'key': 'properties.isDomainJoined', 'type': 'bool'}, + } + + def __init__(self, *, os_family=None, **kwargs) -> None: + super(HostEntity, self).__init__(**kwargs) + self.dns_domain = None + self.nt_domain = None + self.host_name = None + self.net_bios_name = None + self.azure_id = None + self.oms_agent_id = None + self.os_family = os_family + self.os_version = None + self.is_domain_joined = None + self.kind = 'Host' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py index 47e35b96e22e..e8f33ade4645 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts import DataConnectorWithAlerts +from .data_connector import DataConnector -class MCASDataConnector(DataConnectorWithAlerts): +class MCASDataConnector(DataConnector): """Represents MCAS (Microsoft Cloud App Security) data connector. Variables are only populated by the server, and will be ignored when @@ -30,9 +30,8 @@ class MCASDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector @@ -51,10 +50,12 @@ class MCASDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } def __init__(self, **kwargs): super(MCASDataConnector, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.data_types = kwargs.get('data_types', None) self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py index f7d3007b934b..8738d0607686 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/mcas_data_connector_py3.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .data_connector_with_alerts_py3 import DataConnectorWithAlerts +from .data_connector_py3 import DataConnector -class MCASDataConnector(DataConnectorWithAlerts): +class MCASDataConnector(DataConnector): """Represents MCAS (Microsoft Cloud App Security) data connector. Variables are only populated by the server, and will be ignored when @@ -30,9 +30,8 @@ class MCASDataConnector(DataConnectorWithAlerts): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector @@ -51,10 +50,12 @@ class MCASDataConnector(DataConnectorWithAlerts): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'AlertsDataTypeOfDataConnector'}, } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: - super(MCASDataConnector, self).__init__(etag=etag, context_id=context_id, data_types=data_types, **kwargs) + def __init__(self, *, etag: str=None, tenant_id: str=None, data_types=None, **kwargs) -> None: + super(MCASDataConnector, self).__init__(etag=etag, **kwargs) + self.tenant_id = tenant_id + self.data_types = data_types self.kind = 'MicrosoftCloudAppSecurity' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py new file mode 100644 index 000000000000..bea49f793ea6 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.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 OfficeConsent(Resource): + """Consent for Office365 tenant that already made. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param tenant_id: The tenantId of the Office365 with the concesnt. + :type tenant_id: str + :ivar tenant_name: The tenant name of the Office365 with the concesnt. + :vartype tenant_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OfficeConsent, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.tenant_name = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_paged.py new file mode 100644 index 000000000000..18a2869e7abf --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_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 OfficeConsentPaged(Paged): + """ + A paging container for iterating over a list of :class:`OfficeConsent ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OfficeConsent]'} + } + + def __init__(self, *args, **kwargs): + + super(OfficeConsentPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py new file mode 100644 index 000000000000..4feb93636e8f --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_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 OfficeConsent(Resource): + """Consent for Office365 tenant that already made. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param tenant_id: The tenantId of the Office365 with the concesnt. + :type tenant_id: str + :ivar tenant_name: The tenant name of the Office365 with the concesnt. + :vartype tenant_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + } + + def __init__(self, *, tenant_id: str=None, **kwargs) -> None: + super(OfficeConsent, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.tenant_name = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py index d27ac1ced326..44559f2536b2 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector.py @@ -30,9 +30,8 @@ class OfficeDataConnector(DataConnector): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes @@ -51,12 +50,12 @@ class OfficeDataConnector(DataConnector): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, } def __init__(self, **kwargs): super(OfficeDataConnector, self).__init__(**kwargs) - self.context_id = kwargs.get('context_id', None) + self.tenant_id = kwargs.get('tenant_id', None) self.data_types = kwargs.get('data_types', None) self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py index 7302bf453ecf..0b8369ad7727 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_data_connector_py3.py @@ -30,9 +30,8 @@ class OfficeDataConnector(DataConnector): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes @@ -51,12 +50,12 @@ class OfficeDataConnector(DataConnector): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'OfficeDataConnectorDataTypes'}, } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + def __init__(self, *, etag: str=None, tenant_id: str=None, data_types=None, **kwargs) -> None: super(OfficeDataConnector, self).__init__(etag=etag, **kwargs) - self.context_id = context_id + self.tenant_id = tenant_id self.data_types = data_types self.kind = 'Office365' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py index fecadd7e4213..430f82b84994 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule.py @@ -30,14 +30,14 @@ class ScheduledAlertRule(AlertRule): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param rule_name: Required. The name for alerts created by this alert - rule. - :type rule_name: str + :param display_name: Required. The display name for alerts created by this + alert rule. + :type display_name: str :param description: Required. The description of the alert rule. :type description: str :param severity: Required. The severity for alerts created by this alert - rule. Possible values include: 'Low', 'Medium', 'High', 'Informational' - :type severity: str or ~azure.mgmt.securityinsight.models.Severity + rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity :param enabled: Required. Determines whether this alert rule is enabled or disabled. :type enabled: bool @@ -72,7 +72,7 @@ class ScheduledAlertRule(AlertRule): 'type': {'readonly': True}, 'name': {'readonly': True}, 'kind': {'required': True}, - 'rule_name': {'required': True}, + 'display_name': {'required': True}, 'description': {'required': True}, 'severity': {'required': True}, 'enabled': {'required': True}, @@ -92,9 +92,9 @@ class ScheduledAlertRule(AlertRule): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'Severity'}, + 'severity': {'key': 'properties.severity', 'type': 'AlertSeverity'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'query': {'key': 'properties.query', 'type': 'str'}, 'query_frequency': {'key': 'properties.queryFrequency', 'type': 'duration'}, @@ -108,7 +108,7 @@ class ScheduledAlertRule(AlertRule): def __init__(self, **kwargs): super(ScheduledAlertRule, self).__init__(**kwargs) - self.rule_name = kwargs.get('rule_name', None) + self.display_name = kwargs.get('display_name', None) self.description = kwargs.get('description', None) self.severity = kwargs.get('severity', None) self.enabled = kwargs.get('enabled', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py index b3eac8ccc2d8..48bdaa08acfc 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_py3.py @@ -30,14 +30,14 @@ class ScheduledAlertRule(AlertRule): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param rule_name: Required. The name for alerts created by this alert - rule. - :type rule_name: str + :param display_name: Required. The display name for alerts created by this + alert rule. + :type display_name: str :param description: Required. The description of the alert rule. :type description: str :param severity: Required. The severity for alerts created by this alert - rule. Possible values include: 'Low', 'Medium', 'High', 'Informational' - :type severity: str or ~azure.mgmt.securityinsight.models.Severity + rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + :type severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity :param enabled: Required. Determines whether this alert rule is enabled or disabled. :type enabled: bool @@ -72,7 +72,7 @@ class ScheduledAlertRule(AlertRule): 'type': {'readonly': True}, 'name': {'readonly': True}, 'kind': {'required': True}, - 'rule_name': {'required': True}, + 'display_name': {'required': True}, 'description': {'required': True}, 'severity': {'required': True}, 'enabled': {'required': True}, @@ -92,9 +92,9 @@ class ScheduledAlertRule(AlertRule): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'severity': {'key': 'properties.severity', 'type': 'Severity'}, + 'severity': {'key': 'properties.severity', 'type': 'AlertSeverity'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, 'query': {'key': 'properties.query', 'type': 'str'}, 'query_frequency': {'key': 'properties.queryFrequency', 'type': 'duration'}, @@ -106,9 +106,9 @@ class ScheduledAlertRule(AlertRule): 'last_modified_utc': {'key': 'properties.lastModifiedUtc', 'type': 'str'}, } - def __init__(self, *, rule_name: str, description: str, severity, enabled: bool, query: str, query_frequency, query_period, trigger_operator, trigger_threshold: int, suppression_enabled: bool, suppression_duration, etag: str=None, **kwargs) -> None: + def __init__(self, *, display_name: str, description: str, severity, enabled: bool, query: str, query_frequency, query_period, trigger_operator, trigger_threshold: int, suppression_enabled: bool, suppression_duration, etag: str=None, **kwargs) -> None: super(ScheduledAlertRule, self).__init__(etag=etag, **kwargs) - self.rule_name = rule_name + self.display_name = display_name self.description = description self.severity = severity self.enabled = enabled diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 71f4acc7853b..655ba0639343 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -17,12 +17,12 @@ class AlertRuleKind(str, Enum): scheduled = "Scheduled" -class Severity(str, Enum): +class AlertSeverity(str, Enum): - low = "Low" - medium = "Medium" - high = "High" - informational = "Informational" + high = "High" #: High severity + medium = "Medium" #: Medium severity + low = "Low" #: Low severity + informational = "Informational" #: Informational severity class TriggerOperator(str, Enum): @@ -33,6 +33,30 @@ class TriggerOperator(str, Enum): not_equal = "NotEqual" +class CaseSeverity(str, Enum): + + critical = "Critical" #: Critical severity + high = "High" #: High severity + medium = "Medium" #: Medium severity + low = "Low" #: Low severity + informational = "Informational" #: Informational severity + + +class CaseStatus(str, Enum): + + draft = "Draft" #: Case that wasn't promoted yet to active + open = "Open" #: An active case which isn't handled currently + in_progress = "InProgress" #: An active case which is handled + closed = "Closed" #: A non active case + + +class CloseReason(str, Enum): + + resolved = "Resolved" #: Case was resolved + dismissed = "Dismissed" #: Case was dismissed + other = "Other" #: Case was closed for another reason + + class DataConnectorKind(str, Enum): azure_active_directory = "AzureActiveDirectory" @@ -46,3 +70,30 @@ class DataTypeState(str, Enum): enabled = "Enabled" disabled = "Disabled" + + +class EntityKind(str, Enum): + + account = "Account" #: Entity represents account in the system. + host = "Host" #: Entity represents host in the system. + file = "File" #: Entity represents file in the system. + + +class OSFamily(str, Enum): + + linux = "Linux" #: Host with Linux operartion system. + windows = "Windows" #: Host with Windows operartion system. + android = "Android" #: Host with Android operartion system. + ios = "IOS" #: Host with IOS operartion system. + + +class SettingKind(str, Enum): + + ueba_settings = "UebaSettings" + toggle_settings = "ToggleSettings" + + +class StatusInMcas(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings.py new file mode 100644 index 000000000000..40c938b5af44 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Settings(Model): + """The Setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UebaSettings, ToggleSettings + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'UebaSettings': 'UebaSettings', 'ToggleSettings': 'ToggleSettings'} + } + + def __init__(self, **kwargs): + super(Settings, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind.py similarity index 60% rename from azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py rename to azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind.py index 7b26fbf253cb..05e31e0ea210 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/data_connector_context_id_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind.py @@ -12,18 +12,18 @@ from msrest.serialization import Model -class DataConnectorContextId(Model): +class SettingsKind(Model): """Describes an Azure resource with kind. - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param kind: The kind of the setting. Possible values include: + 'UebaSettings', 'ToggleSettings' + :type kind: str or ~azure.mgmt.securityinsight.models.SettingKind """ _attribute_map = { - 'context_id': {'key': 'contextId', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, } - def __init__(self, *, context_id: str=None, **kwargs) -> None: - super(DataConnectorContextId, self).__init__(**kwargs) - self.context_id = context_id + def __init__(self, **kwargs): + super(SettingsKind, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind_py3.py new file mode 100644 index 000000000000..a6501e3c7613 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_kind_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SettingsKind(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the setting. Possible values include: + 'UebaSettings', 'ToggleSettings' + :type kind: str or ~azure.mgmt.securityinsight.models.SettingKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(SettingsKind, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_py3.py new file mode 100644 index 000000000000..cca5858eafb8 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/settings_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Settings(Model): + """The Setting. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UebaSettings, ToggleSettings + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'UebaSettings': 'UebaSettings', 'ToggleSettings': 'ToggleSettings'} + } + + def __init__(self, **kwargs) -> None: + super(Settings, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py index 8a5d5362da47..8b7527c417d9 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector.py @@ -30,9 +30,8 @@ class TIDataConnector(DataConnector): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes @@ -51,12 +50,12 @@ class TIDataConnector(DataConnector): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, } def __init__(self, **kwargs): super(TIDataConnector, self).__init__(**kwargs) - self.context_id = kwargs.get('context_id', None) + self.tenant_id = kwargs.get('tenant_id', None) self.data_types = kwargs.get('data_types', None) self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py index 8109ed18495b..fca339c71037 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types.py @@ -13,7 +13,7 @@ class TIDataConnectorDataTypes(Model): - """The available data types for TI data connector. + """The available data types for TI (Threat Intelligence) data connector. :param indicators: Data type for indicators connection. :type indicators: diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py index c96a8d6db3b4..0abe983c3ad3 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_data_types_py3.py @@ -13,7 +13,7 @@ class TIDataConnectorDataTypes(Model): - """The available data types for TI data connector. + """The available data types for TI (Threat Intelligence) data connector. :param indicators: Data type for indicators connection. :type indicators: diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py index 3e2cb053bb05..9342603bf765 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ti_data_connector_py3.py @@ -30,9 +30,8 @@ class TIDataConnector(DataConnector): :type etag: str :param kind: Required. Constant filled by server. :type kind: str - :param context_id: The context id of the origin data source (Like - tenantID, SubscriptionID etc.). - :type context_id: str + :param tenant_id: The tenant id to connect to, and get the data from. + :type tenant_id: str :param data_types: The available data types for the connector. :type data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes @@ -51,12 +50,12 @@ class TIDataConnector(DataConnector): 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'context_id': {'key': 'properties.contextId', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, 'data_types': {'key': 'properties.dataTypes', 'type': 'TIDataConnectorDataTypes'}, } - def __init__(self, *, etag: str=None, context_id: str=None, data_types=None, **kwargs) -> None: + def __init__(self, *, etag: str=None, tenant_id: str=None, data_types=None, **kwargs) -> None: super(TIDataConnector, self).__init__(etag=etag, **kwargs) - self.context_id = context_id + self.tenant_id = tenant_id self.data_types = data_types self.kind = 'ThreatIntelligence' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings.py new file mode 100644 index 000000000000..cd5eafbe1a96 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings.py @@ -0,0 +1,53 @@ +# 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 .settings import Settings + + +class ToggleSettings(Settings): + """Settings with single toggle. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param is_enabled: Determines whether the setting is enable or disabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ToggleSettings, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.kind = 'ToggleSettings' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings_py3.py new file mode 100644 index 000000000000..9573ec9202e4 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/toggle_settings_py3.py @@ -0,0 +1,53 @@ +# 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 .settings_py3 import Settings + + +class ToggleSettings(Settings): + """Settings with single toggle. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param is_enabled: Determines whether the setting is enable or disabled. + :type is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__(self, *, is_enabled: bool=None, **kwargs) -> None: + super(ToggleSettings, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.kind = 'ToggleSettings' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings.py new file mode 100644 index 000000000000..b41abbd99b37 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings.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 .settings import Settings + + +class UebaSettings(Settings): + """Represents settings for User and Entity Behavior Analytics enablement. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param is_enabled: Determines whether User and Entity Behavior Analytics + is enabled for this workspace. + :type is_enabled: bool + :ivar status_in_mcas: Determines whether User and Entity Behavior + Analytics is enabled from MCAS (Microsoft Cloud App Security). Possible + values include: 'Enabled', 'Disabled' + :vartype status_in_mcas: str or + ~azure.mgmt.securityinsight.models.StatusInMcas + :ivar atp_license_status: Determines whether the tenant has ATP (Advanced + Threat Protection) license. + :vartype atp_license_status: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'status_in_mcas': {'readonly': True}, + 'atp_license_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'status_in_mcas': {'key': 'properties.statusInMcas', 'type': 'str'}, + 'atp_license_status': {'key': 'properties.atpLicenseStatus', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(UebaSettings, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.status_in_mcas = None + self.atp_license_status = None + self.kind = 'UebaSettings' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings_py3.py new file mode 100644 index 000000000000..5c8b801a89b3 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/ueba_settings_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 .settings_py3 import Settings + + +class UebaSettings(Settings): + """Represents settings for User and Entity Behavior Analytics enablement. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param is_enabled: Determines whether User and Entity Behavior Analytics + is enabled for this workspace. + :type is_enabled: bool + :ivar status_in_mcas: Determines whether User and Entity Behavior + Analytics is enabled from MCAS (Microsoft Cloud App Security). Possible + values include: 'Enabled', 'Disabled' + :vartype status_in_mcas: str or + ~azure.mgmt.securityinsight.models.StatusInMcas + :ivar atp_license_status: Determines whether the tenant has ATP (Advanced + Threat Protection) license. + :vartype atp_license_status: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'status_in_mcas': {'readonly': True}, + 'atp_license_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'status_in_mcas': {'key': 'properties.statusInMcas', 'type': 'str'}, + 'atp_license_status': {'key': 'properties.atpLicenseStatus', 'type': 'bool'}, + } + + def __init__(self, *, is_enabled: bool=None, **kwargs) -> None: + super(UebaSettings, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.status_in_mcas = None + self.atp_license_status = None + self.kind = 'UebaSettings' diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info.py new file mode 100644 index 000000000000..2a3863f81e85 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UserInfo(Model): + """User information that made some action. + + :param object_id: The object id of the user. + :type object_id: str + :param email: The email of the user. + :type email: str + :param name: The name of the user. + :type name: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserInfo, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) + self.email = kwargs.get('email', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info_py3.py new file mode 100644 index 000000000000..f69ed5c45e56 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/user_info_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UserInfo(Model): + """User information that made some action. + + :param object_id: The object id of the user. + :type object_id: str + :param email: The email of the user. + :type email: str + :param name: The name of the user. + :type name: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, object_id: str=None, email: str=None, name: str=None, **kwargs) -> None: + super(UserInfo, self).__init__(**kwargs) + self.object_id = object_id + self.email = email + self.name = name diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py index d2ed4a88c33a..3fb060e77fd9 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -11,10 +11,22 @@ from .operations import Operations from .alert_rules_operations import AlertRulesOperations +from .actions_operations import ActionsOperations +from .cases_operations import CasesOperations +from .bookmarks_operations import BookmarksOperations from .data_connectors_operations import DataConnectorsOperations +from .entities_operations import EntitiesOperations +from .office_consents_operations import OfficeConsentsOperations +from .product_settings_operations import ProductSettingsOperations __all__ = [ 'Operations', 'AlertRulesOperations', + 'ActionsOperations', + 'CasesOperations', + 'BookmarksOperations', 'DataConnectorsOperations', + 'EntitiesOperations', + 'OfficeConsentsOperations', + 'ProductSettingsOperations', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/actions_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/actions_operations.py new file mode 100644 index 000000000000..e32d7e6f3188 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/actions_operations.py @@ -0,0 +1,116 @@ +# 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 ActionsOperations(object): + """ActionsOperations 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_by_alert_rule( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers=None, raw=False, **operation_config): + """Gets all actions of alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_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 Action + :rtype: + ~azure.mgmt.securityinsight.models.ActionPaged[~azure.mgmt.securityinsight.models.Action] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_alert_rule.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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_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.ActionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ActionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_alert_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py index ad49f712b1be..9f246b8a89f9 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/alert_rules_operations.py @@ -114,7 +114,7 @@ def internal_paging(next_link=None, raw=False): def get( self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers=None, raw=False, **operation_config): - """Gets a alert rule. + """Gets the alert rule. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -143,7 +143,7 @@ def get( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), - 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + 'ruleId': self._serialize.url("rule_id", rule_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -182,7 +182,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} - def create( + def create_or_update( self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, alert_rule, custom_headers=None, raw=False, **operation_config): """Creates or updates the alert rule. @@ -209,13 +209,13 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = self.create.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), - 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + 'ruleId': self._serialize.url("rule_id", rule_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -258,7 +258,7 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} def delete( self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, custom_headers=None, raw=False, **operation_config): @@ -290,7 +290,7 @@ def delete( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), - 'ruleId': self._serialize.url("rule_id", rule_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$') + 'ruleId': self._serialize.url("rule_id", rule_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -320,3 +320,225 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} + + def get_action( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers=None, raw=False, **operation_config): + """Gets the action of alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_id: str + :param action_id: Action ID + :type action_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: Action or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Action or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_action.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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'actionId': self._serialize.url("action_id", action_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('Action', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'} + + def create_or_update_action( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, etag=None, trigger_uri=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates the action of alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_id: str + :param action_id: Action ID + :type action_id: str + :param etag: Etag of the action. + :type etag: str + :param trigger_uri: The uri for the action to trigger. + :type trigger_uri: 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: Action or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Action or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + action = models.Action(etag=etag, trigger_uri=trigger_uri) + + # Construct URL + url = self.create_or_update_action.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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'actionId': self._serialize.url("action_id", action_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' + 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(action, 'Action') + + # 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('Action', response) + if response.status_code == 201: + deserialized = self._deserialize('Action', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'} + + def delete_action( + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, action_id, custom_headers=None, raw=False, **operation_config): + """Delete the action of alert rule. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param rule_id: Alert rule ID + :type rule_id: str + :param action_id: Action ID + :type action_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_action.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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'actionId': self._serialize.url("action_id", action_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 = {} + 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_action.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/bookmarks_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/bookmarks_operations.py new file mode 100644 index 000000000000..c0d38f7ee281 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/bookmarks_operations.py @@ -0,0 +1,322 @@ +# 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 BookmarksOperations(object): + """BookmarksOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all bookmarks. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 Bookmark + :rtype: + ~azure.mgmt.securityinsight.models.BookmarkPaged[~azure.mgmt.securityinsight.models.Bookmark] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.BookmarkPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BookmarkPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, bookmark_id, custom_headers=None, raw=False, **operation_config): + """Gets a bookmark. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param bookmark_id: Bookmark ID + :type bookmark_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: Bookmark or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Bookmark 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'bookmarkId': self._serialize.url("bookmark_id", bookmark_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('Bookmark', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}'} + + def create_or_update( + self, resource_group_name, operational_insights_resource_provider, workspace_name, bookmark_id, bookmark, custom_headers=None, raw=False, **operation_config): + """Creates or updates the bookmark. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param bookmark_id: Bookmark ID + :type bookmark_id: str + :param bookmark: The bookmark + :type bookmark: ~azure.mgmt.securityinsight.models.Bookmark + :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: Bookmark or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Bookmark or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'bookmarkId': self._serialize.url("bookmark_id", bookmark_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' + 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(bookmark, 'Bookmark') + + # 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('Bookmark', response) + if response.status_code == 201: + deserialized = self._deserialize('Bookmark', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, bookmark_id, custom_headers=None, raw=False, **operation_config): + """Delete the bookmark. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param bookmark_id: Bookmark ID + :type bookmark_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'bookmarkId': self._serialize.url("bookmark_id", bookmark_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_operations.py new file mode 100644 index 000000000000..c7ded22b619c --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_operations.py @@ -0,0 +1,322 @@ +# 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 CasesOperations(object): + """CasesOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all cases. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 Case + :rtype: + ~azure.mgmt.securityinsight.models.CasePaged[~azure.mgmt.securityinsight.models.Case] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.CasePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CasePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, case_id, custom_headers=None, raw=False, **operation_config): + """Gets a case. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param case_id: Case ID + :type case_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: Case or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Case 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'caseId': self._serialize.url("case_id", case_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('Case', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}'} + + def create_or_update( + self, resource_group_name, operational_insights_resource_provider, workspace_name, case_id, case, custom_headers=None, raw=False, **operation_config): + """Creates or updates the case. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param case_id: Case ID + :type case_id: str + :param case: The case + :type case: ~azure.mgmt.securityinsight.models.Case + :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: Case or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Case or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'caseId': self._serialize.url("case_id", case_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' + 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(case, 'Case') + + # 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('Case', response) + if response.status_code == 201: + deserialized = self._deserialize('Case', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, case_id, custom_headers=None, raw=False, **operation_config): + """Delete the case. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param case_id: Case ID + :type case_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'caseId': self._serialize.url("case_id", case_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/cases/{caseId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py index 408213b64719..61107803dfad 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/data_connectors_operations.py @@ -182,7 +182,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} - def create( + def create_or_update( self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, data_connector, custom_headers=None, raw=False, **operation_config): """Creates or updates the data connector. @@ -209,7 +209,7 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = self.create.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -258,7 +258,7 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}'} def delete( self, resource_group_name, operational_insights_resource_provider, workspace_name, data_connector_id, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/entities_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/entities_operations.py new file mode 100644 index 000000000000..b00353ee2ce2 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/entities_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 EntitiesOperations(object): + """EntitiesOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all entities. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 Entity + :rtype: + ~azure.mgmt.securityinsight.models.EntityPaged[~azure.mgmt.securityinsight.models.Entity] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.EntityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EntityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, entity_id, custom_headers=None, raw=False, **operation_config): + """Gets an entity. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param entity_id: entity ID + :type entity_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: Entity or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Entity 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'entityId': self._serialize.url("entity_id", entity_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('Entity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/office_consents_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/office_consents_operations.py new file mode 100644 index 000000000000..c3e133607a46 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/office_consents_operations.py @@ -0,0 +1,244 @@ +# 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 OfficeConsentsOperations(object): + """OfficeConsentsOperations 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, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets all office365 consents. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_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 OfficeConsent + :rtype: + ~azure.mgmt.securityinsight.models.OfficeConsentPaged[~azure.mgmt.securityinsight.models.OfficeConsent] + :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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1) + } + 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.OfficeConsentPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OfficeConsentPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents'} + + def get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, consent_id, custom_headers=None, raw=False, **operation_config): + """Gets an office365 consent. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param consent_id: consent ID + :type consent_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: OfficeConsent or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.OfficeConsent 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'consentId': self._serialize.url("consent_id", consent_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('OfficeConsent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}'} + + def delete( + self, resource_group_name, operational_insights_resource_provider, workspace_name, consent_id, custom_headers=None, raw=False, **operation_config): + """Delete the office365 consent. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param consent_id: consent ID + :type consent_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'consentId': self._serialize.url("consent_id", consent_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py new file mode 100644 index 000000000000..4bdaffcbf466 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py @@ -0,0 +1,184 @@ +# 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 ProductSettingsOperations(object): + """ProductSettingsOperations 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 get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, settings_name, custom_headers=None, raw=False, **operation_config): + """Gets a stting. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param settings_name: The setting name. Supports- Fusion, UEBA + :type settings_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: Settings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Settings 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'settingsName': self._serialize.url("settings_name", settings_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('Settings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}'} + + def update( + self, resource_group_name, operational_insights_resource_provider, workspace_name, settings_name, settings, custom_headers=None, raw=False, **operation_config): + """Updates the setting. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param settings_name: The setting name. Supports- Fusion, UEBA + :type settings_name: str + :param settings: The setting + :type settings: ~azure.mgmt.securityinsight.models.Settings + :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: Settings or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Settings or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'settingsName': self._serialize.url("settings_name", settings_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(settings, 'Settings') + + # 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('Settings', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py index b32b1e4ee1ee..a8ed1d8179c5 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -15,7 +15,13 @@ from .version import VERSION from .operations.operations import Operations from .operations.alert_rules_operations import AlertRulesOperations +from .operations.actions_operations import ActionsOperations +from .operations.cases_operations import CasesOperations +from .operations.bookmarks_operations import BookmarksOperations from .operations.data_connectors_operations import DataConnectorsOperations +from .operations.entities_operations import EntitiesOperations +from .operations.office_consents_operations import OfficeConsentsOperations +from .operations.product_settings_operations import ProductSettingsOperations from . import models @@ -61,8 +67,20 @@ class SecurityInsights(SDKClient): :vartype operations: azure.mgmt.securityinsight.operations.Operations :ivar alert_rules: AlertRules operations :vartype alert_rules: azure.mgmt.securityinsight.operations.AlertRulesOperations + :ivar actions: Actions operations + :vartype actions: azure.mgmt.securityinsight.operations.ActionsOperations + :ivar cases: Cases operations + :vartype cases: azure.mgmt.securityinsight.operations.CasesOperations + :ivar bookmarks: Bookmarks operations + :vartype bookmarks: azure.mgmt.securityinsight.operations.BookmarksOperations :ivar data_connectors: DataConnectors operations :vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations + :ivar entities: Entities operations + :vartype entities: azure.mgmt.securityinsight.operations.EntitiesOperations + :ivar office_consents: OfficeConsents operations + :vartype office_consents: azure.mgmt.securityinsight.operations.OfficeConsentsOperations + :ivar product_settings: ProductSettings operations + :vartype product_settings: azure.mgmt.securityinsight.operations.ProductSettingsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -87,5 +105,17 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.alert_rules = AlertRulesOperations( self._client, self.config, self._serialize, self._deserialize) + self.actions = ActionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.cases = CasesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.bookmarks = BookmarksOperations( + self._client, self.config, self._serialize, self._deserialize) self.data_connectors = DataConnectorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.entities = EntitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.office_consents = OfficeConsentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.product_settings = ProductSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) From 9075de863d5fda7c2315031da8c9ed59420e9c1d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 14 Feb 2019 12:49:35 -0800 Subject: [PATCH 5/6] Generated from 14a99c1dc6e71db842f396d6b87d7fbca8dc6f93 (#4364) typo: securityinsights/resource-manager/Microsoft.SecurityInsights - stting -> setting - etnties -> entities - NETBIOS -> NetBIOS - operartion -> operating - concesnt -> consent --- .../azure/mgmt/securityinsight/models/account_entity.py | 2 +- .../mgmt/securityinsight/models/account_entity_py3.py | 2 +- .../azure/mgmt/securityinsight/models/host_entity.py | 2 +- .../azure/mgmt/securityinsight/models/host_entity_py3.py | 2 +- .../azure/mgmt/securityinsight/models/office_consent.py | 4 ++-- .../mgmt/securityinsight/models/office_consent_py3.py | 4 ++-- .../securityinsight/models/security_insights_enums.py | 8 ++++---- .../operations/product_settings_operations.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py index 89c273d5013e..e1b09b4fc542 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity.py @@ -31,7 +31,7 @@ class AccountEntity(Entity): :ivar account_name: The name of the account. This field should hold only the name without any domain added to it, i.e. administrator. :vartype account_name: str - :ivar nt_domain: The NETBIOS domain name as it appears in the alert format + :ivar nt_domain: The NetBIOS domain name as it appears in the alert format – domain\\username. Examples: NT AUTHORITY. :vartype nt_domain: str :ivar upn_suffix: The user principal name suffix for the account, in some diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py index ec5e903ae655..488716037262 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/account_entity_py3.py @@ -31,7 +31,7 @@ class AccountEntity(Entity): :ivar account_name: The name of the account. This field should hold only the name without any domain added to it, i.e. administrator. :vartype account_name: str - :ivar nt_domain: The NETBIOS domain name as it appears in the alert format + :ivar nt_domain: The NetBIOS domain name as it appears in the alert format – domain\\username. Examples: NT AUTHORITY. :vartype nt_domain: str :ivar upn_suffix: The user principal name suffix for the account, in some diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py index 550383353480..eca078070880 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity.py @@ -41,7 +41,7 @@ class HostEntity(Entity): :vartype azure_id: str :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed. :vartype oms_agent_id: str - :param os_family: The operartion system type. Possible values include: + :param os_family: The operating system type. Possible values include: 'Linux', 'Windows', 'Android', 'IOS' :type os_family: str or ~azure.mgmt.securityinsight.models.OSFamily :ivar os_version: A free text representation of the operating system. This diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py index 75dd6e81efdb..0590bd25f509 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/host_entity_py3.py @@ -41,7 +41,7 @@ class HostEntity(Entity): :vartype azure_id: str :ivar oms_agent_id: The OMS agent id, if the host has OMS agent installed. :vartype oms_agent_id: str - :param os_family: The operartion system type. Possible values include: + :param os_family: The operating system type. Possible values include: 'Linux', 'Windows', 'Android', 'IOS' :type os_family: str or ~azure.mgmt.securityinsight.models.OSFamily :ivar os_version: A free text representation of the operating system. This diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py index bea49f793ea6..c5e997afa3af 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent.py @@ -24,9 +24,9 @@ class OfficeConsent(Resource): :vartype type: str :ivar name: Azure resource name :vartype name: str - :param tenant_id: The tenantId of the Office365 with the concesnt. + :param tenant_id: The tenantId of the Office365 with the consent. :type tenant_id: str - :ivar tenant_name: The tenant name of the Office365 with the concesnt. + :ivar tenant_name: The tenant name of the Office365 with the consent. :vartype tenant_name: str """ diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py index 4feb93636e8f..4d2c4de98318 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/office_consent_py3.py @@ -24,9 +24,9 @@ class OfficeConsent(Resource): :vartype type: str :ivar name: Azure resource name :vartype name: str - :param tenant_id: The tenantId of the Office365 with the concesnt. + :param tenant_id: The tenantId of the Office365 with the consent. :type tenant_id: str - :ivar tenant_name: The tenant name of the Office365 with the concesnt. + :ivar tenant_name: The tenant name of the Office365 with the consent. :vartype tenant_name: str """ diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 655ba0639343..7f82e3f12db9 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -81,10 +81,10 @@ class EntityKind(str, Enum): class OSFamily(str, Enum): - linux = "Linux" #: Host with Linux operartion system. - windows = "Windows" #: Host with Windows operartion system. - android = "Android" #: Host with Android operartion system. - ios = "IOS" #: Host with IOS operartion system. + linux = "Linux" #: Host with Linux operating system. + windows = "Windows" #: Host with Windows operating system. + android = "Android" #: Host with Android operating system. + ios = "IOS" #: Host with IOS operating system. class SettingKind(str, Enum): diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py index 4bdaffcbf466..6878551636cc 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/product_settings_operations.py @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): def get( self, resource_group_name, operational_insights_resource_provider, workspace_name, settings_name, custom_headers=None, raw=False, **operation_config): - """Gets a stting. + """Gets a setting. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. From 2d7c4c10257147b529ca28eb262be908c338bba4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 3 Apr 2019 15:15:12 -0700 Subject: [PATCH 6/6] [AutoPR securityinsights/resource-manager] Add cases aggregation endpoint to SecurityInsights RP swagger spec (#4742) * Generated from f20f1d94a584bf55c225139c0991138b1c90420f Add cases aggregation endpoint to SecurityInsights RP swagger spec * Packaging update of azure-mgmt-securityinsight * Generated from 2e84b343d46947d2cc6d9f79a64ced02e82027c6 Fix pathParam and add Tag --- azure-mgmt-securityinsight/MANIFEST.in | 1 + azure-mgmt-securityinsight/README.rst | 3 + .../mgmt/securityinsight/models/__init__.py | 8 ++ .../securityinsight/models/aggregations.py | 52 +++++++++ .../models/aggregations_kind1.py | 29 +++++ .../models/aggregations_kind1_py3.py | 29 +++++ .../models/aggregations_py3.py | 52 +++++++++ .../models/security_insights_enums.py | 5 + .../securityinsight/operations/__init__.py | 2 + .../cases_aggregations_operations.py | 109 ++++++++++++++++++ .../mgmt/securityinsight/security_insights.py | 5 + 11 files changed, 295 insertions(+) create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py create mode 100644 azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py diff --git a/azure-mgmt-securityinsight/MANIFEST.in b/azure-mgmt-securityinsight/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-securityinsight/MANIFEST.in +++ b/azure-mgmt-securityinsight/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-securityinsight/README.rst b/azure-mgmt-securityinsight/README.rst index d0429ebc7565..94ef30d6093b 100644 --- a/azure-mgmt-securityinsight/README.rst +++ b/azure-mgmt-securityinsight/README.rst @@ -28,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-securityinsight%2FREADME.png diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index f44962a7aeb5..c619ab787d2f 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -47,6 +47,8 @@ from .settings_kind_py3 import SettingsKind from .ueba_settings_py3 import UebaSettings from .toggle_settings_py3 import ToggleSettings + from .aggregations_py3 import Aggregations + from .aggregations_kind1_py3 import AggregationsKind1 except (SyntaxError, ImportError): from .operation_display import OperationDisplay from .operation import Operation @@ -85,6 +87,8 @@ from .settings_kind import SettingsKind from .ueba_settings import UebaSettings from .toggle_settings import ToggleSettings + from .aggregations import Aggregations + from .aggregations_kind1 import AggregationsKind1 from .operation_paged import OperationPaged from .alert_rule_paged import AlertRulePaged from .action_paged import ActionPaged @@ -106,6 +110,7 @@ OSFamily, SettingKind, StatusInMcas, + AggregationsKind, ) __all__ = [ @@ -146,6 +151,8 @@ 'SettingsKind', 'UebaSettings', 'ToggleSettings', + 'Aggregations', + 'AggregationsKind1', 'OperationPaged', 'AlertRulePaged', 'ActionPaged', @@ -166,4 +173,5 @@ 'OSFamily', 'SettingKind', 'StatusInMcas', + 'AggregationsKind', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.py new file mode 100644 index 000000000000..1725d1ad51af --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations.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 Aggregations(Model): + """The aggregation. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Aggregations, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py new file mode 100644 index 000000000000..8af6327111f3 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AggregationsKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the setting. Possible values include: + 'CasesAggregation' + :type kind: str or ~azure.mgmt.securityinsight.models.AggregationsKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AggregationsKind1, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py new file mode 100644 index 000000000000..13fe73cf6168 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_kind1_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AggregationsKind1(Model): + """Describes an Azure resource with kind. + + :param kind: The kind of the setting. Possible values include: + 'CasesAggregation' + :type kind: str or ~azure.mgmt.securityinsight.models.AggregationsKind + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, kind=None, **kwargs) -> None: + super(AggregationsKind1, self).__init__(**kwargs) + self.kind = kind diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_py3.py new file mode 100644 index 000000000000..82ab1d137e2a --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/aggregations_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 Aggregations(Model): + """The aggregation. + + 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: Azure resource Id + :vartype id: str + :ivar type: Azure resource type + :vartype type: str + :ivar name: Azure resource name + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Aggregations, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.kind = None diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py index 7f82e3f12db9..b36f9a1e1f89 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/security_insights_enums.py @@ -97,3 +97,8 @@ class StatusInMcas(str, Enum): enabled = "Enabled" disabled = "Disabled" + + +class AggregationsKind(str, Enum): + + cases_aggregation = "CasesAggregation" diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py index 3fb060e77fd9..ae9a8cf31361 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/__init__.py @@ -18,6 +18,7 @@ from .entities_operations import EntitiesOperations from .office_consents_operations import OfficeConsentsOperations from .product_settings_operations import ProductSettingsOperations +from .cases_aggregations_operations import CasesAggregationsOperations __all__ = [ 'Operations', @@ -29,4 +30,5 @@ 'EntitiesOperations', 'OfficeConsentsOperations', 'ProductSettingsOperations', + 'CasesAggregationsOperations', ] diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py new file mode 100644 index 000000000000..4a22e3374106 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/cases_aggregations_operations.py @@ -0,0 +1,109 @@ +# 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 CasesAggregationsOperations(object): + """CasesAggregationsOperations 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 get( + self, resource_group_name, operational_insights_resource_provider, workspace_name, aggregations_name, custom_headers=None, raw=False, **operation_config): + """Get aggregative result for the given resources under the defined + workspace. + + :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 operational_insights_resource_provider: The namespace of + workspaces resource provider- Microsoft.OperationalInsights. + :type operational_insights_resource_provider: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param aggregations_name: The aggregation name. Supports - Cases + :type aggregations_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: Aggregations or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.Aggregations 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\._\(\)]+$'), + 'operationalInsightsResourceProvider': self._serialize.url("operational_insights_resource_provider", operational_insights_resource_provider, 'str'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=90, min_length=1), + 'aggregationsName': self._serialize.url("aggregations_name", aggregations_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('Aggregations', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/aggregations/{aggregationsName}'} diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py index a8ed1d8179c5..37efb48bba3d 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/security_insights.py @@ -22,6 +22,7 @@ from .operations.entities_operations import EntitiesOperations from .operations.office_consents_operations import OfficeConsentsOperations from .operations.product_settings_operations import ProductSettingsOperations +from .operations.cases_aggregations_operations import CasesAggregationsOperations from . import models @@ -81,6 +82,8 @@ class SecurityInsights(SDKClient): :vartype office_consents: azure.mgmt.securityinsight.operations.OfficeConsentsOperations :ivar product_settings: ProductSettings operations :vartype product_settings: azure.mgmt.securityinsight.operations.ProductSettingsOperations + :ivar cases_aggregations: CasesAggregations operations + :vartype cases_aggregations: azure.mgmt.securityinsight.operations.CasesAggregationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -119,3 +122,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.product_settings = ProductSettingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.cases_aggregations = CasesAggregationsOperations( + self._client, self.config, self._serialize, self._deserialize)