Feature description
Triggers a re-execution of all failed subtasks of a task.
Call instructions
Interface constraints
The caller must have the TASK_MANAGER permission.
Request path
POST /api/v2/tasks/instances/{taskInstanceId}/retry
Request parameters
path:
Parameter |
Type |
Required |
Example Value |
Description |
|---|---|---|---|---|
| taskInstanceId | Long | Yes | 1000 | The ID of the target task instance. |
Response
Parameter |
Type |
Description |
|---|---|---|
| data | Object | WrappedTaskInstance object that contains the requested data. For more information, see Data structure of WrappedTaskInstance. |
| successful | Boolean | Indicates whether the request is successful. |
| timestamp | Datetime | The timestamp when the server completes 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 to troubleshoot issues. |
| server | String | The address of the application service that responds to the request. |
Data structure of WrappedTaskInstance
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The software package ID. |
| name | String | The software package name. |
| taskDefinitionId | Long | The task definition ID. |
| cluster | Object | The cluster information. For more information, see cluster parameter description. |
| tenant | Object | The tenant information. For more information, see tenant parameter description. |
| creator | Object | The information about the task creator. For more information, see creator parameter description. |
| status | StringArray | The execution status of the task. Valid values: |
| type | String | The task type. Valid values: |
| operation | String | The task operation. Valid values: |
| executor | String | The host that executes the task. |
| prohibitRollback | Boolean | Indicates whether to prohibit rollback. |
| subtasks | ObjectArray | The summary information of the WrappedSubtaskInstance array. For more information, see Data structure of WrappedSubtaskInstance. |
| createTime | String | The task creation time. |
| startTime | String | The task start time. |
| finishTime | String | The task end time. |
| tags | Array | The tag information. For more information, see InstanceFullTag data structure. |
| isRemote | Boolean | Indicates whether the task is remote. |
cluster parameter description
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The cluster ID on OCP. |
| name | String | The cluster name. |
| obClusterId | Long | The cluster ID on OceanBase. |
| type | String | The cluster type. Valid values: |
tenant parameter description
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The tenant ID on OCP. |
| name | String | The tenant name. |
| obClusterId | Long | The tenant ID on OceanBase. |
| mode | String | The tenant mode. Valid values: |
creator parameter description
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The user ID of the creator. |
| name | String | The username of the creator. |
Data structure of WrappedSubtaskInstance
Parameter |
Type |
Description |
|---|---|---|
| id | Long | The subtask instance ID. |
| name | String | The subtask name. |
| seriesId | Long | The subtask series ID. |
| description | String | The subtask description. |
| timeout | Integer | The subtask timeout, in seconds. |
| status | String | The subtask status. Valid values: |
| operation | String | The subtask operation. Valid values: |
| executor | String | The subtask execution node information. |
| runTime | Integer | The subtask execution count. |
| nodeType | String | The node type, such as JAVA_TASK. |
| paralleIdx | Integer | The parallel subtask index value. -1 indicates a non-parallel subtask. |
| upstreams | LongArray | The upstream subtask ID list. |
| downstream | LongArray | The downstream subtask ID list. |
| prohibitRollback | Boolean | Indicates whether the subtask supports rollback. |
| createTime | String | The subtask creation time. |
| startTime | String | The subtask start time. |
| finishTime | String | The subtask end time. |
| tags | Array | The tag information. For more information, see InstanceFullTag data structure. |
| taskId | Long | The task ID. |
InstanceFullTag data structure
Parameter |
Type |
Description |
|---|---|---|
| clusterName | String | The cluster name. |
| clusterId | Long | The cluster ID on OCP. |
| obClusterId | Long | The cluster ID on OceanBase. |
| clusterType | String | The cluster type. Valid values: |
| zoneName | String | The zone name. |
| tenantName | String | The tenant name. |
| tenantId | Long | The tenant ID on OCP. |
| obTenantId | Long | The tenant ID on OceanBase. |
| tenantMode | String | The tenant mode. Valid values: |
| tenantRole | String | The tenant role. Valid values: |
| obVersion | String | The OceanBase version. |
| serverId | Long | The OBServer ID. |
| arbitrationServiceId | Long | The arbitration service ID. |
| arbitrationServiceGroupName | String | The arbitration service group name. |
| arbitrationServiceGroupId | Long | The arbitration service group ID. |
| arbitrationServiceSvrPort | Integer | The arbitration service port. |
| obproxyClusterName | String | The OBProxy cluster name. |
| obproxyClusterId | Long | The OBProxy cluster ID. |
| obproxyServerId | Long | The OBProxy server ID. |
| hostId | Long | The host ID. |
| svrIp | Long | The host IP address. |
| objectType | String | The type of the object associated with the task. |
| deleted | Boolean | Indicates whether the information associated with the task is deleted. |
| binlogClusterName | String | The Binlog cluster name. |
| binlogClusterId | Long | The Binlog cluster ID. |
| binlogServerId | Long | The Binlog server ID. |
| tenantBinlogServiceId | Long | The Binlog instance ID. |
| binlogInstanceName | String | The Binlog instance name. |
Examples
Request example
POST /api/v2/tasks/instances/1000/retry
Response example
{
"data": {
"createTime": "2021-08-25T15:09:31+08:00",
"creator": {
"id": 100,
"name": "admin"
},
"executor": "xxx.xxx.xxx.xxx",
"finishTime": "2021-08-25T15:09:54.067+08:00",
"id": 35000312,
"name": "Reinstall OCP agent",
"operation": "EXECUTE",
"prohibitRollback": false,
"startTime": "2021-08-25T15:09:31.74+08:00",
"status": "SUCCESSFUL",
"subtasks": [
{
"createTime": "2021-08-25T15:09:31+08:00",
"description": "Install ocp agent",
"downstreams": [
13000334
],
"executor": "xxx.xxx.xxx.xxx",
"finishTime": "2021-08-25T15:09:52.182+08:00",
"id": 13000336,
"name": "Install ocp agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"startTime": "2021-08-25T15:09:36.821+08:00",
"status": "SUCCESSFUL",
"timeout": 5400,
"upstreams": [
13000333
]
},
{
"createTime": "2021-08-25T15:09:31+08:00",
"description": "Finish reinstalling OCP agent",
"downstreams": [],
"executor": "xxx.xxx.xxx.xxx",
"finishTime": "2021-08-25T15:09:53.252+08:00",
"id": 13000334,
"name": "Finish reinstalling OCP agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"startTime": "2021-08-25T15:09:53.062+08:00",
"status": "SUCCESSFUL",
"timeout": 60,
"upstreams": [
13000336
]
},
{
"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": 13000333,
"name": "Uninstall ocp agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 2,
"startTime": "2021-08-25T15:09:33.732+08:00",
"status": "SUCCESSFUL",
"timeout": 1800,
"upstreams": [
13000335
]
},
{
"createTime": "2021-08-25T15:09:31+08:00",
"description": "Prepare reinstalling OCP agent",
"downstreams": [
13000333
],
"executor": "xxx.xxx.xxx.xxx",
"finishTime": "2021-08-25T15:09:33.082+08:00",
"id": 13000335,
"name": "Prepare reinstalling OCP agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 3,
"startTime": "2021-08-25T15:09:32.688+08:00",
"status": "SUCCESSFUL",
"timeout": 60,
"upstreams": []
}
],
"taskDefinitionId": -1,
"type": "MANUAL",
"prohibitSkip": true,
"taskId": 1000,
"tags": [
{
"deleted": true,
"hostId": 1,
"objectType": "HOST",
"svrIp": "11.124.9.46"
}
],
},
"duration": 55,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-08-25T15:10:13.176+08:00",
"traceId": "0bc49000675d41af"
}
