Skip to content

Commit

Permalink
[AutoPR monitor/resource-manager] Added GA API version for Scheduled …
Browse files Browse the repository at this point in the history
…Query Rule (#2416)

* Generated from d183bad923d3a0a4092d21203f850db6cde9f4e9

Resolving Comments

Resolving Comments

* Generated from df40ac3bbf17ea0180dd4adff2af3094065feca0

Made SKU as top level proprty and including generic error response format

Couple of changes -
1. Made SKU as top level proprty as mentioned here - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#put-resource
 2. including generic error response format

* Generated from 7578160670750a68d05f77ec8163b25bb72f391e

Minor Changes to align implementation

1. Removed SKU - Billing Model is still under discussion, hence need not to be exposed to customers.
2.  Enabled field ichanged to align with camel case.
3.  'throttleTillDate' in properties.action changed to 'throttlingInMin' to denote correct meaning  and it’s data type changed to number instead of date.
4. 'status' to be removed in properties.action from examples.
5.  'severity' made a required field in properties.action.
6. Removed Examples from original spec json

* Generated from fb180fb311d73934d0f5150f72638cc3de155ea0

Added Default Response payload in all APIs

Changes -
1. Added Default Response payload in all APIs
2. Made azNs description more clear

* Generated from fb180fb311d73934d0f5150f72638cc3de155ea0

Added Default Response payload in all APIs

Changes -
1. Added Default Response payload in all APIs
2. Made azNs description more clear
  • Loading branch information
AutorestCI authored Apr 24, 2018
1 parent 0c48dd2 commit d19dcb8
Show file tree
Hide file tree
Showing 53 changed files with 3,222 additions and 9 deletions.
73 changes: 73 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
from .itsm_receiver_py3 import ItsmReceiver
from .azure_app_push_receiver_py3 import AzureAppPushReceiver
from .automation_runbook_receiver_py3 import AutomationRunbookReceiver
from .voice_receiver_py3 import VoiceReceiver
from .logic_app_receiver_py3 import LogicAppReceiver
from .azure_function_receiver_py3 import AzureFunctionReceiver
from .action_group_resource_py3 import ActionGroupResource
from .enable_request_py3 import EnableRequest
from .action_group_patch_body_py3 import ActionGroupPatchBody
Expand All @@ -84,6 +87,22 @@
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_criteria_py3 import MetricAlertCriteria
from .metric_alert_resource_py3 import MetricAlertResource
from .metric_alert_resource_patch_py3 import MetricAlertResourcePatch
from .metric_alert_status_properties_py3 import MetricAlertStatusProperties
from .metric_alert_status_py3 import MetricAlertStatus
from .metric_alert_status_collection_py3 import MetricAlertStatusCollection
from .metric_dimension_py3 import MetricDimension
from .metric_criteria_py3 import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .log_search_rule_resource_py3 import LogSearchRuleResource
from .trigger_condition_py3 import TriggerCondition
from .az_ns_action_group_py3 import AzNsActionGroup
from .alerting_action_py3 import AlertingAction
except (SyntaxError, ImportError):
from .resource import Resource
from .scale_capacity import ScaleCapacity
Expand Down Expand Up @@ -134,6 +153,9 @@
from .itsm_receiver import ItsmReceiver
from .azure_app_push_receiver import AzureAppPushReceiver
from .automation_runbook_receiver import AutomationRunbookReceiver
from .voice_receiver import VoiceReceiver
from .logic_app_receiver import LogicAppReceiver
from .azure_function_receiver import AzureFunctionReceiver
from .action_group_resource import ActionGroupResource
from .enable_request import EnableRequest
from .action_group_patch_body import ActionGroupPatchBody
Expand All @@ -159,6 +181,22 @@
from .baseline_response import BaselineResponse
from .time_series_information import TimeSeriesInformation
from .calculate_baseline_response import CalculateBaselineResponse
from .action import Action
from .metric_alert_criteria import MetricAlertCriteria
from .metric_alert_resource import MetricAlertResource
from .metric_alert_resource_patch import MetricAlertResourcePatch
from .metric_alert_status_properties import MetricAlertStatusProperties
from .metric_alert_status import MetricAlertStatus
from .metric_alert_status_collection import MetricAlertStatusCollection
from .metric_dimension import MetricDimension
from .metric_criteria import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .log_search_rule_resource import LogSearchRuleResource
from .trigger_condition import TriggerCondition
from .az_ns_action_group import AzNsActionGroup
from .alerting_action import AlertingAction
from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged
from .incident_paged import IncidentPaged
from .alert_rule_resource_paged import AlertRuleResourcePaged
Expand All @@ -168,10 +206,14 @@
from .event_data_paged import EventDataPaged
from .localizable_string_paged import LocalizableStringPaged
from .metric_definition_paged import MetricDefinitionPaged
from .metric_alert_resource_paged import MetricAlertResourcePaged
from .log_search_rule_resource_paged import LogSearchRuleResourcePaged
from .monitor_management_client_enums import (
MetricStatisticType,
TimeAggregationType,
ComparisonOperationType,
ConditionalOperator,
MetricTriggerType,
ScaleDirection,
ScaleType,
RecurrenceFrequency,
Expand All @@ -183,6 +225,10 @@
Unit,
AggregationType,
Sensitivity,
Enabled,
ProvisioningState,
QueryType,
AlertSeverity,
ResultType,
)

Expand Down Expand Up @@ -236,6 +282,9 @@
'ItsmReceiver',
'AzureAppPushReceiver',
'AutomationRunbookReceiver',
'VoiceReceiver',
'LogicAppReceiver',
'AzureFunctionReceiver',
'ActionGroupResource',
'EnableRequest',
'ActionGroupPatchBody',
Expand All @@ -261,6 +310,22 @@
'BaselineResponse',
'TimeSeriesInformation',
'CalculateBaselineResponse',
'Action',
'MetricAlertCriteria',
'MetricAlertResource',
'MetricAlertResourcePatch',
'MetricAlertStatusProperties',
'MetricAlertStatus',
'MetricAlertStatusCollection',
'MetricDimension',
'MetricCriteria',
'MetricAlertSingleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'LogSearchRuleResource',
'TriggerCondition',
'AzNsActionGroup',
'AlertingAction',
'AutoscaleSettingResourcePaged',
'IncidentPaged',
'AlertRuleResourcePaged',
Expand All @@ -270,9 +335,13 @@
'EventDataPaged',
'LocalizableStringPaged',
'MetricDefinitionPaged',
'MetricAlertResourcePaged',
'LogSearchRuleResourcePaged',
'MetricStatisticType',
'TimeAggregationType',
'ComparisonOperationType',
'ConditionalOperator',
'MetricTriggerType',
'ScaleDirection',
'ScaleType',
'RecurrenceFrequency',
Expand All @@ -284,5 +353,9 @@
'Unit',
'AggregationType',
'Sensitivity',
'Enabled',
'ProvisioningState',
'QueryType',
'AlertSeverity',
'ResultType',
]
49 changes: 49 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 Action(Model):
"""An alert 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
"""

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

