🎉 CloudCanal 上线 V6.6.0.0:开放 TDSQL PostgreSQL 链路,优化 Kudu DDL 同步能力
跳到主要内容

列名列表

接口描述​

获取表的列,以便创建任务时选取需要的列

接口地址​

/cloudcanal/console/api/v1/openapi/datasource/listcols

请求方式​

POST

请求参数​

参数名称参数说明请求类型是否必须数据类型
clusterId尝试连接数据源的机器集群idbody是long
dataSourceId目标数据源idbody是long
hostType所选数据源网络类型

PRIVATE(内网)
PUBLIC(公网)
body是string
schemas是一个符合结构数组,具体说明如下body是string

schema 复合结构说明

参数名称参数说明请求类型是否必须数据类型
dbdatabase 名称,关系型数据库不为空body是string
schemaschema 名称,MySQL 为空body否string
tables表名列表body是string

schema 复合结构示例

{
"schemas": [
{
"db": "",
"schema": "",
"tables": []
}
]
}

公共响应结果​

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

data 参数说明​

参数名称参数说明类型(java)不为空
tableMetaDataMap包含多个库,多个表 中的列信息string否
noPkTableNameList没有主键的表列表string是
numberOfShardskudu 数据源有效string否
numberOfReplicaskudu 数据源有效string否

列信息说明

参数名称参数说明类型(java)不为空
columnName列名称string是
dataTypeWithLength带长度描述的数据类型string否
isNullable是否可为nullboolean是
dataType数据类型string是
sqlTypeIntValue类型长度int否
jdbcTypejdbc类型string否
timePrecision时间精度int否
characterMaxLength字符串长度string否
numberPrecision数字精度int否
numberScale数字scaleint否
esAnalyzerTypeElasticSearch 分词器类型string否
needIndexElasticSearch field是否需要索引string否
timeFormat时间格式string否
pk是否是主键boolean是

响应示例​

{
"requestId": "6fd787d4-2bdf-11ec-b616-5141902f97d8",
"code": "1",
"msg": "request success",
"data": {
"tableMetaDataMap": {
"console": {
"worker_stats": [
{
"columnName": "id",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "BIGINT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": null,
"numberPrecision": 19,
"numberScale": 0,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": true
},
{
"columnName": "gmt_create",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "DATETIME",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": 0,
"characterMaxLength": null,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "worker_id",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "BIGINT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": null,
"numberPrecision": 19,
"numberScale": 0,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "cpu_stat",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "TEXT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 65535,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "mem_stat",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "TEXT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 65535,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "disk_stat",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "TEXT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 65535,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
}
],
"cluster": [
{
"columnName": "id",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "BIGINT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": null,
"numberPrecision": 19,
"numberScale": 0,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": true
},
{
"columnName": "gmt_create",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "DATETIME",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": 0,
"characterMaxLength": null,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "gmt_modified",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "DATETIME",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": 0,
"characterMaxLength": null,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "cluster_name",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 128,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "region",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 64,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "cloud_or_idc_name",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 128,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "console_host",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 255,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "zk_host",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 255,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "cluster_desc",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 128,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "uid",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 255,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
}
]
},
"dingtax": {
"kbs_new_create": [
{
"columnName": "id",
"dataTypeWithLength": null,
"isNullable": "yes",
"dataType": "BIGINT",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": null,
"numberPrecision": 19,
"numberScale": 0,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": true
},
{
"columnName": "name",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "VARCHAR",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": null,
"characterMaxLength": 244,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
},
{
"columnName": "new_col",
"dataTypeWithLength": null,
"isNullable": "no",
"dataType": "DATETIME",
"sqlTypeIntValue": 0,
"jdbcType": null,
"timePrecision": 0,
"characterMaxLength": null,
"numberPrecision": null,
"numberScale": null,
"esAnalyzerType": null,
"needIndex": null,
"timeFormat": null,
"pk": false
}
]
}
},
"noPkTableNameList": {},
"numberOfShards": null,
"numberOfReplicas": null
}
}
联系我们
微信二维码

扫码添加微信,获取技术支持