Description
You can call this operation to cancel an ongoing subtask and mark it as failed.
Call description
Prerequisite
You have the TASK_MANAGER permissions.
Request path
POST /api/v2/tasks/instances/{taskInstanceId}/subtasks/{subtaskInstanceId}/cancel
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| taskInstanceId | Long | Yes | 1000 | The ID of the task instance. |
| subtaskInstanceId | Long | Yes | 10001 | The ID of the subtask instance. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Examples
Sample request
POST api/v2/tasks/instances/100/subtasks/1000/cancel
Sample response
{
"duration": 55,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T15:10:13.176+08:00",
"traceId": "0bc49000675d41af"
}