Skip to main content

List Columns

Interface Overview

Gets the columns of the table so that you can select the columns you want when creating a task

Interface Address

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

Request Manner

POST

Request Parameters

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
clusterIdCluster ID of the machine group attempting to connect to the data sourceBodyTrueLong
dataSourceIdTarget data source IDBodyTrueLong
hostTypeSelected network type of the data source

PRIVATE (for intranet)
PUBLIC (for public internet)
BodyTrueString
schemasAn array that conforms to the structure, details are as followsBodyTrueString

Schema composite structure specification

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
dbName of the database. For relational databases, this field cannot be emptyBodyTrueString
schemaName of the schema. For MySQL, this field can be emptyBodyFalseString
tablesList of table namesBodyTrueString

Schema composite structure example

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

Public Response Results

ParameterNameParameter DescriptionType(Java)NotNull
code1: success 0: failureStringTrue
data-ObjectFalse
msgStringFalse
requestIdStringTrue

Data Parameter

ParameterNameParameter DescriptionType(Java)NotNull
tableMetaDataMapColumn information for multiple databases and tablesStringFalse
noPkTableNameListList of tables without primary keysStringTrue
numberOfShardsValid for Kudu data sourceStringFalse
numberOfReplicasValid for Kudu data sourceStringFalse

Column information specification

ParameterNameParameter DescriptionType(Java)NotNull
columnNameColumn nameStringTrue
dataTypeWithLengthData type with length descriptionStringFalse
isNullableWhether the column can be nullBooleanTrue
dataTypeData typeStringTrue
sqlTypeIntValueType lengthintFalse
jdbcTypeJDBC typeStringFalse
timePrecisionTime precisionintFalse
characterMaxLengthString lengthStringFalse
numberPrecisionNumeric precisionintFalse
numberScaleNumeric scaleintFalse
esAnalyzerTypeElasticSearch analyzer typeStringFalse
needIndexWhether the ElasticSearch field needs to be indexedStringFalse
timeFormatTime formatStringFalse
pkWhether the column is a primary keyBooleanTrue

Response Example

{
"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
}
}