Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Generated from 35adc5e493c20a57e6e2cb35d87c578133d2b7a6
[Monitor] Deconflict "Action" name in MetricAlert

Generates bad SDK.
  • Loading branch information
AutorestCI committed May 23, 2018
commit c4229cea73b0cbccb91bfada63eb38c3fc824030
9 changes: 6 additions & 3 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
from .baseline_response_py3 import BaselineResponse
from .time_series_information_py3 import TimeSeriesInformation
from .calculate_baseline_response_py3 import CalculateBaselineResponse
from .action_py3 import Action
from .metric_alert_action_py3 import MetricAlertAction
from .metric_alert_criteria_py3 import MetricAlertCriteria
from .action_py3 import Action
from .metric_alert_resource_py3 import MetricAlertResource
from .metric_alert_resource_patch_py3 import MetricAlertResourcePatch
from .metric_alert_status_properties_py3 import MetricAlertStatusProperties
Expand Down Expand Up @@ -181,8 +182,9 @@
from .baseline_response import BaselineResponse
from .time_series_information import TimeSeriesInformation
from .calculate_baseline_response import CalculateBaselineResponse
from .action import Action
from .metric_alert_action import MetricAlertAction
from .metric_alert_criteria import MetricAlertCriteria
from .action import Action
from .metric_alert_resource import MetricAlertResource
from .metric_alert_resource_patch import MetricAlertResourcePatch
from .metric_alert_status_properties import MetricAlertStatusProperties
Expand Down Expand Up @@ -310,8 +312,9 @@
'BaselineResponse',
'TimeSeriesInformation',
'CalculateBaselineResponse',
'Action',
'MetricAlertAction',
'MetricAlertCriteria',
'Action',
'MetricAlertResource',
'MetricAlertResourcePatch',
'MetricAlertStatusProperties',
Expand Down
10 changes: 1 addition & 9 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@


class Action(Model):
"""An alert action.
"""Action.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
"""
Expand All @@ -33,8 +29,6 @@ class Action(Model):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
}

Expand All @@ -44,6 +38,4 @@ class Action(Model):

def __init__(self, **kwargs):
super(Action, self).__init__(**kwargs)
self.action_group_id = kwargs.get('action_group_id', None)
self.webhook_properties = kwargs.get('webhook_properties', None)
self.odatatype = None
12 changes: 2 additions & 10 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@


class Action(Model):
"""An alert action.
"""Action.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
"""
Expand All @@ -33,17 +29,13 @@ class Action(Model):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
}

_subtype_map = {
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction'}
}

def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
def __init__(self, **kwargs) -> None:
super(Action, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
self.odatatype = None
10 changes: 2 additions & 8 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ class AlertingAction(Action):

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
: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. azns notification group reference.
: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
throttled or suppressed.
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand All @@ -44,8 +40,6 @@ class AlertingAction(Action):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ class AlertingAction(Action):

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

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
: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. azns notification group reference.
: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
throttled or suppressed.
:type throttling_in_min: int
:param trigger: Required. The trigger condition that results in the alert
rule being.
Expand All @@ -44,17 +40,15 @@ class AlertingAction(Action):
}

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
'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, action_group_id: str=None, webhook_properties=None, throttling_in_min: int=None, **kwargs) -> None:
super(AlertingAction, self).__init__(action_group_id=action_group_id, webhook_properties=webhook_properties, **kwargs)
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@


class AzNsActionGroup(Model):
"""azns notification group.
"""Azure action group.

:param action_group: Azure Group reference.
:param action_group: Azure Action Group reference.
:type action_group: list[str]
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom webhook payload to be send to azns
:param email_subject: Custom subject override for all email ids in Azure
action group
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:type custom_webhook_payload: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@


class AzNsActionGroup(Model):
"""azns notification group.
"""Azure action group.

