BladePipe 1.13.0: Custom message parsing and faster Binlog processing.
跳到主要内容

Upload Jar Package

Interface Overview​

Upload a custom jar package to the specified DataJob. The package is only stored and does not take effect automatically.

Interface Address​

/cloudcanal/console/api/v1/openapi/jarpackage/upload

Request Manner​

POST

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

Request Parameters​

ParameterNameParameter DescriptionRequestTypeWhether RequiredDataType
dataJobIdDataJob IDBodyTruelong
descriptionJar package description, must not be blankBodyTruestring
customPkgFileJar package file, only the .jar suffix is supportedmultipartTruefile

Public Response Results​

ParameterNameParameter DescriptionType(Java)NotNull
code1: Success, others: FailurestringTrue
dataID of the new jar packagelongFalse
msgResponse messagestringFalse
requestIdRequest IDstringTrue
信息

Whether the request succeeds is determined by code: 1 for success, 0001 for a business exception, 0002 for parameter validation failure. See msg for details.

Data Parameter Description​

data returns the ID of the new jar package directly, no nested object, and is used by the activate interface.

ParameterNameParameter DescriptionType(Java)NotNull
dataID of the new jar packagelongTrue
信息

After a successful upload the package is inactive. Call Activate Jar Package and restart the DataJob for it to take effect. Multiple jar packages can be uploaded to the same DataJob.

Request Example​

With the custom package custom-code.jar, send the request:

curl --request POST \
"${CONSOLE_URL}/cloudcanal/console/api/v1/openapi/jarpackage/upload" \
--header "AccessKeyId: ${ACCESS_KEY_ID}" \
--header "SignatureMethod: HmacSHA1" \
--header "SignatureNonce: ${SIGNATURE_NONCE}" \
--header "Signature: ${SIGNATURE}" \
--form 'dataJobId=1' \
--form 'description=test package' \
--form 'customPkgFile=@./custom-code.jar;type=application/java-archive'

Response Example​

{
"requestId": "9181193f-2be3-11ec-b616-231d2f6b0021",
"code": "1",
"msg": "request success",
"data": 10
}