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
| ParameterName | Parameter Description | RequestType | Whether Required | DataType |
|---|---|---|---|---|
| dataJobId | DataJob ID | Body | True | long |
| description | Jar package description, must not be blank | Body | True | string |
| customPkgFile | Jar package file, only the .jar suffix is supported | multipart | True | file |
Public Response Results
| ParameterName | Parameter Description | Type(Java) | NotNull |
|---|---|---|---|
| code | 1: Success, others: Failure | string | True |
| data | ID of the new jar package | long | False |
| msg | Response message | string | False |
| requestId | Request ID | string | True |
信息
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.
| ParameterName | Parameter Description | Type(Java) | NotNull |
|---|---|---|---|
| data | ID of the new jar package | long | True |
信息
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
}