Skip to main content

workers

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

Overview

Nameworkers
TypeResource
Idaws.deadline.workers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The date and time the resource was created.
created_bystringThe user or system that created this resource.
farm_idstringThe farm ID. (pattern: <code>farm-[0-9a-f]{32}</code>)
fleet_idstringThe fleet ID. (pattern: <code>fleet-[0-9a-f]{32}</code>)
host_propertiesobjectThe host properties for the worker.
logobjectThe logs for the associated worker.
statusstringThe status of the worker. (CREATED, STARTED, STOPPING, STOPPED, NOT_RESPONDING, NOT_COMPATIBLE, RUNNING, IDLE)
updated_atstring (date-time)The date and time the resource was updated.
updated_bystringThe user or system that updated this resource.
worker_idstringThe worker ID. (pattern: <code>worker-[0-9a-f]{32}</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_workerselectfarm_id, fleet_id, worker_id, regionGets a worker.
search_workersselectfarm_id, regionSearches for workers.
list_workersselectfarm_id, fleet_id, regionnextToken, maxResultsLists workers.
batch_get_workerselectregionRetrieves multiple workers in a single request. This is a batch version of the GetWorker API. The result of getting each worker is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.
create_workerinsertfarm_id, fleet_id, regionX-Amz-Client-TokenCreates a worker. A worker tells your instance how much processing power (vCPU), and memory (GiB) you’ll need to assemble the digital assets held within a particular instance. You can specify certain instance types to use, or let the worker know which instances types to exclude. Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to CreateWorker before the field updates, you might exceed your fleet's maximum worker count. For example, if your maxWorkerCount is 10 and you currently have 9 workers, making two quick CreateWorker calls might successfully create 2 workers instead of 1, resulting in 11 total workers.
update_workerupdatefarm_id, fleet_id, worker_id, regionUpdates a worker.
delete_workerdeletefarm_id, fleet_id, worker_id, regionDeletes a worker.
assume_fleet_role_for_workerexecfarm_id, fleet_id, worker_id, regionGet credentials from the fleet role for a worker.
assume_queue_role_for_workerexecfarm_id, fleet_id, worker_id, queueId, regionAllows a worker to assume a queue role.
update_worker_scheduleexecfarm_id, fleet_id, worker_id, regionUpdates the schedule for a worker.

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
farm_idstringThe farm ID to update.
fleet_idstringThe fleet ID to update.
queueIdstringThe queue ID of the worker assuming the queue role.
regionstringAWS region (default: us-east-1)
worker_idstringThe worker ID to update.
X-Amz-Client-TokenstringThe unique token which the server uses to recognize retries of the same request.
maxResultsintegerThe maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
nextTokenstringThe token for the next set of results, or null to start from the beginning.

SELECT examples

Gets a worker.

SELECT
created_at,
created_by,
farm_id,
fleet_id,
host_properties,
log,
status,
updated_at,
updated_by,
worker_id
FROM aws.deadline.workers
WHERE farm_id = '{{ farm_id }}' -- required
AND fleet_id = '{{ fleet_id }}' -- required
AND worker_id = '{{ worker_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a worker. A worker tells your instance how much processing power (vCPU), and memory (GiB) you’ll need to assemble the digital assets held within a particular instance. You can specify certain instance types to use, or let the worker know which instances types to exclude. Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to CreateWorker before the field updates, you might exceed your fleet's maximum worker count. For example, if your maxWorkerCount is 10 and you currently have 9 workers, making two quick CreateWorker calls might successfully create 2 workers instead of 1, resulting in 11 total workers.

INSERT INTO aws.deadline.workers (
hostProperties,
tags,
farm_id,
fleet_id,
region,
`X-Amz-Client-Token`
)
SELECT
'{{ hostProperties }}',
'{{ tags }}',
'{{ farm_id }}',
'{{ fleet_id }}',
'{{ region }}',
'{{ X-Amz-Client-Token }}'
RETURNING
worker_id
;

UPDATE examples

Updates a worker.

UPDATE aws.deadline.workers
SET
status = '{{ status }}',
capabilities = '{{ capabilities }}',
hostProperties = '{{ hostProperties }}'
WHERE
farm_id = '{{ farm_id }}' --required
AND fleet_id = '{{ fleet_id }}' --required
AND worker_id = '{{ worker_id }}' --required
AND region = '{{ region }}' --required
RETURNING
host_configuration,
log;

DELETE examples

Deletes a worker.

DELETE FROM aws.deadline.workers
WHERE farm_id = '{{ farm_id }}' --required
AND fleet_id = '{{ fleet_id }}' --required
AND worker_id = '{{ worker_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Get credentials from the fleet role for a worker.

EXEC aws.deadline.workers.assume_fleet_role_for_worker
@farm_id='{{ farm_id }}' --required,
@fleet_id='{{ fleet_id }}' --required,
@worker_id='{{ worker_id }}' --required,
@region='{{ region }}' --required
;