AlertsOperations Class
AlertsOperations async 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.objectAlertsOperations
Constructor
AlertsOperations(client, config, serializer, deserializer)
Parameters
- client
Client for service requests.
- config
Configuration of service client.
- serializer
An object model serializer.
- deserializer
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.
async change_state(alert_id: str, new_state: Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.AlertState], **kwargs) -> azure.mgmt.alertsmanagement.models._models_py3.Alert
Parameters
- 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, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.MonitorService]] = None, monitor_condition: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.MonitorCondition]] = None, severity: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.Severity]] = None, alert_state: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.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, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.AlertsSortByFields]] = None, sort_order: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.Enum11]] = None, select: Optional[str] = None, time_range: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.TimeRange]] = None, custom_time_range: Optional[str] = None, **kwargs) -> AsyncIterable[azure.mgmt.alertsmanagement.models._models_py3.AlertsList]
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 generates the alert instance. Default value is select all.
- monitor_condition
- str or MonitorCondition
Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
- alert_state
- str or AlertState
Filter by state of the 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 contextual data specific 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'.
Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.
- select
- str
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.
Filter by time range by below listed values. Default value is 1 day.
- 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.
- 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.
async get_by_id(alert_id: str, **kwargs) -> azure.mgmt.alertsmanagement.models._models_py3.Alert
Parameters
- 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).
async get_history(alert_id: str, **kwargs) -> azure.mgmt.alertsmanagement.models._models_py3.AlertModification
Parameters
- 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).
async get_summary(groupby: Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.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, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.MonitorService]] = None, monitor_condition: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.MonitorCondition]] = None, severity: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.Severity]] = None, alert_state: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.AlertState]] = None, alert_rule: Optional[str] = None, time_range: Optional[Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.TimeRange]] = None, custom_time_range: Optional[str] = None, **kwargs) -> azure.mgmt.alertsmanagement.models._models_py3.AlertsSummary
Parameters
- groupby
- str or AlertsSummaryGroupByFields
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
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 generates the alert instance. Default value is select all.
- monitor_condition
- str or MonitorCondition
Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
- alert_state
- str or AlertState
Filter by state of the alert instance. Default value is to select all.
Filter by time range by below listed values. Default value is 1 day.
- 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.
- 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.
async meta_data(identifier: Union[str, azure.mgmt.alertsmanagement.models._alerts_management_client_enums.Identifier], **kwargs) -> azure.mgmt.alertsmanagement.models._models_py3.AlertsMetaData
Parameters
- identifier
- str or Identifier
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'>
Feedback
Submit and view feedback for