Menu
AWS IoT
Developer Guide

StartNextPendingJobExecution

Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.

Request syntax:

PUT /things/thingName/jobs/$next Content-type: application/json { "statusDetails": { "string": "string" } }

URI Request Parameters:

Name

Type

Req?

Description

thingName

ThingName

yes

The name of the thing associated with the device.

Request Body Parameters:

Name

Type

Req?

Description

statusDetails

DetailsMap

no

A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.

Response syntax:

Content-type: application/json { "execution": { "jobId": "string", "thingName": "string", "status": "string", "statusDetails": { "string": "string" }, "queuedAt": "long", "startedAt": "long", "lastUpdatedAt": "long", "versionNumber": "long", "executionNumber": "long", "jobDocument": "string" } }

Response Body Parameters:

Name

Type

Req?

Description

execution

JobExecution

no

A JobExecution object.

Errors:

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

CertificateValidationException

The certificate is invalid.

HTTP response code: 400

CLI

Synopsis:

aws iot-jobs-data start-next-pending-job-execution \ --thing-name <value> \ [--status-details <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "thingName": "string", "statusDetails": { "string": "string" } }

cli-input-json fields:

Name

Type

Description

thingName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The name of the thing associated with the device.

statusDetails

map

key: DetailsKey

value: DetailsValue

A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.

DetailsKey

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

DetailsValue

string

length max:1024 min:1

pattern: [^\\p{C}]*+

Output:

{ "execution": { "jobId": "string", "thingName": "string", "status": "string", "statusDetails": { "string": "string" }, "queuedAt": "long", "startedAt": "long", "lastUpdatedAt": "long", "versionNumber": "long", "executionNumber": "long", "jobDocument": "string" } }

cli output fields:

Name

Type

Description

execution

JobExecution

A JobExecution object.

jobId

string

length max:64 min:1

pattern: [a-zA-Z0-9_-]+

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

thingName

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

The name of the thing that is executing the job.

status

string

enum: QUEUED | IN_PROGRESS | SUCCEEDED | FAILED | REJECTED | REMOVED | CANCELED

java class: com.amazonaws.iot.laser.common.JobExecutionStatus

The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".

statusDetails

map

key: DetailsKey

value: DetailsValue

A collection of name/value pairs that describe the status of the job execution.

DetailsKey

string

length max:128 min:1

pattern: [a-zA-Z0-9:_-]+

DetailsValue

string

length max:1024 min:1

pattern: [^\\p{C}]*+

queuedAt

long

The time, in milliseconds since the epoch, when the job execution was enqueued.

startedAt

long

java class: java.lang.Long

The time, in milliseconds since the epoch, when the job execution was started.

lastUpdatedAt

long

The time, in milliseconds since the epoch, when the job execution was last updated.

versionNumber

long

The version of the job execution. Job execution versions are incremented each time they are updated by a device.

executionNumber

long

java class: java.lang.Long

A number that identifies a particular job execution on a particular device. It can be used later in commands that return or update job execution information.

jobDocument

string

length max:32768

The content of the job document.

On this page: