Alerts Interface

public interface Alerts

Resource collection API of Alerts.

Method Summary

Modifier and Type Method and Description
abstract Alert changeState(String alertId, AlertState newState)

Change the state of an alert.

abstract Response<Alert> changeStateWithResponse(String alertId, AlertState newState, Comments comment, Context context)

Change the state of an alert.

abstract Alert getById(String alertId)

Get a specific alert.

abstract Response<Alert> getByIdWithResponse(String alertId, Context context)

Get a specific alert.

abstract AlertModification getHistory(String alertId)

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

abstract Response<AlertModification> getHistoryWithResponse(String alertId, Context context)

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

abstract AlertsSummary getSummary(AlertsSummaryGroupByFields groupby)

Get a summarized count of your alerts grouped by various parameters (e.g.

abstract Response<AlertsSummary> getSummaryWithResponse(AlertsSummaryGroupByFields groupby, Boolean includeSmartGroupsCount, String targetResource, String targetResourceType, String targetResourceGroup, MonitorService monitorService, MonitorCondition monitorCondition, Severity severity, AlertState alertState, String alertRule, TimeRange timeRange, String customTimeRange, Context context)

Get a summarized count of your alerts grouped by various parameters (e.g.

abstract PagedIterable<Alert> list()

List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g.

abstract PagedIterable<Alert> list(String targetResource, String targetResourceType, String targetResourceGroup, MonitorService monitorService, MonitorCondition monitorCondition, Severity severity, AlertState alertState, String alertRule, String smartGroupId, Boolean includeContext, Boolean includeEgressConfig, Long pageCount, AlertsSortByFields sortBy, SortOrder sortOrder, String select, TimeRange timeRange, String customTimeRange, Context context)

List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g.

abstract AlertsMetadata metadata(Identifier identifier)

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

abstract Response<AlertsMetadata> metadataWithResponse(Identifier identifier, Context context)

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

Method Details

changeState

public abstract Alert changeState(String alertId, AlertState newState)

Change the state of an alert.

Parameters:

alertId - Unique ID of an alert instance.
newState - New state of the alert.

Returns:

an alert created in alert management service.

changeStateWithResponse

public abstract Response<Alert> changeStateWithResponse(String alertId, AlertState newState, Comments comment, Context context)

Change the state of an alert.

Parameters:

alertId - Unique ID of an alert instance.
newState - New state of the alert.
comment - reason of change alert state.
context - The context to associate with this operation.

Returns:

an alert created in alert management service along with Response<T>.

getById

public abstract Alert getById(String alertId)

Get a specific alert. Get information related to a specific alert.

Parameters:

alertId - Unique ID of an alert instance.

Returns:

information related to a specific alert.

getByIdWithResponse

public abstract Response<Alert> getByIdWithResponse(String alertId, Context context)

Get a specific alert. Get information related to a specific alert.

Parameters:

alertId - Unique ID of an alert instance.
context - The context to associate with this operation.

Returns:

information related to a specific alert along with Response<T>.

getHistory

public abstract AlertModification getHistory(String alertId)

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

Parameters:

alertId - Unique ID of an alert instance.

Returns:

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

getHistoryWithResponse

public abstract Response<AlertModification> getHistoryWithResponse(String alertId, Context context)

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

Parameters:

alertId - Unique ID of an alert instance.
context - The context to associate with this operation.

Returns:

the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed) along with Response<T>.

getSummary

public abstract AlertsSummary getSummary(AlertsSummaryGroupByFields groupby)

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

Parameters:

groupby - 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.

Returns:

a summarized count of your alerts grouped by various parameters (e.g.

getSummaryWithResponse

public abstract Response<AlertsSummary> getSummaryWithResponse(AlertsSummaryGroupByFields groupby, Boolean includeSmartGroupsCount, String targetResource, String targetResourceType, String targetResourceGroup, MonitorService monitorService, MonitorCondition monitorCondition, Severity severity, AlertState alertState, String alertRule, TimeRange timeRange, String customTimeRange, Context context)

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

Parameters:

groupby - 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.
includeSmartGroupsCount - Include count of the SmartGroups as part of the summary. Default value is 'false'.
targetResource - Filter by target resource( which is full ARM ID) Default value is select all.
targetResourceType - Filter by target resource type. Default value is select all.
targetResourceGroup - Filter by target resource group name. Default value is select all.
monitorService - Filter by monitor service which generates the alert instance. Default value is select all.
monitorCondition - Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
severity - Filter by severity. Default value is select all.
alertState - Filter by state of the alert instance. Default value is to select all.
alertRule - Filter by specific alert rule. Default value is to select all.
timeRange - Filter by time range by below listed values. Default value is 1 day.
customTimeRange - 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.
context - The context to associate with this operation.

Returns:

a summarized count of your alerts grouped by various parameters (e.g along with Response<T>.

list

public abstract PagedIterable<Alert> list()

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.

Returns:

list the alerts as paginated response with PagedIterable<T>.

list

public abstract PagedIterable<Alert> list(String targetResource, String targetResourceType, String targetResourceGroup, MonitorService monitorService, MonitorCondition monitorCondition, Severity severity, AlertState alertState, String alertRule, String smartGroupId, Boolean includeContext, Boolean includeEgressConfig, Long pageCount, AlertsSortByFields sortBy, SortOrder sortOrder, String select, TimeRange timeRange, String customTimeRange, Context context)

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.

Parameters:

targetResource - Filter by target resource( which is full ARM ID) Default value is select all.
targetResourceType - Filter by target resource type. Default value is select all.
targetResourceGroup - Filter by target resource group name. Default value is select all.
monitorService - Filter by monitor service which generates the alert instance. Default value is select all.
monitorCondition - Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
severity - Filter by severity. Default value is select all.
alertState - Filter by state of the alert instance. Default value is to select all.
alertRule - Filter by specific alert rule. Default value is to select all.
smartGroupId - Filter the alerts list by the Smart Group Id. Default value is none.
includeContext - Include context which has contextual data specific to the monitor service. Default value is false'.
includeEgressConfig - Include egress config which would be used for displaying the content in portal. Default value is 'false'.
pageCount - 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.
sortBy - Sort the query results by input field, Default value is 'lastModifiedDateTime'.
sortOrder - Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.
select - 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.
timeRange - Filter by time range by below listed values. Default value is 1 day.
customTimeRange - 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.
context - The context to associate with this operation.

Returns:

list the alerts as paginated response with PagedIterable<T>.

metadata

public abstract AlertsMetadata metadata(Identifier identifier)

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

Parameters:

identifier - Identification of the information to be retrieved by API call.

Returns:

alert meta data information.

metadataWithResponse

public abstract Response<AlertsMetadata> metadataWithResponse(Identifier identifier, Context context)

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

Parameters:

identifier - Identification of the information to be retrieved by API call.
context - The context to associate with this operation.

Returns:

alert meta data information along with Response<T>.

Applies to