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 796b77aad1e4117699fe386eb6bd5245d8bfac9c
Fixing the linter diff errors
  • Loading branch information
AutorestCI committed Sep 13, 2018
commit 97504872370e7321ff45a6b78a5019d37af2f816
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,11 @@ class AlertsManagementClientConfiguration(AzureConfiguration):
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param monitor_service1: Filter by monitor service which is the source of
the alert instance. Default value is select all. Possible values include:
'Application Insights', 'ActivityLog Administrative', 'ActivityLog
Security', 'ActivityLog Recommendation', 'ActivityLog Policy',
'ActivityLog Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM',
'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix'
:type monitor_service1: str or
~azure.mgmt.alertsmanagement.models.MonitorService
:param alert_rule: Filter by alert rule(monitor) which fired alert
instance. Default value is to select all.
:type alert_rule: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, monitor_service1=None, alert_rule=None, base_url=None):
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
Expand All @@ -62,8 +51,6 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.monitor_service1 = monitor_service1
self.alert_rule = alert_rule


class AlertsManagementClient(SDKClient):
Expand All @@ -86,24 +73,13 @@ class AlertsManagementClient(SDKClient):
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param monitor_service1: Filter by monitor service which is the source of
the alert instance. Default value is select all. Possible values include:
'Application Insights', 'ActivityLog Administrative', 'ActivityLog
Security', 'ActivityLog Recommendation', 'ActivityLog Policy',
'ActivityLog Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM',
'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix'
:type monitor_service1: str or
~azure.mgmt.alertsmanagement.models.MonitorService
:param alert_rule: Filter by alert rule(monitor) which fired alert
instance. Default value is to select all.
:type alert_rule: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, monitor_service1=None, alert_rule=None, base_url=None):
self, credentials, subscription_id, base_url=None):

