Method description
Obtains status details of all tasks under a job based on the job ID.
Parameter description
| Parameter | Type | Required | Description |
|---|---|---|---|
| jobId | String | Yes | Job ID |
| 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 ListTasksResponse instance is returned. You can use the getTaskList() method of this instance to obtain the List
object. If a failure occurs, a ClientException is thrown.
Sample code 1
try{ListTasksResponse response = client.listTasks("job-0101010299123");//SucceededList<Task> 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{ListTasksResponse response = client.listTasks("job-0101010299123",marker,maxItemCount);//SucceededList<Task> 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 Task
| Attribute | Type | Description |
|---|---|---|
| taskName | String | Name of a task |
| 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 |
| instanceMetrics | Metrics | Number of instances in various states |