openapi: 3.0.1
info:
  title: Alerting service
  contact:
    name: Cobrick
    url: https://cobrick.com
    email: aiops@cobrick.com
  license:
    name: Commercial
    url: https://cobrick.com
  version: v1
servers:
  - url: https://app.observe.digital/api/v1
    description: Production environment
  - url: https://stage.observe.digital/api/v1
    description: Staging environment
  - url: http://localhost:8080
    description: Local environment
paths:
  /alerting/alerts:
    get:
      tags:
        - Alerts
      summary: Get all alert definitions
      operationId: getAlertDefinitions
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: namespaces
          in: query
          schema:
            type: array
            items:
              type: string
        - name: services
          in: query
          schema:
            type: array
            items:
              type: string
        - name: metrics
          in: query
          schema:
            type: array
            items:
              type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned alert definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AlertDefinition'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    post:
      tags:
        - Alerts
      summary: Create a new alert definition
      operationId: createAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        description: JSON representation of the alert definition to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDefinition'
        required: true
      responses:
        '201':
          description: Successfully created new alert definition
          content:
            text/plain:
              schema:
                description: An id of the newly created alert definition
              examples:
                example:
                  value: '1'
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/functional/incident:
    get:
      tags:
        - Functional alerts
      summary: Get all incident alert definitions
      operationId: getIncidentAlertDefinitions
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned alert definitions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LogAlertDefinition'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    post:
      tags:
        - Functional alerts
      summary: Create a new incident alert definition
      operationId: createIncidentAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        description: JSON representation of the alert definition to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogAlertDefinition'
        required: true
      responses:
        '201':
          description: Successfully created new alert definition
          content:
            text/plain:
              schema:
                description: An id of the newly created alert definition
              examples:
                example:
                  value: '1'
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/functional/incident/{id}:
    put:
      tags:
        - Functional alerts
      summary: Update an existing incident alert definition
      operationId: updateIncidentAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogAlertDefinition'
        required: true
      responses:
        '200':
          description: Successfully updated the alert definition
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    delete:
      tags:
        - Functional alerts
      summary: Remove an existing incident alert definition
      operationId: deleteIncidentAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the alert definition
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/notifications:
    get:
      tags:
        - Notification channels
      summary: Get all notification channels
      operationId: getNotificationChannels
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned notification channels
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NotificationChannel'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    post:
      tags:
        - Notification channels
      summary: Create a new notification channel
      operationId: createNotificationChannel
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        description: JSON representation of the notification channel to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationChannel'
        required: true
      responses:
        '201':
          description: Successfully created new notification channel
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/notifications/{name}:
    put:
      tags:
        - Notification channels
      summary: Update an existing notification channel
      operationId: updateNotificationChannel
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: name
          in: path
          description: Notification channel name
          required: true
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationChannel'
        required: true
      responses:
        '200':
          description: Successfully updated the notification channel
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The notification channel doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    delete:
      tags:
        - Notification channels
      summary: Remove an existing notification channel
      operationId: deleteNotificationChannel
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: name
          in: path
          description: Notification channel name
          required: true
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the notification channel
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The notification channel doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/templates:
    get:
      tags:
        - Message templates
      summary: Get all message templates
      operationId: getMessageTemplates
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned message templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MessageTemplate'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    post:
      tags:
        - Message templates
      summary: Create a new message template
      operationId: createMessageTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        description: JSON representation of the message template to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageTemplate'
        required: true
      responses:
        '201':
          description: Successfully created new message template
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/templates/{name}:
    get:
      tags:
        - Message templates
      summary: Get message template by name
      operationId: getMessageTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: name
          in: path
          description: Message template name
          required: true
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned message template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SloDefinition'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The message template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    put:
      tags:
        - Message templates
      summary: Update an existing message template
      operationId: updateMessageTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: name
          in: path
          description: Message template name
          required: true
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageTemplate'
        required: true
      responses:
        '200':
          description: Successfully updated the message template
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The message template doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    delete:
      tags:
        - Message templates
      summary: Remove an existing message template
      operationId: deleteMessageTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: name
          in: path
          description: Message template name
          required: true
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the message template
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The message template doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/alerts/{id}:
    get:
      tags:
        - Alerts
      summary: Get alert definition
      operationId: getAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned alert definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDefinition'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    put:
      tags:
        - Alerts
      summary: Update an existing alert definition
      operationId: updateAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDefinition'
        required: true
      responses:
        '200':
          description: Successfully updated the alert definition
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    delete:
      tags:
        - Alerts
      summary: Remove an existing alert definition
      operationId: deleteAlertDefinition
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the alert definition
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    patch:
      tags:
        - Alerts
      summary: Patch an existing alert definition
      operationId: updateAlertDefinition_1
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert definition identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDefinitionPatch'
        required: true
      responses:
        '200':
          description: Successfully applied the patch
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert definition doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/templates:
    get:
      tags:
        - Alert templates
      summary: Get all alert templates
      operationId: getAlertTemplates
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned alert templates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AlertTemplate'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '403':
          description: Insufficient roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    post:
      tags:
        - Alert templates
      summary: Create a new alert template
      operationId: createAlertTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: applyToSites
          in: query
          description: List of sites the new alert template should be applied to
          schema:
            type: array
            items:
              type: string
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      requestBody:
        description: JSON representation of the alert template to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertTemplate'
        required: true
      responses:
        '201':
          description: Successfully created new alert template
          content:
            text/plain:
              schema:
                description: An id of the newly created alert template
              examples:
                example:
                  value: '1'
        '400':
          description: Incorrect payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '403':
          description: Insufficient roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
  /alerting/templates/{id}:
    get:
      tags:
        - Alert templates
      summary: Get alert template
      operationId: getAlertTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert template identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '200':
          description: Successfully returned alert template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertTemplate'
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '403':
          description: Insufficient roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert template doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
    delete:
      tags:
        - Alert templates
      summary: Remove an existing alert template
      operationId: deleteAlertTemplate
      parameters:
        - name: X-Scope-OrgID
          in: header
          description: Scope header
          schema:
            type: string
        - name: id
          in: path
          description: Alert template identifier
          required: true
          schema:
            type: integer
            format: int64
        - name: deleteRelatedDefinitions
          in: query
          schema:
            type: boolean
            description: >-
              Flag that determines if all alert definitions related to the alert
              template should be deleted
            default: false
        - name: Api-Version
          in: header
          description: API version
          schema:
            type: string
      responses:
        '204':
          description: Successfully deleted the alert template
        '401':
          description: Authorization information is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '403':
          description: Insufficient roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '404':
          description: The alert template doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonError'
