All Products
Search
Document Center

Batch Compute:get_instance

Last Updated:May 14, 2018

Parameter description

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

Response description

The get_instance method returns a GetResponse object, which encapsulates all interfaces of the Instance class.

Instance class

Parameter description

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

Attribute description

Attribute Type Description
InstanceId int Instance ID
State str Instance running status
StartTime str Start time of the instance
EndTime str End time of the instance
RetryCount int Number of instance retries
Progross int Instance progress
StdoutRedirectPath str Directory to which standard output is redirected
StderrRedirectPath str Directory to which a standard error is redirected
Result Result object Return value of the instance

Result class

Parameter description

Parameter Type Description
properties dict, str, Result object Return value of the instance

Attribute description

Attribute Type Description
ExitCode int Command line return value
ErrorCode str Error code of the instance
ErrorMessage str Error message of the instance
Detail str Detailed information of the instance

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. instance_id = 0
  9. instance_desc = client.get_instance(job, task_name, instance_id)
  10. print (instance_desc.InstanceId, instance_desc.State)
  11. except ClientError, e:
  12. print(e)