Skip to main content

List Tables

Interface Overview

Gets a list of database tables so you can select the tables to be migrated and synchronized when creating a task.

Interface Address

/cloudcanal/console/api/v1/openapi/datasource/listtables

Request Manner

POST

Request Parameters

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
clusterIdCluster ID of the machine set that attempts to connect to the data sourceBodyTrueLong
dataSourceIdID of the target data sourceBodyTrueLong
hostTypeSelected data source network type

PRIVATE (intranet)
PUBLIC (internet)
BodyTrueString
dbNameDatabase name, required depending on the type of data source, required for relational databasesBodyFalseString
schemaSchema name, required depending on the type of data sourceBodyFalseString

Public response result

ParameterNameParameter DescriptionType(Java)NotNull
code1: success, 0: failureStringTrue
dataObjectFalse
msgStringFalse
requestIdStringTrue

Data Parameter

data is an array whose parameters are described as follows:

ParameterNameParameter DescriptionType(Java)NotNull
dbNameName of the database to which the table belongsStringFalse
schemaNameName of the schema to which the table belongsStringFalse
tableNameFor relational databases, this is the table name; for messaging, it is the topic; for MongoDB, it is the collection; for caching, it is the namespaceStringTrue
hasPkIndicates whether the table has a primary keyBooleanFalse
indexMetaIf the data source is Elasticsearch, there may be non-null valuesStringFalse
mqTopicPartitionsIf the data source is a message middleware that supports partitions (such as Kafka, RocketMQ, etc.), this indicates the topic partition valueintFalse

Response Example

{
"requestId": "3962501d-2bd7-11ec-b616-c1fbb3356577",
"code": "1",
"msg": "request success",
"data": [
{
"dbName": "console",
"schemaName": "",
"tableName": "alert_config_detail",
"hasPk": true,
"indexMeta": null,
"mqTopicPartitions": 0
},
{
"dbName": "console",
"schemaName": "",
"tableName": "alert_event_log",
"hasPk": true,
"indexMeta": null,
"mqTopicPartitions": 0
},
{
"dbName": "console",
"schemaName": "",
"tableName": "aliyun_sts_token",
"hasPk": true,
"indexMeta": null,
"mqTopicPartitions": 0
}
]
}