components:
  schemas:
    AbstractResource_JsonError_:
      type: object
      properties:
        _links:
          type: object
          additionalProperties: true
        _embedded:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/Resource'
    AlertAggregationFunction:
      type: string
      enum:
        - SUM
        - AVERAGE
        - MAXIMUM
        - MINIMUM
    AlertDefinition:
      required:
        - aggregationFunction
        - aggregationLabels
        - description
        - detectionMethod
        - enabled
        - metricName
        - name
        - notificationChannels
        - serviceName
        - serviceNamespace
        - thresholds
      type: object
      properties:
        id:
          type: integer
          format: int64
          readOnly: true
        name:
          maxLength: 255
          minLength: 1
          type: string
        serviceName:
          maxLength: 255
          minLength: 1
          type: string
        serviceNamespace:
          maxLength: 255
          minLength: 1
          type: string
        metricName:
          maxLength: 255
          minLength: 1
          type: string
        description:
          maxLength: 2000
          type: string
        detectionMethod:
          $ref: '#/components/schemas/AlertDetectionMethod'
        aggregationFunction:
          $ref: '#/components/schemas/AlertAggregationFunction'
        aggregationLabels:
          type: array
          items:
            type: string
        window:
          type: string
          format: duration
        thresholds:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/AlertThreshold'
        enabled:
          type: boolean
        templateId:
          type: integer
          format: int64
          readOnly: true
        notificationChannels:
          type: array
          items:
            type: string
      description: A model class representing an alerting rule configuration.
    AlertDefinitionPatch:
      required:
        - enabled
      type: object
      properties:
        enabled:
          type: boolean
      description: >-
        A DTO representing a patch payload for @linkplain
        com.cobrick.aiops.alerting.model.AlertDefinition.
    AlertDetectionMethod:
      type: string
      enum:
        - METRIC
        - ANOMALY
        - INCIDENT
    AlertSeverity:
      type: string
      enum:
        - WARNING
        - ERROR
        - ALERT
    AlertTemplate:
      type: object
      description: A model class representing an alerting template configuration.
      allOf:
        - $ref: '#/components/schemas/AlertDefinition'
        - required:
            - applyToNewSites
          properties:
            applyToNewSites:
              type: boolean
    AlertThreshold:
      required:
        - duration
        - operator
        - severity
        - unit
        - value
      type: object
      properties:
        severity:
          $ref: '#/components/schemas/AlertSeverity'
        value:
          type: number
          format: double
        operator:
          $ref: '#/components/schemas/AlertThreshold.Operator'
        unit:
          $ref: '#/components/schemas/AlertThreshold.Unit'
        duration:
          type: string
          format: duration
    AlertThreshold.Operator:
      type: string
      enum:
        - EQUAL
        - NOT_EQUAL
        - GREATER
        - LESS
        - GAP
    AlertThreshold.Unit:
      type: string
      enum:
        - PERCENTAGE
        - ABSOLUTE
    Charset:
      type: object
      properties:
        registered:
          type: boolean
    EmailNotificationChannel:
      type: object
      description: >-
        A model class reprensenting an email alert notification channel
        configuration.
      allOf:
        - $ref: '#/components/schemas/NotificationChannel'
        - required:
            - recipients
          properties:
            recipients:
              minItems: 1
              type: array
              items:
                type: string
    IncidentType:
      type: string
      enum:
        - INCIDENT
        - ANOMALY
        - ALERT
    JsonError:
      type: object
      allOf:
        - $ref: '#/components/schemas/AbstractResource_JsonError_'
        - required:
            - message
          properties:
            _links:
              type: object
              additionalProperties: true
            _embedded:
              type: object
              additionalProperties:
                type: array
                items:
                  $ref: '#/components/schemas/Resource'
            message:
              type: string
            logref:
              type: string
              nullable: true
            path:
              type: string
              nullable: true
    LogAlertDefinition:
      required:
        - name
        - type
      type: object
      properties:
        id:
          type: integer
          format: int64
          readOnly: true
        name:
          maxLength: 255
          minLength: 1
          type: string
        type:
          $ref: '#/components/schemas/IncidentType'
        notificationChannels:
          type: array
          items:
            type: string
      description: A model class representing a log-based alerting rule configuration.
    MediaType:
      required:
        - name
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        subtype:
          type: string
        extension:
          type: string
        parameters:
          $ref: '#/components/schemas/OptionalValues_String_'
        quality:
          type: string
        qualityAsNumber:
          type: number
        version:
          type: string
        charset:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Charset'
        textBased:
          type: boolean
    MessageTemplate:
      required:
        - name
        - template
      type: object
      properties:
        name:
          maxLength: 255
          minLength: 1
          type: string
        template:
          minLength: 1
          type: string
    NotificationChannel:
      required:
        - name
      type: object
      properties:
        name:
          maxLength: 255
          minLength: 1
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/NotificationChannel.Type'
            - readOnly: true
      description: >-
        An abstract model class representing common properties of all alert
        notification channels.
      discriminator:
        propertyName: type
        mapping:
          SLACK: '#/components/schemas/SlackNotificationChannel'
          EMAIL: '#/components/schemas/EmailNotificationChannel'
      oneOf:
        - $ref: '#/components/schemas/EmailNotificationChannel'
        - $ref: '#/components/schemas/SlackNotificationChannel'
    NotificationChannel.Type:
      type: string
      enum:
        - EMAIL
        - SLACK
    OptionalMultiValues_Link_:
      $ref: '#/components/schemas/OptionalValues_List_Link__'
    OptionalMultiValues_Resource_:
      $ref: '#/components/schemas/OptionalValues_List_Resource__'
    OptionalValues_List_Link__:
      type: object
      properties:
        empty:
          type: boolean
    OptionalValues_List_Resource__:
      type: object
      properties:
        empty:
          type: boolean
    OptionalValues_String_:
      type: object
      properties:
        empty:
          type: boolean
    Resource:
      type: object
      properties:
        _links:
          $ref: '#/components/schemas/OptionalMultiValues_Link_'
        _embedded:
          $ref: '#/components/schemas/OptionalMultiValues_Resource_'
    SlackNotificationChannel:
      type: object
      description: >-
        A model class representing a Slack alert notification channel
        configuration.
      allOf:
        - $ref: '#/components/schemas/NotificationChannel'
        - required:
            - apiUrl
            - channel
          properties:
            apiUrl:
              minLength: 1
              type: string
            channel:
              minLength: 1
              type: string
    SloDefinition:
      required:
        - metricName
        - name
        - targetThreshold
        - timeWindow
        - warningThreshold
      type: object
      properties:
        id:
          type: integer
          format: int64
          readOnly: true
        name:
          maxLength: 255
          minLength: 1
          type: string
        metricName:
          maxLength: 255
          minLength: 1
          type: string
        serviceName:
          maxLength: 255
          type: string
        serviceNamespace:
          maxLength: 255
          type: string
        targetThreshold:
          minimum: 0
          type: number
          format: double
        timeWindow:
          type: string
          format: duration
        warningThreshold:
          minimum: 0
          type: number
          format: double
        notificationChannels:
          type: array
          items:
            type: string
