SDK for PHP 3.x

Client: Aws\IoTJobsDataPlane\IoTJobsDataPlaneClient
Service ID: iot-jobs-data
Version: 2017-09-29

This page describes the parameters and results for the operations of the AWS IoT Jobs Data Plane (2017-09-29), and shows how to use the Aws\IoTJobsDataPlane\IoTJobsDataPlaneClient object to call the described operations. This documentation is specific to the 2017-09-29 API version of the service.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

DescribeJobExecution ( array $params = [] )
Gets details of a job execution.
GetPendingJobExecutions ( array $params = [] )
Gets the list of all jobs for a thing that are not in a terminal status.
StartCommandExecution ( array $params = [] )
Using the command created with the CreateCommand API, start a command execution on a specific device.
StartNextPendingJobExecution ( array $params = [] )
Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution for a thing.
UpdateJobExecution ( array $params = [] )
Updates the status of a job execution.

Operations

DescribeJobExecution

$result = $client->describeJobExecution([/* ... */]);
$promise = $client->describeJobExecutionAsync([/* ... */]);

Gets details of a job execution.

Requires permission to access the DescribeJobExecution action.

Parameter Syntax

$result = $client->describeJobExecution([
    'executionNumber' => <integer>,
    'includeJobDocument' => true || false,
    'jobId' => '<string>', // REQUIRED
    'thingName' => '<string>', // REQUIRED
]);

Parameter Details

Members
executionNumber
Type: long (int|float)

Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.

includeJobDocument
Type: boolean

Optional. Unless set to false, the response contains the job document. The default is true.

jobId
Required: Yes
Type: string

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

thingName
Required: Yes
Type: string

The thing name associated with the device the job execution is running on.

Result Syntax

[
    'execution' => [
        'approximateSecondsBeforeTimedOut' => <integer>,
        'executionNumber' => <integer>,
        'jobDocument' => '<string>',
        'jobId' => '<string>',
        'lastUpdatedAt' => <integer>,
        'queuedAt' => <integer>,
        'startedAt' => <integer>,
        'status' => 'QUEUED|IN_PROGRESS|SUCCEEDED|FAILED|TIMED_OUT|REJECTED|REMOVED|CANCELED',
        'statusDetails' => ['<string>', ...],
        'thingName' => '<string>',
        'versionNumber' => <integer>,
    ],
]

Result Details

Members
execution
Type: JobExecution structure

Contains data about a job execution.

Errors

InvalidRequestException:

The contents of the request were invalid.

ResourceNotFoundException:

The specified resource does not exist.

ThrottlingException:

The rate exceeds the limit.

ServiceUnavailableException:

The service is temporarily unavailable.

CertificateValidationException:

The certificate is invalid.

TerminalStateException:

The job is in a terminal state.

GetPendingJobExecutions

$result = $client->getPendingJobExecutions([/* ... */]);
$promise = $client->getPendingJobExecutionsAsync([/* ... */]);

Gets the list of all jobs for a thing that are not in a terminal status.

Requires permission to access the GetPendingJobExecutions action.

Parameter Syntax

$result = $client->getPendingJobExecutions([
    'thingName' => '<string>', // REQUIRED
]);

Parameter Details

Members
thingName
Required: Yes
Type: string

The name of the thing that is executing the job.

Result Syntax

[
    'inProgressJobs' => [
        [
            'executionNumber' => <integer>,
            'jobId' => '<string>',
            'lastUpdatedAt' => <integer>,
            'queuedAt' => <integer>,
            'startedAt' => <integer>,
            'versionNumber' => <integer>,
        ],
        // ...
    ],
    'queuedJobs' => [
        [
            'executionNumber' => <integer>,
            'jobId' => '<string>',
            'lastUpdatedAt' => <integer>,
            'queuedAt' => <integer>,
            'startedAt' => <integer>,
            'versionNumber' => <integer>,
        ],
        // ...
    ],
]

Result Details

Members
inProgressJobs
Type: Array of JobExecutionSummary structures

A list of JobExecutionSummary objects with status IN_PROGRESS.

queuedJobs
Type: Array of JobExecutionSummary structures

A list of JobExecutionSummary objects with status QUEUED.

Errors

InvalidRequestException:

The contents of the request were invalid.

ResourceNotFoundException:

The specified resource does not exist.

ThrottlingException:

The rate exceeds the limit.

ServiceUnavailableException:

The service is temporarily unavailable.

CertificateValidationException:

The certificate is invalid.

StartCommandExecution

$result = $client->startCommandExecution([/* ... */]);
$promise = $client->startCommandExecutionAsync([/* ... */]);

Using the command created with the CreateCommand API, start a command execution on a specific device.

Parameter Syntax

