openapi: 3.0.0
info:
  title: DM OpenAPI DOC
  version: 6.0.0
externalDocs:
  description: DM OpenAPI DOC
  url: https://docs.pingcap.com/zh/tidb-data-migration/stable
servers:
- url: https://you.domain.com/
tags:
- description: source
  externalDocs:
    description: doc
    url: https://docs.pingcap.com/zh/tidb/stable/quick-start-create-source
  name: source
- description: task
  externalDocs:
    description: doc
    url: https://docs.pingcap.com/zh/tidb/stable/quick-start-with-dm
  name: task
- description: cluster
  name: cluster
paths:
  /api/v1/cluster/info:
    get:
      operationId: DMAPIGetClusterInfo
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetClusterInfoResponse"
          description: success
      summary: get cluster info such as cluster id
      tags:
      - cluster
    put:
      operationId: DMAPIUpdateClusterInfo
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ClusterTopology"
        description: request body
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetClusterInfoResponse"
          description: success
      summary: update cluster info.
      tags:
      - cluster
  /api/v1/cluster/masters:
    get:
      operationId: DMAPIGetClusterMasterList
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetClusterMasterListResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get cluster master node list
      tags:
      - cluster
  /api/v1/cluster/masters/{master-name}:
    delete:
      operationId: DMAPIOfflineMasterNode
      parameters:
      - description: master node name
        explode: false
        in: path
        name: master-name
        required: true
        schema:
          example: master1
          type: string
        style: simple
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: offline master node
      tags:
      - cluster
  /api/v1/cluster/workers:
    get:
      operationId: DMAPIGetClusterWorkerList
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetClusterWorkerListResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get cluster worker node list
      tags:
      - cluster
  /api/v1/cluster/workers/{worker-name}:
    delete:
      operationId: DMAPIOfflineWorkerNode
      parameters:
      - description: worker node name
        explode: false
        in: path
        name: worker-name
        required: true
        schema:
          example: master1
          type: string
        style: simple
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: offline worker node
      tags:
      - cluster
  /api/v1/dm.json:
    get:
      operationId: GetDocJSON
      responses:
        "200":
          description: json content
      summary: get doc json
      tags:
      - doc
  /api/v1/docs:
    get:
      operationId: GetDocHTML
      responses:
        "200":
          description: HTML content
      summary: get doc html
      tags:
      - doc
  /api/v1/sources:
    get:
      operationId: DMAPIGetSourceList
      parameters:
      - description: list source with status
        explode: true
        in: query
        name: with_status
        required: false
        schema:
          example: true
          type: boolean
        style: form
      - description: only return the enable-relay source
        explode: true
        in: query
        name: enable_relay
        required: false
        schema:
          example: true
          type: boolean
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSourceListResponse"
          description: data source list
      summary: get data source list
      tags:
      - source
    post:
      operationId: DMAPICreateSource
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateSourceRequest"
        description: request body
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Source"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: create and enable a new data source
      tags:
      - source
  /api/v1/sources/{source-name}:
    delete:
      operationId: DMAPIDeleteSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      - description: force stop source also stop the related tasks
        explode: true
        in: query
        name: force
        required: false
        schema:
          example: true
          type: boolean
        style: form
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: delete a data source
      tags:
      - source
    get:
      operationId: DMAPIGetSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      - description: list source with status
        explode: true
        in: query
        name: with_status
        required: false
        schema:
          example: true
          type: boolean
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Source"
          description: source
        "404":
          description: source not found
      summary: get source
      tags:
      - source
    put:
      operationId: DMAPIUpdateSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSourceRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Source"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: update a data source
      tags:
      - source
  /api/v1/sources/{source-name}/disable:
    post:
      operationId: DMAPIDisableSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: disable a data source
      tags:
      - source
  /api/v1/sources/{source-name}/enable:
    post:
      operationId: DMAPIEnableSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: enable a data source
      tags:
      - source
  /api/v1/sources/{source-name}/relay/disable:
    post:
      operationId: DMAPIDisableRelay
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisableRelayRequest"
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: disable relay log function for the data source
      tags:
      - source
  /api/v1/sources/{source-name}/relay/enable:
    post:
      operationId: DMAPIEnableRelay
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EnableRelayRequest"
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: enable relay log function for the data source
      tags:
      - source
  /api/v1/sources/{source-name}/relay/purge:
    post:
      operationId: DMAPIPurgeRelay
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PurgeRelayRequest"
        required: true
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: purge relay log
      tags:
      - source
  /api/v1/sources/{source-name}/schemas:
    get:
      operationId: DMAPIGetSourceSchemaList
      parameters:
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SchemaNameList"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get source schema list
      tags:
      - source
  /api/v1/sources/{source-name}/schemas/{schema-name}:
    get:
      operationId: DMAPIGetSourceTableList
      parameters:
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      - description: schema name
        explode: false
        in: path
        name: schema-name
        required: true
        schema:
          example: db1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TableNameList"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get source table list
      tags:
      - source
  /api/v1/sources/{source-name}/status:
    get:
      operationId: DMAPIGetSourceStatus
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-replica-01
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSourceStatusResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get the current status of the data source
      tags:
      - source
  /api/v1/sources/{source-name}/transfer:
    post:
      operationId: DMAPITransferSource
      parameters:
      - description: globally unique data source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: mysql-01
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WorkerNameRequest"
        required: true
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: transfer source to a free worker
      tags:
      - source
  /api/v1/tasks:
    get:
      operationId: DMAPIGetTaskList
      parameters:
      - description: get task with status
        explode: true
        in: query
        name: with_status
        required: false
        schema:
          example: true
          type: boolean
        style: form
      - description: filter by task stage
        explode: true
        in: query
        name: stage
        required: false
        schema:
          $ref: "#/components/schemas/TaskStage"
        style: form
      - description: filter by source name
        explode: true
        in: query
        name: source_name_list
        required: false
        schema:
          $ref: "#/components/schemas/SourceNameList"
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTaskListResponse"
          description: task list
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task list
      tags:
      - task
    post:
      operationId: DMAPICreateTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTaskRequest"
        description: request body
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OperateTaskResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: create a task
      tags:
      - task
  /api/v1/tasks/converters:
    post:
      operationId: DMAPIConvertTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ConverterTaskRequest"
        description: if task is input this task will be converted to task_config file
          or vice versa
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConverterTaskResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: Turn task into the format of a configuration file or vice versa.
      tags:
      - task
  /api/v1/tasks/templates:
    get:
      operationId: DMAPIGetTaskTemplateList
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTaskListResponse"
          description: task list
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task template list
      tags:
      - task
    post:
      operationId: DMAPICreateTaskTemplate
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Task"
        description: request body
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: create task template
      tags:
      - task
  /api/v1/tasks/templates/import:
    post:
      operationId: DMAPIImportTaskTemplate
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskTemplateRequest"
        description: request body
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaskTemplateResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: import task template
      tags:
      - task
  /api/v1/tasks/templates/{task-name}:
    delete:
      operationId: DMAPIDeleteTaskTemplate
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: delete task template template
      tags:
      - task
    get:
      operationId: DMAPIGetTaskTemplate
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task template template
      tags:
      - task
    put:
      operationId: DMAPUpdateTaskTemplate
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: update task template template
      tags:
      - task
  /api/v1/tasks/{task-name}:
    delete:
      operationId: DMAPIDeleteTask
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: force stop task even if some subtask is running
        explode: true
        in: query
        name: force
        required: false
        schema:
          example: true
          type: boolean
        style: form
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: delete a task
      tags:
      - task
    get:
      operationId: DMAPIGetTask
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: get task with status
        explode: true
        in: query
        name: with_status
        required: false
        schema:
          example: true
          type: boolean
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
          description: task list
        "404":
          description: task not found
      summary: get a task
      tags:
      - task
    put:
      operationId: DMAPIUpdateTask
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTaskRequest"
        description: request body
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OperateTaskResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: update a task
      tags:
      - task
  /api/v1/tasks/{task-name}/sources/{source-name}/migrate_targets:
    get:
      operationId: DMAPIGetTaskMigrateTargets
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      - explode: true
        in: query
        name: schema_pattern
        required: false
        schema:
          example: db*
          type: string
        style: form
      - explode: true
        in: query
        name: table_pattern
        required: false
        schema:
          example: table*
          type: string
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTaskMigrateTargetsResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task source table and target table route relation
      tags:
      - task
  /api/v1/tasks/{task-name}/sources/{source-name}/schemas:
    get:
      operationId: DMAPIGetSchemaListByTaskAndSource
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SchemaNameList"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task source schema list
      tags:
      - task
  /api/v1/tasks/{task-name}/sources/{source-name}/schemas/{schema-name}:
    get:
      operationId: DMAPIGetTableListByTaskAndSource
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      - description: schema name
        explode: false
        in: path
        name: schema-name
        required: true
        schema:
          example: db1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TableNameList"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task source table list
      tags:
      - task
  /api/v1/tasks/{task-name}/sources/{source-name}/schemas/{schema-name}/{table-name}:
    delete:
      operationId: DMAPIDeleteTableStructure
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      - description: schema name
        explode: false
        in: path
        name: schema-name
        required: true
        schema:
          example: db1
          type: string
        style: simple
      - description: table name
        explode: false
        in: path
        name: table-name
        required: true
        schema:
          example: table1
          type: string
        style: simple
      responses:
        "204":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: delete task source table structure
      tags:
      - task
    get:
      operationId: DMAPIGetTableStructure
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: source-1
          type: string
        style: simple
      - description: schema name
        explode: false
        in: path
        name: schema-name
        required: true
        schema:
          example: db1
          type: string
        style: simple
      - description: table name
        explode: false
        in: path
        name: table-name
        required: true
        schema:
          example: table1
          type: string
        style: simple
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTaskTableStructureResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task source table structure
      tags:
      - task
    put:
      operationId: DMAPIOperateTableStructure
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name
        explode: false
        in: path
        name: source-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: schema name
        explode: false
        in: path
        name: schema-name
        required: true
        schema:
          example: db1
          type: string
        style: simple
      - description: table name
        explode: false
        in: path
        name: table-name
        required: true
        schema:
          example: table1
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OperateTaskTableStructureRequest"
        required: true
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: operate task source table structure
      tags:
      - task
  /api/v1/tasks/{task-name}/start:
    post:
      operationId: DMAPIStartTask
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StartTaskRequest"
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: start a task
      tags:
      - task
  /api/v1/tasks/{task-name}/status:
    get:
      operationId: DMAPIGetTaskStatus
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      - description: source name list
        explode: true
        in: query
        name: source_name_list
        required: false
        schema:
          $ref: "#/components/schemas/SourceNameList"
        style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTaskStatusResponse"
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: get task status
      tags:
      - task
  /api/v1/tasks/{task-name}/stop:
    post:
      operationId: DMAPIStopTask
      parameters:
      - description: globally unique task name
        explode: false
        in: path
        name: task-name
        required: true
        schema:
          example: task-1
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StopTaskRequest"
      responses:
        "200":
          description: success
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorWithMessage"
          description: failed
      summary: stop a task
      tags:
      - task
