Спецификации OpenAPI

Содержание раздела
  1. Основная спецификация
  2. Спецификация методов по мониторингу состояния нод

HTTP API системы описывается двумя отдельными спецификациями OpenAPI:

Спецификации доступны по приведенным выше ссылкам, а также в секциях ниже.

Основная спецификация

openapi: 3.0.0
info:
  title: ProstorePublicAPI
  version: 1.0.8
  description: Prostore public Rest API
  contact:
    name: Alexander Senko
servers:
  - url: 'http://{host}:{port}'
    variables:
      host:
        default: localhost
      port:
        default: '9090'
paths:
  /api/v1/datamarts/query:
    post:
      summary: Execute Query based on SQL+ command
      operationId: post-query-execute
      responses:
        '200':
          $ref: '#/components/responses/query'
        '500':
          $ref: '#/components/responses/500'
      description: Execute a query in simple or prepared modes. The query can be any supported SQL+ command.
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/query-format'
        - $ref: '#/components/parameters/query-compression-level'
        - $ref: '#/components/parameters/x-request-id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/query-request'
            examples:
              simple query:
                value:
                  query: 'SELECT id, data FROM test_db.test_table WHERE id > 3 AND id < 6 AND (data = ''data'' OR data IS null) ORDER BY id DATASOURCE_TYPE = ''adb'''
                  queryId: '12345'
                  maxRowsToRead: 1000
                  fetchSize: 100
                  fetchTimeoutMs: 60000
              prepared query (async):
                value:
                  query: 'INSERT INTO test_db.test_table (id, data) values (?, ?), (?, ?), (?, ?)'
                  async: true
                  params:
                    - value: 4
                      type: INTEGER
                    - value: data
                      type: VARCHAR
                    - value: 5
                      type: INTEGER
                    - value: null
                      type: VARCHAR
                    - value: 6
                      type: INTEGER
                    - value: null
                      type: VARCHAR
        description: |-
          - If the optional <b>parameter "params" is not specified</b>, the request is executed as <b>simple query</b>, when all parameter values are passed in the query string itself.

          - If the optional <b>parameter "params" is specified</b>, the request is executed as <b>prepared query</b>. In this case, all values within the query string, represented as a "?", are replaced with the corresponding value from the "params" array.

          Datamart should be specified inside of query text.
    parameters: []
  '/api/v1/datamarts/{datamart}/query':
    post:
      summary: Execute Query based on SQL+ command
      operationId: post-query-datamart-execute
      responses:
        '200':
          $ref: '#/components/responses/query'
        '500':
          $ref: '#/components/responses/500'
      description: Execute a query in simple or prepared modes based on specified datamart. The query can be any supported SQL+ command.
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/query-format'
        - $ref: '#/components/parameters/query-compression-level'
        - $ref: '#/components/parameters/x-request-id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/query-request'
            examples:
              prepared select query:
                value:
                  query: 'SELECT t1.* FROM all_types FOR SYSTEM_TIME AS OF :p_timestamp AS t1 JOIN all_types AS t2 ON t1.id = t2.id WHERE t1.boolean_col = ? AND t1.varchar_col = ? AND t1.id IN (SELECT id FROM all_types2 FOR SYSTEM_TIME STARTED TS (''2022-10-01 16:00:00'', ?)) AND t2.id IN (SELECT id FROM all_types3 FOR SYSTEM_TIME AS OF DELTA_NUM :p_delta) AND t2.timestamp_col > :p_timestamp AND t2.int_col < :p_int AND t2.float_col < ?'
                  queryId: '12345'
                  params:
                    - name: p_timestamp
                      value: '2024-11-17 21:11:12'
                      type: TIMESTAMP
                    - value: true
                      type: BOOLEAN
                    - value: A
                      type: VARCHAR
                    - value: '2024-12-18 22:22:13'
                      type: TIMESTAMP
                    - name: p_delta
                      value: 1
                      type: INT
                    - name: p_int
                      value: 10
                      type: INT
                    - value: 1.1
                      type: FLOAT
                    - name: settings_for_system_time_started
                      value: '2022-11-14 16:00:00, 2024-11-15 16:00:00'
                      type: VARCHAR
        description: |-
          - If the optional <b>parameter "params" is not specified</b>, the request is executed as <b>simple query</b>, when all parameter values are passed in the query string itself.

          - If the optional <b>parameter "params" is specified</b>, the request is executed as <b>prepared query</b>. In this case, all values within the query string, represented as a "?", are replaced with the corresponding value from the "params" array.
    parameters:
      - $ref: '#/components/parameters/datamart'
  '/api/v1/datamarts/query/{requestId}':
    parameters:
      - $ref: '#/components/parameters/requestId'
    get:
      summary: Get status of async query by requestId
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          $ref: '#/components/responses/async-query-status'
        '404':
          $ref: '#/components/responses/async-query-status-404'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-async-query-status
      description: Get status of async query by requestId. Status 0 - running; status 2 - error.
    post:
      summary: Delete async query by requestId
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      operationId: delete-async-query-status
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Clear async query information by requestId (any status).
  '/api/v1/datamarts/{datamart}/query/{requestId}':
    parameters:
      - $ref: '#/components/parameters/datamart'
      - $ref: '#/components/parameters/requestId'
    get:
      summary: Get status of async query by requestId
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          $ref: '#/components/responses/async-query-status'
        '404':
          $ref: '#/components/responses/async-query-status-404'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-async-datamart-query-status
      description: Get status of async query by requestId. Status 0 - running; status 2 - error.
    post:
      summary: Delete async query by requestId
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      operationId: delete-async-datamart-query-status
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Clear async query information by requestId (any status).
  /api/v1/datamarts/queries:
    parameters: []
    get:
      summary: Get list of async queries
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          $ref: '#/components/responses/async-queries-list'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-async-queries
      description: Get list of async queries. Status 0 - running; status 2 - error.
    post:
      summary: Delete async queries for all of datamarts
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      operationId: delete-async-queries
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Clear all async queries information.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/delete-async-queries-request'
            examples:
              delete errors only:
                value: {}
        description: |-
          Clears errors of async queries by default. 
          If running is set true, then running and erros will be cleared
  '/api/v1/datamarts/{datamart}/queries':
    parameters:
      - $ref: '#/components/parameters/datamart'
    get:
      summary: Get list of async queries
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          $ref: '#/components/responses/async-queries-list'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-async-datamart-queries
      description: Get list of async queries. Status 0 - running; status 2 - error.
    post:
      summary: Deletes async queries for the datamart specified
      tags:
        - SQL+ Query
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      operationId: delete-async-datamart-queries
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: 'Clears errors of async queries by default. If running is set true, then running and erros will be cleared'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/delete-async-queries-request'
            examples:
              clear_all:
                value:
                  running: true
        description: |-
          Clears errors of async queries by default. 
          If running is set true, then running and erros will be cleared
  '/api/v1/datamarts/{datamart}/deltas/{deltaNum}':
    get:
      summary: Get Delta by Num
      tags:
        - Deltas
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: Information about delta.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delta'
              examples:
                delta:
                  value:
                    deltaNum: 0
                    deltaDate: '2022-09-05 11:40:00'
                    deltaServerDate: '2022-09-05 11:39:02'
                    cnFrom: 0
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-deltas-delta-num
      description: 'A query that returns the information about delta specified by number. If the delta does not exist, response of the type "500" will be returned for it.'
    parameters:
      - $ref: '#/components/parameters/datamart'
      - schema:
          type: integer
          example: 0
        name: deltaNum
        in: path
        required: true
        description: The number of delta for which the information should be fetched
  '/api/v1/datamarts/{datamart}/deltas/current':
    get:
      summary: Get Delta-now
      tags:
        - Deltas
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: Information about delta-now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delta'
              examples:
                delta:
                  value:
                    deltaNum: 1
                    deltaDate: '2022-09-05 11:50:00'
                    deltaServerDate: '2022-09-05 11:49:20'
                    cnFrom: 4
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-deltas-current
      description: 'A query that returns a delta-now information. If the delta does not exist, response of the type "500" will be returned for it.'
    parameters:
      - $ref: '#/components/parameters/datamart'
  '/api/v1/datamarts/{datamart}/deltas/latest':
    get:
      summary: 'Get Delta-hot, Delta-ok'
      tags:
        - Deltas
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: Information about delta-ok and delta-hot.
          content:
            application/json:
              schema:
                type: object
                properties:
                  hot:
                    anyOf:
                      - $ref: '#/components/schemas/null'
                      - $ref: '#/components/schemas/delta-hot'
                  ok:
                    anyOf:
                      - $ref: '#/components/schemas/null'
                      - $ref: '#/components/schemas/delta'
              examples:
                'delta-ok(+), delta-hot(+)':
                  value:
                    hot:
                      deltaNum: 8
                      cnFrom: 9
                      cnMax: 11
                      rollingBack: false
                      writeOperationsFinished:
                        - tableName: transactions
                          cnList:
                            - cn: 10
                              status: 0
                              rowsAffected: 300
                            - cn: 11
                              status: 2
                              rowsAffected: null
                    ok:
                      deltaNum: 7
                      deltaDate: '2022-08-09 11:38:04'
                      deltaServerDate: '2022-08-09 11:38:04'
                      cnFrom: 7
                'delta-ok(+), delta-hot(-)':
                  value:
                    hot: null
                    ok:
                      deltaNum: 7
                      deltaDate: '2022-08-09 11:38:04'
                      deltaServerDate: '2022-08-09 11:38:04'
                      cnFrom: 7
                'delta-ok(-), delta-hot(-)':
                  value:
                    hot: null
                    ok: null
                'delta-ok(-), delta-hot(+)':
                  value:
                    hot:
                      deltaNum: 0
                      cnFrom: 0
                      cnMax: 0
                      rollingBack: false
                      writeOperationsFinished: null
                    ok: null
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-deltas-latest
      description: 'A query that returns a delta-ok and delta-hot information. If any of the deltas does not exist, null will be returned for it.'
    parameters:
      - $ref: '#/components/parameters/datamart'
  '/api/v1/datamarts/{datamart}/deltas/latest/hot':
    get:
      summary: Get Delta-hot
      tags:
        - Deltas
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: Information about delta-hot.
          content:
            application/json:
              schema:
                type: object
                properties:
                  hot:
                    anyOf:
                      - $ref: '#/components/schemas/null'
                      - $ref: '#/components/schemas/delta-hot'
              examples:
                delta-hot:
                  value:
                    hot:
                      deltaNum: 8
                      cnFrom: 9
                      cnMax: 10
                      rollingBack: false
                      writeOperationsFinished:
                        - tableName: transactions
                          cnList:
                            - cn: 10
                              status: 0
                              rowsAffected: 300
                delta-hot empty:
                  value:
                    hot: null
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-deltas-latest-hot
      description: 'A query that returns a delta-hot information. If the delta does not exist, null will be returned for it.'
    parameters:
      - $ref: '#/components/parameters/datamart'
  '/api/v1/datamarts/{datamart}/deltas/latest/ok':
    get:
      summary: Get Delta-ok
      tags:
        - Deltas
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: Information about delta-ok.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    anyOf:
                      - $ref: '#/components/schemas/null'
                      - $ref: '#/components/schemas/delta'
              examples:
                delta-ok:
                  value:
                    ok:
                      deltaNum: 7
                      deltaDate: '2022-08-09 11:38:04'
                      deltaServerDate: '2022-08-09 11:38:04'
                      cnFrom: 7
                delta-ok empty:
                  value:
                    ok: null
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-deltas-latest-ok
      description: 'A query that returns a delta-ok information. If the delta does not exist, null will be returned for it.'
    parameters:
      - $ref: '#/components/parameters/datamart'
  /api/v1/datamarts:
    get:
      summary: List of Datamarts
      tags:
        - Schema
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  datamarts:
                    type: array
                    items:
                      type: string
                required:
                  - datamarts
              examples:
                ResultSet:
                  value:
                    datamarts:
                      - TESTDB1
                      - TESTDB2
                      - TESTDB3
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-schema-datamarts
      description: Get a list of datamarts based on the information schema.
    parameters: []
  '/api/v1/datamarts/{datamart}/entities':
    parameters:
      - $ref: '#/components/parameters/datamart'
    get:
      summary: Datamart Entities
      tags:
        - Schema
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  entities:
                    type: array
                    items:
                      type: string
                required:
                  - entities
              examples:
                ResultSet:
                  value:
                    entities:
                      - TESTTABLE
                      - TESTTABLE_VIEW
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-schema-datamart
      description: Get a list of entities of the specified datamart based on the information schema.
  '/api/v1/datamarts/{datamart}/entities/{entity}':
    parameters:
      - $ref: '#/components/parameters/datamart'
      - $ref: '#/components/parameters/entity'
    get:
      summary: Entity Attributes
      tags:
        - Schema
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  schema:
                    type: string
                  viewQuery:
                    type: string
                    nullable: true
                  entityType:
                    type: string
                    enum:
                      - TABLE
                      - UPLOAD_EXTERNAL_TABLE
                      - DOWNLOAD_EXTERNAL_TABLE
                      - READABLE_EXTERNAL_TABLE
                      - WRITEABLE_EXTERNAL_TABLE
                      - VIEW
                      - MATERIALIZED_VIEW
                  externalTableFormat:
                    type: string
                    nullable: true
                  externalTableSchema:
                    type: string
                    nullable: true
                  externalTableLocationType:
                    type: string
                    nullable: true
                  externalTableLocationPath:
                    type: string
                    nullable: true
                  externalTableOptions:
                    type: object
                    nullable: true
                  externalTableDownloadChunkSize:
                    type: integer
                    nullable: true
                  externalTableUploadMessageLimit:
                    type: integer
                    nullable: true
                  destination:
                    type: array
                    nullable: true
                    items:
                      type: string
                  retentions:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        period:
                          type: integer
                        destination:
                          type: string
                          nullable: true
                        minValidSysTo:
                          type: integer
                          nullable: true
                        minAvailableSysTo:
                          type: integer
                          nullable: true
                      required:
                        - period
                        - destination
                        - minValidSysTo
                        - minAvailableSysTo
                    nullable: true
                  partitionOf:
                    type: object
                    required:
                      - schema
                      - name
                      - ranges
                    nullable: true
                    properties:
                      schema:
                        type: string
                      name:
                        type: string
                      ranges:
                        type: array
                        nullable: true
                        items:
                          type: object
                          description: Model for partition-range
                          properties:
                            leftValues:
                              type: array
                              items:
                                type: string
                                nullable: true
                            rightValues:
                              type: array
                              items:
                                type: string
                                nullable: true
                          required:
                            - leftValues
                            - rightValues
                  partitions:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        schema:
                          type: string
                        name:
                          type: string
                      required:
                        - schema
                        - name
                  materializedDeltaNum:
                    type: integer
                    nullable: true
                  materializedDataSource:
                    type: string
                    nullable: true
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        ordinalPosition:
                          type: integer
                        name:
                          type: string
                        type:
                          $ref: '#/components/schemas/data-type'
                        size:
                          type: integer
                          nullable: true
                        accuracy:
                          type: integer
                          nullable: true
                        nullable:
                          type: boolean
                        primaryOrder:
                          type: integer
                          nullable: true
                        shardingOrder:
                          type: integer
                          nullable: true
                        partitionOrder:
                          type: integer
                          nullable: true
                        defaultValue:
                          anyOf:
                            - type: string
                              nullable: true
                            - type: number
                            - type: integer
                            - type: boolean
                      required:
                        - ordinalPosition
                        - name
                        - type
                        - size
                        - accuracy
                        - nullable
                        - primaryOrder
                        - shardingOrder
                        - partitionOrder
                        - defaultValue
                  materializedDeltaSyncDate:
                    type: string
                    nullable: true
                  lastTs:
                    type: integer
                    nullable: true
                  lastCn:
                    type: integer
                    nullable: true
                  lastTslogPage:
                    type: string
                    nullable: true
                  statisticsRowsCountEnabled:
                    type: boolean
                    nullable: true
                  historyInTslogOnly:
                    type: boolean
                    nullable: true
                  materializedCnList:
                    type: array
                    items:
                      type: object
                      properties:
                        schema:
                          type: string
                        name:
                          type: string
                        cn:
                          type: integer
                      required:
                        - schema
                        - name
                        - cn
                    nullable: true
                  lastDelta:
                    type: integer
                    nullable: true
                required:
                  - id
                  - name
                  - schema
                  - viewQuery
                  - entityType
                  - externalTableFormat
                  - externalTableSchema
                  - externalTableLocationType
                  - externalTableLocationPath
                  - externalTableOptions
                  - externalTableDownloadChunkSize
                  - externalTableUploadMessageLimit
                  - destination
                  - retentions
                  - partitionOf
                  - partitions
                  - materializedDeltaNum
                  - materializedDataSource
                  - fields
                  - materializedDeltaSyncDate
                  - lastTs
                  - lastCn
                  - lastTslogPage
                  - statisticsRowsCountEnabled
                  - historyInTslogOnly
                  - materializedCnList
                  - lastDelta
              examples:
                TABLE:
                  value:
                    id: 40ed9f4f-fda7-4c99-8b5a-d9c8b68c2a0e
                    name: all_types_transactions
                    schema: testdb
                    viewQuery: null
                    entityType: TABLE
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions: null
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADB2
                      - ADP
                      - ADB
                      - ADP2
                    retentions:
                      ADB:
                        period: 3600
                        destination: ADB2
                        minValidSysTo: null
                        minAvailableSysTo: null
                      ADP:
                        period: 0
                        destination: ADP2
                        minValidSysTo: 30
                        minAvailableSysTo: 25
                      ADB2:
                        period: 3600
                        destination: null
                        minValidSysTo: null
                        minAvailableSysTo: null
                      ADP2:
                        period: 0
                        destination: null
                        minValidSysTo: 30
                        minAvailableSysTo: 30
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: transaction_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: account_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 2
                        shardingOrder: 1
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 2
                        name: double_col
                        type: DOUBLE
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 3
                        name: float_col
                        type: FLOAT
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 4
                        name: varchar_col
                        type: VARCHAR
                        size: 36
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 5
                        name: boolean_col
                        type: BOOLEAN
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 6
                        name: int_col
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 7
                        name: bigint_col
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 8
                        name: date_col
                        type: DATE
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 9
                        name: timestamp_col
                        type: TIMESTAMP
                        size: null
                        accuracy: 6
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 10
                        name: time_col
                        type: TIME
                        size: null
                        accuracy: 5
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 11
                        name: uuid_col
                        type: UUID
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 12
                        name: char_col
                        type: CHAR
                        size: 10
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 13
                        name: int32_col
                        type: INT32
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 14
                        name: link_col
                        type: LINK
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: 1693892993123456
                    lastCn: 10
                    lastTslogPage: 10/10
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: 2
                UPLOAD_EXTERNAL_TABLE:
                  value:
                    id: fb207606-cb27-4422-816b-ae011604e3be
                    name: table_ext_upload
                    schema: testdb
                    viewQuery: null
                    entityType: UPLOAD_EXTERNAL_TABLE
                    externalTableFormat: AVRO
                    externalTableSchema: '{"type":"record","name":"table_ext_upload","namespace":"testdb","fields":[{"name":"id","type":["null","long"],"default":null},{"name":"data","type":["null",{"type":"string","avro.java.string":"String"}],"default":null},{"name":"sys_op","type":"int","default":0}]}'
                    externalTableLocationType: KAFKA
                    externalTableLocationPath: 'kafka://server/testdb_upload'
                    externalTableOptions: {}
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: 1000
                    destination: null
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                DOWNLOAD_EXTERNAL_TABLE:
                  value:
                    id: 5ecf27b4-b3a0-46e7-a404-154f3e3af472
                    name: table_ext_download
                    schema: testdb
                    viewQuery: null
                    entityType: DOWNLOAD_EXTERNAL_TABLE
                    externalTableFormat: AVRO
                    externalTableSchema: '{"type":"record","name":"table_ext_download","namespace":"testdb","fields":[{"name":"id","type":["null","long"],"default":null},{"name":"data","type":["null",{"type":"string","avro.java.string":"String"}],"default":null}]}'
                    externalTableLocationType: KAFKA
                    externalTableLocationPath: 'kafka://server/testdb_download'
                    externalTableOptions: null
                    externalTableDownloadChunkSize: 1000
                    externalTableUploadMessageLimit: null
                    destination: null
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                WRITEABLE_EXTERNAL_TABLE:
                  value:
                    id: f5b5c0b4-acd2-4763-aec5-97fd9b775835
                    name: table_ext_write
                    schema: testdb
                    viewQuery: null
                    entityType: WRITEABLE_EXTERNAL_TABLE
                    externalTableFormat: null
                    externalTableSchema: '{"type":"record","name":"table_ext_write_adb","namespace":"testdb","fields":[{"name":"id","type":"long"},{"name":"data","type":["null",{"type":"string","avro.java.string":"String"}],"default":null},{"name":"sys_op","type":["null","int"],"default":null}]}'
                    externalTableLocationType: CORE_ADB
                    externalTableLocationPath: testdb.table_standalone
                    externalTableOptions: {}
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADB
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: 1
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 2
                        name: sys_op
                        type: INT32
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                READABLE_EXTERNAL_TABLE (core):
                  value:
                    id: 35c2a90f-6b1a-4ed2-bdd5-914a53cd61d5
                    name: table_ext_read
                    schema: testdb
                    viewQuery: null
                    entityType: READABLE_EXTERNAL_TABLE
                    externalTableFormat: null
                    externalTableSchema: '{"type":"record","name":"table_ext_read","namespace":"testdb","fields":[{"name":"id","type":"long"},{"name":"data","type":["null",{"type":"string","avro.java.string":"String"}],"default":null},{"name":"sys_op","type":["null","int"],"default":null}]}'
                    externalTableLocationType: CORE_ADB
                    externalTableLocationPath: testdb.table_standalone
                    externalTableOptions:
                      auto.create.table.enable: 'false'
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADB
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: 1
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 2
                        name: sys_op
                        type: INT32
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                READABLE_EXTERNAL_TABLE (kafka):
                  value:
                    id: 93035209-02f2-403c-9231-dc7353d432a3
                    name: table_ext_ret_jet
                    schema: testdb
                    viewQuery: null
                    entityType: READABLE_EXTERNAL_TABLE
                    externalTableFormat: null
                    externalTableSchema: '{"type":"record","name":"table_ext_ret_jet","namespace":"testdb","fields":[{"name":"id","type":"long"},{"name":"data","type":["null",{"type":"string","avro.java.string":"String"}],"default":null},{"name":"sys_op","type":["null","int"],"default":null}]}'
                    externalTableLocationType: KAFKA
                    externalTableLocationPath: 'kafka://server/testdb_ret_jet'
                    externalTableOptions: {}
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination: []
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: 1
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 2
                        name: sys_op
                        type: INT32
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                VIEW:
                  value:
                    id: 6a1e72af-2f7f-4ec8-b78b-eaae18f63fec
                    name: test_view
                    schema: testdb
                    viewQuery: 'SELECT id, data FROM testdb.test_table'
                    entityType: VIEW
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions: null
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination: null
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: false
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
                MATERIALIZED_VIEW:
                  value:
                    id: 09f25da0-0ad1-4d55-a959-7007a2f13b6b
                    name: test_mat_view
                    schema: testdb
                    viewQuery: 'SELECT id AS id, data AS data FROM testdb.test_table'
                    entityType: MATERIALIZED_VIEW
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions: null
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADP
                      - ADG
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: 9
                    materializedDataSource: ADB
                    fields:
                      - ordinalPosition: 0
                        name: id
                        type: INTEGER
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: 1
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: data
                        type: VARCHAR
                        size: 30
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: '2022-11-23 13:33:01.033'
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList:
                      - schema: testdb
                        name: test_table
                        cn: 10
                    lastDelta: null
                PARTITIONED TABLE:
                  value:
                    id: 7899b24e-3094-46db-a473-dd81c40b8402
                    name: partitioned_table
                    schema: testdb
                    viewQuery: null
                    entityType: TABLE
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions: null
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADP
                    retentions: null
                    partitionOf: null
                    partitions:
                      - schema: testdb
                        name: partition_table
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: transaction_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: null
                        partitionOrder: 1
                        defaultValue: null
                      - ordinalPosition: 1
                        name: account_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 2
                        shardingOrder: null
                        partitionOrder: 2
                        defaultValue: null
                      - ordinalPosition: 2
                        name: double_col
                        type: DOUBLE
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: 1693896020546312
                    lastCn: 21
                    lastTslogPage: 21/21
                    statisticsRowsCountEnabled: false
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: 5
                PARTITION TABLE:
                  value:
                    id: ab2c78cd-14b0-4d73-9281-78ec70d44f09
                    name: partition_table
                    schema: testdb
                    viewQuery: null
                    entityType: TABLE
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions: null
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADP
                      - ADP2
                    retentions: null
                    partitionOf:
                      schema: testdb
                      name: partitioned_table
                      ranges:
                        - leftValues:
                            - '1'
                            - '10'
                          rightValues:
                            - '5'
                            - '50'
                        - leftValues:
                            - '8'
                            - '80'
                          rightValues:
                            - null
                            - null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: transaction_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: null
                        partitionOrder: 1
                        defaultValue: null
                      - ordinalPosition: 1
                        name: account_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 2
                        shardingOrder: null
                        partitionOrder: 2
                        defaultValue: null
                      - ordinalPosition: 2
                        name: double_col
                        type: DOUBLE
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: 1693896020546312
                    lastCn: 21
                    lastTslogPage: 19/19
                    statisticsRowsCountEnabled: true
                    historyInTslogOnly: true
                    materializedCnList: null
                    lastDelta: 5
                PROXY TABLE:
                  value:
                    id: 3d5eb5ec-7b6b-46aa-9141-68fc4cd7c66c
                    name: proxy_table
                    schema: testdb
                    viewQuery: null
                    entityType: TABLE
                    externalTableFormat: null
                    externalTableSchema: null
                    externalTableLocationType: null
                    externalTableLocationPath: null
                    externalTableOptions:
                      auto.version.records.enable: 'false'
                    externalTableDownloadChunkSize: null
                    externalTableUploadMessageLimit: null
                    destination:
                      - ADP
                    retentions: null
                    partitionOf: null
                    partitions: null
                    materializedDeltaNum: null
                    materializedDataSource: null
                    fields:
                      - ordinalPosition: 0
                        name: transaction_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 1
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 1
                        name: account_id
                        type: BIGINT
                        size: null
                        accuracy: null
                        nullable: false
                        primaryOrder: 2
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                      - ordinalPosition: 2
                        name: double_col
                        type: DOUBLE
                        size: null
                        accuracy: null
                        nullable: true
                        primaryOrder: null
                        shardingOrder: null
                        partitionOrder: null
                        defaultValue: null
                    materializedDeltaSyncDate: null
                    lastTs: null
                    lastCn: null
                    lastTslogPage: null
                    statisticsRowsCountEnabled: null
                    historyInTslogOnly: null
                    materializedCnList: null
                    lastDelta: null
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-schema-entity
      description: Get a list of attributes of the specified entity based on the information schema.
  '/api/v1/datamarts/{datamart}/entities/{entity}/ddl':
    get:
      summary: Get Entity DDL script
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  ddlScript:
                    type: string
                required:
                  - ddlScript
              examples:
                ResultSet:
                  value:
                    ddlScript: 'CREATE TABLE TESTDB.ALL_TYPES_TRANSACTIONS (TRANSACTION_ID BIGINT NOT NULL, ACCOUNT_ID BIGINT NOT NULL, DOUBLE_COL DOUBLE NULL, FLOAT_COL FLOAT NULL, VARCHAR_COL VARCHAR(36) NULL, BOOLEAN_COL BOOLEAN NULL, INT_COL INT NULL, BIGINT_COL BIGINT NULL, DATE_COL DATE NULL, TIMESTAMP_COL TIMESTAMP(6) NULL, TIME_COL TIME(5) NULL, UUID_COL UUID NULL, CHAR_COL CHAR(10) NULL, INT32_COL INT32 NULL, LINK_COL LINK NULL, PRIMARY KEY (TRANSACTION_ID, ACCOUNT_ID)) DISTRIBUTED BY (ACCOUNT_ID) DATASOURCE_TYPE (ADB, ADG, ADP, ADQM)'
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-schema-entity-ddl
      description: |-
        Returns current create entity SQL script:
        - SQL+ DDL CREATE TABLE;
        - SQL+ DDL CREATE VIEW;
        - SQL+ DDL CREATE MATERIALIZED VIEW.
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      tags:
        - Schema
    parameters:
      - $ref: '#/components/parameters/datamart'
      - $ref: '#/components/parameters/entity'
  '/api/v1/datamarts/{datamart}/sync':
    parameters:
      - $ref: '#/components/parameters/datamart'
    post:
      summary: Sync ServiceDB
      operationId: delete-sync-datamart
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Force sync ServiceDB servers.
      tags:
        - Schema
      parameters:
        - $ref: '#/components/parameters/x-request-id'
  /api/v1/versions:
    get:
      summary: Check Versions
      tags:
        - Check
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  versions:
                    type: array
                    items:
                      type: object
                      properties:
                        componentName:
                          type: string
                        version:
                          type: string
                      required:
                        - componentName
                        - version
                required:
                  - versions
              examples:
                ResultSet:
                  value:
                    versions:
                      - componentName: query-execution-core
                        version: 5.8.0-SNAPSHOT
                      - componentName: tarantool
                        version: 2.10.0-31-g2d20ef4
                      - componentName: tarantool-cartridge
                        version: 2.7.5
                      - componentName: kafka-tarantool connector
                        version: 1.5.8-1
                      - componentName: adb cluster
                        version: 'PostgreSQL 9.4.24 (Greenplum Database 6.17.5 build 6.17.5_arenadata26-714.git18d86c5.el7) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit compiled on Sep 27 2021 11:01:47'
                      - componentName: kafka-greenplum connector writer (fdw)
                        version: 0.10.2
                      - componentName: kafka-greenplum connector reader (pxf)
                        version: '1.0'
                      - componentName: adp instance
                        version: 'PostgreSQL 13.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit'
                      - componentName: kafka-postgres connector reader
                        version: 0.4.0-SNAPSHOT
                      - componentName: kafka-postgres connector writer
                        version: 0.4.0-SNAPSHOT
                      - componentName: adqm cluster
                        version: 21.8.13.6
                      - componentName: kafka-clickhouse connector reader
                        version: 3.9.0-SNAPSHOT
                      - componentName: kafka-clickhouse connector writer
                        version: 3.9.0-SNAPSHOT
                      - componentName: status-monitor
                        version: 5.8.0-SNAPSHOT
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-check-versions
      description: Get actual versions of components used.
    parameters: []
  /api/v1/datamarts/all/statistics:
    parameters: []
    get:
      summary: Get Statistics for All Datamarts
      operationId: get-statistics
      responses:
        '200':
          $ref: '#/components/responses/statistics'
        '500':
          $ref: '#/components/responses/500'
      description: Get statistics information of all datamart's about query performance.
      tags:
        - Statistics
      parameters:
        - $ref: '#/components/parameters/x-request-id'
    post:
      summary: Reset Statistics for All Datamarts
      operationId: delete-statistics
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Reset statistics information of all datamart's about query performance.
      tags:
        - Statistics
      parameters:
        - $ref: '#/components/parameters/x-request-id'
  '/api/v1/datamarts/{datamart}/statistics':
    get:
      summary: Get Datamart statistics
      responses:
        '200':
          $ref: '#/components/responses/statistics'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-datamart-statistics
      description: Returns statistics information of all entities of a datamart specified about query performance.
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      tags:
        - Statistics
    parameters:
      - $ref: '#/components/parameters/datamart'
    post:
      summary: Reset Datamart statistics
      operationId: delete-datamart-statistics
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Reset statistics information of all entities of a datamart specified about query performance.
      tags:
        - Statistics
      parameters:
        - $ref: '#/components/parameters/x-request-id'
  '/api/v1/datamarts/{datamart}/entities/{entity}/statistics':
    get:
      summary: Get Entity statistics
      responses:
        '200':
          description: ResultSet
          content:
            application/json:
              schema:
                type: object
                properties:
                  statistics:
                    anyOf:
                      - $ref: '#/components/schemas/null'
                      - $ref: '#/components/schemas/statistics'
                required:
                  - statistics
              examples:
                ResultSet:
                  value:
                    statistics:
                      entityCatalog: null
                      entitySchema: testdb
                      entityName: test_table
                      readCount: 1
                      readDuration: 29
                      readErrorCount: 0
                      firstRead: '2022-08-18T06:52:59.643Z'
                      lastRead: '2022-08-18T06:52:59.643Z'
                      downloadCount: 1
                      downloadDuration: 1229
                      downloadErrorCount: 0
                      firstDownload: '2022-08-18T06:54:27.358Z'
                      lastDownload: '2022-08-18T06:54:27.358Z'
                      writeCount: 1
                      writeDuration: 624
                      writeErrorCount: 0
                      firstWrite: '2022-08-18T06:54:15.697Z'
                      lastWrite: '2022-08-18T06:54:15.697Z'
                      uploadCount: 1
                      uploadDuration: 6270
                      uploadErrorCount: 0
                      firstUpload: '2022-08-18T06:52:47.157Z'
                      lastUpload: '2022-08-18T06:52:47.157Z'
                      rowsCount: 16
                      rowsCountDelta: 9
                ResultSet (empty):
                  value:
                    statistics: null
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      operationId: get-entity-statistics
      description: Returns statistics information of specified entity about query performance.
      parameters:
        - $ref: '#/components/parameters/x-request-id'
      tags:
        - Statistics
    parameters:
      - $ref: '#/components/parameters/datamart'
      - $ref: '#/components/parameters/entity'
    post:
      summary: Reset Entity statistics
      operationId: delete-entity-statistics
      responses:
        '200':
          description: OK
          headers:
            x-request-id:
              $ref: '#/components/headers/x-request-id-required'
        '500':
          $ref: '#/components/responses/500'
      description: Reset statistics information of specified entity about query performance.
      tags:
        - Statistics
      parameters:
        - $ref: '#/components/parameters/x-request-id'
