Skip to main content

Create DataJob

Interface Overview

Create data migration, synchronization, verification, and correction tasks

Interface Address

/cloudcanal/console/api/v1/openapi/datajob/create

Request Manner

POST

Request Parameters

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
clusterIdCluster ID used to link to the data sourceBodyTrueLong
srcDsIdSource data source IDBodyTrueLong
srcHostTypeSource data source host type (PRIVATE or PUBLIC)BodyTrueString
srcSchemaDescription of source database table, see Data Source Schema DescriptionBodyTrueString
dstDsIdDestination data source IDBodyTrueLong
dstHostTypeDestination data source host type (PRIVATE or PUBLIC)BodyTrueString
dstSchemaDescription of destination database table, which can be calculated from srcSchema and mappingDef, and can be emptyBodyFalseString
mappingDefLibrary table mapping, see Mapping Rule DescriptionBodyTrueString
jobTypeTask type, please query through the Get Task Type interfaceBodyTrueString
initialSyncWhether to initialize data (full migration) if it is a data synchronization taskBodyFalseBoolean
shortTermNumIf there is short-term synchronization, how many days it lastsBodyFalseInt
shortTermSyncWhether short-term synchronization is required if it is a data migration taskBodyFalseBoolean
specIdSpecification IDBodyTrueInt
dataJobDescTask descriptionBodyFalseString
fullPeriodWhether it is a periodic full migrationBodyFalseBoolean
fullPeriodCronExprPeriodic full migration CronTab expressionBodyFalseString
autoStartWhether to start automaticallyBodyFalseBoolean
checkOnceWhether to perform a full data verification after catching up with incremental dataBodyFalseBoolean
checkPeriodWhether to perform periodic data verificationBodyFalseBoolean
checkPeriodCronExprCronTab expression for periodic data verificationBodyFalseString
dstCaseSensitiveTypeCase-sensitive type of destination metadata

UpperCase
LowerCase
Sensitive
NoSpecified
BodyFalseString
srcCaseSensitiveTypeCase-sensitive type of source metadata

UpperCase
LowerCase
Sensitive
NoSpecified
BodyFalseString
srcDsCharsetEncoding of the source data source, obtained through the "Get Encoding List Based on Data Source Type" APIBodyTrueString
tarDsCharsetEncoding of the target data source, obtained through the "Get Encoding List Based on Data Source Type" APIBodyTrueString
dstCkTableEngineTable engine selection for ClickHouse if the target is ClickHouse

CollapsingMergeTree
ReplacingMergeTree
BodyFalseString
dstMqDefaultTopicDefault topic for delivering newly added tables during full data migration if the target is a message queue (Kafka/RocketMQ)BodyFalseString
dstMqDefaultTopicPartitionsNumber of partitions for the default topicBodyFalseInteger
dstSchemaLessFormatData format for destination if it is a message (Kafka/RocketMQ) or cache (Redis)

CLOUDCANAL_JSON_FOR_MQ
CANAL_JSON_FOR_MQ
VALUE_JSON_FOR_CACHE
VALUE_COL_CAMEL_CASE_JSON_FOR_CACHE
BodyFalseString
srcSchemaLessFormatData format for source if it is a message (Kafka/RocketMQ) or cache (Redis)

CLOUDCANAL_JSON_FOR_MQ
CANAL_JSON_FOR_MQ
VALUE_JSON_FOR_CACHE
VALUE_COL_CAMEL_CASE_JSON_FOR_CACHE
BodyFalseString
filterDDLWhether to filter DDL synchronization

True: filter, False: do not filter
bodyTrueBoolean
kafkaConsumerGroupIdConsumer Group ID for the source if it is KafkaBodyFalseString
srcRabbitExchangeExchange for the source if it is RabbitMQBodyFalseString
srcRabbitMqVhostVHost for the source if it is RabbitMQBodyFalseString
srcRocketMqGroupIdGroup ID for the source if it is RocketMQBodyFalseString
keyConflictStrategyHow to handle primary key or unique key conflicts if the target is a relational database

IGNORE
REPLACE
EXCEPTION (not supported yet)
bodyFalseString
kuduNumReplicasNumber of replicas for Kudu if the target is KuduBodyFalseInteger
schemaWhiteListLevelWhitelist level. If empty, defaults to full whitelist mode (except for column change operations). Currently supports DB level and no value set.

NONE
DB
SCHEMA
TABLE
BodyFalseString
structMigrationWhether to perform schema migration. If there is an item in srcSchema with targetAutoCreate set to true, this value is set to trueBodyTrueBoolean

Public Response Results

ParameterNameParameter DescriptionType(Java)NotNull
code1: Success, 0: FailureStringTrue
dataObjectFalse
msgStringFalse
requestIdStringTrue

Data parameter description

data is a number that indicates the id of the task being created. You can query the task record with this id to obtain the id of the asynchronous task, and then query the asynchronous task to learn about the creation process.

Response Example

{
"requestId": "422622b9-2bf5-11ec-8b3e-172e4c81a5c3",
"code": "1",
"msg": "request success",
"data": 123243
}