PingCAP Source API

source

GitHub OpenAPI

Operations 14

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /api/v1/sources Create and enable a data source · create and enable a new data source #
Ask an LLM
“How do I add a new data source to my DM cluster?”
“Can I choose which worker a new source runs on?”
Tell an agent
Create data source {source}.
Create source {source} on worker {worker_name}.
GET /api/v1/sources List data sources · get data source list #
Ask an LLM
“Which data sources are configured in my DM cluster?”
“Can I list only the sources that are currently relaying?”
Tell an agent
List all data sources.
List data sources with status {with_status}.
GET /api/v1/sources/{source-name} Get a data source · get source #
Ask an LLM
“What configuration does a specific data source have?”
“Can I fetch one source with its status?”
Tell an agent
Get data source {source-name}.
Show source {source-name} with status {with_status}.
DELETE /api/v1/sources/{source-name} Delete a data source · delete a data source #
Ask an LLM
“How do I remove a data source from my cluster?”
“Can I force-stop a source's tasks when deleting it?”
Tell an agent destructive · confirm first
Delete data source {source-name}.
Delete source {source-name} and force-stop its tasks ({force}).
PUT /api/v1/sources/{source-name} Update a data source · update a data source #
Ask an LLM
“How do I change the configuration of an existing data source?”
“Can I rename a source after it is created?”
Tell an agent
Update data source {source-name} with {source}.
Change the configuration of source {source-name}.
GET /api/v1/sources/{source-name}/status Get a data source's status · get the current status of the data source #
Ask an LLM
“Is my data source currently running?”
“What is the current status of a source?”
Tell an agent
Get the status of data source {source-name}.
Check whether source {source-name} is healthy.
POST /api/v1/sources/{source-name}/enable Enable a data source · enable a data source #
Ask an LLM
“How do I start a data source that is disabled?”
“Can I turn a stopped source back on?”
Tell an agent
Enable data source {source-name}.
Start the disabled source {source-name}.
POST /api/v1/sources/{source-name}/disable Disable a data source · disable a data source #
Ask an LLM
“How do I pause a data source without deleting it?”
“Can I stop a source temporarily?”
Tell an agent
Disable data source {source-name}.
Pause the running source {source-name}.
POST /api/v1/sources/{source-name}/transfer Move a data source to a worker · transfer source to a free worker #
Ask an LLM
“How do I move a source to a different worker?”
“Can I reassign a source to a free worker?”
Tell an agent
Transfer source {source-name} to worker {worker_name}.
Reassign source {source-name} to worker {worker_name}.
POST /api/v1/sources/{source-name}/relay/enable Enable relay logs for a source · enable relay log function for the data source #
Ask an LLM
“How do I turn on relay logs for a data source?”
“Can I start relaying upstream binlogs from a specific filename?”
Tell an agent
Enable relay logs for data source {source-name}.
Enable relay for source {source-name} from binlog {relay_binlog_name}.
POST /api/v1/sources/{source-name}/relay/disable Disable relay logs for a source · disable relay log function for the data source #
Ask an LLM
“How do I stop relaying logs for a data source?”
“Can I disable relay on specific workers?”
Tell an agent
Disable relay logs for data source {source-name}.
Disable relay for source {source-name} on workers {worker_name_list}.
POST /api/v1/sources/{source-name}/relay/purge Purge relay logs for a source · purge relay log #
Ask an LLM
“How do I clear relay logs for a data source?”
“Can I purge relay logs from a specific binlog filename?”
Tell an agent destructive · confirm first
Purge relay logs for data source {source-name} from {relay_binlog_name}.
Clear relay logs of source {source-name} in directory {relay_dir}.
GET /api/v1/sources/{source-name}/schemas List schemas of a data source · get source schema list #
Ask an LLM
“Which schemas does a data source contain?”
“What tables are available in a source's schema?”
Tell an agent
List schemas of data source {source-name}.
Show the tables in each schema of source {source-name}.
GET /api/v1/sources/{source-name}/schemas/{schema-name} List tables in a source schema · get source table list #
Ask an LLM
“What tables are in a particular schema of a data source?”
“Can I list tables for one schema of a source?”
Tell an agent
List tables in schema {schema-name} of data source {source-name}.
Show the tables in source {source-name} schema {schema-name}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pingcap:pingcap-source-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pingcap-source-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DM OpenAPI DOC Source API
  version: 6.0.0
  description: source
servers:
- url: https://you.domain.com/
tags:
- name: Source
  description: source
  externalDocs:
    description: doc
    url: https://docs.pingcap.com/zh/tidb/stable/quick-start-create-source
