Skip to main content

sessions

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

Overview

Namesessions
TypeResource
Idaws.deadline.sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
ended_atstring (date-time)The date and time the resource ended running.
fleet_idstringThe fleet ID for the session. (pattern: <code>fleet-[0-9a-f]{32}</code>)
host_propertiesobjectProvides the Amazon EC2 properties of the host.
lifecycle_statusstringThe life cycle status of the session. (STARTED, UPDATE_IN_PROGRESS, UPDATE_SUCCEEDED, UPDATE_FAILED, ENDED)
logobjectThe session log.
session_idstringThe session ID. (pattern: <code>session-[0-9a-f]{32}</code>)
started_atstring (date-time)The date and time the resource started running.
target_lifecycle_statusstringThe life cycle status with which the session started. (ENDED)
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 for the session. (pattern: <code>worker-[0-9a-f]{32}</code>)
worker_logobjectThe worker log for the session.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_sessionselectfarm_id, queue_id, job_id, session_id, regionGets a session.
list_sessionsselectfarm_id, queue_id, job_id, regionnextToken, maxResultsLists sessions.
batch_get_sessionselectregionRetrieves 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_sessionupdatefarm_id, queue_id, job_id, session_id, region, targetLifecycleStatusX-Amz-Client-TokenUpdates a session.
start_sessions_statistics_aggregationexecfarm_id, region, resourceIds, startTime, endTime, groupBy, statisticsStarts 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.

NameDatatypeDescription
farm_idstringThe identifier of the farm that contains queues or fleets to return statistics for.
job_idstringThe job ID to update in the session.
queue_idstringThe queue ID to update in the session.
regionstringAWS region (default: us-east-1)
session_idstringThe session 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 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
;

UPDATE examples

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

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 }}"
}'
;