AWS IoT

2018/05/18 - AWS IoT - 2 new api methods

Changes  We are releasing DeleteJob and DeleteJobExecution APIs to allow customer to delete resources created using AWS IoT Jobs.

DeleteJob (new) Link ¶

Deletes a job and its related job executions.

Deleting a job may take time, depending on the number of job executions created for the job and various other factors. While the job is being deleted, the status of the job will be shown as "DELETION_IN_PROGRESS". Attempting to delete or cancel a job whose status is already "DELETION_IN_PROGRESS" will result in an error.

Only 10 jobs may have status "DELETION_IN_PROGRESS" at the same time, or a LimitExceededException will occur.

See also: AWS API Documentation

Request Syntax

client.delete_job(
    jobId='string',
    force=True|False
)
type jobId

string

param jobId

[REQUIRED]

The ID of the job to be deleted.

After a job deletion is completed, you may reuse this jobId when you create a new job. However, this is not recommended, and you must ensure that your devices are not using the jobId to refer to the deleted job.

type force

boolean

param force

(Optional) When true, you can delete a job which is "IN_PROGRESS". Otherwise, you can only delete a job which is in a terminal state ("COMPLETED" or "CANCELED") or an exception will occur. The default is false.

Note

Deleting a job which is "IN_PROGRESS", will cause a device which is executing the job to be unable to access job information or update the job execution status. Use caution and ensure that each device executing a job which is deleted is able to recover to a valid state.

returns

None

DeleteJobExecution (new) Link ¶

Deletes a job execution.

See also: AWS API Documentation

Request Syntax

client.delete_job_execution(
    jobId='string',
    thingName='string',
    executionNumber=123,
    force=True|False
)
type jobId

string

param jobId

[REQUIRED]

The ID of the job whose execution on a particular device will be deleted.

type thingName

string

param thingName

[REQUIRED]

The name of the thing whose job execution will be deleted.

type executionNumber

integer

param executionNumber

[REQUIRED]

The ID of the job execution to be deleted. The executionNumber refers to the execution of a particular job on a particular device.

Note that once a job execution is deleted, the executionNumber may be reused by IoT, so be sure you get and use the correct value here.

type force

boolean

param force

(Optional) When true, you can delete a job execution which is "IN_PROGRESS". Otherwise, you can only delete a job execution which is in a terminal state ("SUCCEEDED", "FAILED", "REJECTED", "REMOVED" or "CANCELED") or an exception will occur. The default is false.

Note

Deleting a job execution which is "IN_PROGRESS", will cause the device to be unable to access job information or update the job execution status. Use caution and ensure that the device is able to recover to a valid state.

returns

None