All Products
Search
Document Center

Batch Compute:list_tasks

Last Updated:May 14, 2018

Parameter description

Attribute Type Description
job str Job ID
next_marker str Start resource ID on the next page. The value is null for the last page
max_item_count int Maximum number of actually returned resources. The default value is 50. The maximum value is 100

Response description

  • The list_tasks method returns a ListResponse object, which contains a set of Task objects.

  • For more information about attributes of the Task object, see the description of the Task class.

Attribute Type Description
NextMarker str Start resource ID on the next page. The value is null for the last page
Items list List of Task classes

Example

  1. try:
  2. # Get a Client object.
  3. client = Client(...
  4. ...
  5. job = "job-xxx"
  6. marker = ""
  7. max_item = 100
  8. round = 0
  9. while marker or round == 0:
  10. response = client.list_tasks(job, marker, max_item)
  11. marker = response.NextMarker
  12. for task in response.Items:
  13. print (task.TaskName, task.State)
  14. round += 1
  15. except ClientError, e:
  16. print(e)