change_job_priority
改变作业的优先级,作业状态为Stopped时才能改变作业的优先级。
参数说明:
属性 | 类型 | 描述 |
---|---|---|
job | CreateResponse, str | 作业标识符 |
priority | int | 作业优先级,[0-1000],数值越高优先级越高 |
返回值说明:
change_job_priority方法将返回一个
ActionResponse
对象,ActionResponse
仅提供了request ID和状态码两个属性。
e.g.
try:
client = Client(...
...
# Job created before.
job_id = "job-xxxx"
# Only the priority of stopped jobs can be changed.
client.stop_job(job_id)
assert client.get_job(job_id).State == 'Stopped'
# Try to change priority.
client.change_job_priority(job_id, 99)
client.start_job(job_id)
assert client.get_job_description(job_id).Priority == 99
except ClientError, e:
print(e)
文档内容是否对您有帮助?