全部产品
Search
文档中心

:获取实例信息

更新时间:Apr 12, 2018

描述

获取实例信息(get_instance)。

参数说明

属性 类型 描述
job CreateResponse, str 作业标识符
task_name str 任务名称
instance_id str 实例标识符

返回值说明

get_instance方法将返回一个GetResponse 对象, 封装了Instance类型的所有接口。

Instance 类

参数说明

参数 类型 描述
properties dict, str, Instance object 作业运行状态信息

属性说明

属性 类型 描述
InstanceId int 实例标识符
State str 实例运行状态
StartTime str 实例开始时间
EndTime str 实例结束时间
RetryCount int 实例重试次数
Progross int 实例完成进度
StdoutRedirectPath str 标准输出路径
StderrRedirectPath str 标准出错路径
Result Result object 实例返回值信息

Result 类

参数说明

参数 类型 描述
properties dict, str, Result object 实例返回值信息

属性说明

属性 类型 描述
ExitCode int 命令行返回值
ErrorCode str 实例错误代码
ErrorMessage str 实例错误信息描述
Detail str 实例详细信息

示例

  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)