$result = $client->startCommandExecution([
    'clientToken' => '<string>',
    'commandArn' => '<string>', // REQUIRED
    'executionTimeoutSeconds' => <integer>,
    'parameters' => [
        '<CommandParameterName>' => [
            'B' => true || false,
            'BIN' => <string || resource || Psr\Http\Message\StreamInterface>,
            'D' => <float>,
            'I' => <integer>,
            'L' => <integer>,
            'S' => '<string>',
            'UL' => '<string>',
        ],
        // ...
    ],
    'targetArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
clientToken
Type: string

The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you retry the request using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.

commandArn
Required: Yes
Type: string

The Amazon Resource Number (ARN) of the command. For example, arn:aws:iot:<region>:<accountid>:command/<commandName>

executionTimeoutSeconds
Type: long (int|float)

Specifies the amount of time in second the device has to finish the command execution. A timer is started as soon as the command execution is created. If the command execution status is not set to another terminal state before the timer expires, it will automatically update to TIMED_OUT.

parameters
Type: Associative array of custom strings keys (CommandParameterName) to CommandParameterValue structures

A list of parameters that are required by the StartCommandExecution API when performing the command on a device.

targetArn
Required: Yes
Type: string

The Amazon Resource Number (ARN) of the device where the command execution is occurring.

Result Syntax

[
    'executionId' => '<string>',
]

Result Details

Members
executionId
Type: string

A unique identifier for the command execution.

Errors

ValidationException:

A validation error occurred when performing the API request.

ResourceNotFoundException:

The specified resource does not exist.

ConflictException:

A conflict has occurred when performing the API request.

ThrottlingException:

The rate exceeds the limit.

ServiceQuotaExceededException:

The service quota has been exceeded for this request.

InternalServerException:

An internal server error occurred when performing the API request.

StartNextPendingJobExecution

$result = $client->startNextPendingJobExecution([/* ... */]);
$promise = $client->startNextPendingJobExecutionAsync([/* ... */]);

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

Requires permission to access the StartNextPendingJobExecution action.

Parameter Syntax

$result = $client->startNextPendingJobExecution([
    'statusDetails' => ['<string>', ...],
    'stepTimeoutInMinutes' => <integer>,
    'thingName' => '<string>', // REQUIRED
]);

Parameter Details

Members
statusDetails
Type: Associative array of custom strings keys (DetailsKey) to strings

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

The maximum length of the value in the name/value pair is 1,024 characters.

stepTimeoutInMinutes
Type: long (int|float)

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 the step timeout has no effect on the in progress timeout that may have been specified when the job was created (CreateJob using field timeoutConfig).

Valid values for this parameter range from 1 to 10080 (1 minute to 7 days).

thingName
Required: Yes
Type: string

The name of the thing associated with the device.

Result Syntax

[
    'execution' => [
        'approximateSecondsBeforeTimedOut' => <integer>,
        'executionNumber' => <integer>,
        'jobDocument' => '<string>',
        'jobId' => '<string>',
        'lastUpdatedAt' => <integer>,
        'queuedAt' => <integer>,
        'startedAt' => <integer>,
        'status' => 'QUEUED|IN_PROGRESS|SUCCEEDED|FAILED|TIMED_OUT|REJECTED|REMOVED|CANCELED',
        'statusDetails' => ['<string>', ...],
        'thingName' => '<string>',
        'versionNumber' => <integer>,
    ],
]

Result Details

Members
execution
Type: JobExecution structure

A JobExecution object.

Errors

InvalidRequestException:

The contents of the request were invalid.

ResourceNotFoundException:

The specified resource does not exist.

ThrottlingException:

The rate exceeds the limit.

ServiceUnavailableException:

The service is temporarily unavailable.

CertificateValidationException:

The certificate is invalid.

UpdateJobExecution

$result = $client->updateJobExecution([/* ... */]);
$promise = $client->updateJobExecutionAsync([/* ... */]);

Updates the status of a job execution.

Requires permission to access the UpdateJobExecution action.

Parameter Syntax

$result = $client->updateJobExecution([
    'executionNumber' => <integer>,
    'expectedVersion' => <integer>,
    'includeJobDocument' => true || false,
    'includeJobExecutionState' => true || false,
    'jobId' => '<string>', // REQUIRED
    'status' => 'QUEUED|IN_PROGRESS|SUCCEEDED|FAILED|TIMED_OUT|REJECTED|REMOVED|CANCELED', // REQUIRED
    'statusDetails' => ['<string>', ...],
    'stepTimeoutInMinutes' => <integer>,
    'thingName' => '<string>', // REQUIRED
]);

Parameter Details

Members
executionNumber
Type: long (int|float)

Optional. A number that identifies a particular job execution on a particular device.

expectedVersion
Type: long (int|float)

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.)

includeJobDocument
Type: boolean

Optional. When set to true, the response contains the job document. The default is false.

includeJobExecutionState
Type: boolean

Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.

jobId
Required: Yes
Type: string

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

status
Required: Yes
Type: string

The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.

statusDetails
Type: Associative array of custom strings keys (DetailsKey) to strings

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

The maximum length of the value in the name/value pair is 1,024 characters.

stepTimeoutInMinutes
Type: long (int|float)

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 again calling UpdateJobExecution, setting the status to IN_PROGRESS, and specifying a new timeout value in this field) the job execution status will be automatically set to TIMED_OUT. Note that setting or resetting the step timeout has no effect on the in progress timeout that may have been specified when the job was created (CreateJob using field timeoutConfig).

Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). A value of -1 is also valid and will cancel the current step timer (created by an earlier use of UpdateJobExecutionRequest).

