This API is used to roll back, retry, cancel, or skip a task.
Call description
Limitations
OceanBase Shell (OBShell) can roll back, retry, or skip a task only if it is in the FAILED state. OBShell can cancel a task only if it is unfinished.
Request path
POST /api/v1/task/dag/{id}
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| operator | String | Yes | "ROLLBACK" | The operator of the operation to be performed on the specified task. |
The following table describes the operators corresponding to different operations.
| Operator | Operation |
|---|---|
| "ROLLBACK" | Rolls back the task. |
| "RETRY" | Retries the task. |
| "PASS" | Skips the task. |
| "CANCEL" | Cancels the task. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. |
| error | Object | The information about the error that occurred. |
Examples
Sample request
POST xxx.xxx.x.x:2886/api/v1/task/22130706433028869
{
"operator": "ROLLBACK"
}
22130706433028869 is the general ID of a failed Initialize cluster task.
Sample response
{
"successful": true,
"timestamp": "2024-01-10T14:44:28.366402356+08:00",
"duration": 1,
"status": 200,
"traceId": "7e77b2ba9ee2fa66"
}
The sample response displays a successful result of the request. To view the operation result, query the task information.