BladePipe 1.12.0: New TDSQL PostgreSQL pipelines and expanded Kudu target support.
跳到主要内容

Create DataJob with Custom Package

Interface Overview​

Create data migration, synchronization, verification, and correction tasks and upload a custom JAR package.

The task creation parameters are the same as those of Create DataJob. Submit the JSON task parameters and the package file together using multipart/form-data.

Interface Address​

/cloudcanal/console/api/v1/openapi/datajob/createwithpackage

Request Manner​

POST

The request Content-Type is multipart/form-data.

Request Parameters​

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
dataThe part's Content-Type is application/json.multipartTrueobject
customPkgFileOnly .jar files are supported.multipartFalsefile
信息

Public Response Results​

ParameterNameParameter DescriptionType(Java)NotNull
code1: Success, 0: FailurestringTrue
dataID of the newly created DataJoblongFalse
msgResponse messagestringFalse
requestIdRequest IDstringTrue

Request Example​

DataJob creation parameters in a local data.json file and prepare the custom package custom-code.jar, then send the request:

curl --request POST \
"${CONSOLE_URL}/cloudcanal/console/api/v1/openapi/datajob/createwithpackage" \
--header "AccessKeyId: ${ACCESS_KEY_ID}" \
--header "SignatureMethod: HmacSHA1" \
--header "SignatureNonce: ${SIGNATURE_NONCE}" \
--header "Signature: ${SIGNATURE}" \
--form 'data=@./data.json;type=application/json' \
--form 'customPkgFile=@./custom-code.jar;type=application/java-archive'

Response Example​

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