swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor.
  title: Azure Alerts Management Service Resource Provider
  version: 2018-05-05
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2018-05-05/AlertsManagement.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: alertsmanagement-AlertsManagement
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
parameters:
  alertId:
    description: Unique ID of an alert instance.
    in: path
    name: alertId
    required: true
    type: string
    x-ms-parameter-location: method
  alertRule:
    description: Filter by specific alert rule.  Default value is to select all.
    in: query
    name: alertRule
    required: false
    type: string
    x-ms-parameter-location: method
  alertState:
    description: Filter by state of the alert instance. Default value is to select all.
    enum:
      - New
      - Acknowledged
      - Closed
    in: query
    name: alertState
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: AlertState
    x-ms-parameter-location: method
  alertsSortBy:
    description: Sort the query results by input field,  Default value is 'lastModifiedDateTime'.
    enum:
      - name
      - severity
      - alertState
      - monitorCondition
      - targetResource
      - targetResourceName
      - targetResourceGroup
      - targetResourceType
      - startDateTime
      - lastModifiedDateTime
    in: query
    name: sortBy
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: AlertsSortByFields
    x-ms-parameter-location: method
  alertsSummaryGroupBy:
    description: This parameter allows the result set to be grouped by input fields. For example, groupby=severity,alertstate.
    enum:
      - severity
      - alertState
      - monitorCondition
      - monitorService
      - signalType
      - alertRule
    in: query
    name: groupby
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: AlertsSummaryGroupByFields
    x-ms-parameter-location: method
  api-version:
    description: API version.
    enum:
      - 2018-05-05
    in: query
    name: api-version
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: api-version
  customTimeRange:
    description: 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.
    in: query
    name: customTimeRange
    required: false
    type: string
    x-ms-parameter-location: method
  includeContext:
    description: Include context which has contextual data specific to the monitor service. Default value is false'
    in: query
    name: includeContext
    required: false
    type: boolean
    x-ms-parameter-location: method
  includeEgressConfig:
    description: Include egress config which would be used for displaying the content in portal.  Default value is 'false'.
    in: query
    name: includeEgressConfig
    required: false
    type: boolean
    x-ms-parameter-location: method
  includeSmartGroupsCount:
    description: Include count of the SmartGroups as part of the summary. Default value is 'false'.
    in: query
    name: includeSmartGroupsCount
    required: false
    type: boolean
    x-ms-parameter-location: method
  monitorCondition:
    description: Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
    enum:
      - Fired
      - Resolved
    in: query
    name: monitorCondition
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: MonitorCondition
    x-ms-parameter-location: method
  monitorService:
    description: Filter by monitor service which generates the alert instance. Default value is select all.
    enum:
      - Application Insights
      - ActivityLog Administrative
      - ActivityLog Security
      - ActivityLog Recommendation
      - ActivityLog Policy
      - ActivityLog Autoscale
      - Log Analytics
      - Nagios
      - Platform
      - SCOM
      - ServiceHealth
      - SmartDetector
      - VM Insights
      - Zabbix
    in: query
    name: monitorService
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: MonitorService
    x-ms-parameter-location: method
  newState:
    description: New state of the alert.
    enum:
      - New
      - Acknowledged
      - Closed
    in: query
    name: newState
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: AlertState
    x-ms-parameter-location: method
  pageCount:
    description: 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.
    in: query
    name: pageCount
    required: false
    type: integer
    x-ms-parameter-location: method
  select:
    description: 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.
    in: query
    name: select
    required: false
    type: string
    x-ms-parameter-location: method
  severity:
    description: Filter by severity.  Default value is select all.
    enum:
      - Sev0
      - Sev1
      - Sev2
      - Sev3
      - Sev4
    in: query
    name: severity
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: Severity
    x-ms-parameter-location: method
  smartGroupId:
    description: "Smart group unique id. "
    in: path
    name: smartGroupId
    required: true
    type: string
    x-ms-parameter-location: method
  smartGroupIdFilter:
    description: Filter the alerts list by the Smart Group Id. Default value is none.
    in: query
    name: smartGroupId
    required: false
    type: string
    x-ms-parameter-location: method
  smartGroupState:
    description: Filter by state of the smart group. Default value is to select all.
    enum:
      - New
      - Acknowledged
      - Closed
    in: query
    name: smartGroupState
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: AlertState
    x-ms-parameter-location: method
  smartGroupsSortBy:
    description: Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.
    enum:
      - alertsCount
      - state
      - severity
      - startDateTime
      - lastModifiedDateTime
    in: query
    name: sortBy
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: SmartGroupsSortByFields
    x-ms-parameter-location: method
  sortOrder:
    description: Sort the query results order in either ascending or descending.  Default value is 'desc' for time fields and 'asc' for others.
    enum:
      - asc
      - desc
    in: query
    name: sortOrder
    required: false
    type: string
    x-ms-parameter-location: method
  subscriptionId:
    description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    in: path
    name: subscriptionId
    required: true
    type: string
  targetResource:
    description: Filter by target resource( which is full ARM ID) Default value is select all.
    in: query
    name: targetResource
    required: false
    type: string
    x-ms-parameter-location: method
  targetResourceGroup:
    description: Filter by target resource group name. Default value is select all.
    in: query
    name: targetResourceGroup
    required: false
    type: string
    x-ms-parameter-location: method
  targetResourceType:
    description: Filter by target resource type. Default value is select all.
    in: query
    name: targetResourceType
    required: false
    type: string
    x-ms-parameter-location: method
  timeRange:
    description: Filter by time range by below listed values. Default value is 1 day.
    enum:
      - 1h
      - 1d
      - 7d
      - 30d
    in: query
    name: timeRange
    required: false
    type: string
    x-ms-enum:
      modelAsString: true
      name: TimeRange
    x-ms-parameter-location: method
