Kafka Connect REST API

Kafka Connect REST API for managing connectors, their configurations, tasks, and offsets for integrating Kafka with external data systems including databases, object stores, and search indexes.

OpenAPI Specification

kafka-connect.yml Raw ↑
openapi: 3.1.0
info:
  title: Kafka Connect REST API
  description: >-
    The Kafka Connect REST API provides endpoints for managing connectors,
    their configurations, tasks, and offsets. Kafka Connect is a framework
    for connecting Kafka with external systems such as databases, key-value
    stores, search indexes, and file systems.
  version: 3.7.0
  contact:
    name: Apache Kafka
    url: https://kafka.apache.org/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:8083
  description: Default Kafka Connect worker
paths:
  /:
    get:
      summary: Apache kafka Get Connect Worker Info
      operationId: getWorkerInfo
      tags:
      - Cluster
      responses:
        '200':
          description: Connect worker information
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                  commit:
                    type: string
                  kafka_cluster_id:
                    type: string
              examples:
                getWorkerInfo200Example:
                  summary: Default getWorkerInfo 200 response
                  x-microcks-default: true
                  value:
                    version: example-value
                    commit: example-value
                    kafka_cluster_id: item-9558
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors:
    get:
      summary: Apache kafka List Connectors
      operationId: listConnectors
      tags:
      - Connectors
      parameters:
      - name: expand
        in: query
        schema:
          type: string
          enum: [status, info]
        example: status
      responses:
        '200':
          description: List of active connectors
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                listConnectors200Example:
                  summary: Default listConnectors 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: Apache kafka Create Connector
      operationId: createConnector
      tags:
      - Connectors
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectorRequest'
            examples:
              createConnectorRequestExample:
                summary: Default createConnector request
                x-microcks-default: true
                value:
                  name: example-name
                  config: {}
      responses:
        '201':
          description: Connector created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorInfo'
              examples:
                createConnector201Example:
                  summary: Default createConnector 201 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    config: {}
                    tasks: []
                    type: source
        '409':
          description: Connector already exists
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}:
    get:
      summary: Apache kafka Get Connector Info
      operationId: getConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Connector information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorInfo'
              examples:
                getConnector200Example:
                  summary: Default getConnector 200 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    config: {}
                    tasks: []
                    type: source
        '404':
          description: Connector not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: Apache kafka Delete Connector
      operationId: deleteConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '204':
          description: Connector deleted
        '404':
          description: Connector not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/config:
    get:
      summary: Apache kafka Get Connector Config
      operationId: getConnectorConfig
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Connector configuration
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
              examples:
                getConnectorConfig200Example:
                  summary: Default getConnectorConfig 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: Apache kafka Create or Update Connector Config
      operationId: putConnectorConfig
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
            examples:
              putConnectorConfigRequestExample:
                summary: Default putConnectorConfig request
                x-microcks-default: true
                value: {}
      responses:
        '200':
          description: Connector config updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorInfo'
              examples:
                putConnectorConfig200Example:
                  summary: Default putConnectorConfig 200 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    config: {}
                    tasks: []
                    type: source
        '201':
          description: Connector created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorInfo'
              examples:
                putConnectorConfig201Example:
                  summary: Default putConnectorConfig 201 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    config: {}
                    tasks: []
                    type: source
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/status:
    get:
      summary: Apache kafka Get Connector Status
      operationId: getConnectorStatus
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Connector status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorStatus'
              examples:
                getConnectorStatus200Example:
                  summary: Default getConnectorStatus 200 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    connector: {}
                    tasks: []
                    type: example-value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/restart:
    post:
      summary: Apache kafka Restart Connector
      operationId: restartConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      - name: includeTasks
        in: query
        schema:
          type: boolean
          default: false
        example: true
      - name: onlyFailed
        in: query
        schema:
          type: boolean
          default: false
        example: true
      responses:
        '200':
          description: Connector restarted
        '204':
          description: Connector restarted (no body)
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/pause:
    put:
      summary: Apache kafka Pause Connector
      operationId: pauseConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '202':
          description: Connector paused
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/resume:
    put:
      summary: Apache kafka Resume Connector
      operationId: resumeConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '202':
          description: Connector resumed
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/stop:
    put:
      summary: Apache kafka Stop Connector
      operationId: stopConnector
      tags:
      - Connectors
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '204':
          description: Connector stopped
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/tasks:
    get:
      summary: Apache kafka List Connector Tasks
      operationId: listConnectorTasks
      tags:
      - Tasks
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: List of tasks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskInfo'
              examples:
                listConnectorTasks200Example:
                  summary: Default listConnectorTasks 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/tasks/{task}/status:
    get:
      summary: Apache kafka Get Task Status
      operationId: getTaskStatus
      tags:
      - Tasks
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      - name: task
        in: path
        required: true
        schema:
          type: integer
        example: 56
      responses:
        '200':
          description: Task status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStatus'
              examples:
                getTaskStatus200Example:
                  summary: Default getTaskStatus 200 response
                  x-microcks-default: true
                  value:
                    id: 69
                    state: UNASSIGNED
                    worker_id: item-6436
                    trace: example-value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/tasks/{task}/restart:
    post:
      summary: Apache kafka Restart Task
      operationId: restartTask
      tags:
      - Tasks
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      - name: task
        in: path
        required: true
        schema:
          type: integer
        example: 18
      responses:
        '204':
          description: Task restarted
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connectors/{connector}/offsets:
    get:
      summary: Apache kafka Get Connector Offsets
      operationId: getConnectorOffsets
      tags:
      - Offsets
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Connector offsets
          content:
            application/json:
              schema:
                type: object
                properties:
                  offsets:
                    type: array
                    items:
                      type: object
              examples:
                getConnectorOffsets200Example:
                  summary: Default getConnectorOffsets 200 response
                  x-microcks-default: true
                  value:
                    offsets: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: Apache kafka Alter Connector Offsets
      operationId: alterConnectorOffsets
      tags:
      - Offsets
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                offsets:
                  type: array
                  items:
                    type: object
            examples:
              alterConnectorOffsetsRequestExample:
                summary: Default alterConnectorOffsets request
                x-microcks-default: true
                value:
                  offsets: []
      responses:
        '200':
          description: Offsets altered
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: Apache kafka Reset Connector Offsets
      operationId: resetConnectorOffsets
      tags:
      - Offsets
      parameters:
      - name: connector
        in: path
        required: true
        schema:
          type: string
        example: example-value
      responses:
        '200':
          description: Offsets reset
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connector-plugins:
    get:
      summary: Apache kafka List Connector Plugins
      operationId: listConnectorPlugins
      tags:
      - Plugins
      parameters:
      - name: connectorsOnly
        in: query
        schema:
          type: boolean
          default: true
        example: true
      responses:
        '200':
          description: List of connector plugins
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorPlugin'
              examples:
                listConnectorPlugins200Example:
                  summary: Default listConnectorPlugins 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /connector-plugins/{plugin}/config/validate:
    put:
      summary: Apache kafka Validate Connector Config
      operationId: validateConnectorConfig
      tags:
      - Plugins
      parameters:
      - name: plugin
        in: path
        required: true
        schema:
          type: string
        example: example-value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
            examples:
              validateConnectorConfigRequestExample:
                summary: Default validateConnectorConfig request
                x-microcks-default: true
                value: {}
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigValidationResult'
              examples:
                validateConnectorConfig200Example:
                  summary: Default validateConnectorConfig 200 response
                  x-microcks-default: true
                  value:
                    name: example-name
                    error_count: 89
                    groups: []
                    configs: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    CreateConnectorRequest:
      type: object
      required:
      - name
      - config
      properties:
        name:
          type: string
        config:
          type: object
          additionalProperties:
            type: string
    ConnectorInfo:
      type: object
      properties:
        name:
          type: string
        config:
          type: object
          additionalProperties:
            type: string
        tasks:
          type: array
          items:
            type: object
            properties:
              connector:
                type: string
              task:
                type: integer
        type:
          type: string
          enum: [source, sink]
    ConnectorStatus:
      type: object
      properties:
        name:
          type: string
        connector:
          type: object
          properties:
            state:
              type: string
              enum: [UNASSIGNED, RUNNING, PAUSED, FAILED, STOPPED]
            worker_id:
              type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/TaskStatus'
        type:
          type: string
    TaskInfo:
      type: object
      properties:
        id:
          type: object
          properties:
            connector:
              type: string
            task:
              type: integer
        config:
          type: object
          additionalProperties:
            type: string
    TaskStatus:
      type: object
      properties:
        id:
          type: integer
        state:
          type: string
          enum: [UNASSIGNED, RUNNING, PAUSED, FAILED]
        worker_id:
          type: string
        trace:
          type: string
    ConnectorPlugin:
      type: object
      properties:
        class:
          type: string
        type:
          type: string
        version:
          type: string
    ConfigValidationResult:
      type: object
      properties:
        name:
          type: string
        error_count:
          type: integer
        groups:
          type: array
          items:
            type: string
        configs:
          type: array
          items:
            type: object