All Products
Search
Document Center

get_job

Last Updated: May 14, 2018

Parameter description

Parameter Type Description
job CreateResponse, str Job ID

Response description

The get_job method returns a GetResponse object, which encapsulates all interfaces and attributes of the Job class.

Job class

Parameter description

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

Attribute description

Attribute Type Description
Name str Job name
Id str Job ID
OwnerId int Job owner ID
CreationTime str Creation time
State str Job state, which can be Waiting, Running, Failed, Finished, or Stopped.
Message str Error message
StartTime str Start time of the job
EndTime str End time of the job
TaskMetrics str Metrics of all tasks in the job
InstanceMetrics str Metrics of all instances in the job

TaskMetrics class

Parameter description

Parameter Type Description
properties dict, str, TaskMetrics object Metrics of all tasks in the job

Attribute description

Attribute Type Description
WaitingCount int Number of waiting tasks in the job
RunningCount int Number of running tasks in the job
FinishedCount int Number of finished tasks in the job
FailedCount int Number of failed tasks in the job
StoppedCount int Number of stopped tasks in a job

InstanceMetrics class

Parameter description

Parameter Type Description
properties dict, str, InstanceMetrics object Metrics of all instances in the job

Attribute description

Attribute Type Description
WaitingCount int Number of waiting instances in the job
RunningCount int Number of running instances in the job
FinishedCount int Number of finished instances in the job
FailedCount int Number of failed instances in the job
StoppedCount int Number of stopped instances in a job

Example

  1. try:
  2. # Get a Client object.
  3. client = Client(...
  4. ...
  5. # Job ID.
  6. job = "job-xxxx"
  7. # Get job status, a Job object returned.
  8. # You can use job_desc exactly like a Job object.
  9. job_desc = client.get_job(job)
  10. print (job_desc.Name, job_desc.Id, job_desc.State)
  11. except ClientError, e:
  12. print (e)