This API operation is used to query the information about a subtask.
Call description
Limitations
The OceanBase Shell (obshell) server verifies the security of requests to this API operation. For more information, see Hybrid encryption for API operations.
Request path
GET /api/v1/task/sub_task/{id}
Here, id indicates the general ID of the subtask.
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. |
| data | TaskDetailDTO | The information about the subtask. For more information, see the data structure of TaskDetailDTO. |
| error | ApiError | The error caused by the request, which contains the following information:
|
The following table describes the data structure of TaskDetailDTO.
| Parameter | Type | Description |
|---|---|---|
| id | String | The general ID of the subtask. |
| task_id | Integer | The ID of the subtask, which is the primary key recorded in OceanBase Database. |
| name | String | The name of the subtask. |
| state | String | The execution status of the subtask. |
| operator | String | The operation type of the subtask. |
| start_time | time.Time | The time when the execution of the subtask started. |
| end_time | time.Time | The time when the execution of the subtask ended. |
| additional_data | map[string]any | Other data of the subtask. |
| execute_times | Integer | The number of executions. |
| execute_agent | AgentInfo | The agent information of the OBServer node that executed the subtask, including the following parameters:
|
| task_logs | []string | The execution logs. |
Examples
Sample request
GET 10.10.10.1:2886/api/v1/task/sub_task/12
Sample response
The sample response displays the information about a subtask named Create local scale out dag. The operation type is RUN, and the execution result is SUCCEED.
{
"successful": true,
"timestamp": "2024-01-09T21:29:37.372338686+08:00",
"duration": 6,
"status": 200,
"traceId": "638aa02fc5b50051",
"data": {
"id": "12",
"task_id": 2,
"name": "Create local scale out dag",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-09T20:40:03.796683+08:00",
"end_time": "2024-01-09T20:40:03.836712+08:00",
"additional_data": null,
"execute_times": 1,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": [
"create local scale out dag success, genericID:22130706433028869"
]
}
}
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 Obtain the information about a subtask.
For more information about how to call the API operation by using obshell-sdk-go, see Obtain the information about a subtask.