sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.deadline.sessions |
Fields
The following fields are returned by SELECT queries:
- get_session
- list_sessions
- batch_get_session
| Name | Datatype | Description |
|---|---|---|
ended_at | string (date-time) | The date and time the resource ended running. |
fleet_id | string | The fleet ID for the session. (pattern: <code>fleet-[0-9a-f]{32}</code>) |
host_properties | object | Provides the Amazon EC2 properties of the host. |
lifecycle_status | string | The life cycle status of the session. (STARTED, UPDATE_IN_PROGRESS, UPDATE_SUCCEEDED, UPDATE_FAILED, ENDED) |
log | object | The session log. |
session_id | string | The session ID. (pattern: <code>session-[0-9a-f]{32}</code>) |
started_at | string (date-time) | The date and time the resource started running. |
target_lifecycle_status | string | The life cycle status with which the session started. (ENDED) |
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 for the session. (pattern: <code>worker-[0-9a-f]{32}</code>) |
worker_log | object | The worker log for the session. |
| Name | Datatype | Description |
|---|---|---|
ended_at | string (date-time) | The date and time the resource ended running. |
fleet_id | string | The fleet ID. (pattern: <code>fleet-[0-9a-f]{32}</code>) |
lifecycle_status | string | The life cycle status for the session. (STARTED, UPDATE_IN_PROGRESS, UPDATE_SUCCEEDED, UPDATE_FAILED, ENDED) |
session_id | string | The session ID. (pattern: <code>session-[0-9a-f]{32}</code>) |
started_at | string (date-time) | The date and time the resource started running. |
target_lifecycle_status | string | The target life cycle status for the session. (ENDED) |
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 sessions that could not be retrieved. |
sessions | array | A list of sessions that were successfully retrieved. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_session | select | farm_id, queue_id, job_id, session_id, region | Gets a session. | |
list_sessions | select | farm_id, queue_id, job_id, region | nextToken, maxResults | Lists sessions. |
batch_get_session | select | region | Retrieves multiple sessions in a single request. This is a batch version of the GetSession API. The result of getting each session 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. | |
update_session | update | farm_id, queue_id, job_id, session_id, region, targetLifecycleStatus | X-Amz-Client-Token | Updates a session. |
start_sessions_statistics_aggregation | exec | farm_id, region, resourceIds, startTime, endTime, groupBy, statistics | Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the GetSessionsStatisticsAggregation operation. You can only have one running aggregation for your Deadline Cloud farm. Call the GetSessionsStatisticsAggregation operation and check the status field to see if an aggregation is running. Statistics are available for 1 hour after you call the StartSessionsStatisticsAggregation operation. |
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 identifier of the farm that contains queues or fleets to return statistics for. |
job_id | string | The job ID to update in the session. |
queue_id | string | The queue ID to update in the session. |
region | string | AWS region (default: us-east-1) |
session_id | string | The session 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_session
- list_sessions
- batch_get_session
Gets a session.
SELECT
ended_at,
fleet_id,
host_properties,
lifecycle_status,
log,
session_id,
started_at,
target_lifecycle_status,
updated_at,
updated_by,
worker_id,
worker_log
FROM aws.deadline.sessions
WHERE farm_id = '{{ farm_id }}' -- required
AND queue_id = '{{ queue_id }}' -- required
AND job_id = '{{ job_id }}' -- required
AND session_id = '{{ session_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists sessions.
SELECT
ended_at,
fleet_id,
lifecycle_status,
session_id,
started_at,
target_lifecycle_status,
updated_at,
updated_by,
worker_id
FROM aws.deadline.sessions
WHERE farm_id = '{{ farm_id }}' -- required
AND queue_id = '{{ queue_id }}' -- required
AND job_id = '{{ job_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
Retrieves multiple sessions in a single request. This is a batch version of the GetSession API. The result of getting each session 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,
sessions
FROM aws.deadline.sessions
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- update_session
Updates a session.
UPDATE aws.deadline.sessions
SET
targetLifecycleStatus = '{{ targetLifecycleStatus }}'
WHERE
farm_id = '{{ farm_id }}' --required
AND queue_id = '{{ queue_id }}' --required
AND job_id = '{{ job_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
AND targetLifecycleStatus = '{{ targetLifecycleStatus }}' --required
AND `X-Amz-Client-Token` = '{{ X-Amz-Client-Token}}';
Lifecycle Methods
- start_sessions_statistics_aggregation
Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the GetSessionsStatisticsAggregation operation. You can only have one running aggregation for your Deadline Cloud farm. Call the GetSessionsStatisticsAggregation operation and check the status field to see if an aggregation is running. Statistics are available for 1 hour after you call the StartSessionsStatisticsAggregation operation.
EXEC aws.deadline.sessions.start_sessions_statistics_aggregation
@farm_id='{{ farm_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"resourceIds": "{{ resourceIds }}",
"startTime": "{{ startTime }}",
"endTime": "{{ endTime }}",
"timezone": "{{ timezone }}",
"period": "{{ period }}",
"groupBy": "{{ groupBy }}",
"statistics": "{{ statistics }}"
}'
;