Skip to main content

tasks

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

Overview

Nametasks
TypeResource
Idaws.snow_device_management.tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
completed_atstring (date-time)When the task was completed.
created_atstring (date-time)When the CreateTask operation was called.
descriptionstringThe description provided of the task and managed devices. (pattern: <code>[A-Za-z0-9 _.,!#]*</code>)
last_updated_atstring (date-time)When the state of the task was last updated.
statestringThe current state of the task. (IN_PROGRESS, CANCELED, COMPLETED)
tagsobjectOptional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
targetsarrayThe managed devices that the task was sent to.
task_arnstringThe Amazon Resource Name (ARN) of the task.
task_idstringThe ID of the task.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_taskselecttask_id, regionChecks the metadata for a given task on a device.
list_tasksselectregionmaxResults, nextToken, stateReturns a list of tasks that can be filtered by state.
create_taskinsertregion, command, targetsInstructs one or more devices to start a task, such as unlocking or rebooting.
cancel_taskexectask_id, regionSends a cancel request for a specified task. You can cancel a task only if it's still in a QUEUED state. Tasks that are already running can't be cancelled. A task might still run if it's processed from the queue before the CancelTask operation changes the task's state.

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
regionstringAWS region (default: us-east-1)
task_idstringThe ID of the task that you are attempting to cancel. You can retrieve a task ID by using the ListTasks operation.
maxResultsintegerThe maximum number of tasks per page.
nextTokenstringA pagination token to continue to the next page of tasks.
statestringA structure used to filter the list of tasks.

SELECT examples

Checks the metadata for a given task on a device.

SELECT
completed_at,
created_at,
description,
last_updated_at,
state,
tags,
targets,
task_arn,
task_id
FROM aws.snow_device_management.tasks
WHERE task_id = '{{ task_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Instructs one or more devices to start a task, such as unlocking or rebooting.

INSERT INTO aws.snow_device_management.tasks (
clientToken,
command,
description,
tags,
targets,
region
)
SELECT
'{{ clientToken }}',
'{{ command }}' /* required */,
'{{ description }}',
'{{ tags }}',
'{{ targets }}' /* required */,
'{{ region }}'
RETURNING
task_arn,
task_id
;

Lifecycle Methods

Sends a cancel request for a specified task. You can cancel a task only if it's still in a QUEUED state. Tasks that are already running can't be cancelled. A task might still run if it's processed from the queue before the CancelTask operation changes the task's state.

EXEC aws.snow_device_management.tasks.cancel_task
@task_id='{{ task_id }}' --required,
@region='{{ region }}' --required
;