Rerunning Job Instances
Function
Job instances and upstream and downstream job instances can be rerun.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/factory/jobs/{job_name}/instances/retry
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_name |
Yes |
String |
Current Job Name |
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Project ID and Account ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory when token authentication is used. The value contains 0 to 4096 characters. |
|
workspace |
Yes |
String |
Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID. |
|
Content-Type |
Yes |
String |
Default value: application/json;charset=UTF-8 Optional. This parameter is mandatory if a body is available. If no body is available, you do not need to set or verify this parameter. |
|
X-Project-Id |
No |
String |
project_id: project ID. For details about how to obtain the project ID and account ID, see Project ID and Account ID. This field is mandatory for API requests that use AK/SK authentication in multi-project scenarios. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
retry_location |
Yes |
String |
Rerun start position. The value can be firstNode, errorNode, or specifiedNode. |
|
node_name |
No |
String |
Node name |
|
retry_task_version |
Yes |
String |
Job parameter. The value can be original_version or current_version. |
|
ignore_obs_monitor |
No |
Boolean |
Whether to ignore OBS listening. The default value is true. |
|
task_retrys |
No |
Array of task_retrys objects |
Job instance rerun parameter. When the current instance type is rerun, you need to specify the rerun information of this parameter. You do not need to specify this parameter when rerun the current job and its upstream and downstream job instance types. |
|
begin_time |
No |
Long |
Instance start time. This parameter is valid only when the current job and its upstream and downstream job instances are re-executed. |
|
end_time |
No |
Long |
Instance end time. This parameter is valid only when the current job and its upstream and downstream job instances are re-executed. |
|
jobs |
No |
Array of jobs objects |
Job instance rerun parameter. When the current job and its upstream and downstream job instance types are rerun, you need to specify the rerun information of this parameter. You do not need to specify this parameter for the current instance type. |
|
concurrent |
No |
Integer |
Concurrency. This parameter is valid when the current job and its upstream and downstream job instances are re-executed. The default value is 1, and the value ranges from 1 to 128. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_id |
Yes |
Long |
Job ID of the current rerun instance. |
|
plan_time |
Yes |
Long |
Planned time of an instance. The value is a 13-digit timestamp, which can be obtained by calling the API for querying the job instance list. |
|
submit_time |
Yes |
Long |
Time when an instance is submitted. The value is a 13-digit timestamp, which can be obtained by calling the API for querying the job instance list. |
Response Parameters
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
-
Rerun the current instance of the test_job_name job.
POST /v2/62099355b894428e8916573ae635f1f9/factory/jobs/test_job_name/instances/retry { "retry_location" : "errorNode", "retry_task_version" : "original_version", "ignore_obs_monitor" : true, "task_retrys" : [ { "job_id" : 917567, "plan_time" : 1732601580000, "submit_time" : 1732239754684 } ] } -
Rerun the current job and its upstream and downstream job instances of the test_job_name job.
POST /v2/62099355b894428e8916573ae635f1f9/factory/jobs/test_job_name/instances/retry { "retry_location" : "errorNode", "retry_task_version" : "current_version", "ignore_obs_monitor" : true, "begin_time" : 1732608520000, "end_time" : 1732612120000, "jobs" : [ { "job_name" : "job_test_smn2", "workspace_id" : "62fbba734e634c5087656fc3ff7adf34" } ], "concurrent" : 2 }
Example Responses
Status code: 400
Response to a job re-execution failure.
{
"error_code" : "DLF.1000",
"error_msg" : "Failed to find the job."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The job is re-executed successfully, and no response is returned. |
|
400 |
Response to a job re-execution failure. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.