Retry failed files¶
Retry the failed file specified in the import task. A successful response will not return the running record. Please query the file and running record again to confirm the result.
POST $CLOUDSIGMA_API_BASE/task/retry
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First Query task files, select only failed files; the task must be in completed or failed state.
Set the operation-specific values used in the request:
$TASK_ID: Import task ID.$FILE_ID: ID of the failed file.
Request¶
curl -X POST "$CLOUDSIGMA_API_BASE/task/retry" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"task_id\":\"$TASK_ID\",\"ids\":[\"$FILE_ID\"]}"
curl -X POST "$CLOUDSIGMA_API_BASE/task/retry" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"task_id\":\"$TASK_ID\"}"
Retry all failed files:
Request body
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
yes |
Import task ID. |
|
string[] |
No |
List of failed file IDs to retry; omitting or passing an empty array will retry the task on all failed files. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 200 on success and data is null. A successful submission does not mean that the file has been processed.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return retry run records. |
Error response¶
{
"code": "ErrForbidden",
"msg": "permission denied",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, or the task is not in a completed or failed state. |
Fix |
|
|
The caller does not have permission to operate the task. |
Check workspace and object authorization. |
|
|
The service is temporarily unable to complete the authorization check. |
Try again later. |
|
|
Service failed to submit retry. |
Check both HTTP status and |
Follow-up operations¶
After retrying the acceptance, Query task files and Query run records again to confirm whether the number of failed items has been reduced.