Description
Changes priority of a job. Priority of a job can be changed only when the job is in Stopped state.
Parameter description
Attribute | Type | Description |
---|---|---|
job | CreateResponse, str | Job ID |
priority | int | Job priority. The value ranges from 0 to 1000. Priority increases with the value. |
Response description
The change_job_priority method returns an ActionResponse
object. ActionResponse
provides only two attributes: request ID and status code.
Example
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)