openapi: 3.0.0
paths:
  /license:
    get:
      operationId: LicenseController_getLicenseInfo
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseInfo'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: No license
                  code: noLicense
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get License Info
      tags:
        - License
  /license/token:
    put:
      operationId: LicenseController_updateLicenseToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LicenseUpdate'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseUpdateResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License is not valid
                  code: newLicenseInvalid
                type: '#/components/schemas/ErrorResult'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Token is set in the environment file and cannot be updated
                  code: licenseTokenReadonly
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update License Token
      tags:
        - License
  /clustering:
    get:
      operationId: ClusteringController_getNodeConfiguration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeConfiguration'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get node configuration
      tags:
        - Clustering
  /clustering/load-balancing:
    get:
      operationId: ClusteringController_getLoadBalancing
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ClusteringLoadBalancing'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get Load Balancing
      tags:
        - Clustering
  /health:
    get:
      operationId: HealthController_ping
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: pong
                  version: 3.7.0
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Grafana version is not supported
                  code: grafanaUnreachable
                type: '#/components/schemas/ErrorResult'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Health check
      tags:
        - Health
  /health/services:
    get:
      operationId: HealthController_servicesHealth
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Microservises health check
      tags:
        - Health
  /grafana/variables-load:
    post:
      operationId: GrafanaController_loadDashboardVariables
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDashboardVariables'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardVariableOptionsResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Dashboard "[id]" does not exist.
                  code: alertRuleNotFound
                type: '#/components/schemas/ErrorResult'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get dashboard variables
      tags:
        - Grafana
  /grafana/check-panel-support:
    post:
      operationId: GrafanaController_checkPanelSupport
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrafanaPanelTarget'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Panel target is not supported
                  code: panelTargetUnsupported
                type: '#/components/schemas/ErrorResult'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Panel not found
                  code: panelNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Check Panel Support
      tags:
        - Grafana
  /grafana/take-panel-screenshot:
    post:
      operationId: GrafanaController_takePanelScreenshot
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrafanaPanelScreenshotTarget'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Unable to take panel screenshot
                  code: grafanaUnableToTakePanelScreenshot
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Take Panel Screenshot
      tags:
        - Grafana
  /grafana-data/search:
    get:
      operationId: GrafanaDataController_searchDashboards
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Search dashboards
      tags:
        - Grafana Proxy
  /grafana-data/dashboards/uid/{id}:
    get:
      operationId: GrafanaDataController_getDashboardInfo
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get dashboard by uid
      tags:
        - Grafana Proxy
  /grafana-data/org/users:
    get:
      operationId: GrafanaDataController_getUsers
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get all users within the current organization.
      tags:
        - Grafana Proxy
  /reports:
    get:
      operationId: ReportsController_getAll
      parameters:
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: ids
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Report'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get all reports
      tags:
        - Reports
    post:
      operationId: ReportsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Create report
      tags:
        - Reports
  /reports/{id}:
    put:
      operationId: ReportsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Report does not exist
                  code: reportNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update report
      tags:
        - Reports
    delete:
      operationId: ReportsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Report does not exist
                  code: reportNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Delete report
      tags:
        - Reports
    get:
      operationId: ReportsController_getById
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Report'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get report by id
      tags:
        - Reports
  /reports/{id}/status:
    put:
      operationId: ReportsController_updateStatus
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportChangeStatus'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Report does not exist
                  code: reportNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update report status
      tags:
        - Reports
  /reports/events:
    get:
      operationId: ReportsController_getEvents
      parameters:
        - name: page
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: ids
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedReportEventResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get events
      tags:
        - Reports
  /reports/events/latest:
    get:
      operationId: ReportsController_getLatestEvents
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReportEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get latest events
      tags:
        - Reports
  /reports/events/{eventId}:
    get:
      operationId: ReportsController_getReportEvent
      parameters:
        - name: eventId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Report event does not exist
                  code: reportEventNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get event for report by id
      tags:
        - Reports
  /alerts:
    get:
      operationId: AlertsController_getAll
      parameters:
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: ids
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResponseAlert'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get all alert rules
      tags:
        - Alert Rules
    post:
      operationId: AlertsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAlert'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Create alert rule
      tags:
        - Alert Rules
  /alerts/{id}:
    put:
      operationId: AlertsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAlert'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule does not exist
                  code: alertRuleNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update alert rule
      tags:
        - Alert Rules
    delete:
      operationId: AlertsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule does not exist
                  code: alertRuleNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Delete alert rule
      tags:
        - Alert Rules
    get:
      operationId: AlertsController_getById
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResponseAlert'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get alert rule by id
      tags:
        - Alert Rules
  /alerts/{id}/status:
    put:
      operationId: AlertsController_updateStatus
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertChangeStatus'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAlert'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule does not exist
                  code: alertRuleNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update alert rule status
      tags:
        - Alert Rules
  /alerts/events/latest:
    get:
      operationId: AlertsController_getLatestEvents
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResponseAlertEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get latest events
      tags:
        - Alert Rules
  /alerts/events/timeline:
    get:
      operationId: AlertsController_getEventsTimeline
      parameters:
        - name: page
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: ids
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAlertEventResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get events timeline
      tags:
        - Alert Rules
  /alerts/events/{eventId}:
    get:
      operationId: AlertsController_getAlertEvent
      parameters:
        - name: eventId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAlertEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule event does not exist
                  code: alertRuleEventNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get event for alert rule by id
      tags:
        - Alert Rules
  /alerts/{id}/data-preview:
    get:
      operationId: AlertsController_getDataPreview
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConditionPreview'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get alert rule data preview
      tags:
        - Alert Rules
  /alerts/data-preview:
    post:
      operationId: AlertsController_getDataPreviewByConfig
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertPreviewConfig'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConditionPreview'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get data preview for alert on configuration stage
      tags:
        - Alert Rules
  /alerts/state-transitions/{stateId}:
    get:
      operationId: AlertsController_getStateTransition
      parameters:
        - name: stateId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAlertStateTransition'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule State Transition does not exist
                  code: alertRuleStateTransitionNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get alert state transition
      tags:
        - Alert Rules
  /alerts/state-transitions/{stateId}/events:
    get:
      operationId: AlertsController_getStateTransitionEvents
      parameters:
        - name: page
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: stateId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAlertEventResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get alert state transition events
      tags:
        - Alert Rules
  /alerts/{id}/overrides/{value}:
    put:
      operationId: AlertsController_updateOverride
      parameters:
        - name: value
          required: true
          in: path
          schema: {}
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertConditionOverrideToUpdate'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '404':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Alert Rule does not exist
                  code: alertRuleNotFound
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update alert rule override
      tags:
        - Alert Rules
  /environment-management:
    get:
      operationId: EnvironmentManagementController_get
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEnvironment'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get Environment Info
      tags:
        - Environment Management
  /environment-management/grafana:
    put:
      operationId: EnvironmentManagementController_updateGrafana
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentGrafanaToUpdate'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEnvironment'
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Grafana is not reachable
                  code: grafanaUnreachable
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update Grafana Environment
      tags:
        - Environment Management
  /environment-management/processing:
    put:
      operationId: EnvironmentManagementController_updateProcessing
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentProcessing'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEnvironment'
      security:
        - Authorization: []
      summary: Update Processing Environment
      tags:
        - Environment Management
  /environment-management/name:
    put:
      operationId: EnvironmentManagementController_updateEnvironmentName
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentName'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentName'
        '400':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Environment name is readonly
                  code: environmentNameReadonly
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update Environment Name
      tags:
        - Environment Management
  /environment-management/ai:
    put:
      operationId: EnvironmentManagementController_updateAi
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentAiToUpdate'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEnvironment'
      security:
        - Authorization: []
      summary: Update AI Environment
      tags:
        - Environment Management
  /environment-management/ai/models:
    get:
      operationId: EnvironmentManagementController_getAvailableAiModels
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEnvironmentAiAvailableModels'
      security:
        - Authorization: []
      summary: Get Available AI Models
      tags:
        - Environment Management
  /transfer/export:
    get:
      operationId: TransferController_exportEngineConfiguration
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExportData'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Export Engine Configuration
      tags:
        - Transfer
  /transfer/import:
    post:
      operationId: TransferController_importEngineConfiguration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportData'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '422':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Version is incompatible, expected "[version]"
                  code: importDataVersionVersionIncompatible
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Import Engine Configuration
      tags:
        - Transfer
  /actions:
    get:
      operationId: ActionsController_getAll
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResponseAction'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get all actions
      tags:
        - Actions
    post:
      operationId: ActionsController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Action'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAction'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Create action
      tags:
        - Actions
  /actions/events:
    get:
      operationId: ActionsController_getEvents
      parameters:
        - name: page
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: alertStateId
          required: false
          in: query
          description: Alert State Transition Id
          schema:
            type: string
        - name: eventId
          required: false
          in: query
          description: Event Id
          schema:
            type: string
        - name: alertId
          required: false
          in: query
          description: Alert Id
          schema:
            type: string
        - name: ids
          required: false
          in: query
          description: Action Ids
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedActionEventResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get action events
      tags:
        - Actions
  /actions/events/count:
    get:
      operationId: ActionsController_getAlertEventNotificationsCount
      parameters:
        - name: alertStateId
          required: false
          in: query
          description: Alert State Transition Id
          schema:
            type: string
        - name: eventId
          required: false
          in: query
          description: Event Id
          schema:
            type: string
        - name: alertId
          required: false
          in: query
          description: Alert Id
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: number
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get event notifications count by id
      tags:
        - Actions
  /actions/events/reports:
    get:
      operationId: ActionsController_getReportEvents
      parameters:
        - name: page
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            type: number
        - name: eventId
          required: false
          in: query
          description: Event Id
          schema:
            type: string
        - name: reportId
          required: false
          in: query
          description: Report Id
          schema:
            type: string
        - name: ids
          required: false
          in: query
          description: Action Ids
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedActionEventResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get action report events
      tags:
        - Actions
  /actions/{id}:
    put:
      operationId: ActionsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Action'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAction'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Update action
      tags:
        - Actions
    delete:
      operationId: ActionsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                default:
                  message:
                    - property queryId should not exist
                type: '#/components/schemas/ValidationError'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Delete action
      tags:
        - Actions
    get:
      operationId: ActionsController_getById
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseAction'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get action by id
      tags:
        - Actions
  /actions/test:
    post:
      operationId: ActionsController_test
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Action'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionTestResult'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
        '502':
          description: ''
          content:
            application/json:
              schema:
                default:
                  ok: false
                  message: Error details
      security:
        - Authorization: []
      summary: Test action
      tags:
        - Actions
  /actions/preview:
    post:
      operationId: ActionsController_getPreview
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Action'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get Preview
      tags:
        - Actions
  /actions/{id}/latest-event:
    get:
      operationId: ActionsController_getLatestAlertEvent
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseActionEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get latest event by action ID
      tags:
        - Actions
  /actions/{id}/latest-event/reports:
    get:
      operationId: ActionsController_getLatestReportEvent
      parameters:
        - name: id
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseActionReportEvent'
        '403':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: License verification failed
                  code: licenseVerificationFailed
                type: '#/components/schemas/ErrorResult'
        '500':
          description: ''
          content:
            application/json:
              schema:
                default:
                  message: Internal Server Error
                  code: unknown
                type: '#/components/schemas/ErrorResult'
      security:
        - Authorization: []
      summary: Get latest report event by action ID
      tags:
        - Actions
  /metrics:
    get:
      operationId: MetricsController_index
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Prometheus Metrics
info:
  title: Business Engine API
  description: Business Intelligence for Grafana.
  version: 3.7.0
  contact: {}
