{
  "components": {
    "schemas": {
      "AlertManagerTopology": {
        "properties": {
          "host": {
            "example": "127.0.0.1",
            "type": "string"
          },
          "port": {
            "example": 9093,
            "type": "integer"
          }
        },
        "required": [
          "host",
          "port"
        ],
        "type": "object"
      },
      "ClusterMaster": {
        "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": [
          "name",
          "alive",
          "leader",
          "addr"
        ],
        "type": "object"
      },
      "ClusterTopology": {
        "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": {
        "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": [
          "name",
          "addr",
          "bound_stage",
          "bound_source_name"
        ],
        "type": "object"
      },
      "ConverterTaskRequest": {
        "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": {
        "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": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source"
          },
          "worker_name": {
            "example": "worker-1",
            "type": "string"
          }
        },
        "required": [
          "source"
        ],
        "type": "object"
      },
      "CreateTaskRequest": {
        "properties": {
          "task": {
            "$ref": "#/components/schemas/Task"
          }
        },
        "required": [
          "task"
        ],
        "type": "object"
      },
      "DisableRelayRequest": {
        "description": "action to stop a relay request",
        "properties": {
          "worker_name_list": {
            "$ref": "#/components/schemas/WorkerNameList"
          }
        },
        "type": "object"
      },
      "DumpStatus": {
        "description": "status of dump unit",
        "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": [
          "total_tables",
          "completed_tables",
          "finished_bytes",
          "finished_rows",
          "estimate_total_rows",
          "bps",
          "progress"
        ],
        "type": "object"
      },
      "EnableRelayRequest": {
        "description": "action to start a relay request",
        "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": {
            "$ref": "#/components/schemas/WorkerNameList"
          }
        },
        "type": "object"
      },
      "ErrorWithMessage": {
        "description": "operation error",
        "properties": {
          "error_code": {
            "description": "error code",
            "type": "integer"
          },
          "error_msg": {
            "description": "error message",
            "type": "string"
          }
        },
        "required": [
          "error_msg",
          "error_code"
        ],
        "type": "object"
      },
      "GetClusterInfoResponse": {
        "properties": {
          "cluster_id": {
            "description": "cluster id",
            "format": "int64",
            "type": "integer"
          },
          "topology": {
            "$ref": "#/components/schemas/ClusterTopology"
          }
        },
        "required": [
          "cluster_id"
        ],
        "type": "object"
      },
      "GetClusterMasterListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ClusterMaster"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetClusterWorkerListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ClusterWorker"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetSourceListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Source"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetSourceStatusResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SourceStatus"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetTaskListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Task"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetTaskMigrateTargetsResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/TaskMigrateTarget"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetTaskStatusResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SubTaskStatus"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "data"
        ],
        "type": "object"
      },
      "GetTaskTableStructureResponse": {
        "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_name",
          "table_create_sql"
        ],
        "type": "object"
      },
      "GrafanaTopology": {
        "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",
        "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": [
          "finished_bytes",
          "total_bytes",
          "progress",
          "meta_binlog",
          "meta_binlog_gtid",
          "bps"
        ],
        "type": "object"
      },
      "MasterTopology": {
        "properties": {
          "host": {
            "example": "127.0.0.1",
            "type": "string"
          },
          "name": {
            "example": "master",
            "type": "string"
          },
          "port": {
            "example": 8261,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "host",
          "port"
        ],
        "type": "object"
      },
      "OperateTaskResponse": {
        "properties": {
          "check_result": {
            "description": "pre-check result",
            "example": "pre-check is passed. ",
            "type": "string"
          },
          "task": {
            "$ref": "#/components/schemas/Task"
          }
        },
        "required": [
          "task",
          "check_result"
        ],
        "type": "object"
      },
      "OperateTaskTableStructureRequest": {
        "description": "action to operate table request",
        "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": {
        "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",
        "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",
        "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",
        "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",
        "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_dir",
          "relay_binlog_gtid",
          "relay_catch_up_master",
          "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",
        "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": {
        "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": [
          "target",
          "ddl_list",
          "first_location",
          "synced",
          "unsynced"
        ],
        "type": "object"
      },
      "Source": {
        "description": "source",
        "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": {
            "$ref": "#/components/schemas/TaskNameList"
          },
          "user": {
            "description": "source username",
            "example": "root",
            "type": "string"
          }
        },
        "required": [
          "source_name",
          "host",
          "port",
          "user",
          "enable_gtid",
          "enable"
        ],
        "type": "object"
      },
      "SourceNameList": {
        "description": "source name list",
        "items": {
          "example": "source-1",
          "type": "string"
        },
        "type": "array"
      },
      "SourceStatus": {
        "description": "source status",
        "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": {
        "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": {
            "$ref": "#/components/schemas/SourceNameList"
          },
          "start_time": {
            "description": "task start time",
            "example": "2006-01-02 15:04:05",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StopTaskRequest": {
        "properties": {
          "source_name_list": {
            "$ref": "#/components/schemas/SourceNameList"
          },
          "timeout_duration": {
            "description": "time duration waiting task stop",
            "example": "15s",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SubTaskStatus": {
        "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",
          "worker_name",
          "stage",
          "unit"
        ],
        "type": "object"
      },
      "SyncStatus": {
        "description": "status of sync unit",
        "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": [
          "total_events",
          "total_tps",
          "recent_tps",
          "master_binlog",
          "master_binlog_gtid",
          "syncer_binlog",
          "syncer_binlog_gtid",
          "blocking_ddls",
          "unresolved_groups",
          "synced",
          "binlog_type",
          "seconds_behind_master",
          "io_total_bytes",
          "dump_io_total_bytes"
        ],
        "type": "object"
      },
      "TableNameList": {
        "description": "schema name list",
        "items": {
          "example": "table1",
          "type": "string"
        },
        "type": "array"
      },
      "Task": {
        "description": "task",
        "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": {
            "description": "how to handle conflicted data",
            "enum": [
              "replace",
              "error",
              "ignore"
            ],
            "type": "string"
          },
          "shard_mode": {
            "description": "the way to coordinate DDL",
            "enum": [
              "pessimistic",
              "optimistic"
            ],
            "type": "string"
          },
          "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": {
            "description": "migrate mode",
            "enum": [
              "full",
              "incremental",
              "all",
              "dump",
              "load"
            ],
            "example": "all",
            "type": "string"
          }
        },
        "required": [
          "name",
          "task_mode",
          "enhance_online_schema_change",
          "on_duplicate",
          "target_config",
          "table_migrate_rule",
          "source_config"
        ],
        "type": "object"
      },
      "TaskBinLogFilterRule": {
        "description": "Filtering rules at binlog level",
        "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",
        "properties": {
          "analyze": {
            "description": "to control checksum of physical import",
            "enum": [
              "required",
              "optional",
              "off"
            ],
            "example": "optional",
            "type": "string"
          },
          "checksum": {
            "description": "to control checksum of physical import",
            "enum": [
              "required",
              "optional",
              "off"
            ],
            "example": "optional",
            "type": "string"
          },
          "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": {
            "description": "to control import mode of full import",
            "enum": [
              "logical",
              "physical"
            ],
            "example": "logical",
            "type": "string"
          },
          "import_threads": {
            "default": 16,
            "description": "full import of concurrent",
            "type": "integer"
          },
          "on_duplicate_logical": {
            "description": "to control the duplication resolution when meet duplicate rows for logical import",
            "enum": [
              "replace",
              "error",
              "ignore"
            ],
            "example": "replace",
            "type": "string"
          },
          "on_duplicate_physical": {
            "description": "to control the duplication resolution when meet duplicate rows for physical import",
            "enum": [
              "none",
              "manual"
            ],
            "example": "none",
            "type": "string"
          },
          "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",
        "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",
        "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": {
        "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",
        "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",
        "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",
        "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": [
          "source_name",
          "schema",
          "table"
        ]
      },
      "TaskTableMigrateRuleTarget": {
        "description": "downstream-related configuration",
        "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",
        "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",
          "port",
          "user",
          "password"
        ],
        "type": "object"
      },
      "TaskTemplateRequest": {
        "properties": {
          "overwrite": {
            "default": false,
            "description": "whether to overwrite task template template",
            "type": "boolean"
          }
        },
        "required": [
          "overwrite"
        ],
        "type": "object"
      },
      "TaskTemplateResponse": {
        "properties": {
          "failed_task_list": {
            "items": {
              "properties": {
                "error_msg": {
                  "type": "string"
                },
                "task_name": {
                  "type": "string"
                }
              },
              "required": [
                "task_name",
                "error_msg"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "success_task_list": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "success_task_list",
          "failed_task_list"
        ],
        "type": "object"
      },
      "UpdateSourceRequest": {
        "properties": {
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "required": [
          "source"
        ],
        "type": "object"
      },
      "UpdateTaskRequest": {
        "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",
        "properties": {
          "worker_name": {
            "description": "worker name",
            "example": "worker-1",
            "type": "string"
          }
        },
        "required": [
          "worker_name"
        ],
        "type": "object"
      },
      "WorkerTopology": {
        "properties": {
          "host": {
            "example": "127.0.0.1",
            "type": "string"
          },
          "name": {
            "example": "worker1",
            "type": "string"
          },
          "port": {
            "example": 8261,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "host",
          "port"
        ],
        "type": "object"
      }
    }
  },
  "externalDocs": {
    "description": "DM OpenAPI DOC",
    "url": "https://docs.pingcap.com/zh/tidb-data-migration/stable"
  },
  "info": {
    "title": "DM OpenAPI DOC",
    "version": "6.0.0"
  },
  "openapi": "3.0.0",
  "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",
            "in": "path",
            "name": "master-name",
            "required": true,
            "schema": {
              "example": "master1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "worker-name",
            "required": true,
            "schema": {
              "example": "master1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "query",
            "name": "with_status",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          },
          {
            "description": "only return the enable-relay source",
            "in": "query",
            "name": "enable_relay",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          },
          {
            "description": "force stop source also stop the related tasks",
            "in": "query",
            "name": "force",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          },
          {
            "description": "list source with status",
            "in": "query",
            "name": "with_status",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          },
          {
            "description": "schema name",
            "in": "path",
            "name": "schema-name",
            "required": true,
            "schema": {
              "example": "db1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-replica-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "mysql-01",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "query",
            "name": "with_status",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          },
          {
            "description": "filter by task stage",
            "in": "query",
            "name": "stage",
            "schema": {
              "$ref": "#/components/schemas/TaskStage"
            }
          },
          {
            "description": "filter by source name",
            "in": "query",
            "name": "source_name_list",
            "schema": {
              "$ref": "#/components/schemas/SourceNameList"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "force stop task even if some subtask is running",
            "in": "query",
            "name": "force",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "get task with status",
            "in": "query",
            "name": "with_status",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "schema_pattern",
            "schema": {
              "example": "db*",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "table_pattern",
            "schema": {
              "example": "table*",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          },
          {
            "description": "schema name",
            "in": "path",
            "name": "schema-name",
            "required": true,
            "schema": {
              "example": "db1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          },
          {
            "description": "schema name",
            "in": "path",
            "name": "schema-name",
            "required": true,
            "schema": {
              "example": "db1",
              "type": "string"
            }
          },
          {
            "description": "table name",
            "in": "path",
            "name": "table-name",
            "required": true,
            "schema": {
              "example": "table1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "source-1",
              "type": "string"
            }
          },
          {
            "description": "schema name",
            "in": "path",
            "name": "schema-name",
            "required": true,
            "schema": {
              "example": "db1",
              "type": "string"
            }
          },
          {
            "description": "table name",
            "in": "path",
            "name": "table-name",
            "required": true,
            "schema": {
              "example": "table1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name",
            "in": "path",
            "name": "source-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "schema name",
            "in": "path",
            "name": "schema-name",
            "required": true,
            "schema": {
              "example": "db1",
              "type": "string"
            }
          },
          {
            "description": "table name",
            "in": "path",
            "name": "table-name",
            "required": true,
            "schema": {
              "example": "table1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          },
          {
            "description": "source name list",
            "in": "query",
            "name": "source_name_list",
            "schema": {
              "$ref": "#/components/schemas/SourceNameList"
            }
          }
        ],
        "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",
            "in": "path",
            "name": "task-name",
            "required": true,
            "schema": {
              "example": "task-1",
              "type": "string"
            }
          }
        ],
        "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"
        ]
      }
    }
  },
  "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"
    }
  ]
}