paths:
  /providers/Microsoft.AlertsManagement/operations:
    get:
      description: List all operations available through Azure Alerts Management Resource Provider.
      operationId: Operations_List
      parameters:
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Successfully retrieved operations list.
          schema:
            $ref: "#/definitions/operationsList"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts":
    get:
      description: "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. "
      operationId: Alerts_GetAll
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/targetResource"
        - $ref: "#/parameters/targetResourceType"
        - $ref: "#/parameters/targetResourceGroup"
        - $ref: "#/parameters/monitorService"
        - $ref: "#/parameters/monitorCondition"
        - $ref: "#/parameters/severity"
        - $ref: "#/parameters/alertState"
        - $ref: "#/parameters/alertRule"
        - $ref: "#/parameters/smartGroupIdFilter"
        - $ref: "#/parameters/includeContext"
        - $ref: "#/parameters/includeEgressConfig"
        - $ref: "#/parameters/pageCount"
        - $ref: "#/parameters/alertsSortBy"
        - $ref: "#/parameters/sortOrder"
        - $ref: "#/parameters/select"
        - $ref: "#/parameters/timeRange"
        - $ref: "#/parameters/customTimeRange"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Successfully listed alert objects.
          schema:
            $ref: "#/definitions/alertsList"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        ListAlerts:
          parameters:
            api-version: 2018-05-05
            subscriptionId: 1e3ff1c0-771a-4119-a03b-be82a51e232d
          responses:
            "200":
              body:
                nextLink: https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1
                value:
                  - id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100
                    name: cpu alert
                    properties:
                      context: {}
                      egressConfig: {}
                      essentials:
                        alertRule: https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=
                        alertState: Acknowledged
                        lastModifiedDateTime: 2018-09-13T15:51:02Z
                        lastModifiedUserName: System
                        monitorCondition: Fired
                        monitorConditionResolvedDateTime: 2018-09-13T15:51:02Z
                        monitorService: Application Insights
                        severity: Sev3
                        signalType: Log
                        smartGroupId: 23d6b2ce-8c54-468f-aff0-sd32aebb7e56
                        smartGroupingReason: Occurred frequently with other alerts
                        sourceCreatedId: 6cd6b2ce-8c54-468f-aff0-9d12aebb7e49
                        startDateTime: 2018-09-13T15:51:02Z
                        targetResource: /subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight
                        targetResourceGroup: servicedeskresourcegroup
                        targetResourceName: servicedeskappinsight
                        targetResourceType: components
                    type: Microsoft.AlertsManagement/alerts
                  - id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100
                    name: cpu alert
                    properties:
                      context: {}
                      egressConfig: {}
                      essentials:
                        alertRule: https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=
                        alertState: New
                        lastModifiedDateTime: 2018-09-13T15:51:02Z
                        lastModifiedUserName: System
                        monitorCondition: Fired
                        monitorConditionResolvedDateTime: 2018-09-13T15:51:02Z
                        monitorService: Application Insights
                        severity: Sev3
                        signalType: Log
                        smartGroupId: d1c49c89-ea95-4697-a299-c0f5ebac62f1
                        smartGroupingReason: Alerts that frequently occur together have been grouped.
                        sourceCreatedId: 6cd6b2ce-8c54-468f-aff0-9d12aebb7e49
                        startDateTime: 2018-09-13T15:51:02Z
                        targetResource: /subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus
                        targetResourceGroup: servicedeskresourcegroup
                        targetResourceName: servicedeskwcus
                        targetResourceType: components
                    type: Microsoft.AlertsManagement/alerts
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}":
    get:
      description: Get information related to a specific alert
      operationId: Alerts_GetById
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/alertId"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Returns the alert with the specified ID.
          schema:
            $ref: "#/definitions/alert"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      summary: Get a specific alert.
      x-ms-examples:
        GetById:
          parameters:
            alertId: 66114d64-d9d9-478b-95c9-b789d6502100
            api-version: 2018-05-05
            subscriptionId: 9e261de7-c804-4b9d-9ebf-6f50fe350a9a
          responses:
            "200":
              body:
                id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100
                name: cpu alert
                properties:
                  context: {}
                  egressConfig: {}
                  essentials:
                    alertRule: https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=
                    alertState: Acknowledged
                    lastModifiedDateTime: 2018-09-13T15:51:02Z
                    lastModifiedUserName: System
                    monitorCondition: Fired
                    monitorConditionResolvedDateTime: 2018-09-13T15:51:02Z
                    monitorService: Application Insights
                    severity: Sev3
                    signalType: Log
                    smartGroupId: 23d6b2ce-8c54-468f-aff0-sd32aebb7e56
                    smartGroupingReason: Occurred frequently with other alerts
                    sourceCreatedId: 6cd6b2ce-8c54-468f-aff0-9d12aebb7e49
                    startDateTime: 2018-09-13T15:51:02Z
                    targetResource: /subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight
                    targetResourceGroup: servicedeskresourcegroup
                    targetResourceName: servicedeskappinsight
                    targetResourceType: components
                type: Microsoft.AlertsManagement/alerts
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate":
    post:
      description: Change the state of an alert.
      operationId: Alerts_ChangeState
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/alertId"
        - $ref: "#/parameters/api-version"
        - $ref: "#/parameters/newState"
      responses:
        "200":
          description: OK. Alert state updated.
          schema:
            $ref: "#/definitions/alert"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        Resolve:
          parameters:
            alertId: 66114d64-d9d9-478b-95c9-b789d6502100
            api-version: 2018-05-05
            body:
              comments: Acknowledging alert
            newState: Acknowledged
            subscriptionId: 9e261de7-c804-4b9d-9ebf-6f50fe350a9a
          responses:
            "200":
              body:
                id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100
                name: cpu alert
                properties:
                  context: {}
                  egressConfig: {}
                  essentials:
                    alertRule: https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId=
                    alertState: Acknowledged
                    lastModifiedDateTime: 2018-09-13T15:51:02Z
                    lastModifiedUserName: System
                    monitorCondition: Fired
                    monitorConditionResolvedDateTime: 2018-09-13T15:51:02Z
                    monitorService: Application Insights
                    severity: Sev3
                    signalType: Log
                    smartGroupId: 23d6b2ce-8c54-468f-aff0-sd32aebb7e56
                    smartGroupingReason: Occurred frequently with other alerts
                    sourceCreatedId: 6cd6b2ce-8c54-468f-aff0-9d12aebb7e49
                    startDateTime: 2018-09-13T15:51:02Z
                    targetResource: /subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight
                    targetResourceGroup: servicedeskresourcegroup
                    targetResourceName: servicedeskappinsight
                    targetResourceType: components
                type: Microsoft.AlertsManagement/alerts
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history":
    get:
      description: Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed).
      operationId: Alerts_GetHistory
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/alertId"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Returns the history of the specified alert.
          schema:
            $ref: "#/definitions/alertModification"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        Resolve:
          parameters:
            alertId: 66114d64-d9d9-478b-95c9-b789d6502100
            api-version: 2018-05-05
            subscriptionId: 9e261de7-c804-4b9d-9ebf-6f50fe350a9a
          responses:
            "200":
              body:
                id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100/history/default
                name: CPU Alert
                properties:
                  alertId: 66114d64-d9d9-478b-95c9-b789d6502100
                  modifications:
                    - comments: Acknowledging alert
                      description: State changed from 'New' to 'Acknowledged'
                      modificationEvent: StateChange
                      modifiedAt: 2018-06-13T06:14:15.7378737Z
                      modifiedBy: vikramm@microsoft.com
                      newValue: Acknowledged
                      oldValue: New
                    - comments: ""
                      description: New Alert Object is created
                      modificationEvent: AlertCreated
                      modifiedAt: 2018-06-13T06:09:01Z
                      modifiedBy: System
                      newValue: ""
                      oldValue: ""
                type: Microsoft.AlertsManagement/alerts
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary":
    get:
      description: Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity).
      operationId: Alerts_GetSummary
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/alertsSummaryGroupBy"
        - $ref: "#/parameters/includeSmartGroupsCount"
        - $ref: "#/parameters/targetResource"
        - $ref: "#/parameters/targetResourceType"
        - $ref: "#/parameters/targetResourceGroup"
        - $ref: "#/parameters/monitorService"
        - $ref: "#/parameters/monitorCondition"
        - $ref: "#/parameters/severity"
        - $ref: "#/parameters/alertState"
        - $ref: "#/parameters/alertRule"
        - $ref: "#/parameters/timeRange"
        - $ref: "#/parameters/customTimeRange"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Alert summary returned.
          schema:
            $ref: "#/definitions/alertsSummary"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        Summary:
          parameters:
            api-version: 2018-05-05
            groupby: severity,alertState
            subscriptionId: 1e3ff1c0-771a-4119-a03b-be82a51e232d
          responses:
            "200":
              body:
                id: /subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current
                name: current
                properties:
                  groupedby: severity
                  smartGroupsCount: 100
                  total: 14189
                  values:
                    - count: 6517
                      groupedby: alertState
                      name: Sev0
                      values:
                        - count: 6517
                          name: New
                        - count: 0
                          name: Acknowledged
                        - count: 0
                          name: Closed
                    - count: 3175
                      groupedby: alertState
                      name: Sev1
                      values:
                        - count: 3175
                          name: New
                        - count: 0
                          name: Acknowledged
                        - count: 0
                          name: Closed
                    - count: 1120
                      groupedby: alertState
                      name: Sev2
                      values:
                        - count: 1120
                          name: New
                        - count: 0
                          name: Acknowledged
                        - count: 0
                          name: Closed
                    - count: 1902
                      groupedby: alertState
                      name: Sev3
                      values:
                        - count: 1902
                          name: New
                        - count: 0
                          name: Acknowledged
                        - count: 0
                          name: Closed
                    - count: 1475
                      groupedby: alertState
                      name: Sev4
                      values:
                        - count: 1475
                          name: New
                        - count: 0
                          name: Acknowledged
                        - count: 0
                          name: Closed
                type: Microsoft.AlertsManagement/alertsSummary
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups":
    get:
      description: "List all the Smart Groups within a specified subscription. "
      operationId: SmartGroups_GetAll
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/targetResource"
        - $ref: "#/parameters/targetResourceGroup"
        - $ref: "#/parameters/targetResourceType"
        - $ref: "#/parameters/monitorService"
        - $ref: "#/parameters/monitorCondition"
        - $ref: "#/parameters/severity"
        - $ref: "#/parameters/smartGroupState"
        - $ref: "#/parameters/timeRange"
        - $ref: "#/parameters/pageCount"
        - $ref: "#/parameters/smartGroupsSortBy"
        - $ref: "#/parameters/sortOrder"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Returns list of all smartGroups.
          schema:
            $ref: "#/definitions/smartGroupsList"
            description: List of smart groups in value property.
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      summary: Get all Smart Groups within a specified subscription
      x-ms-examples:
        List:
          parameters:
            api-version: 2018-05-05
            subscriptionId: dd91de05-d791-4ceb-b6dc-988682dc7d72
          responses:
            "200":
              body:
                nextLink: null
                value:
                  - id: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059
                    name: cpu alert
                    properties:
                      alertSeverities:
                        - count: 1942
                          name: Sev3
                      alertStates:
                        - count: 1941
                          name: New
                        - count: 1
                          name: Acknowledged
                      alertsCount: 1942
                      lastModifiedDateTime: 2018-06-13T06:30:09Z
                      lastModifiedUserName: System
                      monitorConditions:
                        - count: 1942
                          name: Fired
                      monitorServices:
                        - count: 1942
                          name: Application Insights
                      resourceGroups:
                        - count: 1942
                          name: alertscorrelationrg
                      resourceTypes:
                        - count: 1942
                          name: components
                      resources:
                        - count: 1942
                          name: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int
                      severity: Sev3
                      smartGroupState: New
                      startDateTime: 2018-06-06T12:35:09Z
                    type: Microsoft.AlertsManagement/smartGroups
                  - id: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/01114c7c-769f-4fd4-b6fa-ab77693b83cd
                    name: CPU Alert
                    properties:
                      alertSeverities:
                        - count: 6984
                          name: Sev0
                        - count: 6927
                          name: Sev1
                      alertStates:
                        - count: 15358
                          name: New
                        - count: 12
                          name: Acknowledged
                        - count: 4
                          name: Closed
                      alertsCount: 15374
                      lastModifiedDateTime: 2018-06-13T06:29:01Z
                      lastModifiedUserName: System
                      monitorConditions:
                        - count: 15374
                          name: Fired
                      monitorServices:
                        - count: 13911
                          name: Log Analytics
                      resourceGroups:
                        - count: 15374
                          name: mms-eus
                      resourceTypes:
                        - count: 6912
                          name: microsoft.operationalinsights/workspaces
                        - count: 8462
                          name: workspaces
                      resources:
                        - count: 15374
                          name: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/alertsint
                      severity: Sev0
                      smartGroupState: Acknowledged
                      startDateTime: 2018-05-17T10:18:44.2020997Z
                    type: Microsoft.AlertsManagement/smartGroups
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}":
    get:
      description: Get information related to a specific Smart Group.
      operationId: SmartGroups_GetById
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/smartGroupId"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Returns the group with the specified smart group Id.
          headers:
            x-ms-request-id:
              description: Service generated Request ID.
              type: string
          schema:
            $ref: "#/definitions/smartGroup"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      summary: Get information related to a specific Smart Group.
      x-ms-examples:
        Get:
          parameters:
            api-version: 2018-05-05
            smartGroupId: 603675da-9851-4b26-854a-49fc53d32715
            subscriptionId: 9e261de7-c804-4b9d-9ebf-6f50fe350a9a
          responses:
            "200":
              body:
                id: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059
                name: cpu alert
                properties:
                  alertSeverities:
                    - count: 1942
                      name: Sev3
                  alertStates:
                    - count: 1941
                      name: New
                    - count: 1
                      name: Acknowledged
                  alertsCount: 1942
                  lastModifiedDateTime: 2018-06-13T06:30:09Z
                  lastModifiedUserName: System
                  monitorConditions:
                    - count: 1942
                      name: Fired
                  monitorServices:
                    - count: 1942
                      name: Application Insights
                  resourceGroups:
                    - count: 1942
                      name: alertscorrelationrg
                  resourceTypes:
                    - count: 1942
                      name: components
                  resources:
                    - count: 1942
                      name: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int
                  severity: Sev3
                  smartGroupState: New
                  startDateTime: 2018-06-06T12:35:09Z
                type: Microsoft.AlertsManagement/smartGroups
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/changeState":
    post:
      description: Change the state of a Smart Group.
      operationId: SmartGroups_ChangeState
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/smartGroupId"
        - $ref: "#/parameters/api-version"
        - $ref: "#/parameters/newState"
      responses:
        "200":
          description: OK. Smart Group state updated.
          headers:
            x-ms-request-id:
              description: Service generated Request ID.
              type: string
          schema:
            $ref: "#/definitions/smartGroup"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        changestate:
          parameters:
            api-version: 2018-05-05
            body:
              comments: Acknowledging smart group
            newState: Acknowledged
            smartGroupId: a808445e-bb38-4751-85c2-1b109ccc1059
            subscriptionId: dd91de05-d791-4ceb-b6dc-988682dc7d72
          responses:
            "200":
              body:
                id: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059
                name: cpu alert
                properties:
                  alertSeverities:
                    - count: 1942
                      name: Sev3
                  alertStates:
                    - count: 1941
                      name: New
                    - count: 1
                      name: Acknowledged
                  alertsCount: 1942
                  lastModifiedDateTime: 2018-06-13T06:30:09Z
                  lastModifiedUserName: System
                  monitorConditions:
                    - count: 1942
                      name: Fired
                  monitorServices:
                    - count: 1942
                      name: Application Insights
                  resourceGroups:
                    - count: 1942
                      name: alertscorrelationrg
                  resourceTypes:
                    - count: 1942
                      name: components
                  resources:
                    - count: 1942
                      name: /subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int
                  severity: Sev3
                  smartGroupState: Acknowledged
                  startDateTime: 2018-06-06T12:35:09Z
                type: Microsoft.AlertsManagement/smartGroups
  "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/history":
    get:
      description: Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) .
      operationId: SmartGroups_GetHistory
      parameters:
        - $ref: "#/parameters/subscriptionId"
        - $ref: "#/parameters/smartGroupId"
        - $ref: "#/parameters/api-version"
      responses:
        "200":
          description: OK. Returns the list of changes of smart group.
          schema:
            $ref: "#/definitions/smartGroupModification"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/errorResponse"
      x-ms-examples:
        Resolve:
          parameters:
            api-version: 2018-05-05
            smartGroupId: a808445e-bb38-4751-85c2-1b109ccc1059
            subscriptionId: 9e261de7-c804-4b9d-9ebf-6f50fe350a9a
          responses:
            "200":
              body:
                id: /subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059/history/default
                name: cpu alert
                properties:
                  modifications:
                    - comments: ""
                      description: New Smart Group is created
                      modificationEvent: SmartGroupCreated
                      modifiedAt: 2018-06-06T12:35:09Z
                      modifiedBy: System
                      newValue: ""
                      oldValue: ""
                  smartGroupId: a808445e-bb38-4751-85c2-1b109ccc1059
                type: Microsoft.AlertsManagement/alerts