components:
  schemas:
    AlertManagerTopology:
      example:
        port: 9093
        host: 127.0.0.1
      properties:
        host:
          example: 127.0.0.1
          type: string
        port:
          example: 9093
          type: integer
      required:
      - host
      - port
      type: object
    ClusterMaster:
      example:
        leader: true
        alive: true
        name: master1
        addr: 127.0.0.1:8261
      properties:
        addr:
          description: address of the current master node
          example: 127.0.0.1:8261
          type: string
        alive:
          description: online status of this master
          example: true
          type: boolean
        leader:
          description: is this master the leader
          example: true
          type: boolean
        name:
          example: master1
          type: string
      required:
      - addr
      - alive
      - leader
      - name
      type: object
    ClusterTopology:
      example:
        grafana_topology:
          port: 3000
          host: 127.0.0.1
        prometheus_topology:
          port: 9090
          host: 127.0.0.1
        worker_topology_list:
        - port: 8261
          host: 127.0.0.1
          name: worker1
        - port: 8261
          host: 127.0.0.1
          name: worker1
        alert_manager_topology:
          port: 9093
          host: 127.0.0.1
        master_topology_list:
        - port: 8261
          host: 127.0.0.1
          name: master
        - port: 8261
          host: 127.0.0.1
          name: master
      properties:
        alert_manager_topology:
          $ref: "#/components/schemas/AlertManagerTopology"
        grafana_topology:
          $ref: "#/components/schemas/GrafanaTopology"
        master_topology_list:
          items:
            $ref: "#/components/schemas/MasterTopology"
          type: array
        prometheus_topology:
          $ref: "#/components/schemas/PrometheusTopology"
        worker_topology_list:
          items:
            $ref: "#/components/schemas/WorkerTopology"
          type: array
      type: object
    ClusterWorker:
      example:
        bound_source_name: mysql-01
        name: worker1
        addr: 127.0.0.1:8261
        bound_stage: bound
      properties:
        addr:
          description: address of the current master node
          example: 127.0.0.1:8261
          type: string
        bound_source_name:
          description: source name bound to this worker node
          example: mysql-01
          type: string
        bound_stage:
          description: bound stage of this worker node
          example: bound
          type: string
        name:
          example: worker1
          type: string
      required:
      - addr
      - bound_source_name
      - bound_stage
      - name
      type: object
    ConverterTaskRequest:
      example:
        task:
          binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
        task_config_file: task_config_file
      properties:
        task:
          $ref: "#/components/schemas/Task"
        task_config_file:
          description: config file in yaml format https://docs.pingcap.com/zh/tidb/stable/task-configuration-file-full.
          type: string
      type: object
    ConverterTaskResponse:
      example:
        task:
          binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
        task_config_file: task_config_file
      properties:
        task:
          $ref: "#/components/schemas/Task"
        task_config_file:
          description: config file in yaml format https://docs.pingcap.com/zh/tidb/stable/task-configuration-file-full.
          type: string
      required:
      - task
      - task_config_file
      type: object
    CreateSourceRequest:
      example:
        worker_name: worker-1
        source:
          task_name_list:
          - task1
          - task1
          purge:
            expires: 0
            remain_space: 1
            interval: 6
          relay_config:
            relay_binlog_name: mysql-bin.000002
            relay_dir: ./relay_log
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            enable_relay: true
          flavor: mysql
          password: "123456"
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          enable_gtid: false
          port: 3306
          enable: false
          status_list:
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          host: 127.0.0.1
          user: root
          source_name: mysql-01
      properties:
        source:
          $ref: "#/components/schemas/Source"
        worker_name:
          example: worker-1
          type: string
      required:
      - source
      type: object
    CreateTaskRequest:
      example:
        task:
          binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
      properties:
        task:
          $ref: "#/components/schemas/Task"
      required:
      - task
      type: object
    DisableRelayRequest:
      description: action to stop a relay request
      example:
        worker_name_list:
        - worker-1
        - worker-1
      properties:
        worker_name_list:
          description: worker name list
          items:
            example: worker-1
            type: string
          type: array
      type: object
    DumpStatus:
      description: status of dump unit
      example:
        estimate_total_rows: 9.301444243932576
        finished_rows: 2.027123023002322
        total_tables: 4
        bps: 2
        completed_tables: 7.061401241503109
        finished_bytes: 3.616076749251911
        progress: progress
      properties:
        bps:
          format: int64
          type: integer
        completed_tables:
          format: double
          type: number
        estimate_total_rows:
          format: double
          type: number
        finished_bytes:
          format: double
          type: number
        finished_rows:
          format: double
          type: number
        progress:
          type: string
        total_tables:
          format: int64
          type: integer
      required:
      - bps
      - completed_tables
      - estimate_total_rows
      - finished_bytes
      - finished_rows
      - progress
      - total_tables
      type: object
    EnableRelayRequest:
      description: action to start a relay request
      example:
        relay_binlog_name: mysql-bin.000002
        relay_dir: ./relay_log
        relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
        worker_name_list:
        - worker-1
        - worker-1
      properties:
        relay_binlog_gtid:
          description: starting GTID of the upstream binlog
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          nullable: true
          type: string
        relay_binlog_name:
          description: starting filename of the upstream binlog
          example: mysql-bin.000002
          nullable: true
          type: string
        relay_dir:
          default: ./relay_log
          description: the directory where the relay log is stored
          nullable: true
          type: string
        worker_name_list:
          description: worker name list
          items:
            example: worker-1
            type: string
          type: array
      type: object
    ErrorWithMessage:
      description: operation error
      example:
        error_msg: error_msg
        error_code: 6
      properties:
        error_code:
          description: error code
          type: integer
        error_msg:
          description: error message
          type: string
      required:
      - error_code
      - error_msg
      type: object
    GetClusterInfoResponse:
      example:
        cluster_id: 0
        topology:
          grafana_topology:
            port: 3000
            host: 127.0.0.1
          prometheus_topology:
            port: 9090
            host: 127.0.0.1
          worker_topology_list:
          - port: 8261
            host: 127.0.0.1
            name: worker1
          - port: 8261
            host: 127.0.0.1
            name: worker1
          alert_manager_topology:
            port: 9093
            host: 127.0.0.1
          master_topology_list:
          - port: 8261
            host: 127.0.0.1
            name: master
          - port: 8261
            host: 127.0.0.1
            name: master
      properties:
        cluster_id:
          description: cluster id
          format: int64
          type: integer
        topology:
          $ref: "#/components/schemas/ClusterTopology"
      required:
      - cluster_id
      type: object
    GetClusterMasterListResponse:
      example:
        total: 0
        data:
        - leader: true
          alive: true
          name: master1
          addr: 127.0.0.1:8261
        - leader: true
          alive: true
          name: master1
          addr: 127.0.0.1:8261
      properties:
        data:
          items:
            $ref: "#/components/schemas/ClusterMaster"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetClusterWorkerListResponse:
      example:
        total: 0
        data:
        - bound_source_name: mysql-01
          name: worker1
          addr: 127.0.0.1:8261
          bound_stage: bound
        - bound_source_name: mysql-01
          name: worker1
          addr: 127.0.0.1:8261
          bound_stage: bound
      properties:
        data:
          items:
            $ref: "#/components/schemas/ClusterWorker"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetSourceListResponse:
      example:
        total: 5
        data:
        - task_name_list:
          - task1
          - task1
          purge:
            expires: 0
            remain_space: 1
            interval: 6
          relay_config:
            relay_binlog_name: mysql-bin.000002
            relay_dir: ./relay_log
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            enable_relay: true
          flavor: mysql
          password: "123456"
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          enable_gtid: false
          port: 3306
          enable: false
          status_list:
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          host: 127.0.0.1
          user: root
          source_name: mysql-01
        - task_name_list:
          - task1
          - task1
          purge:
            expires: 0
            remain_space: 1
            interval: 6
          relay_config:
            relay_binlog_name: mysql-bin.000002
            relay_dir: ./relay_log
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            enable_relay: true
          flavor: mysql
          password: "123456"
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          enable_gtid: false
          port: 3306
          enable: false
          status_list:
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          host: 127.0.0.1
          user: root
          source_name: mysql-01
      properties:
        data:
          items:
            $ref: "#/components/schemas/Source"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetSourceStatusResponse:
      example:
        total: 0
        data:
        - error_msg: error_msg
          worker_name: worker-1
          relay_status:
            master_binlog: "(mysql-bin.000001, 1979)"
            relay_dir: ./sub_dir
            relay_catch_up_master: true
            stage: Running
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          source_name: mysql-replica-01
        - error_msg: error_msg
          worker_name: worker-1
          relay_status:
            master_binlog: "(mysql-bin.000001, 1979)"
            relay_dir: ./sub_dir
            relay_catch_up_master: true
            stage: Running
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          source_name: mysql-replica-01
      properties:
        data:
          items:
            $ref: "#/components/schemas/SourceStatus"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetTaskListResponse:
      example:
        total: 9
        data:
        - binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
        - binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
      properties:
        data:
          items:
            $ref: "#/components/schemas/Task"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetTaskMigrateTargetsResponse:
      example:
        total: 0
        data:
        - target_schema: db1
          target_table: tb1
          source_table: tb1
          source_schema: db1
        - target_schema: db1
          target_table: tb1
          source_table: tb1
          source_schema: db1
      properties:
        data:
          items:
            $ref: "#/components/schemas/TaskMigrateTarget"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetTaskStatusResponse:
      example:
        total: 0
        data:
        - unresolved_ddl_lock_id: unresolved_ddl_lock_id
          unit: sync
          error_msg: error_msg
          stage: Stopped
          dump_status:
            estimate_total_rows: 9.301444243932576
            finished_rows: 2.027123023002322
            total_tables: 4
            bps: 2
            completed_tables: 7.061401241503109
            finished_bytes: 3.616076749251911
            progress: progress
          worker_name: worker_name
          name: name
          sync_status:
            total_events: 4
            total_tps: 5
            synced: true
            unresolved_groups:
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            dump_io_total_bytes: 1
            binlog_type: binlog_type
            syncer_binlog_gtid: syncer_binlog_gtid
            master_binlog_gtid: master_binlog_gtid
            blocking_ddls:
            - blocking_ddls
            - blocking_ddls
            io_total_bytes: 6
            seconds_behind_master: 1
            recent_tps: 7
            master_binlog: master_binlog
            syncer_binlog: syncer_binlog
          source_name: source_name
          load_status:
            meta_binlog_gtid: meta_binlog_gtid
            meta_binlog: meta_binlog
            bps: 7
            finished_bytes: 1
            total_bytes: 1
            progress: progress
        - unresolved_ddl_lock_id: unresolved_ddl_lock_id
          unit: sync
          error_msg: error_msg
          stage: Stopped
          dump_status:
            estimate_total_rows: 9.301444243932576
            finished_rows: 2.027123023002322
            total_tables: 4
            bps: 2
            completed_tables: 7.061401241503109
            finished_bytes: 3.616076749251911
            progress: progress
          worker_name: worker_name
          name: name
          sync_status:
            total_events: 4
            total_tps: 5
            synced: true
            unresolved_groups:
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            dump_io_total_bytes: 1
            binlog_type: binlog_type
            syncer_binlog_gtid: syncer_binlog_gtid
            master_binlog_gtid: master_binlog_gtid
            blocking_ddls:
            - blocking_ddls
            - blocking_ddls
            io_total_bytes: 6
            seconds_behind_master: 1
            recent_tps: 7
            master_binlog: master_binlog
            syncer_binlog: syncer_binlog
          source_name: source_name
          load_status:
            meta_binlog_gtid: meta_binlog_gtid
            meta_binlog: meta_binlog
            bps: 7
            finished_bytes: 1
            total_bytes: 1
            progress: progress
      properties:
        data:
          items:
            $ref: "#/components/schemas/SubTaskStatus"
          type: array
        total:
          type: integer
      required:
      - data
      - total
      type: object
    GetTaskTableStructureResponse:
      example:
        schema_name: db1
        schema_create_sql: "CREATE TABLE `t1` (`id` int(11) NOT NULL AUTO_INCREMENT,PRIMARY\
          \ KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\
          \ COLLATE=utf8mb4_bin"
        table_name: table1
      properties:
        schema_create_sql:
          example: "CREATE TABLE `t1` (`id` int(11) NOT NULL AUTO_INCREMENT,PRIMARY\
            \ KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT\
            \ CHARSET=utf8mb4 COLLATE=utf8mb4_bin"
          type: string
        schema_name:
          example: db1
          type: string
        table_name:
          example: table1
          type: string
      required:
      - table_create_sql
      - table_name
      type: object
    GrafanaTopology:
      example:
        port: 3000
        host: 127.0.0.1
      properties:
        host:
          example: 127.0.0.1
          type: string
        port:
          example: 3000
          type: integer
      required:
      - host
      - port
      type: object
    LoadStatus:
      description: status of load unit
      example:
        meta_binlog_gtid: meta_binlog_gtid
        meta_binlog: meta_binlog
        bps: 7
        finished_bytes: 1
        total_bytes: 1
        progress: progress
      properties:
        bps:
          format: int64
          type: integer
        finished_bytes:
          format: int64
          type: integer
        meta_binlog:
          type: string
        meta_binlog_gtid:
          type: string
        progress:
          type: string
        total_bytes:
          format: int64
          type: integer
      required:
      - bps
      - finished_bytes
      - meta_binlog
      - meta_binlog_gtid
      - progress
      - total_bytes
      type: object
    MasterTopology:
      example:
        port: 8261
        host: 127.0.0.1
        name: master
      properties:
        host:
          example: 127.0.0.1
          type: string
        name:
          example: master
          type: string
        port:
          example: 8261
          type: integer
      required:
      - host
      - name
      - port
      type: object
    OperateTaskResponse:
      example:
        check_result: 'pre-check is passed. '
        task:
          binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
      properties:
        check_result:
          description: pre-check result
          example: 'pre-check is passed. '
          type: string
        task:
          $ref: "#/components/schemas/Task"
      required:
      - check_result
      - task
      type: object
    OperateTaskTableStructureRequest:
      description: action to operate table request
      example:
        flush: true
        sql_content: "CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11)\
          \ DEFAULT NULL, `c3` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\
          \ COLLATE=utf8mb4_bin;"
        sync: true
      properties:
        flush:
          default: true
          description: Writes the schema to the checkpoint so that DM can load it
            after restarting the task
          type: boolean
        sql_content:
          description: sql you want to operate
          example: "CREATE TABLE `t1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT\
            \ NULL, `c3` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4\
            \ COLLATE=utf8mb4_bin;"
          type: string
        sync:
          description: Updates the optimistic sharding metadata with this schema only
            used when an error occurs in the optimistic sharding DDL mode
          type: boolean
      required:
      - sql_content
      type: object
    PrometheusTopology:
      example:
        port: 9090
        host: 127.0.0.1
      properties:
        host:
          example: 127.0.0.1
          type: string
        port:
          example: 9090
          type: integer
      required:
      - host
      - port
      type: object
    Purge:
      description: relay log cleanup policy configuration
      example:
        expires: 0
        remain_space: 1
        interval: 6
      properties:
        expires:
          default: 0
          description: expiration time of relay log
          format: int64
          nullable: true
          type: integer
        interval:
          default: 3600
          description: "The interval to periodically check if the relay log is expired,\
            \ default value: 3600, in seconds"
          format: int64
          nullable: true
          type: integer
        remain_space:
          default: 15
          description: "Minimum free disk space, in GB"
          format: int64
          nullable: true
          type: integer
      type: object
    PurgeRelayRequest:
      description: action to stop a relay request
      example:
        relay_binlog_name: mysql-bin.000002
        relay_dir: relay_dir
      properties:
        relay_binlog_name:
          description: starting filename of the upstream binlog
          example: mysql-bin.000002
          type: string
        relay_dir:
          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"
          nullable: true
          type: string
      required:
      - relay_binlog_name
      type: object
    RelayConfig:
      description: the config of relay
      example:
        relay_binlog_name: mysql-bin.000002
        relay_dir: ./relay_log
        relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
        enable_relay: true
      properties:
        enable_relay:
          type: boolean
        relay_binlog_gtid:
          description: starting GTID of the upstream binlog
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          nullable: true
          type: string
        relay_binlog_name:
          description: starting filename of the upstream binlog
          example: mysql-bin.000002
          nullable: true
          type: string
        relay_dir:
          default: ./relay_log
          description: the directory where the relay log is stored
          nullable: true
          type: string
      type: object
    RelayStatus:
      description: status of relay log
      example:
        master_binlog: "(mysql-bin.000001, 1979)"
        relay_dir: ./sub_dir
        relay_catch_up_master: true
        stage: Running
        relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
        master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
      properties:
        master_binlog:
          description: upstream binlog file information
          example: "(mysql-bin.000001, 1979)"
          type: string
        master_binlog_gtid:
          description: GTID of the upstream
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          type: string
        relay_binlog_gtid:
          description: relay current GTID
          example: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          type: string
        relay_catch_up_master:
          description: whether to catch up with upstream progress
          type: boolean
        relay_dir:
          description: the directory where the relay log is stored
          example: ./sub_dir
          type: string
        stage:
          description: current status
          example: Running
          type: string
      required:
      - master_binlog
      - master_binlog_gtid
      - relay_binlog_gtid
      - relay_catch_up_master
      - relay_dir
      - stage
      type: object
    SchemaNameList:
      description: schema name list
      items:
        example: db1
        type: string
      type: array
    Security:
      description: "data source ssl configuration, the field will be hidden when getting\
        \ the data source configuration from the interface"
      example:
        ssl_ca_content: ""
        ssl_cert_content: ""
        ssl_key_content: ""
        cert_allowed_cn:
        - cert_allowed_cn
        - cert_allowed_cn
      nullable: true
      properties:
        cert_allowed_cn:
          description: Common Name of SSL certificates
          items:
            type: string
          type: array
        ssl_ca_content:
          description: certificate file content
          example: ""
          type: string
        ssl_cert_content:
          description: File content of PEM format/X509 format certificates
          example: ""
          type: string
        ssl_key_content:
          description: Content of the private key file in X509 format
          example: ""
          type: string
      required:
      - ssl_ca_content
      - ssl_cert_content
      - ssl_key_content
      type: object
    ShardingGroup:
      example:
        synced:
        - synced
        - synced
        unsynced:
        - unsynced
        - unsynced
        first_location: first_location
        ddl_list:
        - ddl_list
        - ddl_list
        target: target
      properties:
        ddl_list:
          items:
            type: string
          type: array
        first_location:
          type: string
        synced:
          items:
            type: string
          type: array
        target:
          type: string
        unsynced:
          items:
            type: string
          type: array
      required:
      - ddl_list
      - first_location
      - synced
      - target
      - unsynced
      type: object
    Source:
      description: source
      example:
        task_name_list:
        - task1
        - task1
        purge:
          expires: 0
          remain_space: 1
          interval: 6
        relay_config:
          relay_binlog_name: mysql-bin.000002
          relay_dir: ./relay_log
          relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          enable_relay: true
        flavor: mysql
        password: "123456"
        security:
          ssl_ca_content: ""
          ssl_cert_content: ""
          ssl_key_content: ""
          cert_allowed_cn:
          - cert_allowed_cn
          - cert_allowed_cn
        enable_gtid: false
        port: 3306
        enable: false
        status_list:
        - error_msg: error_msg
          worker_name: worker-1
          relay_status:
            master_binlog: "(mysql-bin.000001, 1979)"
            relay_dir: ./sub_dir
            relay_catch_up_master: true
            stage: Running
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          source_name: mysql-replica-01
        - error_msg: error_msg
          worker_name: worker-1
          relay_status:
            master_binlog: "(mysql-bin.000001, 1979)"
            relay_dir: ./sub_dir
            relay_catch_up_master: true
            stage: Running
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          source_name: mysql-replica-01
        host: 127.0.0.1
        user: root
        source_name: mysql-01
      properties:
        enable:
          default: false
          description: whether this source is enabled
          example: false
          type: boolean
        enable_gtid:
          default: false
          description: whether to use GTID to pull binlogs from upstream
          example: false
          type: boolean
        flavor:
          description: flavor of this source
          example: mysql
          type: string
        host:
          description: source address
          example: 127.0.0.1
          type: string
        password:
          description: source password
          example: "123456"
          nullable: true
          type: string
        port:
          description: source port
          example: 3306
          type: integer
        purge:
          $ref: "#/components/schemas/Purge"
        relay_config:
          $ref: "#/components/schemas/RelayConfig"
        security:
          $ref: "#/components/schemas/Security"
        source_name:
          description: source name
          example: mysql-01
          type: string
        status_list:
          items:
            $ref: "#/components/schemas/SourceStatus"
          type: array
        task_name_list:
          description: task name list
          items:
            example: task1
            type: string
          type: array
        user:
          description: source username
          example: root
          type: string
      required:
      - enable
      - enable_gtid
      - host
      - port
      - source_name
      - user
      type: object
    SourceNameList:
      description: source name list
      items:
        example: source-1
        type: string
      type: array
    SourceStatus:
      description: source status
      example:
        error_msg: error_msg
        worker_name: worker-1
        relay_status:
          master_binlog: "(mysql-bin.000001, 1979)"
          relay_dir: ./sub_dir
          relay_catch_up_master: true
          stage: Running
          relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
          master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
        source_name: mysql-replica-01
      properties:
        error_msg:
          description: error message when something wrong
          type: string
        relay_status:
          $ref: "#/components/schemas/RelayStatus"
        source_name:
          description: source name
          example: mysql-replica-01
          type: string
        worker_name:
          description: The worker currently bound to the source
          example: worker-1
          type: string
      required:
      - source_name
      - worker_name
      type: object
    StartTaskRequest:
      example:
        start_time: 2006-01-02 15:04:05
        source_name_list:
        - source-1
        - source-1
        safe_mode_time_duration: 10s
        remove_meta: false
      properties:
        remove_meta:
          default: false
          description: whether to remove meta database in downstream database
          type: boolean
        safe_mode_time_duration:
          description: time duration of safe mode
          example: 10s
          type: string
        source_name_list:
          description: source name list
          items:
            example: source-1
            type: string
          type: array
        start_time:
          description: task start time
          example: 2006-01-02 15:04:05
          type: string
      type: object
    StopTaskRequest:
      example:
        timeout_duration: 15s
        source_name_list:
        - source-1
        - source-1
      properties:
        source_name_list:
          description: source name list
          items:
            example: source-1
            type: string
          type: array
        timeout_duration:
          description: time duration waiting task stop
          example: 15s
          type: string
      type: object
    SubTaskStatus:
      example:
        unresolved_ddl_lock_id: unresolved_ddl_lock_id
        unit: sync
        error_msg: error_msg
        stage: Stopped
        dump_status:
          estimate_total_rows: 9.301444243932576
          finished_rows: 2.027123023002322
          total_tables: 4
          bps: 2
          completed_tables: 7.061401241503109
          finished_bytes: 3.616076749251911
          progress: progress
        worker_name: worker_name
        name: name
        sync_status:
          total_events: 4
          total_tps: 5
          synced: true
          unresolved_groups:
          - synced:
            - synced
            - synced
            unsynced:
            - unsynced
            - unsynced
            first_location: first_location
            ddl_list:
            - ddl_list
            - ddl_list
            target: target
          - synced:
            - synced
            - synced
            unsynced:
            - unsynced
            - unsynced
            first_location: first_location
            ddl_list:
            - ddl_list
            - ddl_list
            target: target
          dump_io_total_bytes: 1
          binlog_type: binlog_type
          syncer_binlog_gtid: syncer_binlog_gtid
          master_binlog_gtid: master_binlog_gtid
          blocking_ddls:
          - blocking_ddls
          - blocking_ddls
          io_total_bytes: 6
          seconds_behind_master: 1
          recent_tps: 7
          master_binlog: master_binlog
          syncer_binlog: syncer_binlog
        source_name: source_name
        load_status:
          meta_binlog_gtid: meta_binlog_gtid
          meta_binlog: meta_binlog
          bps: 7
          finished_bytes: 1
          total_bytes: 1
          progress: progress
      properties:
        dump_status:
          $ref: "#/components/schemas/DumpStatus"
        error_msg:
          description: error message when something wrong
          type: string
        load_status:
          $ref: "#/components/schemas/LoadStatus"
        name:
          description: task name
          type: string
        source_name:
          description: source name
          type: string
        stage:
          $ref: "#/components/schemas/TaskStage"
        sync_status:
          $ref: "#/components/schemas/SyncStatus"
        unit:
          description: task unit type
          example: sync
          type: string
        unresolved_ddl_lock_id:
          type: string
        worker_name:
          description: worker name
          type: string
      required:
      - name
      - source_name
      - stage
      - unit
      - worker_name
      type: object
    SyncStatus:
      description: status of sync unit
      example:
        total_events: 4
        total_tps: 5
        synced: true
        unresolved_groups:
        - synced:
          - synced
          - synced
          unsynced:
          - unsynced
          - unsynced
          first_location: first_location
          ddl_list:
          - ddl_list
          - ddl_list
          target: target
        - synced:
          - synced
          - synced
          unsynced:
          - unsynced
          - unsynced
          first_location: first_location
          ddl_list:
          - ddl_list
          - ddl_list
          target: target
        dump_io_total_bytes: 1
        binlog_type: binlog_type
        syncer_binlog_gtid: syncer_binlog_gtid
        master_binlog_gtid: master_binlog_gtid
        blocking_ddls:
        - blocking_ddls
        - blocking_ddls
        io_total_bytes: 6
        seconds_behind_master: 1
        recent_tps: 7
        master_binlog: master_binlog
        syncer_binlog: syncer_binlog
      properties:
        binlog_type:
          type: string
        blocking_ddls:
          description: sharding DDL which current is blocking
          items:
            type: string
          type: array
        dump_io_total_bytes:
          format: int64
          type: integer
        io_total_bytes:
          format: int64
          type: integer
        master_binlog:
          type: string
        master_binlog_gtid:
          type: string
        recent_tps:
          format: int64
          type: integer
        seconds_behind_master:
          format: int64
          type: integer
        synced:
          type: boolean
        syncer_binlog:
          type: string
        syncer_binlog_gtid:
          type: string
        total_events:
          format: int64
          type: integer
        total_tps:
          format: int64
          type: integer
        unresolved_groups:
          description: sharding groups which current are un-resolved
          items:
            $ref: "#/components/schemas/ShardingGroup"
          type: array
      required:
      - binlog_type
      - blocking_ddls
      - dump_io_total_bytes
      - io_total_bytes
      - master_binlog
      - master_binlog_gtid
      - recent_tps
      - seconds_behind_master
      - synced
      - syncer_binlog
      - syncer_binlog_gtid
      - total_events
      - total_tps
      - unresolved_groups
      type: object
    TableNameList:
      description: schema name list
      items:
        example: table1
        type: string
      type: array
    Task:
      description: task
      example:
        binlog_filter_rule:
          key:
            ignore_sql:
            - ^Drop
            - ^Drop
            ignore_event:
            - all dml
            - all dml
        meta_schema: dm-meta
        enhance_online_schema_change: true
        table_migrate_rule:
        - binlog_filter_rule:
          - rule-1
          - rule-1
          source:
            schema: db-*
            source_name: source-name
            table: tb-*
          target:
            schema: db1
            table: tb1
        - binlog_filter_rule:
          - rule-1
          - rule-1
          source:
            schema: db-*
            source_name: source-name
            table: tb-*
          target:
            schema: db1
            table: tb1
        on_duplicate: replace
        shard_mode: pessimistic
        strict_optimistic_shard_mode: true
        status_list:
        - unresolved_ddl_lock_id: unresolved_ddl_lock_id
          unit: sync
          error_msg: error_msg
          stage: Stopped
          dump_status:
            estimate_total_rows: 9.301444243932576
            finished_rows: 2.027123023002322
            total_tables: 4
            bps: 2
            completed_tables: 7.061401241503109
            finished_bytes: 3.616076749251911
            progress: progress
          worker_name: worker_name
          name: name
          sync_status:
            total_events: 4
            total_tps: 5
            synced: true
            unresolved_groups:
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            dump_io_total_bytes: 1
            binlog_type: binlog_type
            syncer_binlog_gtid: syncer_binlog_gtid
            master_binlog_gtid: master_binlog_gtid
            blocking_ddls:
            - blocking_ddls
            - blocking_ddls
            io_total_bytes: 6
            seconds_behind_master: 1
            recent_tps: 7
            master_binlog: master_binlog
            syncer_binlog: syncer_binlog
          source_name: source_name
          load_status:
            meta_binlog_gtid: meta_binlog_gtid
            meta_binlog: meta_binlog
            bps: 7
            finished_bytes: 1
            total_bytes: 1
            progress: progress
        - unresolved_ddl_lock_id: unresolved_ddl_lock_id
          unit: sync
          error_msg: error_msg
          stage: Stopped
          dump_status:
            estimate_total_rows: 9.301444243932576
            finished_rows: 2.027123023002322
            total_tables: 4
            bps: 2
            completed_tables: 7.061401241503109
            finished_bytes: 3.616076749251911
            progress: progress
          worker_name: worker_name
          name: name
          sync_status:
            total_events: 4
            total_tps: 5
            synced: true
            unresolved_groups:
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            - synced:
              - synced
              - synced
              unsynced:
              - unsynced
              - unsynced
              first_location: first_location
              ddl_list:
              - ddl_list
              - ddl_list
              target: target
            dump_io_total_bytes: 1
            binlog_type: binlog_type
            syncer_binlog_gtid: syncer_binlog_gtid
            master_binlog_gtid: master_binlog_gtid
            blocking_ddls:
            - blocking_ddls
            - blocking_ddls
            io_total_bytes: 6
            seconds_behind_master: 1
            recent_tps: 7
            master_binlog: master_binlog
            syncer_binlog: syncer_binlog
          source_name: source_name
          load_status:
            meta_binlog_gtid: meta_binlog_gtid
            meta_binlog: meta_binlog
            bps: 7
            finished_bytes: 1
            total_bytes: 1
            progress: progress
        name: task-1
        task_mode: all
        target_config:
          password: "123456"
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          port: 3306
          host: 127.0.0.1
          user: root
        ignore_checking_items:
        - version
        - version
        source_config:
          full_migrate_conf:
            sorting_dir: ./sort_dir
            import_threads: 6
            on_duplicate_logical: replace
            export_threads: 0
            consistency: auto
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            compress-kv-pairs: compress-kv-pairs
            import_mode: logical
            analyze: optional
            checksum: optional
            disk_quota: 80G
            range_concurrency: 1
            pd_addr: pd_addr
            on_duplicate_physical: none
            data_dir: ./exported_data
          source_conf:
          - binlog_pos: 4
            binlog_name: binlog.000001
            binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
            source_name: mysql-replica-01
          - binlog_pos: 4
            binlog_name: binlog.000001
            binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
            source_name: mysql-replica-01
          incr_migrate_conf:
            repl_batch: 5
            repl_threads: 5
      properties:
        binlog_filter_rule:
          additionalProperties:
            $ref: "#/components/schemas/TaskBinLogFilterRule"
          type: object
        enhance_online_schema_change:
          default: true
          description: whether to enable support for the online ddl plugin
          example: true
          type: boolean
        ignore_checking_items:
          description: ignore precheck items
          items:
            example: version
            type: string
          type: array
        meta_schema:
          default: dm-meta
          description: downstream database for storing meta information
          example: dm-meta
          type: string
        name:
          description: task name
          example: task-1
          type: string
        on_duplicate:
          $ref: "#/components/schemas/Task_on_duplicate"
        shard_mode:
          $ref: "#/components/schemas/Task_shard_mode"
        source_config:
          $ref: "#/components/schemas/TaskSourceConfig"
        status_list:
          items:
            $ref: "#/components/schemas/SubTaskStatus"
          type: array
        strict_optimistic_shard_mode:
          default: false
          description: whether to enable strict optimistic shard mode
          example: true
          type: boolean
        table_migrate_rule:
          description: table migrate rule
          items:
            $ref: "#/components/schemas/TaskTableMigrateRule"
          type: array
        target_config:
          $ref: "#/components/schemas/TaskTargetDataBase"
        task_mode:
          $ref: "#/components/schemas/Task_task_mode"
      required:
      - enhance_online_schema_change
      - name
      - on_duplicate
      - source_config
      - table_migrate_rule
      - target_config
      - task_mode
      type: object
    TaskBinLogFilterRule:
      description: Filtering rules at binlog level
      example:
        ignore_sql:
        - ^Drop
        - ^Drop
        ignore_event:
        - all dml
        - all dml
      properties:
        ignore_event:
          description: event type
          items:
            description: event type
            example: all dml
            type: string
          type: array
        ignore_sql:
          description: sql pattern to filter
          items:
            description: sql pattern to filter
            example: ^Drop
            type: string
          type: array
      type: object
    TaskFullMigrateConf:
      description: configuration of full migrate tasks
      example:
        sorting_dir: ./sort_dir
        import_threads: 6
        on_duplicate_logical: replace
        export_threads: 0
        consistency: auto
        security:
          ssl_ca_content: ""
          ssl_cert_content: ""
          ssl_key_content: ""
          cert_allowed_cn:
          - cert_allowed_cn
          - cert_allowed_cn
        compress-kv-pairs: compress-kv-pairs
        import_mode: logical
        analyze: optional
        checksum: optional
        disk_quota: 80G
        range_concurrency: 1
        pd_addr: pd_addr
        on_duplicate_physical: none
        data_dir: ./exported_data
      properties:
        analyze:
          $ref: "#/components/schemas/TaskFullMigrateConf_analyze"
        checksum:
          $ref: "#/components/schemas/TaskFullMigrateConf_analyze"
        compress-kv-pairs:
          description: to control compress kv pairs of physical import
          type: string
        consistency:
          description: to control the way in which data is exported for consistency
            assurance
          example: auto
          type: string
        data_dir:
          description: storage dir name
          example: ./exported_data
          type: string
        disk_quota:
          description: disk quota for physical import
          example: 80G
          type: string
        export_threads:
          default: 4
          description: full export of concurrent
          type: integer
        import_mode:
          $ref: "#/components/schemas/TaskFullMigrateConf_import_mode"
        import_threads:
          default: 16
          description: full import of concurrent
          type: integer
        on_duplicate_logical:
          $ref: "#/components/schemas/TaskFullMigrateConf_on_duplicate_logical"
        on_duplicate_physical:
          $ref: "#/components/schemas/TaskFullMigrateConf_on_duplicate_physical"
        pd_addr:
          description: address of pd
          type: string
        range_concurrency:
          default: 0
          description: to control range concurrency of physical import
          type: integer
        security:
          $ref: "#/components/schemas/Security"
        sorting_dir:
          description: sorting dir name for physical import
          example: ./sort_dir
          type: string
      type: object
    TaskIncrMigrateConf:
      description: configuration of incremental tasks
      example:
        repl_batch: 5
        repl_threads: 5
      properties:
        repl_batch:
          default: 100
          description: incremental synchronization of batch execution sql quantities
          type: integer
        repl_threads:
          default: 16
          description: incremental task of concurrent
          type: integer
      type: object
    TaskMigrateTarget:
      description: task migrate targets
      example:
        target_schema: db1
        target_table: tb1
        source_table: tb1
        source_schema: db1
      properties:
        source_schema:
          example: db1
          type: string
        source_table:
          example: tb1
          type: string
        target_schema:
          example: db1
          type: string
        target_table:
          example: tb1
          type: string
      required:
      - source_schema
      - source_table
      - target_schema
      - target_table
      type: object
    TaskNameList:
      description: task name list
      items:
        example: task1
        type: string
      type: array
    TaskSourceConf:
      example:
        binlog_pos: 4
        binlog_name: binlog.000001
        binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
        source_name: mysql-replica-01
      properties:
        binlog_gtid:
          example: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
          type: string
        binlog_name:
          example: binlog.000001
          type: string
        binlog_pos:
          example: 4
          type: integer
        source_name:
          description: source name
          example: mysql-replica-01
          type: string
      required:
      - source_name
      type: object
    TaskSourceConfig:
      description: source-related configuration
      example:
        full_migrate_conf:
          sorting_dir: ./sort_dir
          import_threads: 6
          on_duplicate_logical: replace
          export_threads: 0
          consistency: auto
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          compress-kv-pairs: compress-kv-pairs
          import_mode: logical
          analyze: optional
          checksum: optional
          disk_quota: 80G
          range_concurrency: 1
          pd_addr: pd_addr
          on_duplicate_physical: none
          data_dir: ./exported_data
        source_conf:
        - binlog_pos: 4
          binlog_name: binlog.000001
          binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
          source_name: mysql-replica-01
        - binlog_pos: 4
          binlog_name: binlog.000001
          binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
          source_name: mysql-replica-01
        incr_migrate_conf:
          repl_batch: 5
          repl_threads: 5
      properties:
        full_migrate_conf:
          $ref: "#/components/schemas/TaskFullMigrateConf"
        incr_migrate_conf:
          $ref: "#/components/schemas/TaskIncrMigrateConf"
        source_conf:
          description: source configuration
          items:
            $ref: "#/components/schemas/TaskSourceConf"
          type: array
      required:
      - source_conf
      type: object
    TaskStage:
      enum:
      - Stopped
      - Running
      - Finished
      - Paused
      type: string
    TaskTableMigrateRule:
      description: upstream table to downstream migrate rules
      example:
        binlog_filter_rule:
        - rule-1
        - rule-1
        source:
          schema: db-*
          source_name: source-name
          table: tb-*
        target:
          schema: db1
          table: tb1
      properties:
        binlog_filter_rule:
          description: filter rule name
          items:
            example: rule-1
            type: string
          type: array
        source:
          $ref: "#/components/schemas/TaskTableMigrateRuleSource"
        target:
          $ref: "#/components/schemas/TaskTableMigrateRuleTarget"
      required:
      - source
      type: object
    TaskTableMigrateRuleSource:
      description: source-related configuration
      example:
        schema: db-*
        source_name: source-name
        table: tb-*
      properties:
        schema:
          description: "schema name, wildcard support"
          example: db-*
          type: string
        source_name:
          description: source name
          example: source-name
          type: string
        table:
          description: "table name, wildcard support"
          example: tb-*
          type: string
      required:
      - schema
      - source_name
      - table
    TaskTableMigrateRuleTarget:
      description: downstream-related configuration
      example:
        schema: db1
        table: tb1
      properties:
        schema:
          description: "schema name, does not support wildcards"
          example: db1
          type: string
        table:
          description: "table name, does not support wildcards"
          example: tb1
          type: string
      type: object
    TaskTargetDataBase:
      description: downstream database configuration
      example:
        password: "123456"
        security:
          ssl_ca_content: ""
          ssl_cert_content: ""
          ssl_key_content: ""
          cert_allowed_cn:
          - cert_allowed_cn
          - cert_allowed_cn
        port: 3306
        host: 127.0.0.1
        user: root
      properties:
        host:
          description: source address
          example: 127.0.0.1
          type: string
        password:
          description: source password
          example: "123456"
          type: string
        port:
          description: source port
          example: 3306
          type: integer
        security:
          $ref: "#/components/schemas/Security"
        user:
          description: source username
          example: root
          type: string
      required:
      - host
      - password
      - port
      - user
      type: object
    TaskTemplateRequest:
      example:
        overwrite: false
      properties:
        overwrite:
          default: false
          description: whether to overwrite task template template
          type: boolean
      required:
      - overwrite
      type: object
    TaskTemplateResponse:
      example:
        failed_task_list:
        - task_name: task_name
          error_msg: error_msg
        - task_name: task_name
          error_msg: error_msg
        success_task_list:
        - success_task_list
        - success_task_list
      properties:
        failed_task_list:
          items:
            $ref: "#/components/schemas/TaskTemplateResponse_failed_task_list_inner"
          type: array
        success_task_list:
          items:
            type: string
          type: array
      required:
      - failed_task_list
      - success_task_list
      type: object
    UpdateSourceRequest:
      example:
        source:
          task_name_list:
          - task1
          - task1
          purge:
            expires: 0
            remain_space: 1
            interval: 6
          relay_config:
            relay_binlog_name: mysql-bin.000002
            relay_dir: ./relay_log
            relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            enable_relay: true
          flavor: mysql
          password: "123456"
          security:
            ssl_ca_content: ""
            ssl_cert_content: ""
            ssl_key_content: ""
            cert_allowed_cn:
            - cert_allowed_cn
            - cert_allowed_cn
          enable_gtid: false
          port: 3306
          enable: false
          status_list:
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          - error_msg: error_msg
            worker_name: worker-1
            relay_status:
              master_binlog: "(mysql-bin.000001, 1979)"
              relay_dir: ./sub_dir
              relay_catch_up_master: true
              stage: Running
              relay_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
              master_binlog_gtid: e9a1fc22-ec08-11e9-b2ac-0242ac110003:1-7849
            source_name: mysql-replica-01
          host: 127.0.0.1
          user: root
          source_name: mysql-01
      properties:
        source:
          $ref: "#/components/schemas/Source"
      required:
      - source
      type: object
    UpdateTaskRequest:
      example:
        task:
          binlog_filter_rule:
            key:
              ignore_sql:
              - ^Drop
              - ^Drop
              ignore_event:
              - all dml
              - all dml
          meta_schema: dm-meta
          enhance_online_schema_change: true
          table_migrate_rule:
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          - binlog_filter_rule:
            - rule-1
            - rule-1
            source:
              schema: db-*
              source_name: source-name
              table: tb-*
            target:
              schema: db1
              table: tb1
          on_duplicate: replace
          shard_mode: pessimistic
          strict_optimistic_shard_mode: true
          status_list:
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          - unresolved_ddl_lock_id: unresolved_ddl_lock_id
            unit: sync
            error_msg: error_msg
            stage: Stopped
            dump_status:
              estimate_total_rows: 9.301444243932576
              finished_rows: 2.027123023002322
              total_tables: 4
              bps: 2
              completed_tables: 7.061401241503109
              finished_bytes: 3.616076749251911
              progress: progress
            worker_name: worker_name
            name: name
            sync_status:
              total_events: 4
              total_tps: 5
              synced: true
              unresolved_groups:
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              - synced:
                - synced
                - synced
                unsynced:
                - unsynced
                - unsynced
                first_location: first_location
                ddl_list:
                - ddl_list
                - ddl_list
                target: target
              dump_io_total_bytes: 1
              binlog_type: binlog_type
              syncer_binlog_gtid: syncer_binlog_gtid
              master_binlog_gtid: master_binlog_gtid
              blocking_ddls:
              - blocking_ddls
              - blocking_ddls
              io_total_bytes: 6
              seconds_behind_master: 1
              recent_tps: 7
              master_binlog: master_binlog
              syncer_binlog: syncer_binlog
            source_name: source_name
            load_status:
              meta_binlog_gtid: meta_binlog_gtid
              meta_binlog: meta_binlog
              bps: 7
              finished_bytes: 1
              total_bytes: 1
              progress: progress
          name: task-1
          task_mode: all
          target_config:
            password: "123456"
            security:
              ssl_ca_content: ""
              ssl_cert_content: ""
              ssl_key_content: ""
              cert_allowed_cn:
              - cert_allowed_cn
              - cert_allowed_cn
            port: 3306
            host: 127.0.0.1
            user: root
          ignore_checking_items:
          - version
          - version
          source_config:
            full_migrate_conf:
              sorting_dir: ./sort_dir
              import_threads: 6
              on_duplicate_logical: replace
              export_threads: 0
              consistency: auto
              security:
                ssl_ca_content: ""
                ssl_cert_content: ""
                ssl_key_content: ""
                cert_allowed_cn:
                - cert_allowed_cn
                - cert_allowed_cn
              compress-kv-pairs: compress-kv-pairs
              import_mode: logical
              analyze: optional
              checksum: optional
              disk_quota: 80G
              range_concurrency: 1
              pd_addr: pd_addr
              on_duplicate_physical: none
              data_dir: ./exported_data
            source_conf:
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            - binlog_pos: 4
              binlog_name: binlog.000001
              binlog_gtid: "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170"
              source_name: mysql-replica-01
            incr_migrate_conf:
              repl_batch: 5
              repl_threads: 5
      properties:
        task:
          $ref: "#/components/schemas/Task"
      required:
      - task
      type: object
    WorkerNameList:
      description: worker name list
      items:
        example: worker-1
        type: string
      type: array
    WorkerNameRequest:
      description: requests related to workers
      example:
        worker_name: worker-1
      properties:
        worker_name:
          description: worker name
          example: worker-1
          type: string
      required:
      - worker_name
      type: object
    WorkerTopology:
      example:
        port: 8261
        host: 127.0.0.1
        name: worker1
      properties:
        host:
          example: 127.0.0.1
          type: string
        name:
          example: worker1
          type: string
        port:
          example: 8261
          type: integer
      required:
      - host
      - name
      - port
      type: object
    Task_on_duplicate:
      description: how to handle conflicted data
      enum:
      - replace
      - error
      - ignore
      type: string
    Task_shard_mode:
      description: the way to coordinate DDL
      enum:
      - pessimistic
      - optimistic
      type: string
    Task_task_mode:
      description: migrate mode
      enum:
      - full
      - incremental
      - all
      - dump
      - load
      example: all
      type: string
    TaskFullMigrateConf_analyze:
      description: to control checksum of physical import
      enum:
      - required
      - optional
      - "off"
      example: optional
      type: string
    TaskFullMigrateConf_import_mode:
      description: to control import mode of full import
      enum:
      - logical
      - physical
      example: logical
      type: string
    TaskFullMigrateConf_on_duplicate_logical:
      description: to control the duplication resolution when meet duplicate rows
        for logical import
      enum:
      - replace
      - error
      - ignore
      example: replace
      type: string
    TaskFullMigrateConf_on_duplicate_physical:
      description: to control the duplication resolution when meet duplicate rows
        for physical import
      enum:
      - none
      - manual
      example: none
      type: string
    TaskTemplateResponse_failed_task_list_inner:
      example:
        task_name: task_name
        error_msg: error_msg
      properties:
        error_msg:
          type: string
        task_name:
          type: string
      required:
      - error_msg
      - task_name
      type: object
