Skip to main content

job_executions

Creates, updates, deletes, gets or lists a job_executions resource.

Overview​

Namejob_executions
TypeResource
Idaws.iot_jobs_data.job_executions

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
approximate_seconds_before_timed_outinteger (int64)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.
execution_numberinteger (int64)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.
job_documentstringThe content of the job document.
job_idstringThe unique identifier you assigned to this job when it was created. (pattern: <code>[a-zA-Z0-9_-]+</code>)
last_updated_atinteger (int64)The time, in seconds since the epoch, when the job execution was last updated.
queued_atinteger (int64)The time, in seconds since the epoch, when the job execution was enqueued.
started_atinteger (int64)The time, in seconds since the epoch, when the job execution was started.
statusstringThe status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". (QUEUED, IN_PROGRESS, SUCCEEDED, FAILED, TIMED_OUT, REJECTED, REMOVED, CANCELED)
status_detailsobjectA 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.
thing_namestringThe name of the thing that is executing the job. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
version_numberinteger (int64)The version of the job execution. Job execution versions are incremented each time they are updated by a device.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_job_executionselectjob_id, thing_name, regionincludeJobDocument, executionNumberGets details of a job execution. Requires permission to access the DescribeJobExecution action.
update_job_executionupdatejob_id, thing_name, region, statusUpdates the status of a job execution. Requires permission to access the UpdateJobExecution action.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
job_idstringThe unique identifier assigned to this job when it was created.
regionstringAWS region (default: us-east-1)
thing_namestringThe name of the thing associated with the device.
executionNumberinteger (int64)Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.
includeJobDocumentbooleanOptional. Unless set to false, the response contains the job document. The default is true.

SELECT examples​

Gets details of a job execution. Requires permission to access the DescribeJobExecution action.

SELECT
approximate_seconds_before_timed_out,
execution_number,
job_document,
job_id,
last_updated_at,
queued_at,
started_at,
status,
status_details,
thing_name,
version_number
FROM aws.iot_jobs_data.job_executions
WHERE job_id = '{{ job_id }}' -- required
AND thing_name = '{{ thing_name }}' -- required
AND region = '{{ region }}' -- required
AND includeJobDocument = '{{ includeJobDocument }}'
AND executionNumber = '{{ executionNumber }}'
;

UPDATE examples​

Updates the status of a job execution. Requires permission to access the UpdateJobExecution action.

UPDATE aws.iot_jobs_data.job_executions
SET
status = '{{ status }}',
statusDetails = '{{ statusDetails }}',
stepTimeoutInMinutes = {{ stepTimeoutInMinutes }},
expectedVersion = {{ expectedVersion }},
includeJobExecutionState = {{ includeJobExecutionState }},
includeJobDocument = {{ includeJobDocument }},
executionNumber = {{ executionNumber }}
WHERE
job_id = '{{ job_id }}' --required
AND thing_name = '{{ thing_name }}' --required
AND region = '{{ region }}' --required
AND status = '{{ status }}' --required
RETURNING
execution_state,
job_document;