security:
  - {}
  - bearerAuth: []
components:
  headers:
    x-request-id-required:
      required: true
      schema:
        type: string
      description: An identifier of the response (required)
      example: ee7c7570-1eec-11ed-861d-0242ac120002
  schemas:
    'null':
      title: OpenAPI 3.0 null-type ref
      description: for adding nullability to a ref
      enum:
        - null
    statistics:
      title: statistics
      description: Model for statistics
      type: object
      properties:
        entityCatalog:
          type: string
          description: always NULL
          nullable: true
        entitySchema:
          type: string
        entityName:
          type: string
        readCount:
          type: integer
        readDuration:
          type: integer
        readErrorCount:
          type: integer
        firstRead:
          type: string
          nullable: true
        lastRead:
          type: string
          nullable: true
        downloadCount:
          type: integer
        downloadDuration:
          type: integer
        downloadErrorCount:
          type: integer
        firstDownload:
          type: string
          nullable: true
        lastDownload:
          type: string
          nullable: true
        writeCount:
          type: integer
        writeDuration:
          type: integer
        writeErrorCount:
          type: integer
        firstWrite:
          type: string
          nullable: true
        lastWrite:
          type: string
          nullable: true
        uploadCount:
          type: integer
        uploadDuration:
          type: integer
        uploadErrorCount:
          type: integer
        firstUpload:
          type: string
          nullable: true
        lastUpload:
          type: string
          nullable: true
        rowsCount:
          type: integer
          description: 'always NULL for WET, RET'
          nullable: true
        rowsCountDelta:
          type: integer
          description: 'always NULL for WET, RET'
          nullable: true
      required:
        - entityCatalog
        - entitySchema
        - entityName
        - readCount
        - readDuration
        - readErrorCount
        - firstRead
        - lastRead
        - downloadCount
        - downloadDuration
        - downloadErrorCount
        - firstDownload
        - lastDownload
        - writeCount
        - writeDuration
        - writeErrorCount
        - firstWrite
        - lastWrite
        - uploadCount
        - uploadDuration
        - uploadErrorCount
        - firstUpload
        - lastUpload
        - rowsCount
        - rowsCountDelta
    query-request:
      title: query-request
      type: object
      description: Model for query-request
      properties:
        query:
          type: string
          description: The text of the query
        queryId:
          type: string
          nullable: true
        maxRowsToRead:
          type: integer
          nullable: true
        fetchSize:
          type: integer
          nullable: true
        fetchTimeoutMs:
          type: integer
          nullable: true
        async:
          type: boolean
        params:
          type: array
          description: An optional array of parameter values that is used when executing the query in prepared mode
          items:
            type: object
            properties:
              name:
                type: string
              value:
                nullable: true
              type:
                $ref: '#/components/schemas/data-type'
            required:
              - value
              - type
      required:
        - query
    delta:
      type: object
      properties:
        deltaNum:
          type: integer
        deltaDate:
          type: string
        deltaServerDate:
          type: string
        cnFrom:
          type: integer
      required:
        - deltaNum
        - deltaDate
        - deltaServerDate
        - cnFrom
      title: delta
      description: Model for delta
    delta-hot:
      title: delta-hot
      type: object
      description: Model for delta-hot
      properties:
        deltaNum:
          type: integer
        cnFrom:
          type: integer
        cnMax:
          type: integer
        rollingBack:
          type: boolean
        writeOperationsFinished:
          type: array
          nullable: true
          items:
            type: object
            properties:
              tableName:
                type: string
              cnList:
                type: array
                items:
                  type: object
                  properties:
                    cn:
                      type: integer
                    status:
                      type: integer
                    rowsAffected:
                      type: integer
                      nullable: true
                  required:
                    - cn
                    - status
                    - rowsAffected
            required:
              - tableName
              - cnList
      required:
        - deltaNum
        - cnFrom
        - cnMax
        - rollingBack
        - writeOperationsFinished
    data-type:
      title: data-type
      type: string
      description: Model for data-type
    query-response:
      title: query-response
      type: object
      description: Model for query-response
      properties:
        result:
          type: array
          items:
            type: object
            additionalProperties:
              anyOf:
                - type: string
                  nullable: true
                - type: number
                - type: integer
                - type: boolean
            description: 'The row as an object with dictionary of key/value pairs according to meta information, where key is a field name and value has any of string/number/integer/boolean type'
        metadata:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                $ref: '#/components/schemas/data-type'
              size:
                type: integer
                nullable: true
              nullable:
                type: boolean
            required:
              - name
              - type
              - size
              - nullable
        rows:
          type: integer
        queryId:
          type: string
          nullable: true
        statistics:
          type: object
          required:
            - elapsedTotalMs
            - elapsedDbMs
          properties:
            elapsedTotalMs:
              type: integer
            elapsedDbMs:
              type: integer
      required:
        - result
        - metadata
        - rows
        - queryId
        - statistics
    async-query-response:
      title: async-query-response
      type: object
      description: Model for async-query-response
      properties:
        requestId:
          type: string
        message:
          type: string
      required:
        - requestId
        - message
    delete-async-queries-request:
      title: delete-async-queries-request
      type: object
      properties:
        running:
          type: boolean
      description: Model for delete-async-queries-request
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
  examples: {}
  parameters:
    datamart:
      name: datamart
      in: path
      schema:
        type: string
        example: test_db
      required: true
      description: The logical database on which the request is executed
    requestId:
      name: requestId
      in: path
      schema:
        type: string
        example: f77f4e22-7850-42ec-9aaa-982c5ac1bf29
      required: true
      description: Unique http request identifier
    entity:
      name: entity
      in: path
      required: true
      schema:
        type: string
        example: test_table
      description: The entity of datamart on which the request is executed
    query-format:
      name: format
      in: query
      required: false
      schema:
        type: string
        enum:
          - json
          - plain
          - avro
          - avro-deflate
          - avro-snappy
          - avro-bzip2
          - avro-xz
          - avro-zstandard
        default: json
      description: Defines the format of query result
    query-compression-level:
      name: compressionLevel
      in: query
      required: false
      schema:
        type: integer
      description: Defines the compression level in the avro format
    x-request-id:
      name: x-request-id
      in: header
      required: false
      schema:
        type: string
        example: ee7c7570-1eec-11ed-861d-0242ac120002
      description: Parameter providing unique http request identifier (optional)
  requestBodies: {}
  responses:
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              exceptionMessage:
                type: string
            required:
              - exceptionMessage
          examples:
            ExceptionMessage:
              value:
                exceptionMessage: error
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
    query:
      description: ResultSet
      content:
        text/plain:
          schema:
            type: string
            description: The result of a request as a plain text
          examples:
            ResultSet:
              value: "id\tname\n0\ttest\n1\ttest1"
            ResultSet (empty):
              value: "id\tname"
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/query-response'
              - $ref: '#/components/schemas/async-query-response'
          examples:
            ResultSet:
              value:
                result:
                  - name: test
                    id: 0
                  - name: test1
                    id: 1
                metadata:
                  - name: id
                    type: BIGINT
                    size: null
                    nullable: false
                  - name: name
                    type: VARCHAR
                    size: -1
                    nullable: true
                rows: 2
                queryId: '12345'
                statistics:
                  elapsedTotalMs: 34
                  elapsedDbMs: 20
            ResultSet (empty):
              value:
                result: []
                metadata:
                  - name: id
                    type: BIGINT
                    size: null
                    nullable: false
                  - name: name
                    type: VARCHAR
                    size: -1
                    nullable: true
                rows: 0
                queryId: null
                statistics:
                  elapsedTotalMs: 34
                  elapsedDbMs: 20
            async:
              value:
                requestId: 2f8b7a67-a17e-4f71-a0f0-22249c005d5c
                message: Async operation started
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
    statistics:
      description: ResultSet
      content:
        application/json:
          schema:
            type: object
            properties:
              statistics:
                type: array
                items:
                  $ref: '#/components/schemas/statistics'
            required:
              - statistics
          examples:
            ResultSet:
              value:
                statistics:
                  - entityCatalog: null
                    entitySchema: testdb
                    entityName: test_table
                    readCount: 1
                    readDuration: 29
                    readErrorCount: 0
                    firstRead: '2022-08-18T06:52:59.643Z'
                    lastRead: '2022-08-18T06:52:59.643Z'
                    downloadCount: 1
                    downloadDuration: 1229
                    downloadErrorCount: 0
                    firstDownload: '2022-08-18T06:54:27.358Z'
                    lastDownload: '2022-08-18T06:54:27.358Z'
                    writeCount: 1
                    writeDuration: 624
                    writeErrorCount: 0
                    firstWrite: '2022-08-18T06:54:15.697Z'
                    lastWrite: '2022-08-18T06:54:15.697Z'
                    uploadCount: 1
                    uploadDuration: 6270
                    uploadErrorCount: 0
                    firstUpload: '2022-08-18T06:52:47.157Z'
                    lastUpload: '2022-08-18T06:52:47.157Z'
                    rowsCount: 16
                    rowsCountDelta: 9
            ResultSet (empty):
              value:
                statistics: []
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
    async-query-status:
      description: ResultSet
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
              statusCode:
                type: integer
              datamart:
                type: string
              table:
                type: string
              topic:
                type: string
                nullable: true
              query:
                type: string
              startTime:
                type: string
              errorTime:
                type: string
                nullable: true
              errorCause:
                type: string
                nullable: true
            required:
              - status
              - statusCode
              - datamart
              - table
              - topic
              - query
              - startTime
              - errorTime
              - errorCause
          examples:
            query-status-run:
              value:
                status: running
                statusCode: 0
                datamart: testdb
                table: tbl
                topic: testdb_topic
                query: INSERT INTO testdb.tbl SELECT * FROM testdb.upload_tbl
                startTime: '2023-09-04 16:06:28'
                errorTime: null
                errorCause: null
            query-status-error:
              value:
                status: error
                statusCode: 2
                datamart: testdb
                table: tbl
                topic: null
                query: INSERT INTO testdb.tbl SELECT * FROM testdb.tbl2
                startTime: '2023-09-04 16:13:45'
                errorTime: '2023-09-04 16:13:46'
                errorCause: 'Table[all_types] blocked: KeeperErrorCode = NodeExists'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
    async-query-status-404:
      description: Request Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              exceptionMessage:
                type: string
            required:
              - exceptionMessage
          examples:
            ExceptionMessage:
              value:
                exceptionMessage: 'Request [f77f4e22-7850-42ec-9aaa-982c5ac1bf29] not found'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
    async-queries-list:
      description: ResultSet
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
              properties:
                id:
                  type: string
                datamart:
                  type: string
                table:
                  type: string
                status:
                  type: string
                statusCode:
                  type: integer
                startTime:
                  type: string
              required:
                - id
                - datamart
                - table
                - status
                - statusCode
                - startTime
          examples:
            queries-list:
              value:
                - id: 2f8b7a67-a17e-4f71-a0f0-22249c005d5c
                  datamart: testdb
                  table: tbl
                  status: running
                  statusCode: 0
                  startTime: '2023-09-04 16:06:28'
                - id: c0a8b9e8-34d0-4e2b-b35c-c7e6c812de45
                  datamart: testdb
                  table: tbl
                  status: error
                  statusCode: 2
                  startTime: '2023-09-04 16:13:45'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id-required'
