This API operation is used to query all unfinished tasks in a cluster.
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/dag/unfinish
Request parameters
| Parameter | Type | Required? | Example value | Description |
|---|---|---|---|---|
| show_detail | Boolean | No | true | Specifies whether to display the details of subtasks. The default value is true. |
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 | []DagDetailDTO | The details of the directed acyclic graph (DAG) task. For more information, see the data structure of DagDetailDTO. |
| error | ApiError | The error caused by the request, which contains the following information:
|
The following table describes the data structure of DagDetailDTO.
| Parameter | Type | Description |
|---|---|---|
| id | String | The general ID of the DAG task. |
| dag_id | Integer | The ID of the DAG task, which is the primary key recorded in OceanBase Database. |
| name | String | The name of the DAG task. |
| stage | Integer | The current stage of the DAG task. |
| max_stage | Integer | The total number of stages of the DAG task during execution. |
| state | String | The execution status of the DAG task. |
| operator | String | The operation type of the DAG task. |
| start_time | time.Time | The time when the execution of the DAG task started. |
| end_time | time.Time | The time when the execution of the DAG task ended. |
| additional_data | map[string]any | Other data of the DAG task. |
| nodes | []NodeDetailDTO | The information about all OBServer nodes involved in the DAG task. For more information, see GetNodeDetails. |
Examples
Sample request
GET 10.10.10.1:2886/api/v1/task/dag/unfinish
Sample response
The sample response displays the unfinished task details of a cluster that is being scaled out. Only one unfinished scale-out task exists in the cluster. No node in the cluster involves any unfinished local task.
{
"successful": true,
"timestamp": "2024-01-10T11:34:32.520371417+08:00",
"duration": 43,
"status": 200,
"traceId": "925c315c8fcf142d",
"data": {
"contents": [
{
"id": "11",
"dag_id": 1,
"name": "Cluster scale out",
"stage": 4,
"max_stage": 9,
"state": "RUNNING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.556477+08:00",
"end_time": "2024-01-10T11:34:22.47652+08:00",
"additional_data": {},
"nodes": [
{
"id": "11",
"node_id": 1,
"name": "Integrate server config",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.567766+08:00",
"end_time": "2024-01-10T11:34:23.595834+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "11",
"task_id": 1,
"name": "Integrate server config",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.59098+08:00",
"end_time": "2024-01-10T11:34:22.611066+08:00",
"additional_data": null,
"execute_times": 1,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": []
}
]
},
{
"id": "12",
"node_id": 2,
"name": "Create local scale out dag",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:24.621206+08:00",
"end_time": "2024-01-10T11:34:25.644996+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "12",
"task_id": 2,
"name": "Create local scale out dag",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:24.635881+08:00",
"end_time": "2024-01-10T11:34:24.670586+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"
]
}
]
},
{
"id": "13",
"node_id": 3,
"name": "Wait scale out ready",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:26.66493+08:00",
"end_time": "2024-01-10T11:34:27.687962+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "13",
"task_id": 3,
"name": "Wait scale out ready",
"state": "SUCCEED",
"operator": "RUN",
"start_time": "2024-01-10T11:34:26.680745+08:00",
"end_time": "2024-01-10T11:34:26.695433+08:00",
"additional_data": null,
"execute_times": 1,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": [
"local scale out dag task Be scaling agent is succeed"
]
}
]
},
{
"id": "14",
"node_id": 4,
"name": "Wait remote deploy finish",
"state": "RUNNING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:28.708662+08:00",
"end_time": "2024-01-10T11:34:28.708662+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "14",
"task_id": 4,
"name": "Wait remote deploy finish",
"state": "RUNNING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:28.725462+08:00",
"end_time": "2024-01-10T11:34:22.514056+08:00",
"additional_data": null,
"execute_times": 1,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": [
"retry stage: 2 successfully"
]
}
]
},
{
"id": "15",
"node_id": 5,
"name": "Wait remote start finish",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.514056+08:00",
"end_time": "2024-01-10T11:34:22.514056+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "15",
"task_id": 5,
"name": "Wait remote start finish",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.515112+08:00",
"end_time": "2024-01-10T11:34:22.515112+08:00",
"additional_data": null,
"execute_times": 0,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": null
}
]
},
{
"id": "16",
"node_id": 6,
"name": "Prev check for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.515112+08:00",
"end_time": "2024-01-10T11:34:22.515112+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "16",
"task_id": 6,
"name": "Prev check for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.51617+08:00",
"end_time": "2024-01-10T11:34:22.51617+08:00",
"additional_data": null,
"execute_times": 0,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": null
}
]
},
{
"id": "17",
"node_id": 7,
"name": "Add server for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.51617+08:00",
"end_time": "2024-01-10T11:34:22.51617+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "17",
"task_id": 7,
"name": "Add server for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.51617+08:00",
"end_time": "2024-01-10T11:34:22.51617+08:00",
"additional_data": null,
"execute_times": 0,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": null
}
]
},
{
"id": "18",
"node_id": 8,
"name": "Add agent for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.517232+08:00",
"end_time": "2024-01-10T11:34:22.517232+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "18",
"task_id": 8,
"name": "Add agent for scale_out",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.517232+08:00",
"end_time": "2024-01-10T11:34:22.517232+08:00",
"additional_data": null,
"execute_times": 0,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": null
}
]
},
{
"id": "19",
"node_id": 9,
"name": "Check cluster scale_out whether finished",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.517232+08:00",
"end_time": "2024-01-10T11:34:22.517232+08:00",
"additional_data": null,
"sub_tasks": [
{
"id": "19",
"task_id": 9,
"name": "Check cluster scale_out whether finished",
"state": "PENDING",
"operator": "RUN",
"start_time": "2024-01-10T11:34:22.518288+08:00",
"end_time": "2024-01-10T11:34:22.518288+08:00",
"additional_data": null,
"execute_times": 0,
"execute_agent": {
"ip": "10.10.10.1",
"port": 2886
},
"task_logs": null
}
]
}
]
}
]
}
}
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 Query all unfinished tasks.
For more information about how to call the API operation by using obshell-sdk-go, see Query all unfinished tasks.