azure.mgmt.alertsmanagement.operations module

class azure.mgmt.alertsmanagement.operations.Operations(client, config, serializer, deserializer)[source]

Bases: object

Operations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – API version. Constant value: “2018-05-05”.

list(custom_headers=None, raw=False, **operation_config)[source]

List all operations available through Azure Alerts Management Resource Provider.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Operation

Return type:

OperationPaged[Operation]

Raises:

CloudError

models = <module 'azure.mgmt.alertsmanagement.models' from '/usr/lib/python3/dist-packages/azure/mgmt/alertsmanagement/models/__init__.py'>
class azure.mgmt.alertsmanagement.operations.AlertsOperations(client, config, serializer, deserializer)[source]

Bases: object

AlertsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – API version. Constant value: “2018-05-05”.

change_state(alert_id, new_state, custom_headers=None, raw=False, **operation_config)[source]

Change the state of the alert.

Parameters:
  • alert_id (str) – Unique ID of an alert instance.
  • new_state (str or AlertState) – New state of the alert. Possible values include: ‘New’, ‘Acknowledged’, ‘Closed’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Alert or ClientRawResponse if raw=true

Return type:

Alert or ClientRawResponse

Raises:

ErrorResponseException

get_all(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, select=None, time_range=None, custom_time_range=None, custom_headers=None, raw=False, **operation_config)[source]

List all the existing alerts, where the results can be selective by passing multiple filter parameters including time range and sorted on specific fields. .

Parameters:
  • target_resource (str) – Filter by target resource( which is full ARM ID) Default value is select all.
  • target_resource_type (str) – Filter by target resource type. Default value is select all.
  • target_resource_group (str) – Filter by target resource group name. Default value is select all.
  • monitor_service (str or MonitorService) – 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’
  • monitor_condition (str or MonitorCondition) – 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’
  • severity (str or Severity) – Filter by severity. Defaut value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’
  • alert_state (str or AlertState) – Filter by state of the alert instance. Default value is to select all. Possible values include: ‘New’, ‘Acknowledged’, ‘Closed’
  • alert_rule (str) – Filter by alert rule(monitor) which fired alert instance. Default value is to select all.
  • smart_group_id (str) – Filter the alerts list by the Smart Group Id. Default value is none.
  • include_context (bool) – Include context which has data contextual to the monitor service. Default value is false’
  • include_egress_config (bool) – Include egress config which would be used for displaying the content in portal. Default value is ‘false’.
  • page_count (int) – Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the “includeContent” filter is selected, maximum value allowed is 25. Default value is 25.
  • sort_by (str or AlertsSortByFields) – Sort the query results by input field, Default value is ‘lastModifiedDateTime’. Possible values include: ‘name’, ‘severity’, ‘alertState’, ‘monitorCondition’, ‘targetResource’, ‘targetResourceName’, ‘targetResourceGroup’, ‘targetResourceType’, ‘startDateTime’, ‘lastModifiedDateTime’
  • sort_order (str) – Sort the query results order in either ascending or descending. Default value is ‘desc’ for time fields and ‘asc’ for others. Possible values include: ‘asc’, ‘desc’
  • select (str) – This filter allows to selection of the fields(comma seperated) which would be part of the the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section.
  • time_range (str or TimeRange) – Filter by time range by below listed values. Default value is 1 day. Possible values include: ‘1h’, ‘1d’, ‘7d’, ‘30d’
  • custom_time_range (str) – Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)’. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Alert

Return type:

AlertPaged[Alert]

Raises:

ErrorResponseException

get_by_id(alert_id, custom_headers=None, raw=False, **operation_config)[source]

Get a specific alert.

Get information related to a specific alert.

Parameters:
  • alert_id (str) – Unique ID of an alert instance.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Alert or ClientRawResponse if raw=true

Return type:

Alert or ClientRawResponse

Raises:

ErrorResponseException

get_history(alert_id, custom_headers=None, raw=False, **operation_config)[source]

Get the history of the changes of an alert.

Parameters:
  • alert_id (str) – Unique ID of an alert instance.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

AlertModification or ClientRawResponse if raw=true

Return type:

AlertModification or ClientRawResponse

Raises:

ErrorResponseException

get_summary(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)[source]

Summary of alerts with the count each severity.

