# This code is auto generated, at src/scripts/generate-docs with the version 2.0.4 do NOT alter it directly

openapi: 3.1.0
info:
  title: Resource Status Tracker (RST)
  version: '1.0'
  description: |
    Use cases:
     - Deviation Popup (System wide number of deviated Resources)
       `GET /resources/states/deviations/count`
     - Service Deviations List
       `GET /resources/states/deviations?serviceIds=myService`
paths:
  /api/v2/resources/states/deviations:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - deviations
      parameters:
        - name: serviceIds
          description: Limit to `ServiceID`s
          in: query
          schema:
            type: array
            maxItems: 100
            items:
              title: ServiceID
              description: The ID of a particular Cybus Service
              type: string
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
              minLength: 1
              maxLength: 128
              examples:
                - myService
        - name: resourceIds
          description: Limit to `ResourceID`s
          in: query
          schema:
            type: array
            maxItems: 100
            items:
              title: ResourceID
              description: |
                The fully qualified ID of a particular Cybus Resource
                which consists of ServiceID & ResourceName seperated by a "-"
              type: string
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
              minLength: 3
              maxLength: 256
              examples:
                - myService-myResource
        - name: page
          description: Page to return
          in: query
          schema:
            description: A page number
            type: integer
            minimum: 1
            default: 1
        - name: itemsPerPage
          description: Number of items per page
          in: query
          schema:
            description: Number of items per page
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: >-
            List of resource state deviations, allowing to identify resources
            that have diverged from their expected states
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      title: Resource Status
                      description: >-
                        Object containing information about the *status* and
                        *state* of a *resource*
                      type: object
                      additionalProperties: false
                      required:
                        - resource
                        - state
                        - deviated
                      properties:
                        resource:
                          title: Resource
                          description: >-
                            Object containing information about a particular
                            resource
                          type: object
                          additionalProperties: false
                          required:
                            - id
                            - name
                          properties:
                            id:
                              title: ResourceID
                              description: >
                                The fully qualified ID of a particular Cybus
                                Resource

                                which consists of ServiceID & ResourceName
                                seperated by a "-"
                              type: string
                              pattern: >-
                                ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
                              minLength: 3
                              maxLength: 256
                              examples:
                                - myService-myResource
                            name:
                              title: ResourceName
                              description: The ID of a particular Cybus Service
                              type: string
                              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                              minLength: 1
                              maxLength: 128
                              examples:
                                - myResource
                        state:
                          title: Resource State
                          description: State information of a resource
                          type: object
                          additionalProperties: false
                          required:
                            - desired
                            - current
                          properties:
                            desired:
                              title: State
                              description: Representing an arbitrary state
                              type: string
                              minLength: 1
                              maxLength: 128
                              examples:
                                - connected
                                - disconnected
                                - enabled
                                - disabled
                                - created
                                - running
                                - paused
                                - exited
                                - active
                            current:
                              title: State
                              description: Representing an arbitrary state
                              type: string
                              minLength: 1
                              maxLength: 128
                              examples:
                                - connected
                                - disconnected
                                - enabled
                                - disabled
                                - created
                                - running
                                - paused
                                - exited
                                - active
                        runnerInfo:
                          title: Resource Runner Info
                          description: Information about resource runner status
                          type: object
                          additionalProperties: false
                          required:
                            - name
                            - status
                          properties:
                            name:
                              title: Name
                              description: Resource Runner Name
                              type: string
                              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                              minLength: 1
                              maxLength: 128
                              examples:
                                - protocol-mapper
                                - container-manager
                            status:
                              title: Status
                              description: Resource Runner Status
                              type: string
                              enum:
                                - healthy
                                - unhealthy
                                - unknown
                        deviated:
                          title: Deviated
                          description: Flag indicating if a deviation was detected or not
                          type: boolean
                        info:
                          title: Info
                          description: Information about the resource state
                          type: string
                          maxLength: 128
                          examples:
                            - Host not reachable
                            - Connection timeout
                  meta:
                    type: object
                    required:
                      - pagination
                    properties:
                      pagination:
                        type: object
                        required:
                          - totalPages
                          - totalRows
                          - pageNumber
                          - totalRowsInPage
                          - nextPage
                          - rowsPerPage
                        properties:
                          totalPages:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRows:
                            type: integer
                            examples:
                              - 1
                          pageNumber:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRowsInPage:
                            type: integer
                            examples:
                              - 1
                          nextPage:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          rowsPerPage:
                            description: Number of items per page
                            type: integer
                            minimum: 1
                            maximum: 100
                            default: 50
            text/event-stream:
              schema:
                title: Resource Status
                description: >-
                  Object containing information about the *status* and *state*
                  of a *resource*
                type: object
                additionalProperties: false
                required:
                  - resource
                  - state
                  - deviated
                properties:
                  resource:
                    title: Resource
                    description: Object containing information about a particular resource
                    type: object
                    additionalProperties: false
                    required:
                      - id
                      - name
                    properties:
                      id:
                        title: ResourceID
                        description: >
                          The fully qualified ID of a particular Cybus Resource

                          which consists of ServiceID & ResourceName seperated
                          by a "-"
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 3
                        maxLength: 256
                        examples:
                          - myService-myResource
                      name:
                        title: ResourceName
                        description: The ID of a particular Cybus Service
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - myResource
                  state:
                    title: Resource State
                    description: State information of a resource
                    type: object
                    additionalProperties: false
                    required:
                      - desired
                      - current
                    properties:
                      desired:
                        title: State
                        description: Representing an arbitrary state
                        type: string
                        minLength: 1
                        maxLength: 128
                        examples:
                          - connected
                          - disconnected
                          - enabled
                          - disabled
                          - created
                          - running
                          - paused
                          - exited
                          - active
                      current:
                        title: State
                        description: Representing an arbitrary state
                        type: string
                        minLength: 1
                        maxLength: 128
                        examples:
                          - connected
                          - disconnected
                          - enabled
                          - disabled
                          - created
                          - running
                          - paused
                          - exited
                          - active
                  runnerInfo:
                    title: Resource Runner Info
                    description: Information about resource runner status
                    type: object
                    additionalProperties: false
                    required:
                      - name
                      - status
                    properties:
                      name:
                        title: Name
                        description: Resource Runner Name
                        type: string
                        pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - protocol-mapper
                          - container-manager
                      status:
                        title: Status
                        description: Resource Runner Status
                        type: string
                        enum:
                          - healthy
                          - unhealthy
                          - unknown
                  deviated:
                    title: Deviated
                    description: Flag indicating if a deviation was detected or not
                    type: boolean
                  info:
                    title: Info
                    description: Information about the resource state
                    type: string
                    maxLength: 128
                    examples:
                      - Host not reachable
                      - Connection timeout
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
  /api/v2/resources/states/deviations/count:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - deviations
      parameters:
        - name: ids
          description: Limit to `ServiceID`s
          in: query
          required: false
          schema:
            type: array
            maxItems: 100
            items:
              title: ServiceID
              description: The ID of a particular Cybus Service
              type: string
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
              minLength: 1
              maxLength: 128
              examples:
                - myService
        - name: page
          description: Page to return
          in: query
          schema:
            description: A page number
            type: integer
            minimum: 1
            default: 1
        - name: itemsPerPage
          description: Number of items per page
          in: query
          schema:
            description: Number of items per page
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: >
            Number of resources currently in a deviated state.

            If no filter is applied the number represents the system wide
            deviations.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    oneOf:
                      - type: array
                        items:
                          type: object
                          additionalProperties: false
                          required:
                            - serviceId
                            - count
                          properties:
                            serviceId:
                              title: ServiceID
                              description: The ID of a particular Cybus Service
                              type: string
                              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                              minLength: 1
                              maxLength: 128
                              examples:
                                - myService
                            count:
                              title: Deviations Count
                              description: The current number of deviations
                              type: integer
                              minimum: 0
                              examples:
                                - 42
                                - 0
                      - title: Deviations Count
                        description: The current number of deviations
                        type: integer
                        minimum: 0
                        examples:
                          - 42
                          - 0
                  meta:
                    type: object
                    required:
                      - pagination
                    properties:
                      pagination:
                        type: object
                        required:
                          - totalPages
                          - totalRows
                          - pageNumber
                          - totalRowsInPage
                          - nextPage
                          - rowsPerPage
                        properties:
                          totalPages:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRows:
                            type: integer
                            examples:
                              - 1
                          pageNumber:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRowsInPage:
                            type: integer
                            examples:
                              - 1
                          nextPage:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          rowsPerPage:
                            description: Number of items per page
                            type: integer
                            minimum: 1
                            maximum: 100
                            default: 50
            text/event-stream:
              schema:
                oneOf:
                  - type: object
                    additionalProperties: false
                    required:
                      - serviceId
                      - count
                    properties:
                      serviceId:
                        title: ServiceID
                        description: The ID of a particular Cybus Service
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - myService
                      count:
                        title: Deviations Count
                        description: The current number of deviations
                        type: integer
                        minimum: 0
                        examples:
                          - 42
                          - 0
                  - title: Deviations Count
                    description: The current number of deviations
                    type: integer
                    minimum: 0
                    examples:
                      - 42
                      - 0
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
  /api/v2/resources/states/deviations/services:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - deviations
      parameters:
        - name: orderBy
          description: Order response by field
          in: query
          required: false
          schema:
            type: string
            enum:
              - serviceId
            default: serviceId
        - name: order
          description: Ascending or descending order
          in: query
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: ASC
        - name: page
          description: Page to return
          in: query
          required: false
          schema:
            description: A page number
            type: integer
            minimum: 1
            default: 1
        - name: itemsPerPage
          description: Number of items per page
          in: query
          required: false
          schema:
            description: Number of items per page
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: searchText
          description: The value used to retrieve services by matching service IDs
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: >
            Returns a list of deviated ServiceIds along with their number of
            deviated resources
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonapi
                  - data
                  - meta
                properties:
                  jsonapi:
                    type: object
                    required:
                      - version
                    properties:
                      version:
                        type: string
                        example: 1.1.1
                  data:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      required:
                        - serviceId
                        - count
                      properties:
                        serviceId:
                          title: ServiceID
                          description: The ID of a particular Cybus Service
                          type: string
                          pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                          minLength: 1
                          maxLength: 128
                          examples:
                            - myService
                        count:
                          title: Deviations Count
                          description: The current number of deviations
                          type: integer
                          minimum: 0
                          examples:
                            - 42
                            - 0
                  meta:
                    type: object
                    required:
                      - pagination
                    properties:
                      pagination:
                        type: object
                        required:
                          - totalPages
                          - totalRows
                          - pageNumber
                          - totalRowsInPage
                          - nextPage
                          - rowsPerPage
                        properties:
                          totalPages:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRows:
                            type: integer
                            examples:
                              - 1
                          pageNumber:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRowsInPage:
                            type: integer
                            examples:
                              - 1
                          nextPage:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          rowsPerPage:
                            description: Number of items per page
                            type: integer
                            minimum: 1
                            maximum: 100
                            default: 50
            text/event-stream:
              schema:
                type: object
                required:
                  - deviatedServices
                additionalProperties: false
                properties:
                  deviatedServices:
                    title: Deviations Count
                    description: The current number of deviations
                    type: integer
                    minimum: 0
                    examples:
                      - 42
                      - 0
                  service:
                    title: Service Deviation State
                    type: object
                    required:
                      - serviceId
                      - deviated
                    additionalProperties: false
                    properties:
                      serviceId:
                        title: ServiceID
                        description: The ID of a particular Cybus Service
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - myService
                      deviated:
                        title: Deviated
                        description: Flag indicating if a deviation was detected or not
                        type: boolean
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonapi
                  - errors
                properties:
                  jsonapi:
                    type: object
                    required:
                      - version
                    properties:
                      version:
                        type: string
                        example: 1.1.1
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                        - status
                        - title
                        - detail
                      properties:
                        status:
                          type: string
                          example: '400'
                        title:
                          type: string
                          example: Invalid parameters provided.
                        detail:
                          type: string
                          example: invalid parameter for orderBy
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonapi
                  - errors
                properties:
                  jsonapi:
                    type: object
                    required:
                      - version
                    properties:
                      version:
                        type: string
                        example: 1.1.1
                  errors:
                    type: array
                    items:
                      type: object
                      required:
                        - status
                        - title
                        - detail
                      properties:
                        status:
                          type: string
                          example: '400'
                        title:
                          type: string
                          example: Invalid parameters provided.
                        detail:
                          type: string
                          example: invalid parameter for orderBy
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
  /api/v2/resources/states:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - states
      parameters:
        - name: serviceIds
          description: Limit to `ServiceID`s
          in: query
          schema:
            type: array
            maxItems: 100
            items:
              title: ServiceID
              description: The ID of a particular Cybus Service
              type: string
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
              minLength: 1
              maxLength: 128
              examples:
                - myService
        - name: resourceIds
          description: Limit to `ResourceID`s
          in: query
          schema:
            type: array
            maxItems: 100
            items:
              title: ResourceID
              description: |
                The fully qualified ID of a particular Cybus Resource
                which consists of ServiceID & ResourceName seperated by a "-"
              type: string
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
              minLength: 3
              maxLength: 256
              examples:
                - myService-myResource
        - name: deviated
          description: Return only deviated resources
          in: query
          schema:
            allOf:
              - title: Deviated
                description: Flag indicating if a deviation was detected or not
                type: boolean
              - default: false
        - name: page
          description: Page to return
          in: query
          schema:
            description: A page number
            type: integer
            minimum: 1
            default: 1
        - name: itemsPerPage
          description: Number of items per page
          in: query
          schema:
            description: Number of items per page
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: >
            List of resources including their state and status.

            If no `ServiceID`s and no `ResourceID`s are provided, it acts as a
            wildcard request.

            Filtering for ResourceIds takes precedence over filtering for
            ServiceIds. Meaning as soon as `ResourceID`s are provided, the
            `ServiceID`s will be ignored.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      title: Resource Status
                      description: >-
                        Object containing information about the *status* and
                        *state* of a *resource*
                      type: object
                      additionalProperties: false
                      required:
                        - resource
                        - state
                        - deviated
                      properties:
                        resource:
                          title: Resource
                          description: >-
                            Object containing information about a particular
                            resource
                          type: object
                          additionalProperties: false
                          required:
                            - id
                            - name
                          properties:
                            id:
                              title: ResourceID
                              description: >
                                The fully qualified ID of a particular Cybus
                                Resource

                                which consists of ServiceID & ResourceName
                                seperated by a "-"
                              type: string
                              pattern: >-
                                ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
                              minLength: 3
                              maxLength: 256
                              examples:
                                - myService-myResource
                            name:
                              title: ResourceName
                              description: The ID of a particular Cybus Service
                              type: string
                              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                              minLength: 1
                              maxLength: 128
                              examples:
                                - myResource
                        state:
                          title: Resource State
                          description: State information of a resource
                          type: object
                          additionalProperties: false
                          required:
                            - desired
                            - current
                          properties:
                            desired:
                              title: State
                              description: Representing an arbitrary state
                              type: string
                              minLength: 1
                              maxLength: 128
                              examples:
                                - connected
                                - disconnected
                                - enabled
                                - disabled
                                - created
                                - running
                                - paused
                                - exited
                                - active
                            current:
                              title: State
                              description: Representing an arbitrary state
                              type: string
                              minLength: 1
                              maxLength: 128
                              examples:
                                - connected
                                - disconnected
                                - enabled
                                - disabled
                                - created
                                - running
                                - paused
                                - exited
                                - active
                        runnerInfo:
                          title: Resource Runner Info
                          description: Information about resource runner status
                          type: object
                          additionalProperties: false
                          required:
                            - name
                            - status
                          properties:
                            name:
                              title: Name
                              description: Resource Runner Name
                              type: string
                              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                              minLength: 1
                              maxLength: 128
                              examples:
                                - protocol-mapper
                                - container-manager
                            status:
                              title: Status
                              description: Resource Runner Status
                              type: string
                              enum:
                                - healthy
                                - unhealthy
                                - unknown
                        deviated:
                          title: Deviated
                          description: Flag indicating if a deviation was detected or not
                          type: boolean
                        info:
                          title: Info
                          description: Information about the resource state
                          type: string
                          maxLength: 128
                          examples:
                            - Host not reachable
                            - Connection timeout
                  meta:
                    type: object
                    required:
                      - pagination
                    properties:
                      pagination:
                        type: object
                        required:
                          - totalPages
                          - totalRows
                          - pageNumber
                          - totalRowsInPage
                          - nextPage
                          - rowsPerPage
                        properties:
                          totalPages:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRows:
                            type: integer
                            examples:
                              - 1
                          pageNumber:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRowsInPage:
                            type: integer
                            examples:
                              - 1
                          nextPage:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          rowsPerPage:
                            description: Number of items per page
                            type: integer
                            minimum: 1
                            maximum: 100
                            default: 50
            text/event-stream:
              schema:
                title: Resource Status
                description: >-
                  Object containing information about the *status* and *state*
                  of a *resource*
                type: object
                additionalProperties: false
                required:
                  - resource
                  - state
                  - deviated
                properties:
                  resource:
                    title: Resource
                    description: Object containing information about a particular resource
                    type: object
                    additionalProperties: false
                    required:
                      - id
                      - name
                    properties:
                      id:
                        title: ResourceID
                        description: >
                          The fully qualified ID of a particular Cybus Resource

                          which consists of ServiceID & ResourceName seperated
                          by a "-"
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 3
                        maxLength: 256
                        examples:
                          - myService-myResource
                      name:
                        title: ResourceName
                        description: The ID of a particular Cybus Service
                        type: string
                        pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - myResource
                  state:
                    title: Resource State
                    description: State information of a resource
                    type: object
                    additionalProperties: false
                    required:
                      - desired
                      - current
                    properties:
                      desired:
                        title: State
                        description: Representing an arbitrary state
                        type: string
                        minLength: 1
                        maxLength: 128
                        examples:
                          - connected
                          - disconnected
                          - enabled
                          - disabled
                          - created
                          - running
                          - paused
                          - exited
                          - active
                      current:
                        title: State
                        description: Representing an arbitrary state
                        type: string
                        minLength: 1
                        maxLength: 128
                        examples:
                          - connected
                          - disconnected
                          - enabled
                          - disabled
                          - created
                          - running
                          - paused
                          - exited
                          - active
                  runnerInfo:
                    title: Resource Runner Info
                    description: Information about resource runner status
                    type: object
                    additionalProperties: false
                    required:
                      - name
                      - status
                    properties:
                      name:
                        title: Name
                        description: Resource Runner Name
                        type: string
                        pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                        minLength: 1
                        maxLength: 128
                        examples:
                          - protocol-mapper
                          - container-manager
                      status:
                        title: Status
                        description: Resource Runner Status
                        type: string
                        enum:
                          - healthy
                          - unhealthy
                          - unknown
                  deviated:
                    title: Deviated
                    description: Flag indicating if a deviation was detected or not
                    type: boolean
                  info:
                    title: Info
                    description: Information about the resource state
                    type: string
                    maxLength: 128
                    examples:
                      - Host not reachable
                      - Connection timeout
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
  /api/v2/resource-runners:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - runners
      parameters:
        - name: names
          description: Limit to specific `runner`s
          in: query
          schema:
            type: array
            maxItems: 100
            items:
              title: Name
              description: Resource Runner Name
              type: string
              pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
              minLength: 1
              maxLength: 128
              examples:
                - protocol-mapper
                - container-manager
        - name: page
          description: Page to return
          in: query
          schema:
            description: A page number
            type: integer
            minimum: 1
            default: 1
        - name: itemsPerPage
          description: Number of items per page
          in: query
          schema:
            description: Number of items per page
            type: integer
            minimum: 1
            maximum: 500
            default: 50
      responses:
        '200':
          description: List of heartbeats
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      title: Runner Heartbeat
                      description: Heartbeat information of a runner
                      type: object
                      additionalProperties: false
                      required:
                        - name
                        - healthy
                        - last
                        - misses
                        - remainingMissedHeartbeats
                        - hostname
                        - version
                      properties:
                        name:
                          title: Name
                          description: Resource Runner Name
                          type: string
                          pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                          minLength: 1
                          maxLength: 128
                          examples:
                            - protocol-mapper
                            - container-manager
                        healthy:
                          title: Resource runner health
                          description: Represents if resource runners are or not healthy
                          type: boolean
                        last:
                          type: integer
                          examples:
                            - 1716543812
                        misses:
                          title: Resource runner missed heartbeats
                          description: Represents the count of missed heartbeats
                          type: integer
                          minimum: 0
                        remainingMissedHeartbeats:
                          title: Resource runner remaining missed heartbeats
                          description: >
                            Represents the number of allowed heartbeats misses
                            for the resource runner

                            until it becomes unhealthy
                          type: integer
                        hostname:
                          type: string
                        version:
                          type: string
                  meta:
                    type: object
                    required:
                      - pagination
                    properties:
                      pagination:
                        type: object
                        required:
                          - totalPages
                          - totalRows
                          - pageNumber
                          - totalRowsInPage
                          - nextPage
                          - rowsPerPage
                        properties:
                          totalPages:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRows:
                            type: integer
                            examples:
                              - 1
                          pageNumber:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          totalRowsInPage:
                            type: integer
                            examples:
                              - 1
                          nextPage:
                            description: A page number
                            type: integer
                            minimum: 1
                            default: 1
                          rowsPerPage:
                            description: Number of items per page
                            type: integer
                            minimum: 1
                            maximum: 500
                            default: 50
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
  /api/v2/resources/rst/httpschemas:
    get:
      security:
        - ApiKeyHeader: []
      tags:
        - runners
      responses:
        '200':
          description: Every RST related http endpoint definition
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    additionalProperties: true
                    patternProperties:
                      '[a-zA-Z0-9]+':
                        type: object
        '503':
          description: Service Unavailable (Infrastructure error)
          content:
            text/plain:
              schema:
                type: string
                example: >-
                  upstream connect error or disconnect/reset before headers.
                  reset reason: connection failure
