All Products
Search
Document Center

Batch Compute:get_task

Last Updated:May 14, 2018

Parameter description

Attribute Type Description
job CreateResponse, str Job ID
task_name str Task name

Response description

The get_task method returns a GetResponse object, which encapsulates all interfaces of the Task class.

Task class

Parameter description

Parameter Type Description
properties dict, str, Task object Task running status information

Attribute description

For more information about interfaces of the InstanceMetrics class, see Section 4.2 “get_job”.

Attribute Type Description
TaskName str Task name
State str Task running status
StartTime str Start time of the task
EndTime str End time of the task
State str Task status
InstanceMetrics InstanceMetrics object Metrics of all instances in the task

Example

  1. try:
  2. # Get a Client object.
  3. client = Client(...
  4. ...
  5. # Job ID.
  6. job = "job-xxxx"
  7. task_name = "echo_task"
  8. task_desc = client.get_task(job, task_name)
  9. print (task_desc.TaskName, task_desc.State)
  10. except ClientError, e:
  11. print(e)