Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Generated from f4b30b3785ae1fa51f4333f2acd863137d9c84b2
removed "required" field from ExpandDetectorParameter
  • Loading branch information
AutorestCI committed Jun 5, 2019
commit 38860b299ec7fe69f1834ff5822a6adda06d9486
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .operations.operations import Operations
from .operations.alerts_operations import AlertsOperations
from .operations.smart_groups_operations import SmartGroupsOperations
from .operations.smart_detector_alert_rules_operations import SmartDetectorAlertRulesOperations
from . import models


Expand All @@ -27,30 +28,45 @@ class AlertsManagementClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param scope: scope here is resourceId for which alert is created.
:type scope: str
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param subscription_id1: The Azure subscription id.
:type subscription_id1: str
:param api_version1: Client Api Version.
:type api_version1: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, scope, subscription_id, subscription_id1, api_version1, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if scope is None:
raise ValueError("Parameter 'scope' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if subscription_id1 is None:
raise ValueError("Parameter 'subscription_id1' must not be None.")
if api_version1 is None:
raise ValueError("Parameter 'api_version1' must not be None.")
if not base_url:
base_url = 'http://localhost'
base_url = 'https://management.azure.com'

super(AlertsManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-alertsmanagement/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.scope = scope
self.subscription_id = subscription_id
self.subscription_id1 = subscription_id1
self.api_version1 = api_version1


class AlertsManagementClient(SDKClient):
Expand All @@ -65,25 +81,33 @@ class AlertsManagementClient(SDKClient):
:vartype alerts: azure.mgmt.alertsmanagement.operations.AlertsOperations
:ivar smart_groups: SmartGroups operations
:vartype smart_groups: azure.mgmt.alertsmanagement.operations.SmartGroupsOperations
:ivar smart_detector_alert_rules: SmartDetectorAlertRules operations
:vartype smart_detector_alert_rules: azure.mgmt.alertsmanagement.operations.SmartDetectorAlertRulesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param scope: scope here is resourceId for which alert is created.
:type scope: str
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param subscription_id1: The Azure subscription id.
:type subscription_id1: str
:param api_version1: Client Api Version.
:type api_version1: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, scope, subscription_id, subscription_id1, api_version1, base_url=None):

self.config = AlertsManagementClientConfiguration(credentials, subscription_id, base_url)
self.config = AlertsManagementClientConfiguration(credentials, scope, subscription_id, subscription_id1, api_version1, base_url)
super(AlertsManagementClient, 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 = '2018-05-05'
self.api_version = '2019-03-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand All @@ -93,3 +117,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.smart_groups = SmartGroupsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.smart_detector_alert_rules = SmartDetectorAlertRulesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
try:
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .resource_py3 import Resource
from .proxy_resource_py3 import ProxyResource
from .essentials_py3 import Essentials
from .alert_properties_py3 import AlertProperties
from .alert_py3 import Alert
Expand All @@ -28,10 +28,16 @@
from .smart_group_aggregated_property_py3 import SmartGroupAggregatedProperty
from .smart_group_py3 import SmartGroup
from .smart_groups_list_py3 import SmartGroupsList
from .error_response1_py3 import ErrorResponse1, ErrorResponse1Exception
from .action_groups_information_py3 import ActionGroupsInformation
from .throttling_information_py3 import ThrottlingInformation
from .azure_resource_py3 import AzureResource
from .detector_py3 import Detector
from .alert_rule_py3 import AlertRule
except (SyntaxError, ImportError):
from .operation_display import OperationDisplay
from .operation import Operation
from .resource import Resource
from .proxy_resource import ProxyResource
from .essentials import Essentials
from .alert_properties import AlertProperties
from .alert import Alert
Expand All @@ -47,8 +53,15 @@
from .smart_group_aggregated_property import SmartGroupAggregatedProperty
from .smart_group import SmartGroup
from .smart_groups_list import SmartGroupsList
from .error_response1 import ErrorResponse1, ErrorResponse1Exception
from .action_groups_information import ActionGroupsInformation
from .throttling_information import ThrottlingInformation
from .azure_resource import AzureResource
from .detector import Detector
from .alert_rule import AlertRule
from .operation_paged import OperationPaged
from .alert_paged import AlertPaged
from .alert_rule_paged import AlertRulePaged
from .alerts_management_client_enums import (
Severity,
SignalType,
Expand All @@ -58,6 +71,7 @@
AlertModificationEvent,
SmartGroupModificationEvent,
State,
AlertRuleState,
TimeRange,
AlertsSortByFields,
AlertsSummaryGroupByFields,
Expand All @@ -67,7 +81,7 @@
__all__ = [
'OperationDisplay',
'Operation',
'Resource',
'ProxyResource',
'Essentials',
'AlertProperties',
'Alert',
Expand All @@ -83,8 +97,15 @@
'SmartGroupAggregatedProperty',
'SmartGroup',
'SmartGroupsList',
'ErrorResponse1', 'ErrorResponse1Exception',
'ActionGroupsInformation',
'ThrottlingInformation',
'AzureResource',
'Detector',
'AlertRule',
'OperationPaged',
'AlertPaged',
'AlertRulePaged',
'Severity',
'SignalType',
'AlertState',
Expand All @@ -93,6 +114,7 @@
'AlertModificationEvent',
'SmartGroupModificationEvent',
'State',
'AlertRuleState',
'TimeRange',
'AlertsSortByFields',
'AlertsSummaryGroupByFields',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ActionGroupsInformation(Model):
"""The Action Groups information, used by the alert rule.

All required parameters must be populated in order to send to Azure.

:param custom_email_subject: An optional custom email subject to use in
email notifications.
:type custom_email_subject: str
:param custom_webhook_payload: An optional custom web-hook payload to use
in web-hook notifications.
:type custom_webhook_payload: str
:param group_ids: Required. The Action Group resource IDs.
:type group_ids: list[str]
"""

_validation = {
'group_ids': {'required': True},
}

_attribute_map = {
'custom_email_subject': {'key': 'customEmailSubject', 'type': 'str'},
'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'},
'group_ids': {'key': 'groupIds', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(ActionGroupsInformation, self).__init__(**kwargs)
self.custom_email_subject = kwargs.get('custom_email_subject', None)
self.custom_webhook_payload = kwargs.get('custom_webhook_payload', None)
self.group_ids = kwargs.get('group_ids', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ActionGroupsInformation(Model):
"""The Action Groups information, used by the alert rule.

All required parameters must be populated in order to send to Azure.

:param custom_email_subject: An optional custom email subject to use in
email notifications.
:type custom_email_subject: str
:param custom_webhook_payload: An optional custom web-hook payload to use
in web-hook notifications.
:type custom_webhook_payload: str
:param group_ids: Required. The Action Group resource IDs.
:type group_ids: list[str]
"""

_validation = {
'group_ids': {'required': True},
}

_attribute_map = {
'custom_email_subject': {'key': 'customEmailSubject', 'type': 'str'},
'custom_webhook_payload': {'key': 'customWebhookPayload', 'type': 'str'},
'group_ids': {'key': 'groupIds', 'type': '[str]'},
}

def __init__(self, *, group_ids, custom_email_subject: str=None, custom_webhook_payload: str=None, **kwargs) -> None:
super(ActionGroupsInformation, self).__init__(**kwargs)
self.custom_email_subject = custom_email_subject
self.custom_webhook_payload = custom_webhook_payload
self.group_ids = group_ids
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .proxy_resource import ProxyResource


class Alert(Resource):
class Alert(ProxyResource):
"""An alert created in alert management service.

Variables are only populated by the server, and will be ignored when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .proxy_resource import ProxyResource


class AlertModification(Resource):
class AlertModification(ProxyResource):
"""Alert Modification details.

Variables are only populated by the server, and will be ignored when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource_py3 import Resource
from .proxy_resource_py3 import ProxyResource


class AlertModification(Resource):
class AlertModification(ProxyResource):
"""Alert Modification details.

Variables are only populated by the server, and will be ignored when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource_py3 import Resource
from .proxy_resource_py3 import ProxyResource


class Alert(Resource):
class Alert(ProxyResource):
"""An alert created in alert management service.

Variables are only populated by the server, and will be ignored when
Expand Down
Loading