Skip to main content

PreCheck DataJob(Basic)

Interface Overview

Basic verification of task information, including connectivity, basic parameters, and permissions

Interface Address

/cloudcanal/console/api/v1/openapi/datajob/precheckbasic

Request Manner

POST

Request Parameters

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
clusterIdThe ID of the cluster that the data source is linked toBodyTrueLong
srcDsIdThe ID of the source data sourceBodyTrueLong
srcHostTypeThe host type of the source data source

PRIVATE
PUBLIC
BodyTrueString
srcSchemaThe description of the source database table, as shown in the exampleBodyTrueString
dstDsIdThe ID of the target data sourceBodyTrueLong
dstHostTypeThe host type of the target data source

PRIVATE
PUBLIC
BodyTrueString
dstSchemaThe description of the target database table, which can be calculated based on srcSchema and mappingDef, and can be emptyBodyFalseString
mappingDefThe mapping of the database table, as shown in the exampleBodyTrueString
jobTypeThe type of the job, which can be obtained through the Get Data Job Types interfaceBodyTrueString
initialSyncWhether to initialize data (full migration) if it is a data synchronization taskBodyFalseBoolean
shortTermNumHow many days the short-term synchronization lasts if there is short-term synchronizationBodyFalseInt
shortTermSyncWhether to perform short-term synchronization if it is a data migration taskBodyFalseBoolean
specIdThe specification IDBodyTrueInt
fullPeriodWhether it is periodic full migrationBodyFalseBoolean
fullPeriodCronExprThe CronTab expression of periodic full migrationBodyFalseString
autoStartWhether to start automaticallyBodyFalseBoolean
checkOnceWhether to perform a full data verification once the incremental sync catches upBodyFalseBoolean
checkPeriodWhether it is periodic verificationBodyFalseBoolean
checkPeriodCronExprThe CronTab expression of periodic verificationBodyFalseString

SrcSchema Description (MySQL)

Different data source schemas have different field descriptions. You need to consult the product team for more source data sources.

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
dbMapping method

DB_DB
SCHEMA_SCHEMA
TABLE_TABLE
COLUMN_COLUMN
DB_SCHEMA
SCHEMA_DB
DB_TOPIC
TABLE_TOPIC
TOPIC_TABLE
TOPIC_INDEX
ANY_DB
TABLE_INDEX
TABLE_KEYPREFIX
BodyTrueString
dbPatternNested multi-level mapping relationship, recognized according to whether method or parent is emptyBodyFalseString
tablesTables owned by the databaseBodyTrueString
targetAutoCreateWhether the target needs to be created automaticallyBodyTrueString
inBlackListWhether it is in the blacklist (not synchronized or migrated)BodyTrueString
[
{
"db": "dingtax",
"dbPattern": "",
"tables": [],
"targetAutoCreate": false,
"inBlackList": false
}
]

MappingDef Description

mappingDef is an array, with each group representing a mapping

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
methodMapping method

DB_DB
SCHEMA_SCHEMA
TABLE_TABLE
COLUMN_COLUMN
DB_SCHEMA
SCHEMA_DB
DB_TOPIC
TABLE_TOPIC
TOPIC_TABLE
TOPIC_INDEX
ANY_DB
TABLE_INDEX
TABLE_KEYPREFIX
BodyTrueString
serializeMappingNested multi-level mapping relationship, recognized according to whether method or parent is emptyBodyFalseString
serializeAutoGenRulesSpecifies the mapping rulesBodyTrueString
commonGenRuleCommon mapping rulesBodyTrueString

Example of mappingDef (MySQL -> PostgreSQL)

[
{
"method": "DB_SCHEMA",
"serializeMapping": {
"{\"value\":\"dingtax\"}": "{\"parent\":{\"value\":\"dingtax_target\"},\"value\":\"public\"}"
},
"serializeAutoGenRules": {},
"commonGenRule": "MIRROR"
},
{
"serializeMapping": {},
"method": "TABLE_TABLE",
"serializeAutoGenRules": {},
"commonGenRule": "MIRROR"
},
{
"method": "COLUMN_COLUMN",
"serializeMapping": {},
"serializeAutoGenRules": {},
"commonGenRule": "MIRROR"
}
]

Public Response Results