thingName
Required: Yes
Type: string

The name of the thing associated with the device.

Result Syntax

[
    'executionState' => [
        'status' => 'QUEUED|IN_PROGRESS|SUCCEEDED|FAILED|TIMED_OUT|REJECTED|REMOVED|CANCELED',
        'statusDetails' => ['<string>', ...],
        'versionNumber' => <integer>,
    ],
    'jobDocument' => '<string>',
]

Result Details

Members
executionState
Type: JobExecutionState structure

A JobExecutionState object.

jobDocument
Type: string

The contents of the Job Documents.

Errors

InvalidRequestException:

The contents of the request were invalid.

ResourceNotFoundException:

The specified resource does not exist.

ThrottlingException:

The rate exceeds the limit.

ServiceUnavailableException:

The service is temporarily unavailable.

CertificateValidationException:

The certificate is invalid.

InvalidStateTransitionException:

An update attempted to change the job execution to a state that is invalid because of the job execution's current state (for example, an attempt to change a request in state SUCCESS to state IN_PROGRESS). In this case, the body of the error message also contains the executionState field.

Shapes

CertificateValidationException

Description

The certificate is invalid.

Members
message
Type: string

Additional information about the exception.

CommandParameterValue

Description

The list of values used to describe a specific command parameter.

Members
B
Type: boolean

An attribute of type Boolean. For example:

"BOOL": true

BIN
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

An attribute of type Binary.

D
Type: double

An attribute of type Double (Sixty-Four Bits).

I
Type: int

An attribute of type Integer (Thirty-Two Bits).

L
Type: long (int|float)

An attribute of type Long.

S
Type: string

An attribute of type String. For example:

"S": "Hello"

UL
Type: string

An attribute of type Unsigned Long.

ConflictException

Description

A conflict has occurred when performing the API request.

Members
message
Type: string
resourceId
Type: string

A conflict occurred while performing the API request on the resource ID.

InternalServerException

Description

An internal server error occurred when performing the API request.

Members
message
Type: string

InvalidRequestException

Description

The contents of the request were invalid.

Members
message
Type: string

The message for the exception.

InvalidStateTransitionException

Description

An update attempted to change the job execution to a state that is invalid because of the job execution's current state (for example, an attempt to change a request in state SUCCESS to state IN_PROGRESS). In this case, the body of the error message also contains the executionState field.

Members
message
Type: string

JobExecution

Description

Contains data about a job execution.

Members
approximateSecondsBeforeTimedOut
Type: long (int|float)

The estimated number of seconds that remain before the job execution status will be changed to TIMED_OUT. The actual job execution timeout can occur up to 60 seconds later than the estimated duration.

executionNumber
Type: long (int|float)

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
Type: string

The content of the job document.

jobId
Type: string

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

lastUpdatedAt
Type: long (int|float)

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

queuedAt
Type: long (int|float)

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

startedAt
Type: long (int|float)

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

status
Type: string

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

statusDetails
Type: Associative array of custom strings keys (DetailsKey) to strings

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

The maximum length of the value in the name/value pair is 1,024 characters.

thingName
Type: string

The name of the thing that is executing the job.

versionNumber
Type: long (int|float)

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

JobExecutionState

Description

Contains data about the state of a job execution.

Members
status
Type: string

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

statusDetails
Type: Associative array of custom strings keys (DetailsKey) to strings

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

The maximum length of the value in the name/value pair is 1,024 characters.

versionNumber
Type: long (int|float)

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

JobExecutionSummary

Description

Contains a subset of information about a job execution.

Members
executionNumber
Type: long (int|float)

A number that identifies a particular job execution on a particular device.

jobId
Type: string

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

lastUpdatedAt
Type: long (int|float)

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

queuedAt
Type: long (int|float)

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

startedAt
Type: long (int|float)

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

versionNumber
Type: long (int|float)

The version of the job execution. Job execution versions are incremented each time IoT Jobs receives an update from a device.

ResourceNotFoundException

Description

The specified resource does not exist.

Members
message
Type: string

The message for the exception.

ServiceQuotaExceededException

Description

The service quota has been exceeded for this request.

Members
message
Type: string

ServiceUnavailableException

Description

The service is temporarily unavailable.

Members
message
Type: string

The message for the exception.

TerminalStateException

Description

The job is in a terminal state.

Members
message
Type: string

ThrottlingException

Description

The rate exceeds the limit.

Members
message
Type: string

The message associated with the exception.

payload
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The payload associated with the exception.

ValidationException

Description

A validation error occurred when performing the API request.

Members
message
Type: string