@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Azure Alerts Management Service Resource Provider
@base https://management.azure.com
@version 2019-05-05-preview
@auth OAuth2
@common_fields {api-version: any # client API version}
@endpoints 7
@toc providers(2), subscriptions(5)

@group providers
@endpoint GET /providers/Microsoft.AlertsManagement/operations
@desc List all operations available through Azure Alerts Management Resource Provider.
@returns(200) OK. Successfully retrieved operations list.

@endpoint GET /providers/Microsoft.AlertsManagement/alertsMetaData
@desc List alerts meta data information based on value of identifier parameter.
@required {identifier: any # Identification of the information to be retrieved by API call.}
@returns(200) OK. Successfully listed alert meta data.

@endgroup

@group subscriptions
@endpoint GET /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts
@desc 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.
@required {subscriptionId: any # The ID of the target subscription.}
@optional {targetResource: any # Filter by target resource( which is full ARM ID) Default value is select all., targetResourceType: any # Filter by target resource type. Default value is select all., targetResourceGroup: any # Filter by target resource group name. Default value is select all., monitorService: any # Filter by monitor service which generates the alert instance. Default value is select all., monitorCondition: any # Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all., severity: any # Filter by severity.  Default value is select all., alertState: any # Filter by state of the alert instance. Default value is to select all., alertRule: any # Filter by specific alert rule.  Default value is to select all., smartGroupId: any # Filter the alerts list by the Smart Group Id. Default value is none., includeContext: any # Include context which has contextual data specific to the monitor service. Default value is false', includeEgressConfig: any # Include egress config which would be used for displaying the content in portal.  Default value is 'false'., pageCount: any # 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: any # Sort the query results by input field,  Default value is 'lastModifiedDateTime'., sortOrder: any # Sort the query results order in either ascending or descending.  Default value is 'desc' for time fields and 'asc' for others., select: any # 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: any # Filter by time range by below listed values. Default value is 1 day., customTimeRange: any # Filter by custom time range in the format /  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.}
@returns(200) OK. Successfully listed alert objects.

@endpoint GET /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}
@desc Get a specific alert.
@required {subscriptionId: any # The ID of the target subscription., alertId: any # Unique ID of an alert instance.}
@returns(200) OK. Returns the alert with the specified ID.

@endpoint POST /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate
@desc Change the state of an alert.
@required {subscriptionId: any # The ID of the target subscription., alertId: any # Unique ID of an alert instance., newState: any # New state of the alert.}
@optional {comment: map # reason of change alert state}
@returns(200) OK. Alert state updated.

@endpoint GET /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history
@desc Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed).
@required {subscriptionId: any # The ID of the target subscription., alertId: any # Unique ID of an alert instance.}
@returns(200) OK. Returns the history of the specified alert.

@endpoint GET /subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary
@desc Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).
@required {subscriptionId: any # The ID of the target subscription., groupby: any # 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.}
@optional {includeSmartGroupsCount: any # Include count of the SmartGroups as part of the summary. Default value is 'false'., targetResource: any # Filter by target resource( which is full ARM ID) Default value is select all., targetResourceType: any # Filter by target resource type. Default value is select all., targetResourceGroup: any # Filter by target resource group name. Default value is select all., monitorService: any # Filter by monitor service which generates the alert instance. Default value is select all., monitorCondition: any # Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all., severity: any # Filter by severity.  Default value is select all., alertState: any # Filter by state of the alert instance. Default value is to select all., alertRule: any # Filter by specific alert rule.  Default value is to select all., timeRange: any # Filter by time range by below listed values. Default value is 1 day., customTimeRange: any # Filter by custom time range in the format /  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.}
@returns(200) OK. Alert summary returned.

@endgroup

@end