self.config = AlertsManagementClientConfiguration(credentials, subscription_id, monitor_service1, alert_rule, base_url)
self.config = AlertsManagementClientConfiguration(credentials, subscription_id, 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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get_all(
self, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_condition=None, severity=None, alert_state=None, smart_group_id=None, include_context=None, include_egress_config=None, page_count=None, sort_by=None, sort_order=None, sort_order1=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
self, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, smart_group_id=None, include_context=None, include_egress_config=None, page_count=None, sort_by=None, sort_order=None, sort_order1=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
"""List all the existing alerts, where the results can be selective by
passing multiple filter parameters including time range and sorted on
specific fields. .
Expand All @@ -51,6 +51,15 @@ def get_all(
:param target_resource_group: Filter by target resource group name.
Default value is select all.
:type target_resource_group: str
:param monitor_service: Filter by monitor service which is the source
of the alert instance. Default value is select all. Possible values
include: 'Application Insights', 'ActivityLog Administrative',
'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
'Zabbix'
:type monitor_service: str or
~azure.mgmt.alertsmanagement.models.MonitorService
:param monitor_condition: Filter by monitor condition which is the
state of the monitor(alertRule) at monitor service. Default value is
to select all. Possible values include: 'Fired', 'Resolved'
Expand All @@ -64,6 +73,9 @@ def get_all(
'Acknowledged', 'Closed'
:type alert_state: str or
~azure.mgmt.alertsmanagement.models.AlertState
:param alert_rule: Filter by alert rule(monitor) which fired alert
instance. Default value is to select all.
:type alert_rule: str
:param smart_group_id: Filter the alerts list by the Smart Group Id.
Default value is none.
:type smart_group_id: str
Expand Down Expand Up @@ -134,16 +146,16 @@ def internal_paging(next_link=None, raw=False):
query_parameters['targetResourceType'] = self._serialize.query("target_resource_type", target_resource_type, 'str')
if target_resource_group is not None:
query_parameters['targetResourceGroup'] = self._serialize.query("target_resource_group", target_resource_group, 'str')
if self.config.monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("self.config.monitor_service", self.config.monitor_service, 'str')
if monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("monitor_service", monitor_service, 'str')
if monitor_condition is not None:
query_parameters['monitorCondition'] = self._serialize.query("monitor_condition", monitor_condition, 'str')
if severity is not None:
query_parameters['severity'] = self._serialize.query("severity", severity, 'str')
if alert_state is not None:
query_parameters['alertState'] = self._serialize.query("alert_state", alert_state, 'str')
if self.config.alert_rule is not None:
query_parameters['alertRule'] = self._serialize.query("self.config.alert_rule", self.config.alert_rule, 'str')
if alert_rule is not None:
query_parameters['alertRule'] = self._serialize.query("alert_rule", alert_rule, 'str')
if smart_group_id is not None:
query_parameters['smartGroupId'] = self._serialize.query("smart_group_id", smart_group_id, 'str')
if include_context is not None:
Expand Down Expand Up @@ -379,7 +391,7 @@ def get_history(
get_history.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'}

def get_summary(
self, groupby, include_smart_groups_count=None, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_condition=None, severity=None, alert_state=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
self, groupby, include_smart_groups_count=None, target_resource=None, target_resource_type=None, target_resource_group=None, monitor_service=None, monitor_condition=None, severity=None, alert_state=None, alert_rule=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config):
"""Summary of alerts with the count each severity.

:param groupby: This parameter allows the result set to be aggregated
Expand All @@ -400,6 +412,15 @@ def get_summary(
:param target_resource_group: Filter by target resource group name.
Default value is select all.
:type target_resource_group: str
:param monitor_service: Filter by monitor service which is the source
of the alert instance. Default value is select all. Possible values
include: 'Application Insights', 'ActivityLog Administrative',
'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
'Zabbix'
:type monitor_service: str or
~azure.mgmt.alertsmanagement.models.MonitorService
:param monitor_condition: Filter by monitor condition which is the
state of the monitor(alertRule) at monitor service. Default value is
to select all. Possible values include: 'Fired', 'Resolved'
Expand All @@ -413,6 +434,9 @@ def get_summary(
'Acknowledged', 'Closed'
:type alert_state: str or
~azure.mgmt.alertsmanagement.models.AlertState
:param alert_rule: Filter by alert rule(monitor) which fired alert
instance. Default value is to select all.
:type alert_rule: str
:param time_range: Filter by time range by below listed values.
Default value is 1 day. Possible values include: '1h', '1d', '7d',
'30d'
Expand Down Expand Up @@ -452,16 +476,16 @@ def get_summary(
query_parameters['targetResourceType'] = self._serialize.query("target_resource_type", target_resource_type, 'str')
if target_resource_group is not None:
query_parameters['targetResourceGroup'] = self._serialize.query("target_resource_group", target_resource_group, 'str')
if self.config.monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("self.config.monitor_service", self.config.monitor_service, 'str')
if monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("monitor_service", monitor_service, 'str')
if monitor_condition is not None:
query_parameters['monitorCondition'] = self._serialize.query("monitor_condition", monitor_condition, 'str')
if severity is not None:
query_parameters['severity'] = self._serialize.query("severity", severity, 'str')
if alert_state is not None:
query_parameters['alertState'] = self._serialize.query("alert_state", alert_state, 'str')
if self.config.alert_rule is not None:
query_parameters['alertRule'] = self._serialize.query("self.config.alert_rule", self.config.alert_rule, 'str')
if alert_rule is not None:
query_parameters['alertRule'] = self._serialize.query("alert_rule", alert_rule, 'str')
if time_range is not None:
query_parameters['timeRange'] = self._serialize.query("time_range", time_range, 'str')
if custom_time_range is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def get_all(
self, target_resource=None, target_resource_group=None, target_resource_type=None, monitor_condition=None, severity=None, smart_group_state=None, time_range=None, page_count=None, sort_by=None, sort_order=None, custom_headers=None, raw=False, **operation_config):
self, target_resource=None, target_resource_group=None, target_resource_type=None, monitor_service=None, monitor_condition=None, severity=None, smart_group_state=None, time_range=None, page_count=None, sort_by=None, sort_order=None, custom_headers=None, raw=False, **operation_config):
"""Get all smartGroups within the subscription.

List all the smartGroups within the specified subscription. .
Expand All @@ -51,6 +51,15 @@ def get_all(
:param target_resource_type: Filter by target resource type. Default
value is select all.
:type target_resource_type: str
:param monitor_service: Filter by monitor service which is the source
of the alert instance. Default value is select all. Possible values
include: 'Application Insights', 'ActivityLog Administrative',
'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog
Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios',
'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights',
'Zabbix'
:type monitor_service: str or
~azure.mgmt.alertsmanagement.models.MonitorService
:param monitor_condition: Filter by monitor condition which is the
state of the monitor(alertRule) at monitor service. Default value is
to select all. Possible values include: 'Fired', 'Resolved'
Expand Down Expand Up @@ -109,8 +118,8 @@ def get_all(
query_parameters['targetResourceGroup'] = self._serialize.query("target_resource_group", target_resource_group, 'str')
if target_resource_type is not None:
query_parameters['targetResourceType'] = self._serialize.query("target_resource_type", target_resource_type, 'str')
if self.config.monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("self.config.monitor_service", self.config.monitor_service, 'str')
if monitor_service is not None:
query_parameters['monitorService'] = self._serialize.query("monitor_service", monitor_service, 'str')
if monitor_condition is not None:
query_parameters['monitorCondition'] = self._serialize.query("monitor_condition", monitor_condition, 'str')
if severity is not None:
Expand Down