workers
Creates, updates, deletes, gets or lists a workers resource.
Overview
| Name | workers |
| Type | Resource |
| Id | aws.deadline.workers |
Fields
The following fields are returned by SELECT queries:
- get_worker
- search_workers
- list_workers
- batch_get_worker
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time the resource was created. |
created_by | string | The user or system that created this resource. |
farm_id | string | The farm ID. (pattern: <code>farm-[0-9a-f]{32}</code>) |
fleet_id | string | The fleet ID. (pattern: <code>fleet-[0-9a-f]{32}</code>) |
host_properties | object | The host properties for the worker. |
log | object | The logs for the associated worker. |
status | string | The status of the worker. (CREATED, STARTED, STOPPING, STOPPED, NOT_RESPONDING, NOT_COMPATIBLE, RUNNING, IDLE) |
updated_at | string (date-time) | The date and time the resource was updated. |
updated_by | string | The user or system that updated this resource. |
worker_id | string | The worker ID. (pattern: <code>worker-[0-9a-f]{32}</code>) |
| Name | Datatype | Description |
|---|---|---|
next_item_offset | integer | The next item offset for the search results. |
total_results | integer | The total number of results in the search. |
workers | array | The workers for the search. |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time the resource was created. |
created_by | string | The user or system that created this resource. |
farm_id | string | The farm ID. (pattern: <code>farm-[0-9a-f]{32}</code>) |
fleet_id | string | The fleet ID. (pattern: <code>fleet-[0-9a-f]{32}</code>) |
host_properties | object | The host properties of the worker. |
log | object | The log configuration for the worker. |
status | string | The status of the worker. (CREATED, STARTED, STOPPING, STOPPED, NOT_RESPONDING, NOT_COMPATIBLE, RUNNING, IDLE) |
updated_at | string (date-time) | The date and time the resource was updated. |
updated_by | string | The user or system that updated this resource. |
worker_id | string | The worker ID. (pattern: <code>worker-[0-9a-f]{32}</code>) |
| Name | Datatype | Description |
|---|---|---|
errors | array | A list of errors for workers that could not be retrieved. |
workers | array | A list of workers that were successfully retrieved. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_worker | select | farm_id, fleet_id, worker_id, region | Gets a worker. | |
search_workers | select | farm_id, region | Searches for workers. | |
list_workers | select | farm_id, fleet_id, region | nextToken, maxResults | Lists workers. |
batch_get_worker | select | region | Retrieves 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_worker | insert | farm_id, fleet_id, region | X-Amz-Client-Token | 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. |
update_worker | update | farm_id, fleet_id, worker_id, region | Updates a worker. | |
delete_worker | delete | farm_id, fleet_id, worker_id, region | Deletes a worker. | |
assume_fleet_role_for_worker | exec | farm_id, fleet_id, worker_id, region | Get credentials from the fleet role for a worker. | |
assume_queue_role_for_worker | exec | farm_id, fleet_id, worker_id, queueId, region | Allows a worker to assume a queue role. | |
update_worker_schedule | exec | farm_id, fleet_id, worker_id, region | Updates 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.
| Name | Datatype | Description |
|---|---|---|
farm_id | string | The farm ID to update. |
fleet_id | string | The fleet ID to update. |
queueId | string | The queue ID of the worker assuming the queue role. |
region | string | AWS region (default: us-east-1) |
worker_id | string | The worker ID to update. |
X-Amz-Client-Token | string | The unique token which the server uses to recognize retries of the same request. |
maxResults | integer | The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. |
nextToken | string | The token for the next set of results, or null to start from the beginning. |
SELECT examples
- get_worker
- search_workers
- list_workers
- batch_get_worker
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
;
Searches for workers.
SELECT
next_item_offset,
total_results,
workers
FROM aws.deadline.workers
WHERE farm_id = '{{ farm_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists workers.
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 region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
Retrieves 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.
SELECT
errors,
workers
FROM aws.deadline.workers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_worker
- Manifest
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
;
# Description fields are for documentation purposes
- name: workers
props:
- name: farm_id
value: "{{ farm_id }}"
description: Required parameter for the workers resource.
- name: fleet_id
value: "{{ fleet_id }}"
description: Required parameter for the workers resource.
- name: region
value: "{{ region }}"
description: Required parameter for the workers resource.
- name: hostProperties
description: |
The host property details.
value:
ipAddresses:
ipV4Addresses:
- "{{ ipV4Addresses }}"
ipV6Addresses:
- "{{ ipV6Addresses }}"
hostName: "{{ hostName }}"
- name: tags
value: "{{ tags }}"
- name: X-Amz-Client-Token
value: "{{ X-Amz-Client-Token }}"
description: The unique token which the server uses to recognize retries of the same request.
description: The unique token which the server uses to recognize retries of the same request.
UPDATE examples
- update_worker
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
- delete_worker
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
- assume_fleet_role_for_worker
- assume_queue_role_for_worker
- update_worker_schedule
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
;
Allows a worker to assume a queue role.
EXEC aws.deadline.workers.assume_queue_role_for_worker
@farm_id='{{ farm_id }}' --required,
@fleet_id='{{ fleet_id }}' --required,
@worker_id='{{ worker_id }}' --required,
@queueId='{{ queueId }}' --required,
@region='{{ region }}' --required
;
Updates the schedule for a worker.
EXEC aws.deadline.workers.update_worker_schedule
@farm_id='{{ farm_id }}' --required,
@fleet_id='{{ fleet_id }}' --required,
@worker_id='{{ worker_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"updatedSessionActions": "{{ updatedSessionActions }}"
}'
;