All Products
Document Center

Batch Compute:startJob

Last Updated:May 11, 2018

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

  1. try{
  2. StartJobResponse response = client.startJob("job-0101010299123");
  3. //The job is successfully restarted.
  4. }catch(ClientException e){
  5. e.printStackTrace();
  6. //The job fails to be restarted.
  7. }