paths:
  /api/v1/sources:
    post:
      tags:
      - Source
      summary: create and enable a new data source
      operationId: DMAPICreateSource
      requestBody:
        description: request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSourceRequest'
      responses:
        '201':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
    get:
      tags:
      - Source
      summary: get data source list
      operationId: DMAPIGetSourceList
      parameters:
      - name: with_status
        in: query
        required: false
        description: list source with status
        schema:
          type: boolean
          example: true
      - name: enable_relay
        in: query
        required: false
        description: only return the enable-relay source
        schema:
          type: boolean
          example: true
      responses:
        '200':
          description: data source list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSourceListResponse'
  /api/v1/sources/{source-name}:
    get:
      tags:
      - Source
      summary: get source
      operationId: DMAPIGetSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      - name: with_status
        in: query
        required: false
        description: list source with status
        schema:
          type: boolean
          example: true
      responses:
        '200':
          description: source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '404':
          description: source not found
    delete:
      tags:
      - Source
      summary: delete a data source
      operationId: DMAPIDeleteSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      - name: force
        in: query
        required: false
        description: force stop source also stop the related tasks
        schema:
          type: boolean
          example: true
      responses:
        '204':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
    put:
      tags:
      - Source
      summary: update a data source
      operationId: DMAPIUpdateSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSourceRequest'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/status:
    get:
      tags:
      - Source
      summary: get the current status of the data source
      operationId: DMAPIGetSourceStatus
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-replica-01
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSourceStatusResponse'
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/enable:
    post:
      tags:
      - Source
      summary: enable a data source
      operationId: DMAPIEnableSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/disable:
    post:
      tags:
      - Source
      summary: disable a data source
      operationId: DMAPIDisableSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/transfer:
    post:
      tags:
      - Source
      summary: transfer source to a free worker
      operationId: DMAPITransferSource
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkerNameRequest'
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/relay/enable:
    post:
      tags:
      - Source
      summary: enable relay log function for the data source
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      operationId: DMAPIEnableRelay
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnableRelayRequest'
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/relay/disable:
    post:
      tags:
      - Source
      summary: disable relay log function for the data source
      operationId: DMAPIDisableRelay
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DisableRelayRequest'
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/relay/purge:
    post:
      tags:
      - Source
      summary: purge relay log
      operationId: DMAPIPurgeRelay
      parameters:
      - name: source-name
        in: path
        description: globally unique data source name
        required: true
        schema:
          type: string
          example: mysql-01
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurgeRelayRequest'
      responses:
        '200':
          description: success
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/schemas:
    get:
      tags:
      - Source
      summary: get source schema list
      operationId: DMAPIGetSourceSchemaList
      parameters:
      - name: source-name
        in: path
        description: source name
        required: true
        schema:
          type: string
          example: source-1
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaNameList'
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
  /api/v1/sources/{source-name}/schemas/{schema-name}:
    get:
      tags:
      - Source
      summary: get source table list
      operationId: DMAPIGetSourceTableList
      parameters:
      - name: source-name
        in: path
        description: source name
        required: true
        schema:
          type: string
          example: source-1
      - name: schema-name
        in: path
        description: schema name
        required: true
        schema:
          type: string
          example: db1
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TableNameList'
        '400':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorWithMessage'