:param action_group: Azure Group reference.
:param action_group: Azure Action Group reference.
:type action_group: list[str]
:param email_subject: Custom subject for Azns email
:type email_subject: str
:param custom_webhook_payload: Custom webhook payload to be send to azns
:param email_subject: Custom subject override for all email ids in Azure
action group
:type email_subject: str
:param custom_webhook_payload: Custom payload to be sent for all webook
URI in Azure action group
:type custom_webhook_payload: str
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -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 MetricAlertAction(Model):
"""An alert action.

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
"""

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(MetricAlertAction, self).__init__(**kwargs)
self.action_group_id = kwargs.get('action_group_id', None)
self.webhook_properties = kwargs.get('webhook_properties', None)
Original file line number Diff line number Diff line change
@@ -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 MetricAlertAction(Model):
"""An alert action.

:param action_group_id: the id of the action group to use.
:type action_group_id: str
:param webhook_properties:
:type webhook_properties: dict[str, str]
"""

_attribute_map = {
'action_group_id': {'key': 'actionGroupId', 'type': 'str'},
'webhook_properties': {'key': 'webhookProperties', 'type': '{str}'},
}

def __init__(self, *, action_group_id: str=None, webhook_properties=None, **kwargs) -> None:
super(MetricAlertAction, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
10 changes: 5 additions & 5 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class Source(Model):
:type query: str
:param authorized_resources: List of Resource referred into query
:type authorized_resources: list[str]
:param datasource_id: Required. The resource uri over which log search
:param data_source_id: Required. The resource uri over which log search
query is to be run.
:type datasource_id: str
:type data_source_id: str
:param query_type: Set value to ResultCount if query should be returning
search result count. Set it to Number if its a metric query. Possible
values include: 'ResultCount'
Expand All @@ -32,19 +32,19 @@ class Source(Model):

_validation = {
'query': {'required': True},
'datasource_id': {'required': True},
'data_source_id': {'required': True},
}

_attribute_map = {
'query': {'key': 'query', 'type': 'str'},
'authorized_resources': {'key': 'authorizedResources', 'type': '[str]'},
'datasource_id': {'key': 'datasourceId', 'type': 'str'},
'data_source_id': {'key': 'dataSourceId', 'type': 'str'},
'query_type': {'key': 'queryType', 'type': 'str'},
}

def __init__(self, **kwargs):
super(Source, self).__init__(**kwargs)
self.query = kwargs.get('query', None)
self.authorized_resources = kwargs.get('authorized_resources', None)
self.datasource_id = kwargs.get('datasource_id', None)
self.data_source_id = kwargs.get('data_source_id', None)
self.query_type = kwargs.get('query_type', None)
12 changes: 6 additions & 6 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/source_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class Source(Model):
:type query: str
:param authorized_resources: List of Resource referred into query
:type authorized_resources: list[str]
:param datasource_id: Required. The resource uri over which log search
:param data_source_id: Required. The resource uri over which log search
query is to be run.
:type datasource_id: str
:type data_source_id: str
:param query_type: Set value to ResultCount if query should be returning
search result count. Set it to Number if its a metric query. Possible
values include: 'ResultCount'
Expand All @@ -32,19 +32,19 @@ class Source(Model):

_validation = {
'query': {'required': True},
'datasource_id': {'required': True},
'data_source_id': {'required': True},
}

_attribute_map = {
'query': {'key': 'query', 'type': 'str'},
'authorized_resources': {'key': 'authorizedResources', 'type': '[str]'},
'datasource_id': {'key': 'datasourceId', 'type': 'str'},
'data_source_id': {'key': 'dataSourceId', 'type': 'str'},
'query_type': {'key': 'queryType', 'type': 'str'},
}

def __init__(self, *, query: str, datasource_id: str, authorized_resources=None, query_type=None, **kwargs) -> None:
def __init__(self, *, query: str, data_source_id: str, authorized_resources=None, query_type=None, **kwargs) -> None:
super(Source, self).__init__(**kwargs)
self.query = query
self.authorized_resources = authorized_resources
self.datasource_id = datasource_id
self.data_source_id = data_source_id
self.query_type = query_type