job_executions
Creates, updates, deletes, gets or lists a job_executions resource.
Overview
| Name | job_executions |
| Type | Resource |
| Id | aws.iot_jobs_data.job_executions |
Fields
The following fields are returned by SELECT queries:
- describe_job_execution
| Name | Datatype | Description |
|---|---|---|
approximate_seconds_before_timed_out | integer (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_number | integer (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_document | string | The content of the job document. |
job_id | string | The unique identifier you assigned to this job when it was created. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
last_updated_at | integer (int64) | The time, in seconds since the epoch, when the job execution was last updated. |
queued_at | integer (int64) | The time, in seconds since the epoch, when the job execution was enqueued. |
started_at | integer (int64) | The time, in seconds since the epoch, when the job execution was started. |
status | string | The 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_details | object | 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. |
thing_name | string | The name of the thing that is executing the job. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
version_number | integer (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_job_execution | select | job_id, thing_name, region | includeJobDocument, executionNumber | Gets details of a job execution. Requires permission to access the DescribeJobExecution action. |
update_job_execution | update | job_id, thing_name, region, status | Updates 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.
| Name | Datatype | Description |
|---|---|---|
job_id | string | The unique identifier assigned to this job when it was created. |
region | string | AWS region (default: us-east-1) |
thing_name | string | The name of the thing associated with the device. |
executionNumber | integer (int64) | Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned. |
includeJobDocument | boolean | Optional. Unless set to false, the response contains the job document. The default is true. |
SELECT examples
- describe_job_execution
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
- update_job_execution
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;