Retry a subtask

2024-11-06 03:13:28  Updated

Description

You can call this operation to retry a failed subtask.

Call description

Prerequisite

You have the TASK_MANAGER permissions.

Request path

POST /api/v2/tasks/instances/{taskInstanceId}/subtasks/{subtaskInstanceId}/retry

Request parameters

Parameter Type Required Example value Description
taskInstanceId Long Yes 1000 The ID of the task instance.
subtaskInstanceId Long Yes 10001 The ID of the subtask instance.

Response parameters

Parameter Type Description
data Object The data requested by the SubtaskInstance object.
successful Boolean Indicates whether the request was successful.
timestamp Datetime The timestamp when the server completed the request.
duration Integer The time taken by the server to process the request, in milliseconds.
status Integer An HTTP status code.
traceId String The trace ID of the request. This trace ID is used for troubleshooting.
server String The address of the application server that responded to the request.

Data structure of SubtaskInstance

Parameter Type Description
id Long The ID of the subtask instance.
name String The name of the subtask.
seriesId Long The serial number of the subtask.
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 String The status of the subtask. Valid values: * PENDING * READY * RUNNING * CANCELING * FAILED * SUCCESSFUL
operation String The operation performed by the subtask. Valid values: * EXECUTE * RETRY * ROLLBACK * SKIP * CANCEL
executor String The node that executed the subtask.
runTime Integer The number of executions of the subtask.
context String The execution context of the subtask.
createTime String The time when the subtask was created.
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 index of a parallel subtask. -1 indicates that the subtask is not a parallel subtask.
upstreams LongArray The IDs of upstream subtasks.
downstream LongArray The IDs of downstream subtasks.
prohibitRollback Boolean Indicates whether rollback was supported by the subtask.

Examples

Sample request

POST api/v2/tasks/instances/100/subtasks/1000/retry

Sample response

{
  "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": 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
    ]
  },
  "duration": 55,
  "server": "a83ad33525",
  "status": 200,
  "successful": true,
  "timestamp": "2021-08-25T15:10:13.176+08:00",
  "traceId": "0bc49000675d41af"
}

Contact Us