diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py index c619ab787d2f..1af7e448d979 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/__init__.py @@ -13,6 +13,7 @@ from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation from .alert_rule_py3 import AlertRule + from .alert_rules_list_py3 import AlertRulesList from .alert_rule_kind1_py3 import AlertRuleKind1 from .scheduled_alert_rule_py3 import ScheduledAlertRule from .action_py3 import Action @@ -53,6 +54,7 @@ from .operation_display import OperationDisplay from .operation import Operation from .alert_rule import AlertRule + from .alert_rules_list import AlertRulesList from .alert_rule_kind1 import AlertRuleKind1 from .scheduled_alert_rule import ScheduledAlertRule from .action import Action @@ -90,7 +92,7 @@ from .aggregations import Aggregations from .aggregations_kind1 import AggregationsKind1 from .operation_paged import OperationPaged -from .alert_rule_paged import AlertRulePaged +from .scheduled_alert_rule_paged import ScheduledAlertRulePaged from .action_paged import ActionPaged from .case_paged import CasePaged from .bookmark_paged import BookmarkPaged @@ -117,6 +119,7 @@ 'OperationDisplay', 'Operation', 'AlertRule', + 'AlertRulesList', 'AlertRuleKind1', 'ScheduledAlertRule', 'Action', @@ -154,7 +157,7 @@ 'Aggregations', 'AggregationsKind1', 'OperationPaged', - 'AlertRulePaged', + 'ScheduledAlertRulePaged', 'ActionPaged', 'CasePaged', 'BookmarkPaged', diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list.py new file mode 100644 index 000000000000..91efa3384dc0 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AlertRulesList(Model): + """List all the alert rules. + + 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 next_link: URL to fetch the next set of alert rules. + :vartype next_link: str + :param value: Required. Array of alert rules. + :type value: list[~azure.mgmt.securityinsight.models.AlertRule] + """ + + _validation = { + 'next_link': {'readonly': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[AlertRule]'}, + } + + def __init__(self, **kwargs): + super(AlertRulesList, self).__init__(**kwargs) + self.next_link = None + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list_py3.py new file mode 100644 index 000000000000..01177f8d54a9 --- /dev/null +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rules_list_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AlertRulesList(Model): + """List all the alert rules. + + 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 next_link: URL to fetch the next set of alert rules. + :vartype next_link: str + :param value: Required. Array of alert rules. + :type value: list[~azure.mgmt.securityinsight.models.AlertRule] + """ + + _validation = { + 'next_link': {'readonly': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[AlertRule]'}, + } + + def __init__(self, *, value, **kwargs) -> None: + super(AlertRulesList, self).__init__(**kwargs) + self.next_link = None + self.value = value diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py index 11c77bf387cb..6382d8a8cb07 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case.py @@ -18,8 +18,6 @@ class Case(Resource): 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 @@ -40,15 +38,15 @@ class Case(Resource): :type labels: list[str] :param description: The description of the case :type description: str - :param title: Required. The title of the case + :param title: 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' + :param severity: 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' + :param status: 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' @@ -59,9 +57,6 @@ class Case(Resource): 'id': {'readonly': True}, 'type': {'readonly': True}, 'name': {'readonly': True}, - 'title': {'required': True}, - 'severity': {'required': True}, - 'status': {'required': True}, } _attribute_map = { @@ -69,17 +64,17 @@ class Case(Resource): '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'}, + '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): diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py index f76402bae134..a70ff5e9a428 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/case_py3.py @@ -18,8 +18,6 @@ class Case(Resource): 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 @@ -40,15 +38,15 @@ class Case(Resource): :type labels: list[str] :param description: The description of the case :type description: str - :param title: Required. The title of the case + :param title: 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' + :param severity: 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' + :param status: 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' @@ -59,9 +57,6 @@ class Case(Resource): 'id': {'readonly': True}, 'type': {'readonly': True}, 'name': {'readonly': True}, - 'title': {'required': True}, - 'severity': {'required': True}, - 'status': {'required': True}, } _attribute_map = { @@ -69,20 +64,20 @@ class Case(Resource): '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'}, + '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: + def __init__(self, *, 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, title: str=None, assigned_to=None, severity=None, status=None, close_reason=None, **kwargs) -> None: super(Case, self).__init__(**kwargs) self.etag = etag self.last_updated_time_utc = last_updated_time_utc diff --git a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_paged.py similarity index 66% rename from azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py rename to azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_paged.py index 765456eff7ec..81a61b427c1e 100644 --- a/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/alert_rule_paged.py +++ b/azure-mgmt-securityinsight/azure/mgmt/securityinsight/models/scheduled_alert_rule_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class AlertRulePaged(Paged): +class ScheduledAlertRulePaged(Paged): """ - A paging container for iterating over a list of :class:`AlertRule ` object + A paging container for iterating over a list of :class:`ScheduledAlertRule ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AlertRule]'} + 'current_page': {'key': 'value', 'type': '[ScheduledAlertRule]'} } def __init__(self, *args, **kwargs): - super(AlertRulePaged, self).__init__(*args, **kwargs) + super(ScheduledAlertRulePaged, self).__init__(*args, **kwargs) 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 9f246b8a89f9..ad0e81732384 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 @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): def list( self, resource_group_name, operational_insights_resource_provider, workspace_name, custom_headers=None, raw=False, **operation_config): - """Gets all alert rules. + """Gets all scheduled alert rules. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -54,9 +54,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of AlertRule + :return: An iterator like instance of ScheduledAlertRule :rtype: - ~azure.mgmt.securityinsight.models.AlertRulePaged[~azure.mgmt.securityinsight.models.AlertRule] + ~azure.mgmt.securityinsight.models.ScheduledAlertRulePaged[~azure.mgmt.securityinsight.models.ScheduledAlertRule] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): @@ -102,11 +102,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.AlertRulePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.ScheduledAlertRulePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.AlertRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.ScheduledAlertRulePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized @@ -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 the alert rule. + """Gets the scheduled alert rule. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -131,8 +131,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AlertRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.securityinsight.models.AlertRule or + :return: ScheduledAlertRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.ScheduledAlertRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -173,7 +173,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AlertRule', response) + deserialized = self._deserialize('ScheduledAlertRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -183,8 +183,8 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}'} 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. + self, resource_group_name, operational_insights_resource_provider, workspace_name, rule_id, scheduled_alert_rule, custom_headers=None, raw=False, **operation_config): + """Creates or updates the scheduled alert rule. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -196,15 +196,16 @@ def create_or_update( :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 scheduled_alert_rule: The scheduled alert rule + :type scheduled_alert_rule: + ~azure.mgmt.securityinsight.models.ScheduledAlertRule :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 + :return: ScheduledAlertRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.securityinsight.models.ScheduledAlertRule or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -235,7 +236,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(alert_rule, 'AlertRule') + body_content = self._serialize.body(scheduled_alert_rule, 'ScheduledAlertRule') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -249,9 +250,9 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AlertRule', response) + deserialized = self._deserialize('ScheduledAlertRule', response) if response.status_code == 201: - deserialized = self._deserialize('AlertRule', response) + deserialized = self._deserialize('ScheduledAlertRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-mgmt-securityinsight/setup.py b/azure-mgmt-securityinsight/setup.py index 0f1737e027b2..824fbb797ff3 100644 --- a/azure-mgmt-securityinsight/setup.py +++ b/azure-mgmt-securityinsight/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',