Skip to content

Callback service

1. Callback notification

Request method:POST

Request data type:application/json

Supported version:v1.7.5

Description:

After task execution is completed, the final result will be notified through the callback address [ callbackUrl ] provided when the task was issued

The notification request method is [ POST ]; the interface must return 200

Number of call failure retries 3

Notification parameters:

Parameter name Parameter description Type Description
jobId Task ID string
uuid Corresponding operation object uuid string generally refers to the uuid of the operated resource (for example board card/container, etc.)
methodDesc Task type string Task type, for example: create container
method Task method string Task method, for example: createArmCardContainer
backupUuid Backup uuid string Returned only when creating a backup task
sn sn string
status Task status code integer 2:execution succeeded -1:execution failed
code Response code integer
message Execution result description string
data Specific execution content object
  stdOut Execution content output list
  stdErr Execution error output list
beginTime Task start time string
endTime Task end time string

Request parameter example:

{
    "jobId": "ec1c2ac1d5e544428c66a0f4f0d9f603",
    "methodDesc":"创建容器",
    "method":""createArmCardContainer,
    "code": 0,
    "data": {
        "stdOut": [
            "/"
        ],
        "stdErr": [

        ]
    },
    "endTime": "2023-08-07 09:17:08.790",
    "beginTime": "2023-08-07 09:17:08.656",
    "message": "任务执行成功",
    "uuid": "165b41ce26fd406cab7cac868262df44",
    "sn": "OR65M22QC1E223700085",
    "status": 2
}

API example:

@PostMapping("/notice")
public ResponseEntity<String> notice(@RequestBody JSONObject jsonObject) {
    log.info("notice:{}", jsonObject);
    return ResponseEntity.status(200).body("success");
}