dtle 3.x 根据业务功能提供了一套HTTP API(开启方式见"节点配置" ,api_addr),可与dtle UI配套使用。
本节API示例默认使用swagger UI调用。
访问http://{dtle ip}:8190/swagger/index.html
通过swagger UI查看接口文档,打开界面如下:
除了使用curl命令外,还可以通过swagger UI界面调用API,具体步骤如下:
1 点击"Try it out",进入调试模式
2 填写请求参数后点击"Execute"调用API
3 查看响应:
4 由于用户校验功能限制,大多数接口调用需要在header中携带登录成功返回的token,在swagger页面可点击swagger页面顶部的Authorize按钮,将token填入Value的文本框中,swagger页面中其他接口即可正常使用
This is a sample server for dev.
ApiKeyAuth
apiKey
API Key
In
header
Name
Authorization
list columns of database source instance.
Name
Located in
Description
Required
Schema
host
query
database host
Yes
string
port
query
database port
Yes
integer
user
query
database user
Yes
string
password
query
database password
Yes
string
database_type
query
database_type
Yes
string
service_name
query
database service_name
No
string
schema
query
database schema
Yes
string
table
query
database table
Yes
string
character_set
query
database character set
No
string
is_password_encrypted
query
indecate that database password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
/v2/database/instance_connection
connect to database instance.
Name
Located in
Description
Required
Schema
host
query
database host
Yes
string
port
query
database port
Yes
integer
user
query
database user
Yes
string
password
query
database password
Yes
string
database_type
query
database_type
Yes
string
service_name
query
database service_name
No
string
is_password_encrypted
query
indecate that database password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
list schemas of database source instance.
Name
Located in
Description
Required
Schema
database_type
query
database_type
Yes
string
host
query
database host
Yes
string
port
query
database port
Yes
integer
user
query
database user
Yes
string
password
query
database password
Yes
string
service_name
query
database service_name
No
string
character_set
query
database character set
No
string
is_password_encrypted
query
indecate that database password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
get src task current gtid.
Name
Located in
Description
Required
Schema
job_id
query
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
create migration job.
Security Schema
Scopes
ApiKeyAuth
delete migration job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
get migration job detail.
Name
Located in
Description
Required
Schema
job_id
query
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
pause migration job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
resume migration job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/migration/reverse
reverse migration Job
Name
Located in
Description
Required
Schema
reverse_config
body
reverse config config
Yes
models.ReverseJobReq
Security Schema
Scopes
ApiKeyAuth
/v2/job/migration/reverse_start
start reverse-init job
Start Reverse Job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
update migration job.
Security Schema
Scopes
ApiKeyAuth
start reverse-init job
Finish Job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/create
create subscription job.
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/delete
delete subscription job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/detail
get subscription job detail.
Name
Located in
Description
Required
Schema
job_id
query
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/pause
pause subscription job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/resume
resume subscription job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
/v2/job/subscription/update
update subscription job.
Security Schema
Scopes
ApiKeyAuth
create sync job.
Security Schema
Scopes
ApiKeyAuth
delete sync job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
get sync job detail.
Name
Located in
Description
Required
Schema
job_id
query
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
pause sync job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
resume sync job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
reverse sync Job
Name
Located in
Description
Required
Schema
reverse_config
body
reverse config config
Yes
models.ReverseJobReq
Security Schema
Scopes
ApiKeyAuth
/v2/job/sync/reverse_start
start reverse-init job
Start Reverse Job.
Name
Located in
Description
Required
Schema
job_id
formData
job id
Yes
string
Security Schema
Scopes
ApiKeyAuth
update sync job.
Security Schema
Scopes
ApiKeyAuth
get job list.
Name
Located in
Description
Required
Schema
filter_job_id
query
filter job id
No
string
filter_job_src_ip
query
filter job src ip
No
string
filter_job_src_port
query
filter job src port
No
string
filter_job_dest_ip
query
filter job dest ip
No
string
filter_job_dest_port
query
filter job dest port
No
string
filter_job_status
query
filter job status
No
string
order_by
query
order by
No
string
Security Schema
Scopes
ApiKeyAuth
get subscription job list.
Name
Located in
Description
Required
Schema
filter_job_id
query
filter job id
No
string
filter_job_src_ip
query
filter job src ip
No
string
filter_job_src_port
query
filter job src port
No
string
filter_job_dest_ip
query
filter job dest ip
No
string
filter_job_dest_port
query
filter job dest port
No
string
filter_job_status
query
filter job status
No
string
order_by
query
order by
No
string
Security Schema
Scopes
ApiKeyAuth
get sync job list.
Name
Located in
Description
Required
Schema
filter_job_id
query
filter job id
No
string
filter_job_src_ip
query
filter job src ip
No
string
filter_job_src_port
query
filter job src port
No
string
filter_job_dest_ip
query
filter job dest ip
No
string
filter_job_dest_port
query
filter job dest port
No
string
filter_job_status
query
filter job status
No
string
order_by
query
order by
No
string
Security Schema
Scopes
ApiKeyAuth
reload log level dynamically.
Name
Located in
Description
Required
Schema
dtle_log_level
formData
dtle log level
Yes
string
Security Schema
Scopes
ApiKeyAuth
user loginV2
user login
create base64Captcha
create base64Captcha
Name
Located in
Description
Required
Schema
captcha_type
formData
captcha type
Yes
string
/v2/loginWithoutVerifyCode
user LoginWithoutVerifyCodeV2
user login Without Verify Code
get progress of tasks within an allocation.
Name
Located in
Description
Required
Schema
allocation_id
query
allocation id
Yes
string
task_name
query
task name
Yes
string
nomad_http_address
query
nomad_http_address is the http address of the nomad that the target dtle is running with. ignore it if you are not sure what to provide
No
string
Security Schema
Scopes
ApiKeyAuth
list columns of mysql source instance.
Name
Located in
Description
Required
Schema
mysql_host
query
mysql host
Yes
string
mysql_port
query
mysql port
Yes
string
mysql_user
query
mysql user
Yes
string
mysql_password
query
mysql password
Yes
string
mysql_schema
query
mysql schema
Yes
string
mysql_table
query
mysql table
Yes
string
mysql_character_set
query
mysql character set
No
string
is_mysql_password_encrypted
query
indecate that mysql password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
/v2/mysql/instance_connection
connect to mysql instance.
Name
Located in
Description
Required
Schema
mysql_host
query
mysql host
Yes
string
mysql_port
query
mysql port
Yes
string
mysql_user
query
mysql user
Yes
string
mysql_password
query
mysql password
Yes
string
is_mysql_password_encrypted
query
indecate that mysql password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
list schemas of mysql source instance.
Name
Located in
Description
Required
Schema
mysql_host
query
mysql host
Yes
string
mysql_port
query
mysql port
Yes
string
mysql_user
query
mysql user
Yes
string
mysql_password
query
mysql password
Yes
string
mysql_character_set
query
mysql character set
No
string
is_mysql_password_encrypted
query
indecate that mysql password is encrypted or not
No
boolean
Security Schema
Scopes
ApiKeyAuth
get node list.
Security Schema
Scopes
ApiKeyAuth
create Role.
Security Schema
Scopes
ApiKeyAuth
delete Role.
Name
Located in
Description
Required
Schema
tenant
formData
tenant
Yes
string
name
formData
role name
Yes
string
Security Schema
Scopes
ApiKeyAuth
get role list.
Name
Located in
Description
Required
Schema
filter_tenant
query
filter tenant
No
string
Security Schema
Scopes
ApiKeyAuth
update Role info.
Security Schema
Scopes
ApiKeyAuth
get tenant list.
Security Schema
Scopes
ApiKeyAuth
create user.
Security Schema
Scopes
ApiKeyAuth
get current user.
Security Schema
Scopes
ApiKeyAuth
delete user.
Name
Located in
Description
Required
Schema
tenant
formData
tenant
Yes
string
username
formData
user name
Yes
string
Security Schema
Scopes
ApiKeyAuth
get user list.
Name
Located in
Description
Required
Schema
filter_username
query
filter user name
No
string
filter_tenant
query
filter tenant
No
string
Security Schema
Scopes
ApiKeyAuth
list user action.
Security Schema
Scopes
ApiKeyAuth
reset user password.
Security Schema
Scopes
ApiKeyAuth
update user info.
Security Schema
Scopes
ApiKeyAuth
validate job config.
Security Schema
Scopes
ApiKeyAuth
Name
Type
Description
Required
dst_addr_list
[ string ]
No
dst_database_type
string
No
job_create_time
string
No
job_id
string
No
job_status
string
No
job_steps
[ common.JobStep ]
No
src_addr_list
[ string ]
No
src_database_type
string
No
topic
string
No
user
string
No
Name
Type
Description
Required
job_create_time
string
No
step_name
string
No
step_schedule
number
No
step_status
string
No
Name
Type
Description
Required
authority
string
No
name
string
No
object_type
string
No
object_users
[ string ]
No
tenant
string
No
Name
Type
Description
Required
create_time
string
No
password
string
No
remark
string
No
role
string
No
tenant
string
No
username
string
No
Name
Type
Description
Required
error
string
Error is a string version of any error that may have occured
No
validated
boolean
No
Name
Type
Description
Required
applier_tx_queue_size
integer
No
binlog_event_queue_size
integer
No
extractor_tx_queue_size
integer
No
send_by_size_full
integer
No
send_by_timeout
integer
No
Name
Type
Description
Required
action
string
No
text_cn
string
No
text_en
string
No
uri
string
No
Name
Type
Description
Required
data_scheme
string
No
id
string
No
message
string
No
Name
Type
Description
Required
message
string
No
models.ConnectionValidation
Name
Type
Description
Required
error
string
Error is a string version of any error that may have occured
No
validated
boolean
No
models.CreateOrUpdateMysqlToKafkaJobParamV2
Name
Type
Description
Required
dest_task
models.KafkaDestTaskConfig
Yes
failover
boolean
failover default:true
No
is_password_encrypted
boolean
No
job_id
string
Yes
retry
integer
No
src_task
models.SrcTaskConfig
Yes
task_step_name
string
No
models.CreateOrUpdateMysqlToKafkaJobRespV2
Name
Type
Description
Required
dest_task
models.KafkaDestTaskConfig
Yes
eval_create_index
integer
No
failover
boolean
failover default:true
No
is_password_encrypted
boolean
No
job_id
string
Yes
job_modify_index
integer
No
message
string
No
retry
integer
No
src_task
models.SrcTaskConfig
Yes
task_step_name
string
No
models.CreateOrUpdateMysqlToMysqlJobParamV2
Name
Type
Description
Required
dest_task
models.DestTaskConfig
Yes
failover
boolean
No
is_password_encrypted
boolean
No
job_id
string
Yes
retry
integer
No
reverse
boolean
No
src_task
models.SrcTaskConfig
Yes
task_step_name
string
No
models.CreateOrUpdateMysqlToMysqlJobRespV2
Name
Type
Description
Required
dest_task
models.DestTaskConfig
Yes
eval_create_index
integer
No
failover
boolean
No
is_password_encrypted
boolean
No
job_id
string
Yes
job_modify_index
integer
No
message
string
No
retry
integer
No
reverse
boolean
No
src_task
models.SrcTaskConfig
Yes
task_step_name
string
No
Name
Type
Description
Required
authority
string
No
name
string
No
operation_object_type
string
No
operation_users
[ string ]
No
tenant
string
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
pass_word
string
Yes
remark
string
No
role
string
Yes
tenant
string
Yes
username
string
Yes
Name
Type
Description
Required
message
string
No
models.CurrentCoordinates
Name
Type
Description
Required
file
string
No
gtid_set
string
No
position
integer
No
read_master_log_pos
integer
No
relay_master_log_file
string
No
retrieved_gtid_set
string
No
Name
Type
Description
Required
current_user
common.User
No
message
string
No
Name
Type
Description
Required
table_schema
string
No
table_schema_regex
string
No
table_schema_rename
string
No
tables
[ models.TableConfig ]
No
models.DatabaseConnectionConfig
Name
Type
Description
Required
database_type
string
Yes
host
string
Yes
password
string
Yes
port
integer
Yes
service_name
string
No
user
string
Yes
Name
Type
Description
Required
num
integer
No
time
integer
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
data_source
string
No
node_addr
string
No
node_id
string
No
source
string
No
models.GetTaskProgressRespV2
models.GtidModeValidation
Name
Type
Description
Required
error
string
Error is a string version of any error that may have occured
No
validated
boolean
No
Name
Type
Description
Required
delay
integer
No
job_create_time
string
No
job_id
string
No
job_status
string
No
job_steps
[ common.JobStep ]
No
subscription_topic
string
No
Name
Type
Description
Required
gtid
string
No
message
string
No
models.KafkaDestTaskConfig
Name
Type
Description
Required
kafka_broker_addrs
[ string ]
Yes
kafka_topic
string
Yes
message_group_max_size
integer
No
message_group_timeout
integer
No
node_id
string
No
task_name
string
Yes
Name
Type
Description
Required
authority
[ models.MenuItem ]
No
message
string
No
Name
Type
Description
Required
columns
[ string ]
No
message
string
No
models.LoginWithoutVerifyCodeReqV2
Name
Type
Description
Required
password
string
Yes
tenant
string
Yes
username
string
Yes
models.MenuItem
Name
Type
Description
Required
admin_only
boolean
No
id
integer
No
menu_level
integer
No
menu_url
string
No
name
string
No
operations
[ models.ButtonItem ]
No
parent_id
integer
No
text_cn
string
No
text_en
string
No
models.MysqlDestTaskConfig
Name
Type
Description
Required
dependency_history_size
integer
No
parallel_workers
integer
No
use_my_sql_dependency
boolean
No
models.MysqlSrcTaskConfig
Name
Type
Description
Required
auto_gtid
boolean
No
binlog_relay
boolean
No
expand_syntax_support
boolean
No
gtid
string
No
wait_on_job
string
No
models.MysqlTaskValidationReport
models.MysqlToKafkaJobDetailRespV2
models.MysqlToMysqlJobDetailRespV2
models.NatsMessageStatistics
Name
Type
Description
Required
in_bytes
integer
No
in_messages
integer
No
out_bytes
integer
No
out_messages
integer
No
reconnects
integer
No
Name
Type
Description
Required
datacenter
string
No
dtle_version
string
No
leader
boolean
No
member
boolean
No
node_address
string
No
node_id
string
No
node_name
string
No
node_status
string
No
node_status_description
string
No
nomad_version
string
No
models.OracleSrcTaskConfig
Name
Type
Description
Required
scn
integer
No
Name
Type
Description
Required
message
string
No
models.PrivilegesValidation
Name
Type
Description
Required
error
string
Error is a string version of any error that may have occured
No
validated
boolean
No
models.ResetPasswordReqV2
Name
Type
Description
Required
current_user_password
string
Yes
password
string
Yes
tenant
string
Yes
username
string
Yes
models.ResetPasswordRespV2
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
dest_user
string
No
dst_pwd
string
No
is_mysql_password_encrypted
boolean
No
src_pwd
string
No
src_user
string
No
Name
Type
Description
Required
message
string
No
models.ReverseStartRespV2
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
message
string
No
role_list
[ common.Role ]
No
Name
Type
Description
Required
schema_name
string
No
tables
[ models.TableItem ]
No
models.ServerIDValidation
Name
Type
Description
Required
error
string
Error is a string version of any error that may have occured
No
validated
boolean
No
Name
Type
Description
Required
chunk_size
integer
No
drop_table_if_exists
boolean
No
group_max_size
integer
No
group_timeout
integer
No
mysql_src_task_config
models.MysqlSrcTaskConfig
No
oracle_src_task_config
models.OracleSrcTaskConfig
No
repl_chan_buffer_size
integer
No
skip_create_db_table
boolean
No
Name
Type
Description
Required
column_map_from
[ string ]
No
table_name
string
No
table_regex
string
No
table_rename
string
No
where
string
No
Name
Type
Description
Required
table_name
string
No
Name
Type
Description
Required
event_type
string
No
message
string
No
setup_error
string
No
time
string
No
Name
Type
Description
Required
address
string
No
allocation_id
string
No
node_id
string
No
target
string
No
task_events
[ models.TaskEvent ]
No
Name
Type
Description
Required
message
string
No
tenant_list
[ string ]
No
Name
Type
Description
Required
num
integer
No
time
integer
No
models.UpdataLogLevelRespV2
Name
Type
Description
Required
dtle_log_level
string
No
message
string
No
Name
Type
Description
Required
authority
string
No
name
string
No
operation_object_type
string
No
operation_users
[ string ]
No
tenant
string
No
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
remark
string
No
role
string
Yes
tenant
string
Yes
username
string
Yes
Name
Type
Description
Required
message
string
No
Name
Type
Description
Required
message
string
No
user_list
[ common.User ]
No
Name
Type
Description
Required
captcha
string
Yes
captcha_id
string
Yes
password
string
Yes
tenant
string
Yes
username
string
Yes
Name
Type
Description
Required
token
string
No
Name
Type
Description
Required
driver_config_validated
boolean
DriverConfigValidated indicates whether the agent validated the driver
No
job_validation_error
string
No
job_validation_warning
string
No
message
string
No
mysql_task_validation_report
[ models.MysqlTaskValidationReport ]
config
No