Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

cancel_job

IoT.Client.cancel_job(**kwargs)

Cancels a job.

Requires permission to access the CancelJob action.

See also: AWS API Documentation

Request Syntax

response = client.cancel_job(
    jobId='string',
    reasonCode='string',
    comment='string',
    force=True|False
)
Parameters
  • jobId (string) --

    [REQUIRED]

    The unique identifier you assigned to this job when it was created.

  • reasonCode (string) -- (Optional)A reason code string that explains why the job was canceled.
  • comment (string) -- An optional comment string describing why the job was canceled.
  • force (boolean) --

    (Optional) If true job executions with status "IN_PROGRESS" and "QUEUED" are canceled, otherwise only job executions with status "QUEUED" are canceled. The default is false .

    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.

Return type

dict

Returns

Response Syntax

{
    'jobArn': 'string',
    'jobId': 'string',
    'description': 'string'
}

Response Structure

  • (dict) --

    • jobArn (string) --

      The job ARN.

    • jobId (string) --

      The unique identifier you assigned to this job when it was created.

    • description (string) --

      A short text description of the job.

Exceptions

  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.ServiceUnavailableException
  • IoT.Client.exceptions.LimitExceededException