start_job
当作业的状态为Stopped或者Failed,才可以调用该接口。当 Failed 状态的作业重启之后,已经运行成功的实例不会重新运行。
参数说明:
属性 | 类型 | 描述 |
---|---|---|
job | CreateResponse, str | 作业标识符 |
返回值说明:
start_job方法将返回一个
ActionResponse
对象,ActionResponse
仅提供了request ID和状态码两个属性。
e.g.
try:
# Get a Client object.
client = Client(...
...
# Job ID.
job = "job-xxxx"
job_detail = client.get_job(job)
if job_detail.State == "Stopped":
# Only stopped job can be restarted.
client.start_job(job)
job_detail = client.get_job(job)
assert job_detail.State in ["Waiting", "Running"]
except ClientError, e:
print(e)
文档内容是否对您有帮助?