tags: []
servers: []
components:
  securitySchemes:
    Authorization:
      scheme: bearer
      bearerFormat: JWT
      type: http
  schemas:
    LicenseInfo:
      type: object
      properties:
        limit:
          type: number
        used:
          type: number
        expiration:
          type: number
          description: Timestamp ms
        isCommunity:
          type: boolean
          description: If Community
      required:
        - limit
        - used
        - expiration
        - isCommunity
    LicenseUpdate:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    LicenseUpdateResponse:
      type: object
      properties:
        token:
          type: string
        info:
          $ref: '#/components/schemas/LicenseInfo'
      required:
        - token
        - info
    NodeConfiguration:
      type: object
      properties:
        isScaled:
          type: boolean
          example: false
      required:
        - isScaled
    ClusteringLoadBalancing:
      type: object
      properties:
        id:
          type: string
        alertIds:
          type: array
          items:
            type: string
        reportIds:
          type: array
          items:
            type: string
      required:
        - id
        - alertIds
        - reportIds
    VariablesTimeRange:
      type: object
      properties:
        from:
          type: number
          description: Timestamp in ms
        to:
          type: number
          description: Timestamp in ms
      required:
        - from
        - to
    GetDashboardVariables:
      type: object
      properties:
        dashboardId:
          type: string
        variables:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
        timeRange:
          $ref: '#/components/schemas/VariablesTimeRange'
      required:
        - dashboardId
        - variables
    VariableOption:
      type: object
      properties:
        label:
          type: string
        value:
          type: string
      required:
        - label
        - value
    DashboardVariableOptionsResponse:
      type: object
      properties:
        options:
          type: object
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/VariableOption'
              - type: array
                items:
                  $ref: '#/components/schemas/VariableOption'
      required:
        - options
    GrafanaPanelTarget:
      type: object
      properties:
        dashboardId:
          type: string
          description: Dashboard Id
        panelId:
          type: number
          description: Panel Id
      required:
        - dashboardId
        - panelId
    AbsoluteTimeRange:
      type: object
      properties:
        from:
          type: number
          description: From timestamp
        to:
          type: number
          description: To timestamp
      required:
        - from
        - to
    WithOptionalAbsoluteTimeRange:
      type: object
      properties:
        timeRange:
          $ref: '#/components/schemas/AbsoluteTimeRange'
    WithOptionalVariables:
      type: object
      properties:
        variables:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: number
              - type: array
                items:
                  type: number
              - type: 'null'
    GrafanaPanelScreenshotTarget:
      type: object
      properties:
        timeRange:
          $ref: '#/components/schemas/AbsoluteTimeRange'
        variables:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: number
              - type: array
                items:
                  type: number
              - type: 'null'
        dashboardId:
          type: string
          description: Dashboard Id
        panelId:
          type: number
          description: Panel Id
      required:
        - dashboardId
        - panelId
    ReportTimeRange:
      type: object
      properties:
        from:
          type: number
          description: Time Offset in seconds
        to:
          type: number
          description: Time Offset in seconds
      required:
        - from
        - to
    Report:
      type: object
      properties:
        id:
          type: string
        dashboardId:
          type: string
        timeRangeSource:
          type: string
          enum:
            - dashboard
            - configured
        timeRange:
          $ref: '#/components/schemas/ReportTimeRange'
        title:
          type: string
        schedule:
          type: string
        status:
          type: string
          enum:
            - active
            - paused
        variables:
          type: object
        actionIds:
          type: array
          items:
            type: string
        event:
          type: object
      required:
        - id
        - dashboardId
        - timeRangeSource
        - title
        - schedule
        - status
        - variables
        - actionIds
        - event
    ReportChangeStatus:
      type: object
      properties:
        status:
          type: string
          enum:
            - active
            - paused
      required:
        - status
    PaginatedData:
      type: object
      properties:
        page:
          type: number
        total:
          type: number
      required:
        - page
        - total
    ReportEvent:
      type: object
      properties:
        id:
          type: string
        date:
          format: date-time
          type: string
        dashboardId:
          type: string
        reportTitle:
          type: string
        reportId:
          type: string
        file:
          type: string
      required:
        - id
        - date
        - dashboardId
        - reportTitle
        - reportId
        - file
    PaginatedReportEventResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/PaginatedData'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ReportEvent'
      required:
        - pagination
        - data
    AlertEvaluationPattern:
      type: object
      properties:
        field:
          type: string
        pattern:
          type: string
        type:
          type: string
          enum:
            - pattern
      required:
        - field
        - pattern
        - type
    AlertEvaluationThresholds:
      type: object
      properties:
        type:
          type: string
          enum:
            - thresholds
        colors:
          type: array
          items:
            type: string
        field:
          type: object
          nullable: true
        deviationRange:
          type: array
          items:
            type: string
      required:
        - type
        - colors
        - field
        - deviationRange
    AlertEvaluationAnomaly:
      type: object
      properties:
        type:
          type: string
          enum:
            - anomaly
      required:
        - type
    AlertVariable:
      type: object
      properties:
        name:
          type: string
        multi:
          type: boolean
        includeAll:
          type: boolean
        value:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
            - type: number
            - type: array
              items:
                type: number
            - type: 'null'
      required:
        - name
        - multi
        - includeAll
        - value
    AlertEvaluationApply:
      type: object
      properties:
        mode:
          type: string
          enum:
            - all
            - last
            - percentage
        percentage:
          type: number
      required:
        - mode
        - percentage
    AlertCondition:
      type: object
      properties:
        id:
          type: string
        alertId:
          type: string
        repeat:
          type: string
          nullable: true
        variables:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/AlertVariable'
        evaluationType:
          type: string
          enum:
            - anomaly
            - pattern
            - thresholds
        evaluation:
          oneOf:
            - $ref: '#/components/schemas/AlertEvaluationPattern'
            - $ref: '#/components/schemas/AlertEvaluationThresholds'
            - $ref: '#/components/schemas/AlertEvaluationAnomaly'
        evaluationApply:
          oneOf:
            - $ref: '#/components/schemas/AlertEvaluationApply'
          allOf:
            - $ref: '#/components/schemas/AlertEvaluationApply'
      required:
        - id
        - alertId
        - repeat
        - evaluationType
        - evaluation
        - evaluationApply
    AlertConditionOverride:
      type: object
      properties:
        id:
          type: string
        alertId:
          type: string
        isDisabled:
          type: boolean
        variables:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
              - type: number
              - type: array
                items:
                  type: number
              - type: 'null'
      required:
        - id
        - alertId
        - isDisabled
    AlertTimeRange:
      type: object
      properties:
        from:
          type: number
          description: Time Offset in seconds
        to:
          type: number
          description: Time Offset in seconds
      required:
        - from
        - to
    ResponseAlert:
      type: object
      properties:
        status:
          type: string
          enum:
            - active
            - paused
        dashboardId:
          type: string
        panelId:
          type: number
        timeRangeSource:
          type: string
          enum:
            - dashboard
            - configured
        timeRange:
          $ref: '#/components/schemas/AlertTimeRange'
        condition:
          $ref: '#/components/schemas/AlertCondition'
        conditionOverrides:
          type: array
          items:
            $ref: '#/components/schemas/AlertConditionOverride'
        title:
          type: string
        sampleSize:
          type: number
        noDataState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        schedule:
          type: string
        actionIds:
          type: array
          items:
            type: string
        annotations:
          type: string
          enum:
            - panel
            - dashboard
            - disabled
        isConfigurationValid:
          type: boolean
        screenshots:
          type: boolean
        id:
          type: string
        stateStartDate:
          format: date-time
          type: string
          description: State Start Date
          nullable: true
      required:
        - status
        - dashboardId
        - panelId
        - timeRangeSource
        - condition
        - conditionOverrides
        - title
        - sampleSize
        - noDataState
        - schedule
        - actionIds
        - annotations
        - isConfigurationValid
        - screenshots
        - id
        - stateStartDate
    Alert:
      type: object
      properties:
        status:
          type: string
          enum:
            - active
            - paused
        dashboardId:
          type: string
        panelId:
          type: number
        timeRangeSource:
          type: string
          enum:
            - dashboard
            - configured
        timeRange:
          $ref: '#/components/schemas/AlertTimeRange'
        condition:
          $ref: '#/components/schemas/AlertCondition'
        conditionOverrides:
          type: array
          items:
            $ref: '#/components/schemas/AlertConditionOverride'
        title:
          type: string
        sampleSize:
          type: number
        noDataState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        schedule:
          type: string
        actionIds:
          type: array
          items:
            type: string
        annotations:
          type: string
          enum:
            - panel
            - dashboard
            - disabled
        isConfigurationValid:
          type: boolean
        screenshots:
          type: boolean
      required:
        - status
        - dashboardId
        - panelId
        - timeRangeSource
        - condition
        - conditionOverrides
        - title
        - sampleSize
        - noDataState
        - schedule
        - actionIds
        - annotations
        - isConfigurationValid
        - screenshots
    AlertChangeStatus:
      type: object
      properties:
        status:
          type: string
          enum:
            - active
            - paused
      required:
        - status
    TriggerAlertEvent:
      type: object
      properties: {}
    ResponseAlertEvent:
      type: object
      properties:
        id:
          type: string
        alertId:
          type: string
        startDate:
          type: string
        endDate:
          type: string
          nullable: true
        event:
          $ref: '#/components/schemas/TriggerAlertEvent'
        prevState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
            - none
        newState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        duration:
          type: number
        alertTitle:
          type: string
        stateId:
          type: string
      required:
        - id
        - alertId
        - startDate
        - endDate
        - event
        - prevState
        - newState
        - duration
        - alertTitle
        - stateId
    PaginatedAlertEventResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/PaginatedData'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ResponseAlertEvent'
      required:
        - pagination
        - data
    UnknownObjectModel:
      type: object
      properties: {}
    ConditionPreviewQuery:
      type: object
      properties:
        from:
          type: string
        to:
          type: string
        queries:
          type: array
          items:
            $ref: '#/components/schemas/UnknownObjectModel'
      required:
        - from
        - to
        - queries
    ConditionPreview:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/ConditionPreviewQuery'
        repeat:
          oneOf:
            - type: string
            - type: 'null'
        error:
          type: boolean
        errorDetails:
          type: object
          properties: {}
        fieldConfig:
          type: object
          properties: {}
        variables:
          description: Scoped Variables
          type: array
          items:
            $ref: '#/components/schemas/UnknownObjectModel'
        series:
          description: Grafana Data Frames
          type: array
          items:
            $ref: '#/components/schemas/UnknownObjectModel'
      required:
        - query
        - repeat
        - error
        - variables
        - series
    AlertPreviewConfig:
      type: object
      properties:
        status:
          type: string
          enum:
            - active
            - paused
        dashboardId:
          type: string
        panelId:
          type: number
        timeRangeSource:
          type: string
          enum:
            - dashboard
            - configured
        timeRange:
          $ref: '#/components/schemas/AlertTimeRange'
        condition:
          $ref: '#/components/schemas/AlertCondition'
        conditionOverrides:
          type: array
          items:
            $ref: '#/components/schemas/AlertConditionOverride'
      required:
        - status
        - dashboardId
        - panelId
        - timeRangeSource
        - condition
        - conditionOverrides
    BaseAlertStateTransition:
      type: object
      properties:
        id:
          type: string
        prevState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        newState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        durationMs:
          type: number
        totalEvents:
          type: number
      required:
        - id
        - prevState
        - newState
        - durationMs
        - totalEvents
    ResponseAlertStateTransition:
      type: object
      properties:
        id:
          type: string
        prevState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        newState:
          type: string
          enum:
            - scheduled
            - ok
            - alerting
            - error
        durationMs:
          type: number
        totalEvents:
          type: number
        startDate:
          type: string
        endDate:
          oneOf:
            - type: string
            - type: 'null'
        lastEvent:
          $ref: '#/components/schemas/ResponseAlertEvent'
      required:
        - id
        - prevState
        - newState
        - durationMs
        - totalEvents
        - startDate
        - endDate
        - lastEvent
    AlertConditionOverrideToUpdate:
      type: object
      properties:
        isDisabled:
          type: boolean
      required:
        - isDisabled
    ResponseEnvironmentMain:
      type: object
      properties:
        serverPort:
          type: number
        schedulerPort:
          type: number
        rendererPort:
          type: number
        nodeId:
          type: string
        logLevel:
          type: string
          enum:
            - log
            - error
            - warn
            - debug
            - verbose
            - fatal
        apiDocumentation:
          type: boolean
      required:
        - serverPort
        - schedulerPort
        - rendererPort
        - nodeId
        - logLevel
        - apiDocumentation
    EnvironmentProcessing:
      type: object
      properties:
        jobBatchSize:
          type: number
        alertConditionsBatchSize:
          type: number
        alertAnnotationsBatchSize:
          type: number
        alertEventsRetentionDays:
          type: number
        actionEventsRetentionDays:
          type: number
        reportEventsRetentionDays:
          type: number
      required:
        - jobBatchSize
        - alertConditionsBatchSize
        - alertAnnotationsBatchSize
        - alertEventsRetentionDays
        - actionEventsRetentionDays
        - reportEventsRetentionDays
    ResponseEnvironmentGrafanaRendererBasicAuth:
      type: object
      properties:
        username:
          type: string
      required:
        - username
    ResponseEnvironmentGrafana:
      type: object
      properties:
        url:
          type: string
          example: http://localhost:3000
        healthCheckTimeout:
          type: number
        healthCheckRetry:
          type: number
        requestTimeout:
          type: number
        version:
          type: string
        rendererAuthType:
          type: string
          enum:
            - ''
            - basic
        rendererBasicAuth:
          $ref: '#/components/schemas/ResponseEnvironmentGrafanaRendererBasicAuth'
      required:
        - url
        - healthCheckTimeout
        - healthCheckRetry
        - requestTimeout
        - version
        - rendererAuthType
        - rendererBasicAuth
    EnvironmentDatabase:
      type: object
      properties:
        host:
          type: string
          example: localhost
        port:
          type: number
          example: 5432
        username:
          type: string
        db:
          type: string
      required:
        - host
        - port
        - username
        - db
    ResponseEnvironmentAiXai:
      type: object
      properties:
        apiKey:
          type: string
        modelId:
          type: string
      required:
        - apiKey
        - modelId
    ResponseEnvironmentAiAnthropic:
      type: object
      properties:
        apiKey:
          type: string
        modelId:
          type: string
      required:
        - apiKey
        - modelId
    ResponseEnvironmentAi:
      type: object
      properties:
        modelType:
          type: string
          enum:
            - ''
            - xai
            - anthropic
        xai:
          $ref: '#/components/schemas/ResponseEnvironmentAiXai'
        anthropic:
          $ref: '#/components/schemas/ResponseEnvironmentAiAnthropic'
      required:
        - modelType
        - xai
        - anthropic
    ResponseEnvironment:
      type: object
      properties:
        main:
          $ref: '#/components/schemas/ResponseEnvironmentMain'
        processing:
          $ref: '#/components/schemas/EnvironmentProcessing'
        grafana:
          $ref: '#/components/schemas/ResponseEnvironmentGrafana'
        database:
          $ref: '#/components/schemas/EnvironmentDatabase'
        ai:
          $ref: '#/components/schemas/ResponseEnvironmentAi'
      required:
        - main
        - processing
        - grafana
        - database
        - ai
    EnvironmentGrafanaRendererBasicAuthToUpdate:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
      required:
        - username
        - password
    EnvironmentGrafanaToUpdate:
      type: object
      properties:
        url:
          type: string
          example: http://localhost:3000
        healthCheckTimeout:
          type: number
        healthCheckRetry:
          type: number
        requestTimeout:
          type: number
        version:
          type: string
        rendererAuthType:
          type: string
          enum:
            - ''
            - basic
        rendererBasicAuth:
          $ref: '#/components/schemas/EnvironmentGrafanaRendererBasicAuthToUpdate'
        token:
          type: string
          description: Grafana service account token
      required:
        - url
        - healthCheckTimeout
        - healthCheckRetry
        - requestTimeout
        - version
        - rendererAuthType
        - rendererBasicAuth
        - token
    EnvironmentName:
      type: object
      properties:
        name:
          type: string
          description: Environment Name
      required:
        - name
    EnvironmentAiXaiToUpdate:
      type: object
      properties:
        apiKey:
          type: string
        modelId:
          type: string
      required:
        - apiKey
        - modelId
    EnvironmentAiAnthropicToUpdate:
      type: object
      properties:
        apiKey:
          type: string
        modelId:
          type: string
      required:
        - apiKey
        - modelId
    EnvironmentAiToUpdate:
      type: object
      properties:
        modelType:
          type: string
          enum:
            - ''
            - xai
            - anthropic
        xai:
          $ref: '#/components/schemas/EnvironmentAiXaiToUpdate'
        anthropic:
          $ref: '#/components/schemas/EnvironmentAiAnthropicToUpdate'
      required:
        - modelType
        - xai
        - anthropic
    ResponseEnvironmentAiAvailableModels:
      type: object
      properties:
        xai:
          type: array
          items:
            type: string
        anthropic:
          type: array
          items:
            type: string
      required:
        - xai
        - anthropic
    ActionRequestHeader:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
    ActionRequestOptions:
      type: object
      properties:
        url:
          type: string
        headers:
          type: array
          items:
            $ref: '#/components/schemas/ActionRequestHeader'
      required:
        - url
        - headers
    ActionCustomOptions:
      type: object
      properties: {}
    ActionAiConfig:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    ResponseCalculatedCondition:
      type: object
      properties: {}
    ResponseActionEvent:
      type: object
      properties:
        id:
          type: string
        date:
          type: string
        alert:
          $ref: '#/components/schemas/ResponseAlert'
        alertEvent:
          $ref: '#/components/schemas/ResponseAlertEvent'
        condition:
          $ref: '#/components/schemas/ResponseCalculatedCondition'
        message:
          type: string
        status:
          type: string
          enum:
            - ok
            - error
        error:
          type: object
      required:
        - id
        - date
        - message
        - status
    ResponseAction:
      type: object
      properties:
        title:
          type: string
        type:
          type: string
          enum:
            - request
            - custom
        target:
          type: string
          enum:
            - alerting
            - reporting
        options:
          oneOf:
            - $ref: '#/components/schemas/ActionRequestOptions'
            - $ref: '#/components/schemas/ActionCustomOptions'
          allOf:
            - $ref: '#/components/schemas/ActionRequestOptions'
        message:
          type: string
        messageType:
          type: string
          enum:
            - template
            - ai
        ai:
          $ref: '#/components/schemas/ActionAiConfig'
        id:
          type: string
        latestEvent:
          $ref: '#/components/schemas/ResponseActionEvent'
        useFor:
          type: array
          items:
            type: string
        useForReports:
          type: array
          items:
            type: string
      required:
        - title
        - type
        - target
        - options
        - message
        - messageType
        - ai
        - id
        - latestEvent
        - useFor
        - useForReports
    ExportData:
      type: object
      properties:
        version:
          type: string
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/ResponseAlert'
        reports:
          type: array
          items:
            $ref: '#/components/schemas/Report'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ResponseAction'
      required:
        - version
        - alerts
        - reports
        - actions
    PaginatedActionEventResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/PaginatedData'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ResponseActionEvent'
      required:
        - pagination
        - data
    Action:
      type: object
      properties:
        title:
          type: string
        type:
          type: string
          enum:
            - request
            - custom
        target:
          type: string
          enum:
            - alerting
            - reporting
        options:
          oneOf:
            - $ref: '#/components/schemas/ActionRequestOptions'
            - $ref: '#/components/schemas/ActionCustomOptions'
          allOf:
            - $ref: '#/components/schemas/ActionRequestOptions'
        message:
          type: string
        messageType:
          type: string
          enum:
            - template
            - ai
        ai:
          $ref: '#/components/schemas/ActionAiConfig'
      required:
        - title
        - type
        - target
        - options
        - message
        - messageType
        - ai
    ActionTestResult:
      type: object
      properties:
        ok:
          type: boolean
        message:
          type: string
      required:
        - ok
        - message
    ResponseActionReportEvent:
      type: object
      properties:
        id:
          type: string
        date:
          type: string
        report:
          $ref: '#/components/schemas/Report'
        reportEvent:
          $ref: '#/components/schemas/ReportEvent'
        message:
          type: string
        status:
          type: string
          enum:
            - ok
            - error
        error:
          type: object
      required:
        - id
        - date
        - message
        - status
externalDocs:
  description: Documentation
  url: https://pulsebi.studio/docs/
