cancel_job_execution
async
¶
cancel_job_execution(
job_id: JobId,
thing_name: ThingName,
*,
config_overrides: Optional[AsyncIoTClientConfig] = None,
force: Optional[ForceFlag] = None,
expected_version: Optional[ExpectedVersion] = None,
status_details: Optional[DetailsMap] = None,
) -> None
Cancels the execution of a job for a given thing.
Requires permission to access the CancelJobExecution action.
Parameters:
-
job_id(JobId) –The ID of the job to be canceled.
-
thing_name(ThingName) –The name of the thing whose execution of the job will be canceled.
-
force(Optional[ForceFlag], default:None) –(Optional) If
truethe job execution will be canceled if it has status IN_PROGRESS or QUEUED, otherwise the job execution will be canceled only if it has status QUEUED. If you attempt to cancel a job execution that is IN_PROGRESS, and you do not setforcetotrue, then anInvalidStateTransitionExceptionwill be thrown. The default isfalse.Canceling a job execution which is "IN_PROGRESS", will cause the device to be unable to update the job execution status. Use caution and ensure that the device is able to recover to a valid state.
-
expected_version(Optional[ExpectedVersion], default:None) –(Optional) The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)
-
status_details(Optional[DetailsMap], default:None) –A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged. You can specify at most 10 name/value pairs.
Raises:
-
InvalidRequestException–The request is not valid.
-
InvalidStateTransitionException–An attempt was made to change to an invalid state, for example by deleting a job or a job execution which is "IN_PROGRESS" without setting the
forceparameter. -
ResourceNotFoundException–The specified resource does not exist.
-
ServiceUnavailableException–The service is temporarily unavailable.
-
ThrottlingException–The rate exceeds the limit.
-
VersionConflictException–An exception thrown when the version of an entity specified with the
expectedVersionparameter does not match the latest version in the system. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iot/_services/async_io_t.py
1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | |