Description
This API can be called only when the job is in Stopped or Failed state.
After a job in Failed state is restarted, instances that have been started will not be restarted again.
Parameter description
Attribute | Type | Description |
---|---|---|
job | CreateResponse, str | Job ID |
Response description
The start_job method returns an ActionResponse
object. ActionResponse
provides only two attributes: request ID and status code.
Example
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)