Parameters:
  • groupby (str or AlertsSummaryGroupByFields) – This parameter allows the result set to be aggregated by input fields. For example, groupby=severity,alertstate. Possible values include: ‘severity’, ‘alertState’, ‘monitorCondition’, ‘monitorService’, ‘signalType’, ‘alertRule’
  • include_smart_groups_count (bool) – Include count of the SmartGroups as part of the summary. Default value is ‘false’.
  • target_resource (str) – Filter by target resource( which is full ARM ID) Default value is select all.
  • target_resource_type (str) – Filter by target resource type. Default value is select all.
  • target_resource_group (str) – Filter by target resource group name. Default value is select all.
  • monitor_service (str or MonitorService) – 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’
  • monitor_condition (str or MonitorCondition) – 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’
  • severity (str or Severity) – Filter by severity. Defaut value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’
  • alert_state (str or AlertState) – Filter by state of the alert instance. Default value is to select all. Possible values include: ‘New’, ‘Acknowledged’, ‘Closed’
  • alert_rule (str) – Filter by alert rule(monitor) which fired alert instance. Default value is to select all.
  • time_range (str or TimeRange) – Filter by time range by below listed values. Default value is 1 day. Possible values include: ‘1h’, ‘1d’, ‘7d’, ‘30d’
  • custom_time_range (str) – Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)’. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

AlertsSummary or ClientRawResponse if raw=true

Return type:

AlertsSummary or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.mgmt.alertsmanagement.models' from '/usr/lib/python3/dist-packages/azure/mgmt/alertsmanagement/models/__init__.py'>
class azure.mgmt.alertsmanagement.operations.SmartGroupsOperations(client, config, serializer, deserializer)[source]

Bases: object

SmartGroupsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – API version. Constant value: “2018-05-05”.

change_state(smart_group_id, new_state, custom_headers=None, raw=False, **operation_config)[source]

Change the state from unresolved to resolved and all the alerts within the smart group will also be resolved.

Parameters:
  • smart_group_id (str) – Smart group unique id.
  • new_state (str or AlertState) – New state of the alert. Possible values include: ‘New’, ‘Acknowledged’, ‘Closed’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

SmartGroup or ClientRawResponse if raw=true

Return type:

SmartGroup or ClientRawResponse

Raises:

ErrorResponseException

get_all(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)[source]

Get all smartGroups within the subscription.

List all the smartGroups within the specified subscription. .

Parameters:
  • target_resource (str) – Filter by target resource( which is full ARM ID) Default value is select all.
  • target_resource_group (str) – Filter by target resource group name. Default value is select all.
  • target_resource_type (str) – Filter by target resource type. Default value is select all.
  • monitor_service (str or MonitorService) – 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’
  • monitor_condition (str or MonitorCondition) – 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’
  • severity (str or Severity) – Filter by severity. Defaut value is select all. Possible values include: ‘Sev0’, ‘Sev1’, ‘Sev2’, ‘Sev3’, ‘Sev4’
  • smart_group_state (str or AlertState) – Filter by state of the smart group. Default value is to select all. Possible values include: ‘New’, ‘Acknowledged’, ‘Closed’
  • time_range (str or TimeRange) – Filter by time range by below listed values. Default value is 1 day. Possible values include: ‘1h’, ‘1d’, ‘7d’, ‘30d’
  • page_count (int) – Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the “includeContent” filter is selected, maximum value allowed is 25. Default value is 25.
  • sort_by (str or SmartGroupsSortByFields) – Sort the query results by input field Default value is sort by ‘lastModifiedDateTime’. Possible values include: ‘alertsCount’, ‘state’, ‘severity’, ‘startDateTime’, ‘lastModifiedDateTime’
  • sort_order (str) – Sort the query results order in either ascending or descending. Default value is ‘desc’ for time fields and ‘asc’ for others. Possible values include: ‘asc’, ‘desc’
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

SmartGroupsList or ClientRawResponse if raw=true

Return type:

SmartGroupsList or ClientRawResponse

Raises:

ErrorResponseException

get_by_id(smart_group_id, custom_headers=None, raw=False, **operation_config)[source]

Get information of smart alerts group.

Get details of smart group.

Parameters:
  • smart_group_id (str) – Smart group unique id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

SmartGroup or ClientRawResponse if raw=true

Return type:

SmartGroup or ClientRawResponse

Raises:

ErrorResponseException

get_history(smart_group_id, custom_headers=None, raw=False, **operation_config)[source]

Get the history of the changes of smart group.

Parameters:
  • smart_group_id (str) – Smart group unique id.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

SmartGroupModification or ClientRawResponse if raw=true

Return type:

SmartGroupModification or ClientRawResponse

Raises:

ErrorResponseException

models = <module 'azure.mgmt.alertsmanagement.models' from '/usr/lib/python3/dist-packages/azure/mgmt/alertsmanagement/models/__init__.py'>