tags:
  - name: SQL+ Query
    description: defines endpoints based on queries in SQL+ format
  - name: Deltas
    description: defines endpoints based on operations with delta
  - name: Schema
    description: defines endpoints based on operations with information schema
  - name: Check
    description: defines endpoints based on check operations
  - name: Statistics
    description: defines endpoints based on statistics operations

Спецификация методов по мониторингу состояния нод

openapi: 3.0.0
info:
  title: ProstoreSpringAPI
  version: 1.0.1
  description: Prostore Spring Rest API
  contact:
    name: Alexander Senko
servers:
  - url: 'http://{host}:{port}'
    variables:
      host:
        default: localhost
      port:
        default: '8080'
paths:
  /actuator/health:
    get:
      summary: Health state
      tags:
        - Health
      responses:
        '200':
          description: UP if all components are UP.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - UP
                  components:
                    type: object
                    required:
                      - diskSpace
                      - livenessState
                      - ping
                      - dtmState
                      - readinessState
                    properties:
                      diskSpace:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                      livenessState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                      ping:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                      dtmState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                      readinessState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                  groups:
                    type: array
                    items:
                      type: string
                      enum:
                        - liveness
                        - readiness
                        - startup
                required:
                  - status
                  - components
                  - groups
              examples:
                '200':
                  value:
                    status: UP
                    components:
                      diskSpace:
                        status: UP
                      dtmState:
                        status: UP
                      livenessState:
                        status: UP
                      ping:
                        status: UP
                      readinessState:
                        status: UP
                    groups:
                      - liveness
                      - readiness
                      - startup
          headers: {}
        '503':
          description: |-
            - OUT_OF_SERVICE if any of the components is OUT_OF_SERVICE, but none of the components are DOWN;
            - DOWN if any of the components is DOWN.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - OUT_OF_SERVICE
                      - DOWN
                  components:
                    type: object
                    required:
                      - diskSpace
                      - livenessState
                      - ping
                      - dtmState
                      - readinessState
                    properties:
                      diskSpace:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-down'
                      livenessState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-down'
                      ping:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                      dtmState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-down'
                      readinessState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-out-of-service'
                  groups:
                    type: array
                    items:
                      type: string
                      enum:
                        - liveness
                        - readiness
                        - startup
                required:
                  - status
                  - components
                  - groups
              examples:
                '503':
                  value:
                    status: DOWN
                    components:
                      diskSpace:
                        status: UP
                      dtmState:
                        status: DOWN
                        details:
                          exception: Query processing verticle is not running
                      livenessState:
                        status: UP
                      ping:
                        status: UP
                      readinessState:
                        status: UP
                    groups:
                      - liveness
                      - readiness
                      - startup
      operationId: get-api-v1-health
      description: Return current health state.
      parameters: []
    parameters: []
  /actuator/health/startup:
    get:
      summary: Startup prob state
      tags:
        - Health
      responses:
        '200':
          description: UP if all components are UP.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - UP
                  components:
                    type: object
                    required:
                      - dtmState
                    properties:
                      dtmState:
                        $ref: '#/components/schemas/probe-status-up'
                required:
                  - status
                  - components
              examples:
                '200':
                  value:
                    status: UP
                    components:
                      dtmState:
                        status: UP
        '503':
          description: DOWN if any of the components is DOWN.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - DOWN
                  components:
                    type: object
                    required:
                      - dtmState
                    properties:
                      dtmState:
                        $ref: '#/components/schemas/probe-status-down'
                required:
                  - status
                  - components
              examples:
                '503':
                  value:
                    status: DOWN
                    components:
                      dtmState:
                        status: DOWN
                        details:
                          exception: Query processing verticle is not running
      operationId: get-api-v1-health-startup
      description: Return current startup prob state.
      parameters: []
    parameters: []
  /actuator/health/liveness:
    get:
      summary: Liveness prob state
      tags:
        - Health
      responses:
        '200':
          description: UP if all components are UP.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/probe-status-up'
              examples:
                '200':
                  value:
                    status: UP
        '503':
          description: DOWN if any of the components is DOWN.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/probe-status-down'
              examples:
                '503':
                  value:
                    status: DOWN
      operationId: get-api-v1-health-liveness
      description: Return current liveness prob state.
      parameters: []
  /actuator/health/readiness:
    get:
      summary: Readiness prob state
      tags:
        - Health
      responses:
        '200':
          description: UP if all components are UP
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - UP
                  components:
                    type: object
                    required:
                      - dtmState
                      - readinessState
                    properties:
                      dtmState:
                        $ref: '#/components/schemas/probe-status-up'
                      readinessState:
                        $ref: '#/components/schemas/probe-status-up'
                required:
                  - status
                  - components
              examples:
                '200':
                  value:
                    status: UP
                    components:
                      dtmState:
                        status: UP
                      readinessState:
                        status: UP
        '503':
          description: |-
            - OUT_OF_SERVICE if any of the components is OUT_OF_SERVICE, but none of the components are DOWN;
            - DOWN if any of the components is DOWN.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - OUT_OF_SERVICE
                      - DOWN
                  components:
                    type: object
                    required:
                      - dtmState
                      - readinessState
                    properties:
                      dtmState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-down'
                      readinessState:
                        anyOf:
                          - $ref: '#/components/schemas/probe-status-up'
                          - $ref: '#/components/schemas/probe-status-out-of-service'
                required:
                  - status
                  - components
              examples:
                DOWN:
                  value:
                    status: DOWN
                    components:
                      dtmState:
                        status: DOWN
                        details:
                          exception: Query processing verticle is not running
                      readinessState:
                        status: UP
                OUT_OF_SERVICE:
                  value:
                    status: OUT_OF_SERVICE
                    components:
                      dtmState:
                        status: UP
                      readinessState:
                        status: OUT_OF_SERVICE
      operationId: get-api-v1-health-readiness
      description: Return current readiness prob state.
      parameters: []
    parameters: []
components:
  schemas:
    probe-status-up:
      title: probe-status-up
      type: object
      properties:
        status:
          type: string
          enum:
            - UP
      required:
        - status
      description: Model for UP status of probe
    probe-status-out-of-service:
      title: probe-status-out-of-service
      type: object
      description: Model for OUT_OF_SERVICE status of probe
      properties:
        status:
          type: string
          enum:
            - OUT_OF_SERVICE
      required:
        - status
    probe-status-down:
      title: probe-status-down
      type: object
      properties:
        status:
          type: string
          enum:
            - DOWN
        details:
          type: object
          properties:
            exception:
              type: string
      required:
        - status
      description: Model for DOWN status of probe
  examples: {}
  parameters: {}
  requestBodies: {}
  responses: {}
tags:
  - name: Health
    description: defines endpoints to support liveness and readiness probes