Skip to main content

Get Count of Databases and Tables

Interface Overview

Gets the number of database tables to quickly filter out empty libraries

Interface Address

/cloudcanal/console/api/v1/openapi/datasource/schemastablecount

Request Manner

POST

Request Parameters

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

PRIVATE (intranet)
PUBLIC (Internet)
BodyTrueString
schemasAn array of structures, as described belowBodyTrueString

schema Description of the composite structure

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
dbName of the database, not empty for relational databasesBodyTrueString
schemaName of the schema, empty for MySQLBodyFalseString

schema Composite structure example

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

Public response result

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

Data Parameter

| ParameterName | Parameter Description | Type(Java) | NotNull |

key Parameter Description

ParameterNameParameter DescriptionType(Java)NotNull
dbNameName of the database, not empty for relational databasesStringFalse
schemaName of the schema, empty for MySQLStringFalse

Response Example

{
"requestId": "ad6d0db7-2bdb-11ec-b616-2bc3f3f1c79f",
"code": "1",
"msg": "request success",
"data": {
"{\"dbName\":\"console\",\"schema\":null}": 45,
"{\"dbName\":\"dingtax\",\"schema\":null}": 26
}
}