This API operation 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
FAILEDstate.obshell can cancel only an unfinished task.
The obshell server verifies the security of requests to this API operation. For more information, see Hybrid encryption for API operations.
Request path
POST /api/v1/task/dag/{id}
Request parameters
| Parameter | Type | Required? | Example value | Description |
|---|---|---|---|---|
| operator | String | Yes | "ROLLBACK" | The operation to be performed on the specified task. Valid values:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | time.Time | 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 | ApiError | The error caused by the request, which contains the following information:
|
Examples
Sample request
POST 10.10.10.1:2886/api/v1/task/22130706433028869
{
"operator": "ROLLBACK"
}
22130706433028869 is the general ID of a failed Initialize cluster task.
Sample response
The following is a sample success response to the request. To view the operation result, query the task information.
{
"successful": true,
"timestamp": "2024-01-10T14:44:28.366402356+08:00",
"duration": 1,
"status": 200,
"traceId": "7e77b2ba9ee2fa66"
}
References
In addition to using the CLI, you can use SDKs to call the API operation.
For more information about how to call the API operation by using obshell-sdk-python, see Operate a task.
For more information about how to call the API operation by using obshell-sdk-go, see Operate a task.