All Products
Document Center

Batch Compute:getInstance

Last Updated:May 11, 2018

Method description

Obtain the status details of an instance based on the job ID, task name, and instance ID.

Parameter description

Parameter Type Description
jobId String Job ID
taskName String Name of a task
instanceId int Instance ID

Response description

  • If the call succeeds, a GetInstanceResponse instance is returned. You can use the getInstance() method of this instance to obtain the Instance object.

  • If a failure occurs, a ClientException is thrown.

Sample code

  1. try{
  2. GetInstanceResponse response = client.getInstance("job-0101010299123","Find", 0);
  3. //Succeeded
  4. Instance ins = response.getInstance();
  5. }catch(ClientException e){
  6. e.printStackTrace();
  7. // Failed
  8. }