跳到主要内容

数据源列表

接口描述

获取数据源列表,以便任务创建选择正确的源端和目标端数据源

接口地址

/cloudcanal/console/api/v1/openapi/datasource/listds

请求方式

POST

请求参数

参数名称参数说明请求类型是否必须数据类型
dataSourceId数据源idbodylong
deployType数据源部署类型

SELF_MAINTENANCE(自建)
ALIBABA_CLOUD_HOSTED(阿里云)
bodystring
hostType数据源默认网络类型

PRIVATE(内网)
PUBLIC(公网)
bodystring
lifeCycleState数据源状态

CREATING(创建中)
CREATED(已创建)
DELETING(删除中)
DELETED(已删除)
LOCKED(已锁定)
bodystring
type数据源类型

MySQL
PolarDbMySQL
PolarDbX
PostgreSQL
Greenplum
Oracle
SQLServer
Redis
MongoDB
Kafka
RocketMQ
RabbitMQ
Hive
ElasticSearch
DRDS
AdbForMySQL
TiDB
ClickHouse
Kudu
bodystring

公共响应结果

参数名称参数说明类型(java)不为空
code1:成功 0:失败string
dataobject
msgstring
requestIdstring

data 参数说明

data 为数组,其中每一组数据中的字段说明如下:

参数名称参数说明类型(java)不为空
id主键Long
gmtCreate创建时间String
gmtModified修改时间String
uid数据源拥有者uidString
owner数据源拥有者String
deployType数据源部署类型

SELF_MAINTENANCE(自建)
ALIBABA_CLOUD_HOSTED(阿里云)
String
region数据源所在区域

hangzhou
shanghai
beijing
shenzhen
qingdao
zhangjiakou
huhehaote
hongkong
singapore
silicon_valley
london
mq_internet_access
customer
String
dataSourceType数据源类型

MySQL
PolarDbMySQL
PolarDbX
PostgreSQL
Greenplum
Oracle
SQLServer
Redis
MongoDB
Kafka
RocketMQ
RabbitMQ
Hive
ElasticSearch
DRDS
AdbForMySQL
TiDB
ClickHouse
Kudu
String
privateHost内网hostString
publicHost公网hostString
hostType数据源默认网络类型

PRIVATE(内网)
PUBLIC(公网)
String
instanceDesc数据源描述String
version数据源版本String
instanceId实例idString
schemaJson库表列结构(json),见 DataJob 相关 API 描述String
consoleJobId当前异步任务idLong
consoleTaskState当前异步任务状态

WAIT_START(等待启动)
EXECUTE(执行中)
SUCCESS(成功)
FAILED(失败)
CANCELED(已取消)
SKIP(忽略)
String
accountName账号String
lifeCycleState数据源状态

CREATING(创建中)
CREATED(已创建)
DELETING(删除中)
DELETED(已删除)
LOCKED(已锁定)
String
securityType数据源安全密钥类型

KERBEROS
USER_PASSWD_WITH_TLS
USER_PASSWD
ONLY_USER
ONLY_PASSWD
NONE
String

响应示例

{
"requestId": "ca5fa39b-2b56-11ec-8c7e-27997c09a959",
"code": "1",
"msg": "request success",
"data": [
{
"id": 15,
"gmtCreate": "2021-05-07T10:11:47.000+0000",
"gmtModified": "2021-06-07T09:50:28.000+0000",
"uid": "4503980488230169",
"owner": "liqiang",
"deployType": "SELF_MAINTENANCE",
"region": "customer",
"dataSourceType": "PostgreSQL",
"privateHost": "192.168.0.152:50402",
"publicHost": "",
"hostType": "PRIVATE",
"instanceDesc": "12.4",
"version": "12.4 (Debian 12.4-1.pgdg100+1)",
"instanceId": "pg-3fjo4n2tmli9cfk",
"schemaJson": null,
"consoleJobId": 0,
"consoleTaskState": null,
"accountName": "postgres",
"lifeCycleState": "CREATED",
"securityType": "USER_PASSWD"
},
{
"id": 1,
"gmtCreate": "2021-03-26T04:07:23.000+0000",
"gmtModified": "2021-09-14T11:11:39.000+0000",
"uid": "4503980488230169",
"owner": "liqiang",
"deployType": "SELF_MAINTENANCE",
"region": "customer",
"dataSourceType": "MySQL",
"privateHost": "127.0.0.1:4306",
"publicHost": "",
"hostType": "PRIVATE",
"instanceDesc": "local target",
"version": "5.7.27-log",
"instanceId": "my-dc1l0m2cfdtrrhq",
"schemaJson": null,
"consoleJobId": 0,
"consoleTaskState": null,
"accountName": "root",
"lifeCycleState": "CREATED",
"securityType": "USER_PASSWD"
}
]
}