AlertsOperations Class

AlertsOperations operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
AlertsOperations

Constructor

AlertsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

change_state

Change the state of an alert.

get_all

List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime.

get_by_id

Get a specific alert.

Get information related to a specific alert.

get_history

Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed).

get_summary

Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).

meta_data

List alerts meta data information based on value of identifier parameter.

change_state

Change the state of an alert.

change_state(alert_id: str, new_state: Union[str, _models.AlertState], **kwargs: Any) -> _models.Alert

Parameters

alert_id
str
Required

Unique ID of an alert instance.

new_state
str or AlertState
Required

New state of the alert.

cls
callable

A custom type or function that will be passed the direct response

Returns

Alert, or the result of cls(response)

Return type

Exceptions

get_all

List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime.

get_all(target_resource: Optional[str] = None, target_resource_type: Optional[str] = None, target_resource_group: Optional[str] = None, monitor_service: Optional[Union[str, _models.MonitorService]] = None, monitor_condition: Optional[Union[str, _models.MonitorCondition]] = None, severity: Optional[Union[str, _models.Severity]] = None, alert_state: Optional[Union[str, _models.AlertState]] = None, alert_rule: Optional[str] = None, smart_group_id: Optional[str] = None, include_context: Optional[bool] = None, include_egress_config: Optional[bool] = None, page_count: Optional[int] = None, sort_by: Optional[Union[str, _models.AlertsSortByFields]] = None, sort_order: Optional[Union[str, _models.Enum11]] = None, select: Optional[str] = None, time_range: Optional[Union[str, _models.TimeRange]] = None, custom_time_range: Optional[str] = None, **kwargs: Any) -> Iterable[_models.AlertsList]

Parameters

target_resource
str
default value: None

Filter by target resource( which is full ARM ID) Default value is select all.

target_resource_type
str
default value: None

Filter by target resource type. Default value is select all.

target_resource_group
str
default value: None

Filter by target resource group name. Default value is select all.

monitor_service
str or MonitorService
default value: None

Filter by monitor service which generates the alert instance. Default value is select all.

monitor_condition
str or MonitorCondition
default value: None

Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.

severity
str or Severity
default value: None

Filter by severity. Default value is select all.

alert_state
str or AlertState
default value: None

Filter by state of the alert instance. Default value is to select all.

alert_rule
str
default value: None

Filter by specific alert rule. Default value is to select all.

smart_group_id
str
default value: None

Filter the alerts list by the Smart Group Id. Default value is none.

include_context
bool
default value: None

Include context which has contextual data specific to the monitor service. Default value is false'.

include_egress_config
bool
default value: None

Include egress config which would be used for displaying the content in portal. Default value is 'false'.

page_count
int
default value: None

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
default value: None

Sort the query results by input field, Default value is 'lastModifiedDateTime'.

sort_order
str or Enum11
default value: None

Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.

select
str
default value: None

This filter allows to selection of the fields(comma separated) which would be part of 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
default value: None

Filter by time range by below listed values. Default value is 1 day.

custom_time_range
str
default value: None

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.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either AlertsList or the result of cls(response)

Return type

Exceptions

get_by_id

Get a specific alert.

Get information related to a specific alert.

get_by_id(alert_id: str, **kwargs: Any) -> _models.Alert

Parameters

alert_id
str
Required

Unique ID of an alert instance.

cls
callable

A custom type or function that will be passed the direct response

Returns

Alert, or the result of cls(response)

Return type

Exceptions

get_history

Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed).

get_history(alert_id: str, **kwargs: Any) -> _models.AlertModification

Parameters

alert_id
str
Required

Unique ID of an alert instance.

cls
callable

A custom type or function that will be passed the direct response

Returns

AlertModification, or the result of cls(response)

Return type

Exceptions

get_summary

Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).

get_summary(groupby: Union[str, _models.AlertsSummaryGroupByFields], include_smart_groups_count: Optional[bool] = None, target_resource: Optional[str] = None, target_resource_type: Optional[str] = None, target_resource_group: Optional[str] = None, monitor_service: Optional[Union[str, _models.MonitorService]] = None, monitor_condition: Optional[Union[str, _models.MonitorCondition]] = None, severity: Optional[Union[str, _models.Severity]] = None, alert_state: Optional[Union[str, _models.AlertState]] = None, alert_rule: Optional[str] = None, time_range: Optional[Union[str, _models.TimeRange]] = None, custom_time_range: Optional[str] = None, **kwargs: Any) -> _models.AlertsSummary

Parameters

groupby
str or AlertsSummaryGroupByFields
Required

This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate.

include_smart_groups_count
bool
default value: None

Include count of the SmartGroups as part of the summary. Default value is 'false'.

target_resource
str
default value: None

Filter by target resource( which is full ARM ID) Default value is select all.

target_resource_type
str
default value: None

Filter by target resource type. Default value is select all.

target_resource_group
str
default value: None

Filter by target resource group name. Default value is select all.

monitor_service
str or MonitorService
default value: None

Filter by monitor service which generates the alert instance. Default value is select all.

monitor_condition
str or MonitorCondition
default value: None

Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.

severity
str or Severity
default value: None

Filter by severity. Default value is select all.

alert_state
str or AlertState
default value: None

Filter by state of the alert instance. Default value is to select all.

alert_rule
str
default value: None

Filter by specific alert rule. Default value is to select all.

time_range
str or TimeRange
default value: None

Filter by time range by below listed values. Default value is 1 day.

custom_time_range
str
default value: None

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.

cls
callable

A custom type or function that will be passed the direct response

Returns

AlertsSummary, or the result of cls(response)

Return type

Exceptions

meta_data

List alerts meta data information based on value of identifier parameter.

meta_data(identifier: Union[str, _models.Identifier], **kwargs: Any) -> _models.AlertsMetaData

Parameters

identifier
str or Identifier
Required

Identification of the information to be retrieved by API call.

cls
callable

A custom type or function that will be passed the direct response

Returns

AlertsMetaData, or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.alertsmanagement.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\alertsmanagement\\models\\__init__.py'>