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
try: # Get a Client object. client = Client(... ... # Job ID. job = "job-xxxx" task_name = "echo_task" instance_id = 0 instance_desc = client.get_instance(job, task_name, instance_id) print (instance_desc.InstanceId, instance_desc.State)except ClientError, e: print(e)