Feature description
Re-executes failed subtasks.
Call instructions
Interface constraints
The caller must have the TASK_MANAGER privilege.
Request path
POST /api/v2/tasks/instances/{taskInstanceId}/subtasks/{subtaskInstanceId}/retry
Request parameters
path:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| taskInstanceId | Long | Yes | 1000 | The ID of the target task instance. |
| subtaskInstanceId | Long | Yes | 10001 | The ID of the target subtask instance. |
Response
Parameter |
Type |
Description |
|---|---|---|
| data | Object | SubtaskInstance object request data, for more information see SubtaskInstance data structure. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server finishes the request. |
| duration | Integer | The 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, which is used for troubleshooting. |
| server | String | The address of the application service that responds to the request. |
SubtaskInstance data structure
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The ID of the subtask instance. |
| name | String | The name of the subtask. |
| seriesId | Long | The ID of the subtask series. |
| description | String | The description of the subtask. |
| clusterName | String | The class name corresponding to the subtask. |
| timeout | Integer | The timeout period of the subtask, in seconds. |
| status | StringArray | The execution status of the subtask. Valid values: |
| operation | String | The operation on the subtask. Valid values: |
| executor | String | The execution node of the subtask. |
| runTime | Integer | The number of times the subtask is executed. |
| context | String | The execution context of the subtask. |
| createTime | String | The creation time of the subtask. |
| startTime | String | The start time of the subtask. |
| finishTime | String | The end time of the subtask. |
| nodeType | String | The node type, for example, JAVA_TASK. |
| paralleIdx | Integer | The parallel subtask index. -1 indicates that the subtask is not parallel. |
| upstreams | LongArray | The list of upstream subtask IDs. |
| downstream | LongArray | The list of downstream subtask IDs. |
| prohibitRollback | Boolean | Indicates whether the subtask supports rollback. |
| prohibitSkip | Boolean | Indicates whether to skip the subtask. |
| taskId | Long | The ID of the task. |
Example
Request example
POST api/v2/tasks/instances/1000/subtasks/10001/retry
Response example
{
"data": {
},
"createTime": "2021-08-25T15:09:31+08:00",
"description": "Uninstall ocp agent",
"downstreams": [
13000336
],
"executor": "xxx.xxx.xxx.xxx",
"finishTime": "2021-08-25T15:09:35.626+08:00",
"id": 10001,
"name": "Uninstall ocp agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"taskId": 1000,
"runTime": 1,
"seriesId": 2,
"startTime": "2021-08-25T15:09:33.732+08:00",
"status": "SUCCESSFUL",
"timeout": 1800,
"upstreams": [
13000335
],
"prohibitSkip": true
},
"duration": 55,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T15:10:13.176+08:00",
"traceId": "0bc49000675d41af"
}
