cancel_job
async
¶
cancel_job(
job_id: JobId,
*,
config_overrides: Optional[AsyncIoTClientConfig] = None,
reason_code: Optional[ReasonCode] = None,
comment: Optional[Comment] = None,
force: Optional[ForceFlag] = None,
) -> CancelJobResponse
Cancels a job.
Requires permission to access the CancelJob action.
Parameters:
-
job_id(JobId) –The unique identifier you assigned to this job when it was created.
-
reason_code(Optional[ReasonCode], default:None) –(Optional)A reason code string that explains why the job was canceled.
-
comment(Optional[Comment], default:None) –An optional comment string describing why the job was canceled.
-
force(Optional[ForceFlag], default:None) –(Optional) If
truejob executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default isfalse.Canceling a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to update the job execution status. Use caution and ensure that each device executing a job which is canceled is able to recover to a valid state.
Raises:
-
InvalidRequestException–The request is not valid.
-
LimitExceededException–A limit has been exceeded.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The rate exceeds the limit.
-
UnknownServiceError–The service returned an error code this client does not model.