_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, **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
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ class ActionGroupResource(Resource):
receivers that are part of this action group.
:type automation_runbook_receivers:
list[~azure.mgmt.monitor.models.AutomationRunbookReceiver]
:param voice_receivers: The list of voice receivers that are part of this
action group.
:type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver]
:param logic_app_receivers: The list of logic app receivers that are part
of this action group.
:type logic_app_receivers:
list[~azure.mgmt.monitor.models.LogicAppReceiver]
:param azure_function_receivers: The list of azure function receivers that
are part of this action group.
:type azure_function_receivers:
list[~azure.mgmt.monitor.models.AzureFunctionReceiver]
"""

_validation = {
Expand All @@ -82,6 +93,9 @@ class ActionGroupResource(Resource):
'itsm_receivers': {'key': 'properties.itsmReceivers', 'type': '[ItsmReceiver]'},
'azure_app_push_receivers': {'key': 'properties.azureAppPushReceivers', 'type': '[AzureAppPushReceiver]'},
'automation_runbook_receivers': {'key': 'properties.automationRunbookReceivers', 'type': '[AutomationRunbookReceiver]'},
'voice_receivers': {'key': 'properties.voiceReceivers', 'type': '[VoiceReceiver]'},
'logic_app_receivers': {'key': 'properties.logicAppReceivers', 'type': '[LogicAppReceiver]'},
'azure_function_receivers': {'key': 'properties.azureFunctionReceivers', 'type': '[AzureFunctionReceiver]'},
}

def __init__(self, **kwargs):
Expand All @@ -94,3 +108,6 @@ def __init__(self, **kwargs):
self.itsm_receivers = kwargs.get('itsm_receivers', None)
self.azure_app_push_receivers = kwargs.get('azure_app_push_receivers', None)
self.automation_runbook_receivers = kwargs.get('automation_runbook_receivers', None)
self.voice_receivers = kwargs.get('voice_receivers', None)
self.logic_app_receivers = kwargs.get('logic_app_receivers', None)
self.azure_function_receivers = kwargs.get('azure_function_receivers', None)
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ class ActionGroupResource(Resource):
receivers that are part of this action group.
:type automation_runbook_receivers:
list[~azure.mgmt.monitor.models.AutomationRunbookReceiver]
:param voice_receivers: The list of voice receivers that are part of this
action group.
:type voice_receivers: list[~azure.mgmt.monitor.models.VoiceReceiver]
:param logic_app_receivers: The list of logic app receivers that are part
of this action group.
:type logic_app_receivers:
list[~azure.mgmt.monitor.models.LogicAppReceiver]
:param azure_function_receivers: The list of azure function receivers that
are part of this action group.
:type azure_function_receivers:
list[~azure.mgmt.monitor.models.AzureFunctionReceiver]
"""

