Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . iot-jobs-data ]

start-next-pending-job-execution

Description

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

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  start-next-pending-job-execution
--thing-name <value>
[--status-details <value>]
[--step-timeout-in-minutes <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--thing-name (string)

The name of the thing associated with the device.

--status-details (map)

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

Shorthand Syntax:

KeyName1=string,KeyName2=string

JSON Syntax:

{"string": "string"
  ...}

--step-timeout-in-minutes (long)

Specifies the amount of time this device has to finish execution of this job. If the job execution status is not set to a terminal state before this timer expires, or before the timer is reset (by calling UpdateJobExecution , setting the status to IN_PROGRESS and specifying a new timeout value in field stepTimeoutInMinutes ) the job execution status will be automatically set to TIMED_OUT . Note that setting this timeout has no effect on that job execution timeout which may have been specified when the job was created (CreateJob using field timeoutConfig ).

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To get and start the next pending job execution for a thing

The following start-next-pending-job-execution example retrieves and starts the next job execution whose status is IN_PROGRESS or QUEUED for the specified thing.

aws iot-jobs-data start-next-pending-job-execution \
    --thing-name MotionSensor1

This command produces no output. Output:

{
    "execution": {
        "approximateSecondsBeforeTimedOut": 88,
        "executionNumber": 2939653338,
        "jobId": "SampleJob",
        "lastUpdatedAt": 1567714853.743,
        "queuedAt": 1567701902.444,
        "startedAt": 1567714871.690,
        "status": "IN_PROGRESS",
        "thingName": "MotionSensor1 ",
        "versionNumber": 3
   }
}

For more information, see Devices and Jobs in the AWS IoT Developer Guide.

Output

execution -> (structure)

A JobExecution object.

jobId -> (string)

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

thingName -> (string)

The name of the thing that is executing the job.

status -> (string)

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

statusDetails -> (map)

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

key -> (string)

value -> (string)

queuedAt -> (long)

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

startedAt -> (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.

approximateSecondsBeforeTimedOut -> (long)

The estimated number of seconds that remain before the job execution status will be changed to TIMED_OUT .

versionNumber -> (long)

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

executionNumber -> (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)

The content of the job document.