File: alerting_action_py3.py

package info (click to toggle)
python-azure 20181112%2Bgit-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 407,300 kB
  • sloc: python: 717,190; makefile: 201; sh: 76
file content (56 lines) | stat: -rw-r--r-- 2,409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .action_py3 import Action


class AlertingAction(Action):
    """Specifiy action need to be taken when rule type is Alert.

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

    :param odatatype: Required. Constant filled by server.
    :type odatatype: str
    :param severity: Required. Severity of the alert. Possible values include:
     '0', '1', '2', '3', '4'
    :type severity: str or ~azure.mgmt.monitor.models.AlertSeverity
    :param azns_action: Required. Azure action group reference.
    :type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
    :param throttling_in_min: time (in minutes) for which Alerts should be
     throttled or suppressed.
    :type throttling_in_min: int
    :param trigger: Required. The trigger condition that results in the alert
     rule being.
    :type trigger: ~azure.mgmt.monitor.models.TriggerCondition
    """

    _validation = {
        'odatatype': {'required': True},
        'severity': {'required': True},
        'azns_action': {'required': True},
        'trigger': {'required': True},
    }

    _attribute_map = {
        'odatatype': {'key': 'odata\\.type', 'type': 'str'},
        'severity': {'key': 'severity', 'type': 'str'},
        'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
        'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'},
        'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
    }

    def __init__(self, *, severity, azns_action, trigger, throttling_in_min: int=None, **kwargs) -> None:
        super(AlertingAction, self).__init__(**kwargs)
        self.severity = severity
        self.azns_action = azns_action
        self.throttling_in_min = throttling_in_min
        self.trigger = trigger
        self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction'