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
Prev Previous commit
Next Next commit
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
  • Loading branch information
AutorestCI committed Apr 23, 2018
commit 72a9a8920c6d80d56b3e12230cc28e6875bbf0c8
5 changes: 0 additions & 5 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .sku1_py3 import Sku1
from .log_search_rule_resource_py3 import LogSearchRuleResource
from .trigger_condition_py3 import TriggerCondition
from .az_ns_action_group_py3 import AzNsActionGroup
Expand Down Expand Up @@ -194,7 +193,6 @@
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .sku1 import Sku1
from .log_search_rule_resource import LogSearchRuleResource
from .trigger_condition import TriggerCondition
from .az_ns_action_group import AzNsActionGroup
Expand Down Expand Up @@ -230,7 +228,6 @@
Enabled,
ProvisioningState,
QueryType,
Sku,
AlertSeverity,
ResultType,
)
Expand Down Expand Up @@ -325,7 +322,6 @@
'MetricAlertSingleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'Sku1',
'LogSearchRuleResource',
'TriggerCondition',
'AzNsActionGroup',
Expand Down Expand Up @@ -360,7 +356,6 @@
'Enabled',
'ProvisioningState',
'QueryType',
'Sku',
'AlertSeverity',
'ResultType',
]
15 changes: 8 additions & 7 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/alerting_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ class AlertingAction(Action):
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param severity: Severity of the alert. Possible values include: '0', '1',
'2', '3', '4'
: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 throttle_till_date: Time untill alert should not be fired in
ISO8601 format.
:type throttle_till_date: datetime
: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},
}
Expand All @@ -48,14 +49,14 @@ class AlertingAction(Action):
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
'throttle_till_date': {'key': 'throttleTillDate', 'type': 'iso-8601'},
'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.throttle_till_date = kwargs.get('throttle_till_date', 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'
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ class AlertingAction(Action):
:type webhook_properties: dict[str, str]
:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param severity: Severity of the alert. Possible values include: '0', '1',
'2', '3', '4'
: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 throttle_till_date: Time untill alert should not be fired in
ISO8601 format.
:type throttle_till_date: datetime
: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},
}
Expand All @@ -48,14 +49,14 @@ class AlertingAction(Action):
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'severity': {'key': 'severity', 'type': 'str'},
'azns_action': {'key': 'aznsAction', 'type': 'AzNsActionGroup'},
'throttle_till_date': {'key': 'throttleTillDate', 'type': 'iso-8601'},
'throttling_in_min': {'key': 'throttlingInMin', 'type': 'int'},
'trigger': {'key': 'trigger', 'type': 'TriggerCondition'},
}

def __init__(self, *, azns_action, trigger, action_group_id: str=None, webhook_properties=None, severity=None, throttle_till_date=None, **kwargs) -> None:
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)
self.severity = severity
self.azns_action = azns_action
self.throttle_till_date = throttle_till_date
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'
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ class DiagnosticSettingsCategoryResource(ProxyOnlyResource):
}

def __init__(self, *, category_type=None, **kwargs) -> None:
super(DiagnosticSettingsCategoryResource, self).__init__(, **kwargs)
super(DiagnosticSettingsCategoryResource, self).__init__(**kwargs)
self.category_type = category_type
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
}

