Method description
Restarts a job by specifying the job ID.
Note: This API can be called only when the job is in Stopped or Failed state.
- After a job in Failed state is restarted, instances that have been started cannot be restarted again.
Parameter description
Parameter | Type | Description |
---|---|---|
jobId | String | Job ID |
Response description
If restart succeeds, a StartJobResponse instance is returned.
If restart fails, a ClientException is thrown.
Sample code
try{
StartJobResponse response = client.startJob("job-0101010299123");
//The job is successfully restarted.
}catch(ClientException e){
e.printStackTrace();
//The job fails to be restarted.
}