_validation = {
Expand All @@ -82,9 +93,12 @@ class ActionGroupResource(Resource):
'itsm_receivers': {'key': 'properties.itsmReceivers', 'type': '[ItsmReceiver]'},
'azure_app_push_receivers': {'key': 'properties.azureAppPushReceivers', 'type': '[AzureAppPushReceiver]'},
'automation_runbook_receivers': {'key': 'properties.automationRunbookReceivers', 'type': '[AutomationRunbookReceiver]'},
'voice_receivers': {'key': 'properties.voiceReceivers', 'type': '[VoiceReceiver]'},
'logic_app_receivers': {'key': 'properties.logicAppReceivers', 'type': '[LogicAppReceiver]'},
'azure_function_receivers': {'key': 'properties.azureFunctionReceivers', 'type': '[AzureFunctionReceiver]'},
}

def __init__(self, *, location: str, group_short_name: str, tags=None, enabled: bool=True, email_receivers=None, sms_receivers=None, webhook_receivers=None, itsm_receivers=None, azure_app_push_receivers=None, automation_runbook_receivers=None, **kwargs) -> None:
def __init__(self, *, location: str, group_short_name: str, tags=None, enabled: bool=True, email_receivers=None, sms_receivers=None, webhook_receivers=None, itsm_receivers=None, azure_app_push_receivers=None, automation_runbook_receivers=None, voice_receivers=None, logic_app_receivers=None, azure_function_receivers=None, **kwargs) -> None:
super(ActionGroupResource, self).__init__(location=location, tags=tags, **kwargs)
self.group_short_name = group_short_name
self.enabled = enabled
Expand All @@ -94,3 +108,6 @@ def __init__(self, *, location: str, group_short_name: str, tags=None, enabled:
self.itsm_receivers = itsm_receivers
self.azure_app_push_receivers = azure_app_push_receivers
self.automation_runbook_receivers = automation_runbook_receivers
self.voice_receivers = voice_receivers
self.logic_app_receivers = logic_app_receivers
self.azure_function_receivers = azure_function_receivers
49 changes: 49 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 Action(Model):
"""An alert 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
"""

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

_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:
super(Action, self).__init__(**kwargs)
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
self.odatatype = None
62 changes: 62 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py
Original file line number Diff line number Diff line change
@@ -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 .action 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 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.
:type azns_action: ~azure.mgmt.monitor.models.AzNsActionGroup
:param throttling_in_min: time (in minutes) for which Alerts should be
throttled
: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 = {
'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, **kwargs):
super(AlertingAction, self).__init__(**kwargs)
self.severity = kwargs.get('severity', None)
self.azns_action = kwargs.get('azns_action', None)
self.throttling_in_min = kwargs.get('throttling_in_min', None)
self.trigger = kwargs.get('trigger', None)
self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction'
Loading

0 comments on commit d19dcb8

Please sign in to comment.