public interface Alerts
Resource collection API of Alerts.
  • Method Details

    • metadata

      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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • metadataWithResponse

      com.azure.core.http.rest.Response<AlertsMetadata> metadataWithResponse(Identifier identifier, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • list

      com.azure.core.http.rest.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.
      Throws:
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • list

      com.azure.core.http.rest.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, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getById

      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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getByIdWithResponse

      com.azure.core.http.rest.Response<Alert> getByIdWithResponse(String alertId, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • changeState

      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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • changeStateWithResponse

      com.azure.core.http.rest.Response<Alert> changeStateWithResponse(String alertId, AlertState newState, String comment, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getHistory

      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).
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getHistoryWithResponse

      com.azure.core.http.rest.Response<AlertModification> getHistoryWithResponse(String alertId, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getSummary

      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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.
    • getSummaryWithResponse

      com.azure.core.http.rest.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, com.azure.core.util.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.
      Throws:
      IllegalArgumentException - thrown if parameters fail the validation.
      com.azure.core.management.exception.ManagementException - thrown if the request is rejected by server.
      RuntimeException - all other wrapped checked exceptions if the request fails to be sent.