Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idaws.deadline.jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the job.
attachmentsobjectThe job attachments.
created_atstring (date-time)The date and time the resource was created.
created_bystringThe user or system that created this resource.
descriptionstringThe description of the job. This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.
ended_atstring (date-time)The date and time the resource ended running.
job_idstringThe job ID. (pattern: <code>job-[0-9a-f]{32}</code>)
lifecycle_statusstringThe life cycle status for the job. (CREATE_IN_PROGRESS, CREATE_FAILED, CREATE_COMPLETE, UPLOAD_IN_PROGRESS, UPLOAD_FAILED, UPDATE_IN_PROGRESS, UPDATE_FAILED, UPDATE_SUCCEEDED, ARCHIVED)
lifecycle_status_messagestringA message that communicates the status of the life cycle for the job.
max_failed_tasks_countintegerThe number of task failures before the job stops running and is marked as FAILED.
max_retries_per_taskintegerThe maximum number of retries per failed tasks.
max_worker_countintegerThe maximum number of worker hosts that can concurrently process a job. When the maxWorkerCount is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers. If you don't set the maxWorkerCount when you create a job, this value is not returned in the response.
parametersobjectThe parameters for the job.
priorityintegerThe job priority.
source_job_idstringThe job ID for the source job. (pattern: <code>job-[0-9a-f]{32}</code>)
started_atstring (date-time)The date and time the resource started running.
storage_profile_idstringThe storage profile ID associated with the job. (pattern: <code>sp-[0-9a-f]{32}</code>)
target_task_run_statusstringThe task status with which the job started. (READY, FAILED, SUCCEEDED, CANCELED, SUSPENDED, PENDING)
task_failure_retry_countintegerThe total number of times tasks from the job failed and were retried.
task_run_statusstringThe task run status for the job. (PENDING, READY, ASSIGNED, STARTING, SCHEDULED, INTERRUPTING, RUNNING, SUSPENDED, CANCELED, FAILED, SUCCEEDED, NOT_COMPATIBLE)
task_run_status_countsobjectThe number of tasks running on the job.
updated_atstring (date-time)The date and time the resource was updated.
updated_bystringThe user or system that updated this resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_jobselectfarm_id, queue_id, job_id, regionGets a Deadline Cloud job.
search_jobsselectfarm_id, regionSearches for jobs.
list_jobsselectfarm_id, queue_id, regionnextToken, maxResults, principalIdLists jobs.
batch_get_jobselectregionRetrieves multiple jobs in a single request. This is a batch version of the GetJob API. The result of getting each job 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_jobinsertfarm_id, queue_id, region, priorityX-Amz-Client-TokenCreates a job. A job is a set of instructions that Deadline Cloud uses to schedule and run work on available workers. For more information, see Deadline Cloud jobs.
associate_member_to_jobupdatefarm_id, queue_id, job_id, principal_id, region, principalType, identityStoreId, membershipLevelAssigns a job membership level to a member
disassociate_member_from_jobupdatefarm_id, queue_id, job_id, principal_id, regionDisassociates a member from a job.
update_jobupdatefarm_id, queue_id, job_id, regionX-Amz-Client-TokenUpdates a job. When you change the status of the job to ARCHIVED, the job can't be scheduled or archived. An archived jobs and its steps and tasks are deleted after 120 days. The job can't be recovered.
copy_job_templateexecfarm_id, queue_id, job_id, region, targetS3LocationCopies a job template to an Amazon S3 bucket.

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 copy.
job_idstringThe job ID to copy.
principal_idstringA member's principal ID to disassociate from a job.
queue_idstringThe queue ID to copy.
regionstringAWS region (default: us-east-1)
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.
principalIdstringThe principal ID of the members on the jobs.

SELECT examples

Gets a Deadline Cloud job.

SELECT
name,
attachments,
created_at,
created_by,
description,
ended_at,
job_id,
lifecycle_status,
lifecycle_status_message,
max_failed_tasks_count,
max_retries_per_task,
max_worker_count,
parameters,
priority,
source_job_id,
started_at,
storage_profile_id,
target_task_run_status,
task_failure_retry_count,
task_run_status,
task_run_status_counts,
updated_at,
updated_by
FROM aws.deadline.jobs
WHERE farm_id = '{{ farm_id }}' -- required
AND queue_id = '{{ queue_id }}' -- required
AND job_id = '{{ job_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a job. A job is a set of instructions that Deadline Cloud uses to schedule and run work on available workers. For more information, see Deadline Cloud jobs.

INSERT INTO aws.deadline.jobs (
template,
templateType,
priority,
parameters,
attachments,
storageProfileId,
targetTaskRunStatus,
maxFailedTasksCount,
maxRetriesPerTask,
maxWorkerCount,
sourceJobId,
nameOverride,
descriptionOverride,
tags,
farm_id,
queue_id,
region,
`X-Amz-Client-Token`
)
SELECT
'{{ template }}',
'{{ templateType }}',
{{ priority }} /* required */,
'{{ parameters }}',
'{{ attachments }}',
'{{ storageProfileId }}',
'{{ targetTaskRunStatus }}',
{{ maxFailedTasksCount }},
{{ maxRetriesPerTask }},
{{ maxWorkerCount }},
'{{ sourceJobId }}',
'{{ nameOverride }}',
'{{ descriptionOverride }}',
'{{ tags }}',
'{{ farm_id }}',
'{{ queue_id }}',
'{{ region }}',
'{{ X-Amz-Client-Token }}'
RETURNING
job_id
;

UPDATE examples

Assigns a job membership level to a member

UPDATE aws.deadline.jobs
SET
principalType = '{{ principalType }}',
identityStoreId = '{{ identityStoreId }}',
membershipLevel = '{{ membershipLevel }}',
identityCenterRegion = '{{ identityCenterRegion }}'
WHERE
farm_id = '{{ farm_id }}' --required
AND queue_id = '{{ queue_id }}' --required
AND job_id = '{{ job_id }}' --required
AND principal_id = '{{ principal_id }}' --required
AND region = '{{ region }}' --required
AND principalType = '{{ principalType }}' --required
AND identityStoreId = '{{ identityStoreId }}' --required
AND membershipLevel = '{{ membershipLevel }}' --required;

Lifecycle Methods

Copies a job template to an Amazon S3 bucket.

EXEC aws.deadline.jobs.copy_job_template
@farm_id='{{ farm_id }}' --required,
@queue_id='{{ queue_id }}' --required,
@job_id='{{ job_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"targetS3Location": "{{ targetS3Location }}"
}'
;