def __init__(self, *, storage_account_id: str=None, event_hub_authorization_rule_id: str=None, event_hub_name: str=None, metrics=None, logs=None, workspace_id: str=None, **kwargs) -> None:
super(DiagnosticSettingsResource, self).__init__(, **kwargs)
super(DiagnosticSettingsResource, self).__init__(**kwargs)
self.storage_account_id = storage_account_id
self.event_hub_authorization_rule_id = event_hub_authorization_rule_id
self.event_hub_name = event_hub_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class LogSearchRuleResource(Resource):
:type schedule: ~azure.mgmt.monitor.models.Schedule
:param action: Required. Action needs to be taken on rule execution.
:type action: ~azure.mgmt.monitor.models.Action
:param sku: Sku of the Log Search Rule
:type sku: ~azure.mgmt.monitor.models.Sku1
"""

_validation = {
Expand All @@ -71,13 +69,12 @@ class LogSearchRuleResource(Resource):
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'description': {'key': 'properties.description', 'type': 'str'},
'enabled': {'key': 'properties.Enabled', 'type': 'str'},
'enabled': {'key': 'properties.enabled', 'type': 'str'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'source': {'key': 'properties.source', 'type': 'Source'},
'schedule': {'key': 'properties.schedule', 'type': 'Schedule'},
'action': {'key': 'properties.action', 'type': 'Action'},
'sku': {'key': 'sku', 'type': 'Sku1'},
}

def __init__(self, **kwargs):
Expand All @@ -89,4 +86,3 @@ def __init__(self, **kwargs):
self.source = kwargs.get('source', None)
self.schedule = kwargs.get('schedule', None)
self.action = kwargs.get('action', None)
self.sku = kwargs.get('sku', None)
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class LogSearchRuleResource(Resource):
:type schedule: ~azure.mgmt.monitor.models.Schedule
:param action: Required. Action needs to be taken on rule execution.
:type action: ~azure.mgmt.monitor.models.Action
:param sku: Sku of the Log Search Rule
:type sku: ~azure.mgmt.monitor.models.Sku1
"""

_validation = {
Expand All @@ -71,16 +69,15 @@ class LogSearchRuleResource(Resource):
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'description': {'key': 'properties.description', 'type': 'str'},
'enabled': {'key': 'properties.Enabled', 'type': 'str'},
'enabled': {'key': 'properties.enabled', 'type': 'str'},
'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'source': {'key': 'properties.source', 'type': 'Source'},
'schedule': {'key': 'properties.schedule', 'type': 'Schedule'},
'action': {'key': 'properties.action', 'type': 'Action'},
'sku': {'key': 'sku', 'type': 'Sku1'},
}

def __init__(self, *, location: str, source, schedule, action, tags=None, description: str=None, enabled=None, sku=None, **kwargs) -> None:
def __init__(self, *, location: str, source, schedule, action, tags=None, description: str=None, enabled=None, **kwargs) -> None:
super(LogSearchRuleResource, self).__init__(location=location, tags=tags, **kwargs)
self.description = description
self.enabled = enabled
Expand All @@ -89,4 +86,3 @@ def __init__(self, *, location: str, source, schedule, action, tags=None, descri
self.source = source
self.schedule = schedule
self.action = action
self.sku = sku
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,6 @@ class QueryType(str, Enum):
result_count = "ResultCount"


class Sku(str, Enum):

l1 = "L1"
l2 = "L2"
l3 = "L3"


class AlertSeverity(str, Enum):

zero = "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RuleEmailAction(RuleAction):
}

def __init__(self, *, send_to_service_owners: bool=None, custom_emails=None, **kwargs) -> None:
super(RuleEmailAction, self).__init__(, **kwargs)
super(RuleEmailAction, self).__init__(**kwargs)
self.send_to_service_owners = send_to_service_owners
self.custom_emails = custom_emails
self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction'
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RuleWebhookAction(RuleAction):
}

def __init__(self, *, service_uri: str=None, properties=None, **kwargs) -> None:
super(RuleWebhookAction, self).__init__(, **kwargs)
super(RuleWebhookAction, self).__init__(**kwargs)
self.service_uri = service_uri
self.properties = properties
self.odatatype = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction'
29 changes: 0 additions & 29 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/sku1.py

This file was deleted.

29 changes: 0 additions & 29 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/sku1_py3.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(
self.subscription_id = subscription_id


class MonitorManagementClient(object):
class MonitorManagementClient(SDKClient):
"""Monitor Management Client

:ivar config: Configuration for client.
Expand Down Expand Up @@ -121,7 +121,7 @@ def __init__(
self, credentials, subscription_id, base_url=None):

self.config = MonitorManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(MonitorManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down