components:
  schemas:
    PurgeRelayRequest:
      description: action to stop a relay request
      type: object
      properties:
        relay_binlog_name:
          type: string
          example: mysql-bin.000002
          description: starting filename of the upstream binlog
        relay_dir:
          type:
          - string
          - 'null'
          description: 'specify relay sub directory for relay_binlog_name. If not specified, the latest one will be used. Sample format: 2ae76434-f79f-11e8-bde2-0242ac130008.000001'
      required:
      - relay_binlog_name
    SourceStatus:
      description: source status
      type: object
      properties:
        source_name:
          type: string
          example: mysql-replica-01
          description: source name
        worker_name:
          type: string
          example: worker-1
          description: The worker currently bound to the source
        relay_status:
          $ref: '#/components/schemas/RelayStatus'
        error_msg:
          type: string
          description: error message when something wrong
      required:
      - source_name
      - worker_name
    SchemaNameList:
      description: schema name list
      type: array
      items:
        type: string
        example: db1
    CreateSourceRequest:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/Source'
        worker_name:
          type: string
          example: worker-1
      required:
      - source
    DisableRelayRequest:
      description: action to stop a relay request
      type: object
      properties:
        worker_name_list:
          $ref: '#/components/schemas/WorkerNameList'
    RelayConfig:
      description: the config of relay
      type: object
      properties:
        enable_relay:
          type: boolean
        relay_binlog_name:
          type:
          - string
          - 'null'
          example: mysql-bin.000002
          description: starting filename of the upstream binlog
        relay_binlog_gtid:
          type:
          - string
          - 'null'
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          description: starting GTID of the upstream binlog
        relay_dir:
          type:
          - string
          - 'null'
          default: ./relay_log
          description: the directory where the relay log is stored
    GetSourceListResponse:
      type: object
      properties:
        total:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Source'
      required:
      - total
      - data
    ErrorWithMessage:
      description: operation error
      type: object
      properties:
        error_msg:
          type: string
          description: error message
        error_code:
          type: integer
          description: error code
      required:
      - error_msg
      - error_code
    TableNameList:
      description: schema name list
      type: array
      items:
        type: string
        example: table1
    UpdateSourceRequest:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/Source'
      required:
      - source
    Purge:
      description: relay log cleanup policy configuration
      type: object
      properties:
        interval:
          type:
          - integer
          - 'null'
          default: 3600
          description: 'The interval to periodically check if the relay log is expired, default value: 3600, in seconds'
          format: int64
        expires:
          type:
          - integer
          - 'null'
          default: 0
          description: expiration time of relay log
          format: int64
        remain_space:
          type:
          - integer
          - 'null'
          default: 15
          description: Minimum free disk space, in GB
          format: int64
    Source:
      type: object
      description: source
      properties:
        source_name:
          type: string
          example: mysql-01
          description: source name
        host:
          type: string
          example: 127.0.0.1
          description: source address
        port:
          type: integer
          example: 3306
          description: source port
        user:
          type: string
          example: root
          description: source username
        password:
          type:
          - string
          - 'null'
          example: '123456'
          description: source password
        enable_gtid:
          type: boolean
          example: false
          default: false
          description: whether to use GTID to pull binlogs from upstream
        enable:
          type: boolean
          example: false
          default: false
          description: whether this source is enabled
        flavor:
          type: string
          example: mysql
          description: flavor of this source
        task_name_list:
          $ref: '#/components/schemas/TaskNameList'
        security:
          $ref: '#/components/schemas/Security'
        purge:
          $ref: '#/components/schemas/Purge'
        status_list:
          type: array
          items:
            $ref: '#/components/schemas/SourceStatus'
        relay_config:
          $ref: '#/components/schemas/RelayConfig'
      required:
      - source_name
      - host
      - port
      - user
      - enable_gtid
      - enable
    WorkerNameList:
      description: worker name list
      type: array
      items:
        type: string
        example: worker-1
    RelayStatus:
      description: status of relay log
      type: object
      properties:
        master_binlog:
          type: string
          example: (mysql-bin.000001, 1979)
          description: upstream binlog file information
        master_binlog_gtid:
          type: string
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          description: GTID of the upstream
        relay_dir:
          type: string
          description: the directory where the relay log is stored
          example: ./sub_dir
        relay_binlog_gtid:
          type: string
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          description: relay current GTID
        relay_catch_up_master:
          type: boolean
          description: whether to catch up with upstream progress
        stage:
          type: string
          description: current status
          example: Running
      required:
      - master_binlog
      - master_binlog_gtid
      - relay_dir
      - relay_binlog_gtid
      - relay_catch_up_master
      - stage
    EnableRelayRequest:
      description: action to start a relay request
      type: object
      properties:
        worker_name_list:
          $ref: '#/components/schemas/WorkerNameList'
        relay_binlog_name:
          type:
          - string
          - 'null'
          example: mysql-bin.000002
          description: starting filename of the upstream binlog
        relay_binlog_gtid:
          type:
          - string
          - 'null'
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          description: starting GTID of the upstream binlog
        relay_dir:
          type:
          - string
          - 'null'
          default: ./relay_log
          description: the directory where the relay log is stored
    WorkerNameRequest:
      description: requests related to workers
      type: object
      properties:
        worker_name:
          type: string
          example: worker-1
          description: worker name
      required:
      - worker_name
    Security:
      type:
      - object
      - 'null'
      description: data source ssl configuration, the field will be hidden when getting the data source configuration from the interface
      properties:
        ssl_ca_content:
          type: string
          example: ''
          description: certificate file content
        ssl_cert_content:
          type: string
          example: ''
          description: File content of PEM format/X509 format certificates
        ssl_key_content:
          type: string
          example: ''
          description: Content of the private key file in X509 format
        cert_allowed_cn:
          type: array
          description: Common Name of SSL certificates
          items:
            type: string
      required:
      - ssl_ca_content
      - ssl_cert_content
      - ssl_key_content
    GetSourceStatusResponse:
      type: object
      properties:
        total:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/SourceStatus'
      required:
      - total
      - data
    TaskNameList:
      description: task name list
      type: array
      items:
        type: string
        example: task1
externalDocs:
  description: DM OpenAPI DOC
  url: https://docs.pingcap.com/zh/tidb-data-migration/stable