securityDefinitions:
  ApiKeyHeader:
    type: apiKey
    in: header
    name: Authorization
components:
  schemas:
    JSONAPI:
      type: object
      required:
        - version
      properties:
        version:
          type: string
          example: 1.1.1
    JSONAPIVersion:
      type: string
      example: 1.1.1
    JSONAPIError:
      type: object
      required:
        - jsonapi
        - errors
      properties:
        jsonapi:
          type: object
          required:
            - version
          properties:
            version:
              type: string
              example: 1.1.1
        errors:
          type: array
          items:
            type: object
            required:
              - status
              - title
              - detail
            properties:
              status:
                type: string
                example: '400'
              title:
                type: string
                example: Invalid parameters provided.
              detail:
                type: string
                example: invalid parameter for orderBy
    pageNumber:
      description: A page number
      type: integer
      minimum: 1
      default: 1
    itemsPerPage:
      description: Number of items per page
      type: integer
      minimum: 1
      maximum: 100
      default: 50
    itemsPerPageLarge:
      description: Number of items per page
      type: integer
      minimum: 1
      maximum: 500
      default: 50
    pagination:
      type: object
      required:
        - totalPages
        - totalRows
        - pageNumber
        - totalRowsInPage
        - nextPage
        - rowsPerPage
      properties:
        totalPages:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        totalRows:
          type: integer
          examples:
            - 1
        pageNumber:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        totalRowsInPage:
          type: integer
          examples:
            - 1
        nextPage:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        rowsPerPage:
          description: Number of items per page
          type: integer
          minimum: 1
          maximum: 100
          default: 50
    paginationLarge:
      type: object
      required:
        - totalPages
        - totalRows
        - pageNumber
        - totalRowsInPage
        - nextPage
        - rowsPerPage
      properties:
        totalPages:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        totalRows:
          type: integer
          examples:
            - 1
        pageNumber:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        totalRowsInPage:
          type: integer
          examples:
            - 1
        nextPage:
          description: A page number
          type: integer
          minimum: 1
          default: 1
        rowsPerPage:
          description: Number of items per page
          type: integer
          minimum: 1
          maximum: 500
          default: 50
    resourceStateList:
      type: array
      items:
        title: Resource Status
        description: >-
          Object containing information about the *status* and *state* of a
          *resource*
        type: object
        additionalProperties: false
        required:
          - resource
          - state
          - deviated
        properties:
          resource:
            title: Resource
            description: Object containing information about a particular resource
            type: object
            additionalProperties: false
            required:
              - id
              - name
            properties:
              id:
                title: ResourceID
                description: |
                  The fully qualified ID of a particular Cybus Resource
                  which consists of ServiceID & ResourceName seperated by a "-"
                type: string
                pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*-[a-zA-Z0-9][a-zA-Z0-9_.]*$
                minLength: 3
                maxLength: 256
                examples:
                  - myService-myResource
              name:
                title: ResourceName
                description: The ID of a particular Cybus Service
                type: string
                pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                minLength: 1
                maxLength: 128
                examples:
                  - myResource
          state:
            title: Resource State
            description: State information of a resource
            type: object
            additionalProperties: false
            required:
              - desired
              - current
            properties:
              desired:
                title: State
                description: Representing an arbitrary state
                type: string
                minLength: 1
                maxLength: 128
                examples:
                  - connected
                  - disconnected
                  - enabled
                  - disabled
                  - created
                  - running
                  - paused
                  - exited
                  - active
              current:
                title: State
                description: Representing an arbitrary state
                type: string
                minLength: 1
                maxLength: 128
                examples:
                  - connected
                  - disconnected
                  - enabled
                  - disabled
                  - created
                  - running
                  - paused
                  - exited
                  - active
          runnerInfo:
            title: Resource Runner Info
            description: Information about resource runner status
            type: object
            additionalProperties: false
            required:
              - name
              - status
            properties:
              name:
                title: Name
                description: Resource Runner Name
                type: string
                pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
                minLength: 1
                maxLength: 128
                examples:
                  - protocol-mapper
                  - container-manager
              status:
                title: Status
                description: Resource Runner Status
                type: string
                enum:
                  - healthy
                  - unhealthy
                  - unknown
          deviated:
            title: Deviated
            description: Flag indicating if a deviation was detected or not
            type: boolean
          info:
            title: Info
            description: Information about the resource state
            type: string
            maxLength: 128
            examples:
              - Host not reachable
              - Connection timeout
    resourceDeviationsCountsList:
      type: array
      items:
        type: object
        additionalProperties: false
        required:
          - serviceId
          - count
        properties:
          serviceId:
            title: ServiceID
            description: The ID of a particular Cybus Service
            type: string
            pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
            minLength: 1
            maxLength: 128
            examples:
              - myService
          count:
            title: Deviations Count
            description: The current number of deviations
            type: integer
            minimum: 0
            examples:
              - 42
              - 0
    JsonApiresourceDeviationsCountsListEnvelope:
      type: object
      required:
        - jsonapi
        - data
        - meta
      properties:
        jsonapi:
          type: object
          required:
            - version
          properties:
            version:
              type: string
              example: 1.1.1
        data:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - serviceId
              - count
            properties:
              serviceId:
                title: ServiceID
                description: The ID of a particular Cybus Service
                type: string
                pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.]*$
                minLength: 1
                maxLength: 128
                examples:
                  - myService
              count:
                title: Deviations Count
                description: The current number of deviations
                type: integer
                minimum: 0
                examples:
                  - 42
                  - 0
        meta:
          type: object
          required:
            - pagination
          properties:
            pagination:
              type: object
              required:
                - totalPages
                - totalRows
                - pageNumber
                - totalRowsInPage
                - nextPage
                - rowsPerPage
              properties:
                totalPages:
                  description: A page number
                  type: integer
                  minimum: 1
                  default: 1
                totalRows:
                  type: integer
                  examples:
                    - 1
                pageNumber:
                  description: A page number
                  type: integer
                  minimum: 1
                  default: 1
                totalRowsInPage:
                  type: integer
                  examples:
                    - 1
                nextPage:
                  description: A page number
                  type: integer
                  minimum: 1
                  default: 1
                rowsPerPage:
                  description: Number of items per page
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 50
    resourceRunners:
      type: array
      items:
        title: Runner Heartbeat
        description: Heartbeat information of a runner
        type: object
        additionalProperties: false
        required:
          - name
          - healthy
          - last
          - misses
          - remainingMissedHeartbeats
          - hostname
          - version
        properties:
          name:
            title: Name
            description: Resource Runner Name
            type: string
            pattern: ^[a-zA-Z][a-zA-Z0-9_-]*$
            minLength: 1
            maxLength: 128
            examples:
              - protocol-mapper
              - container-manager
          healthy:
            title: Resource runner health
            description: Represents if resource runners are or not healthy
            type: boolean
          last:
            type: integer
            examples:
              - 1716543812
          misses:
            title: Resource runner missed heartbeats
            description: Represents the count of missed heartbeats
            type: integer
            minimum: 0
          remainingMissedHeartbeats:
            title: Resource runner remaining missed heartbeats
            description: >
              Represents the number of allowed heartbeats misses for the
              resource runner

              until it becomes unhealthy
            type: integer
          hostname:
            type: string
          version:
            type: string
    httpSchema:
      type: object
      additionalProperties: true
      patternProperties:
        '[a-zA-Z0-9]+':
          type: object
  responses:
    ServiceUnavailable:
      description: Service Unavailable (Infrastructure error)
      content:
        text/plain:
          schema:
            type: string
            example: >-
              upstream connect error or disconnect/reset before headers. reset
              reason: connection failure