ParameterNameParameter DescriptionType(Java)NotNull
code1: succeeded, 0: failedStringTrue
dataObjectFalse
msgStringFalse
requestIdStringTrue

Data Parameter Description

data is an array. Each item in the array represents a check item. Check item parameters are described as follows

ParameterNameParameter DescriptionType(Java)NotNull
titleTest item nameTrueLong
passRequirementCondition for test item to passTrueString
varNameParameter nameFalseString
varRequireValuesRequired values for parameterFalseString
varActualValueActual value of parameterFalseString
preCheckTypeCheck type
CONNECTIVITY (connectivity)
VERSION (version)
BINLOG_EXISTENCE (existence of incremental logs)
PRIVILEGES (privileges)
STRUCT_TABLE_STORAGE (table storage)
STRUCT_TABLE_PK (primary key)
STRUCT_TABLE_CHARSET (table character set)
STRUCT_TABLE_COLLATION (table collation)
STRUCT_TABLE_FK (foreign key)
STRUCT_EXISTENCE (existence of database, tables, and columns)
VARIABLES (database parameters)
SPEC_SCHEDULE_SUPPORT (capacity sufficiency)
INCREMENT_BALANCE (incremental license)
FULL_BALANCE (full license)
CHECK_BALANCE (verification license)
STRUCT_BALANCE (schema migration license)
NAME_LENGTH (metadata name length)
INDEX_COLUMN (index column)
COLUMN_TYPE (column type)
VERSION_COMPATIBILITY (version compatibility)
FalseString
successWhether the item passed precheckFalseString
checkedWhether the item has been precheckedFalseInteger
contextDbNameDatabase associated with the checkFalseInteger
contextTableNameTable associated with the checkFalseString
contextColumnNameColumn associated with the checkFalseString

Response Example

{
"requestId": "422622b9-2bf5-11ec-8b3e-172e4c81a5c3",
"code": "1",
"msg": "request success",
"data": [
{
"title": "Source-end database connection test",
"passRequirement": "The database can be linked",
"varName": null,
"varRequireValues": null,
"varActualValue": null,
"preCheckType": "CONNECTIVITY",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "Check the source database version",
"passRequirement": "Support 5.1.x,5.5.x,5.6.x,5.7.x,8.x MySQL",
"varName": null,
"varRequireValues": null,
"varActualValue": null,
"preCheckType": "VERSION",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "PRECHECK_PRIVS_SOURCE_SELECT_TITLE",
"passRequirement": "Requires database dingtax select permission",
"varName": null,
"varRequireValues": [
"select"
],
"varActualValue": null,
"preCheckType": "PRIVILEGES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "Check for parameter 'log bin'",
"passRequirement": "The 'log_bin' parameter must be 1",
"varName": "log_bin",
"varRequireValues": [
"1"
],
"varActualValue": "1",
"preCheckType": "VARIABLES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "The 'binlog format' parameter is checked",
"passRequirement": "The 'binlog format' parameter must be 'ROW'",
"varName": "binlog_format",
"varRequireValues": [
"ROW"
],
"varActualValue": "ROW",
"preCheckType": "VARIABLES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "The 'binlog row image' parameter is checked",
"passRequirement": "The 'binlog row image' parameter must be 'FULL'",
"varName": "binlog_row_image",
"varRequireValues": [
"FULL"
],
"varActualValue": "FULL",
"preCheckType": "VARIABLES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "'replication client' permission check",
"passRequirement": "Requires 'replication client' permission",
"varName": null,
"varRequireValues": [
"replication client"
],
"varActualValue": null,
"preCheckType": "PRIVILEGES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "'replication slave' permission check",
"passRequirement": "The 'replication slave' permission is required",
"varName": null,
"varRequireValues": [
"replication slave"
],
"varActualValue": null,
"preCheckType": "PRIVILEGES",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
},
{
"title": "Pre-check the availability of task specifications",
"passRequirement": "The remaining available memory of the machine you add needs to meet the specifications of the selected task",
"varName": null,
"varRequireValues": null,
"varActualValue": null,
"preCheckType": "SPEC_SCHEDULE_SUPPORT",
"success": true,
"checked": true,
"contextDbName": null,
"contextTableName": null,
"contextColumnName": null
}
]
}