Method description
Obtains status details of all instances under a task based on the job ID and task name.
Parameter description
Parameter | Type | Required | Description |
---|---|---|---|
jobId | String | Yes | Job ID |
taskName | String | Yes | Name of a task |
marker | String | No | Start resource ID of the current page. Default value: Null string |
maxItemCount | int | No | Maximum number of returned items. The maximum value is 200. The default value is also 200 |
Response description
If the call succeeds, a ListInstancesResponse instance is returned. You can use the getInstanceList() method of this instance to obtain the List
object. If a failure occurs, a ClientException is thrown.
Sample code 1
try{
ListInstancesResponse response = client.listInstances("job-0101010299123","Find");
//Succeeded
List<Instance> list = response.getItems();
//Marker of the next page. This parameter must be specified when you query the next page.
String nextMarker = response.getNextMarker();
}catch(ClientException e){
e.printStackTrace();
// Failed
}
Sample code 2
String marker = ""; //Next marker returned by the previous listJobs. This parameter is not specified upon the first query.
int maxItemCount = 200; //The maximum value is 200. The default value is also 200.
try{
ListInstancesResponse response = client.listInstances("job-0101010299123","Find",marker,maxItemCount);
//Succeeded
List<Instance> list = response.getItems();
//Marker of the next page. This parameter must be specified when you query the next page.
String nextMarker = response.getNextMarker();
}catch(ClientException e){
e.printStackTrace();
// Failed
}
Attributes of Instance
Attribute | Type | Description |
---|---|---|
instanceId | int | Instance ID |
state | String | Task state, which can be Waiting, Running, Failed, Finished, or Stopped |
startTime | Date | Start time of the task. If the task is still in Waiting state, the start time is null |
endTime | Date | End time of the task. If the task is not finished yet, the end time is null |
retryCount | int | Number of retries |
progress | int | Progress |
stdoutRedirectPath | String | OSS directory to which standard output is redirected |
stderrRedirectPath | String | OSS directory to which a standard error is redirected |
result | Result | Result |
Attributes of Result
Attribute | Type | Description |
---|---|---|
exitCode | int | Exit code of the program |
errorCode | String | Error code |
errorMessage | String | Error message |
detail | String | Detailed information |