definitions:
  Resource:
    description: An azure resource object
    properties:
      id:
        description: Azure resource Id
        readOnly: true
        type: string
      name:
        description: Azure resource name
        readOnly: true
        type: string
      type:
        description: Azure resource type
        readOnly: true
        type: string
    x-ms-azure-resource: true
  alert:
    allOf:
      - $ref: "#/definitions/Resource"
    description: An alert created in alert management service.
    properties:
      properties:
        $ref: "#/definitions/alertProperties"
  alertContext:
    description: Information specific to the monitor service that gives more contextual details about the alert.
    readOnly: true
    type: object
  alertModification:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Alert Modification details
    properties:
      properties:
        $ref: "#/definitions/alertModificationProperties"
  alertModificationItem:
    description: Alert modification item.
    properties:
      comments:
        description: Modification comments
        type: string
      description:
        description: Description of the modification
        type: string
      modificationEvent:
        description: Reason for the modification
        enum:
          - AlertCreated
          - StateChange
          - MonitorConditionChange
        type: string
        x-ms-enum:
          name: AlertModificationEvent
      modifiedAt:
        description: Modified date and time
        type: string
      modifiedBy:
        description: Modified user details (Principal client name)
        type: string
      newValue:
        description: New value
        type: string
      oldValue:
        description: Old value
        type: string
  alertModificationProperties:
    description: Properties of the alert modification item.
    properties:
      alertId:
        description: Unique Id of the alert for which the history is being retrieved
        readOnly: true
        type: string
      modifications:
        description: Modification details
        items:
          $ref: "#/definitions/alertModificationItem"
        type: array
    type: object
  alertProperties:
    description: Alert property bag
    properties:
      context:
        $ref: "#/definitions/alertContext"
      egressConfig:
        $ref: "#/definitions/egressConfig"
      essentials:
        $ref: "#/definitions/essentials"
    type: object
  alertsList:
    description: List the alerts.
    properties:
      nextLink:
        description: URL to fetch the next set of alerts.
        type: string
      value:
        description: List of alerts
        items:
          $ref: "#/definitions/alert"
        type: array
  alertsSummary:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Summary of alerts based on the input filters and 'groupby' parameters.
    properties:
      properties:
        $ref: "#/definitions/alertsSummaryGroup"
  alertsSummaryGroup:
    description: Group the result set.
    properties:
      groupedby:
        description: Name of the field aggregated
        type: string
      smartGroupsCount:
        description: Total count of the smart groups.
        type: integer
      total:
        description: Total count of the result set.
        type: integer
      values:
        description: List of the items
        items:
          $ref: "#/definitions/alertsSummaryGroupItem"
        type: array
    type: object
  alertsSummaryGroupItem:
    description: Alerts summary group item
    properties:
      count:
        description: Count of the aggregated field
        type: integer
      groupedby:
        description: Name of the field aggregated
        type: string
      name:
        description: Value of the aggregated field
        type: string
      values:
        description: List of the items
        items:
          $ref: "#/definitions/alertsSummaryGroupItem"
        type: array
    type: object
  egressConfig:
    description: Config which would be used for displaying the data in portal.
    readOnly: true
    type: object
  errorResponse:
    description: An error response from the service.
    properties:
      error:
        $ref: "#/definitions/errorResponseBody"
  errorResponseBody:
    description: Details of error response.
    properties:
      code:
        description: Error code, intended to be consumed programmatically.
        type: string
      details:
        description: A list of additional details about the error.
        items:
          $ref: "#/definitions/errorResponseBody"
        type: array
      message:
        description: Description of the error, intended for display in user interface.
        type: string
      target:
        description: Target of the particular error, for example name of the property.
        type: string
  essentials:
    description: This object contains consistent fields across different monitor services.
    properties:
      alertRule:
        description: Rule(monitor) which fired alert instance. Depending on the monitor service,  this would be ARM id or name of the rule.
        readOnly: true
        type: string
      alertState:
        description: Alert object state, which can be modified by the user.
        enum:
          - New
          - Acknowledged
          - Closed
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: AlertState
      lastModifiedDateTime:
        description: Last modification time(ISO-8601 format) of alert instance.
        format: date-time
        readOnly: true
        type: string
      lastModifiedUserName:
        description: User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name of the user.
        readOnly: true
        type: string
      monitorCondition:
        description: Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert rule thresholds.
        enum:
          - Fired
          - Resolved
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: MonitorCondition
      monitorConditionResolvedDateTime:
        description: Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert instance because the rule condition is no longer met.
        format: date-time
        readOnly: true
        type: string
      monitorService:
        description: Monitor service on which the rule(monitor) is set.
        enum:
          - Application Insights
          - ActivityLog Administrative
          - ActivityLog Security
          - ActivityLog Recommendation
          - ActivityLog Policy
          - ActivityLog Autoscale
          - Log Analytics
          - Nagios
          - Platform
          - SCOM
          - ServiceHealth
          - SmartDetector
          - VM Insights
          - Zabbix
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: MonitorService
      severity:
        description: Severity of alert Sev0 being highest and Sev4 being lowest.
        enum:
          - Sev0
          - Sev1
          - Sev2
          - Sev3
          - Sev4
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: Severity
      signalType:
        description: The type of signal the alert is based on, which could be metrics, logs or activity logs.
        enum:
          - Metric
          - Log
          - Unknown
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: SignalType
      smartGroupId:
        description: Unique Id of the smart group
        readOnly: true
        type: string
      smartGroupingReason:
        description: Verbose reason describing the reason why this alert instance is added to a smart group
        readOnly: true
        type: string
      sourceCreatedId:
        description: Unique Id created by monitor service for each alert instance. This could be used to track the issue at the monitor service, in case of Nagios, Zabbix, SCOM etc.
        readOnly: true
        type: string
      startDateTime:
        description: Creation time(ISO-8601 format) of alert instance.
        format: date-time
        readOnly: true
        type: string
      targetResource:
        description: Target ARM resource, on which alert got created.
        type: string
      targetResourceGroup:
        description: Resource group of target ARM resource, on which alert got created.
        type: string
      targetResourceName:
        description: Name of the target ARM resource name, on which alert got created.
        type: string
      targetResourceType:
        description: Resource type of target ARM resource, on which alert got created.
        type: string
    type: object
  operation:
    description: Operation provided by provider
    properties:
      display:
        description: Properties of the operation
        properties:
          description:
            description: Description of the operation
            type: string
          operation:
            description: Operation name
            type: string
          provider:
            description: Provider name
            type: string
          resource:
            description: Resource name
            type: string
        type: object
      name:
        description: Name of the operation
        type: string
  operationsList:
    description: Lists the operations available in the AlertsManagement RP.
    properties:
      nextLink:
        description: URL to fetch the next set of alerts.
        type: string
      value:
        description: Array of operations
        items:
          $ref: "#/definitions/operation"
        type: array
    required:
      - value
  smartGroup:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Set of related alerts grouped together smartly by AMS.
    properties:
      properties:
        $ref: "#/definitions/smartGroupProperties"
        x-ms-client-flatten: true
  smartGroupAggregatedProperty:
    description: Aggregated property of each type
    properties:
      count:
        description: Total number of items of type.
        type: integer
      name:
        description: Name of the type.
        type: string
    type: object
  smartGroupModification:
    allOf:
      - $ref: "#/definitions/Resource"
    description: Alert Modification details
    properties:
      properties:
        $ref: "#/definitions/smartGroupModificationProperties"
  smartGroupModificationItem:
    description: smartGroup modification item.
    properties:
      comments:
        description: Modification comments
        type: string
      description:
        description: Description of the modification
        type: string
      modificationEvent:
        description: Reason for the modification
        enum:
          - SmartGroupCreated
          - StateChange
          - AlertAdded
          - AlertRemoved
        type: string
        x-ms-enum:
          name: SmartGroupModificationEvent
      modifiedAt:
        description: Modified date and time
        type: string
      modifiedBy:
        description: Modified user details (Principal client name)
        type: string
      newValue:
        description: New value
        type: string
      oldValue:
        description: Old value
        type: string
  smartGroupModificationProperties:
    description: Properties of the smartGroup modification item.
    properties:
      modifications:
        description: Modification details
        items:
          $ref: "#/definitions/smartGroupModificationItem"
        type: array
      nextLink:
        description: URL to fetch the next set of results.
        type: string
      smartGroupId:
        description: Unique Id of the smartGroup for which the history is being retrieved
        readOnly: true
        type: string
  smartGroupProperties:
    description: Properties of smart group.
    properties:
      alertSeverities:
        description: Summary of alertSeverities in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      alertStates:
        description: Summary of alertStates in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      alertsCount:
        description: Total number of alerts in smart group
        type: integer
      lastModifiedDateTime:
        description: Last updated time of smart group. Date-Time in ISO-8601 format.
        format: date-time
        readOnly: true
        type: string
      lastModifiedUserName:
        description: Last modified by user name.
        readOnly: true
        type: string
      monitorConditions:
        description: Summary of monitorConditions in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      monitorServices:
        description: Summary of monitorServices in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      nextLink:
        description: The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the next page alerts.
        type: string
      resourceGroups:
        description: Summary of target resource groups in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      resourceTypes:
        description: Summary of target resource types in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      resources:
        description: Summary of target resources in the smart group
        items:
          $ref: "#/definitions/smartGroupAggregatedProperty"
        type: array
      severity:
        description: Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group.
        enum:
          - Sev0
          - Sev1
          - Sev2
          - Sev3
          - Sev4
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: Severity
      smartGroupState:
        description: Smart group state
        enum:
          - New
          - Acknowledged
          - Closed
        readOnly: true
        type: string
        x-ms-enum:
          modelAsString: true
          name: State
      startDateTime:
        description: Creation time of smart group. Date-Time in ISO-8601 format.
        format: date-time
        readOnly: true
        type: string
    type: object
  smartGroupsList:
    description: List the alerts.
    properties:
      nextLink:
        description: URL to fetch the next set of alerts.
        type: string
      value:
        description: List of alerts
        items:
          $ref: "#/definitions/smartGroup"
        type: array
