swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: MonitorManagementClient
  version: 2016-03-01
  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-ms-code-generation-settings:
    name: MonitorManagementClient
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: monitor-alertRulesIncidents_API
  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
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  ResourceGroupNameParameter:
    description: The name of the resource group.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  RuleNameParameter:
    description: The name of the rule.
    in: path
    name: ruleName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The Azure subscription Id.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents":
    get:
      description: Gets a list of incidents associated to an alert rule
      operationId: AlertRuleIncidents_ListByAlertRule
      parameters:
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/RuleNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Successful request for a list of alert rule related incidents
          schema:
            $ref: "#/definitions/IncidentListResult"
      tags:
        - AlertRuleIncidents
      x-ms-examples:
        List alert rule incidents:
          parameters:
            api-version: 2016-03-01
            resourceGroupName: Rac46PostSwapRG
            ruleName: myRuleName
            subscriptionId: b67f7fec-69fc-4974-9099-a26bd6ffeda3
          responses:
            "200":
              body:
                value:
                  - activatedTime: 2017-09-13T15:45:26.9792776Z
                    isActive: true
                    name: Website_started
                    resolvedTime: 2017-09-13T22:14:28.9792776Z
                    ruleName: myRuleName
              headers: {}
      x-ms-pageable:
        nextLinkName: null
  "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}":
    get:
      description: Gets an incident associated to an alert rule
      operationId: AlertRuleIncidents_Get
      parameters:
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/RuleNameParameter"
        - description: The name of the incident to retrieve.
          in: path
          name: incidentName
          required: true
          type: string
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
      responses:
        "200":
          description: Successful request for one alert rule related incident
          schema:
            $ref: "#/definitions/Incident"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - AlertRuleIncidents
      x-ms-examples:
        Get a single alert rule incident:
          parameters:
            api-version: 2016-03-01
            incidentName: Website_started
            resourceGroupName: Rac46PostSwapRG
            ruleName: myRuleName
            subscriptionId: b67f7fec-69fc-4974-9099-a26bd6ffeda3
          responses:
            "200":
              body:
                activatedTime: 2017-09-13T15:45:26.9792776Z
                isActive: true
                name: Website_started
                resolvedTime: 2017-09-13T22:14:28.9792776Z
                ruleName: myRuleName
              headers: {}
definitions:
  ErrorResponse:
    description: Describes the format of Error response.
    properties:
      code:
        description: Error code
        type: string
      message:
        description: Error message indicating why the operation failed.
        type: string
    type: object
  Incident:
    description: An alert incident indicates the activation status of an alert rule.
    properties:
      activatedTime:
        description: The time at which the incident was activated in ISO8601 format.
        format: date-time
        readOnly: true
        type: string
      isActive:
        description: A boolean to indicate whether the incident is active or resolved.
        readOnly: true
        type: boolean
      name:
        description: Incident name.
        readOnly: true
        type: string
      resolvedTime:
        description: The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active.
        format: date-time
        readOnly: true
        type: string
      ruleName:
        description: Rule name that is associated with the incident.
        readOnly: true
        type: string
  IncidentListResult:
    description: The List incidents operation response.
    properties:
      value:
        description: the incident collection.
        items:
          $ref: "#/definitions/Incident"
        type: array
