jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | aws.deadline.jobs |
Fields
The following fields are returned by SELECT queries:
- get_job
- search_jobs
- list_jobs
- batch_get_job
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the job. |
attachments | object | The job attachments. |
created_at | string (date-time) | The date and time the resource was created. |
created_by | string | The user or system that created this resource. |
description | string | The 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_at | string (date-time) | The date and time the resource ended running. |
job_id | string | The job ID. (pattern: <code>job-[0-9a-f]{32}</code>) |
lifecycle_status | string | The 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_message | string | A message that communicates the status of the life cycle for the job. |
max_failed_tasks_count | integer | The number of task failures before the job stops running and is marked as FAILED. |
max_retries_per_task | integer | The maximum number of retries per failed tasks. |
max_worker_count | integer | The 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. |
parameters | object | The parameters for the job. |
priority | integer | The job priority. |
source_job_id | string | The job ID for the source job. (pattern: <code>job-[0-9a-f]{32}</code>) |
started_at | string (date-time) | The date and time the resource started running. |
storage_profile_id | string | The storage profile ID associated with the job. (pattern: <code>sp-[0-9a-f]{32}</code>) |
target_task_run_status | string | The task status with which the job started. (READY, FAILED, SUCCEEDED, CANCELED, SUSPENDED, PENDING) |
task_failure_retry_count | integer | The total number of times tasks from the job failed and were retried. |
task_run_status | string | The task run status for the job. (PENDING, READY, ASSIGNED, STARTING, SCHEDULED, INTERRUPTING, RUNNING, SUSPENDED, CANCELED, FAILED, SUCCEEDED, NOT_COMPATIBLE) |
task_run_status_counts | object | The number of tasks running on the job. |
updated_at | string (date-time) | The date and time the resource was updated. |
updated_by | string | The user or system that updated this resource. |
| Name | Datatype | Description |
|---|---|---|
jobs | array | The jobs in the search. |
next_item_offset | integer | The next item offset for the search results. |
total_results | integer | The total number of results in the search. |
| Name | Datatype | Description |
|---|---|---|
name | string | The job name. |
created_at | string (date-time) | The date and time the resource was created. |
created_by | string | The user or system that created this resource. |
ended_at | string (date-time) | The date and time the resource ended running. |
job_id | string | The job ID. (pattern: <code>job-[0-9a-f]{32}</code>) |
lifecycle_status | string | The life cycle status. (CREATE_IN_PROGRESS, CREATE_FAILED, CREATE_COMPLETE, UPLOAD_IN_PROGRESS, UPLOAD_FAILED, UPDATE_IN_PROGRESS, UPDATE_FAILED, UPDATE_SUCCEEDED, ARCHIVED) |
lifecycle_status_message | string | The life cycle status message. |
max_failed_tasks_count | integer | The number of task failures before the job stops running and is marked as FAILED. |
max_retries_per_task | integer | The maximum number of retries for a job. |
max_worker_count | integer | The 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. You can't set the maxWorkerCount to 0. If you set it to -1, there is no maximum number of workers. If you don't specify the maxWorkerCount, the default is -1. |
priority | integer | The job priority. |
source_job_id | string | The job ID for the source job. (pattern: <code>job-[0-9a-f]{32}</code>) |
started_at | string (date-time) | The date and time the resource started running. |
target_task_run_status | string | The task status to update the job's tasks to. (READY, FAILED, SUCCEEDED, CANCELED, SUSPENDED, PENDING) |
task_failure_retry_count | integer | The total number of times tasks from the job failed and were retried. |
task_run_status | string | The task run status for the job. PENDING–pending and waiting for resources. READY–ready to be processed. ASSIGNED–assigned and will run next on a worker. SCHEDULED–scheduled to be run on a worker. INTERRUPTING–being interrupted. RUNNING–running on a worker. SUSPENDED–the task is suspended. CANCELED–the task has been canceled. FAILED–the task has failed. SUCCEEDED–the task has succeeded. (PENDING, READY, ASSIGNED, STARTING, SCHEDULED, INTERRUPTING, RUNNING, SUSPENDED, CANCELED, FAILED, SUCCEEDED, NOT_COMPATIBLE) |
task_run_status_counts | object | The number of tasks running on the job. |
updated_at | string (date-time) | The date and time the resource was updated. |
updated_by | string | The user or system that updated this resource. |
| Name | Datatype | Description |
|---|---|---|
errors | array | A list of errors for jobs that could not be retrieved. |
jobs | array | A list of jobs that were successfully retrieved. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_job | select | farm_id, queue_id, job_id, region | Gets a Deadline Cloud job. | |
search_jobs | select | farm_id, region | Searches for jobs. | |
list_jobs | select | farm_id, queue_id, region | nextToken, maxResults, principalId | Lists jobs. |
batch_get_job | select | region | Retrieves 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_job | insert | farm_id, queue_id, region, priority | X-Amz-Client-Token | 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. |
associate_member_to_job | update | farm_id, queue_id, job_id, principal_id, region, principalType, identityStoreId, membershipLevel | Assigns a job membership level to a member | |
disassociate_member_from_job | update | farm_id, queue_id, job_id, principal_id, region | Disassociates a member from a job. | |
update_job | update | farm_id, queue_id, job_id, region | X-Amz-Client-Token | Updates 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_template | exec | farm_id, queue_id, job_id, region, targetS3Location | Copies 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.
| Name | Datatype | Description |
|---|---|---|
farm_id | string | The farm ID to copy. |
job_id | string | The job ID to copy. |
principal_id | string | A member's principal ID to disassociate from a job. |
queue_id | string | The queue ID to copy. |
region | string | AWS region (default: us-east-1) |
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. |
principalId | string | The principal ID of the members on the jobs. |
SELECT examples
- get_job
- search_jobs
- list_jobs
- batch_get_job
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
;
Searches for jobs.
SELECT
jobs,
next_item_offset,
total_results
FROM aws.deadline.jobs
WHERE farm_id = '{{ farm_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists jobs.
SELECT
name,
created_at,
created_by,
ended_at,
job_id,
lifecycle_status,
lifecycle_status_message,
max_failed_tasks_count,
max_retries_per_task,
max_worker_count,
priority,
source_job_id,
started_at,
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 region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND principalId = '{{ principalId }}'
;
Retrieves 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.
SELECT
errors,
jobs
FROM aws.deadline.jobs
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_job
- Manifest
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
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: farm_id
value: "{{ farm_id }}"
description: Required parameter for the jobs resource.
- name: queue_id
value: "{{ queue_id }}"
description: Required parameter for the jobs resource.
- name: region
value: "{{ region }}"
description: Required parameter for the jobs resource.
- name: template
value: "{{ template }}"
- name: templateType
value: "{{ templateType }}"
valid_values: ['JSON', 'YAML']
- name: priority
value: {{ priority }}
- name: parameters
value: "{{ parameters }}"
- name: attachments
description: |
The job attachments.
value:
manifests:
- fileSystemLocationName: "{{ fileSystemLocationName }}"
rootPath: "{{ rootPath }}"
rootPathFormat: "{{ rootPathFormat }}"
outputRelativeDirectories: "{{ outputRelativeDirectories }}"
inputManifestPath: "{{ inputManifestPath }}"
inputManifestHash: "{{ inputManifestHash }}"
fileSystem: "{{ fileSystem }}"
- name: storageProfileId
value: "{{ storageProfileId }}"
- name: targetTaskRunStatus
value: "{{ targetTaskRunStatus }}"
valid_values: ['READY', 'SUSPENDED']
- name: maxFailedTasksCount
value: {{ maxFailedTasksCount }}
- name: maxRetriesPerTask
value: {{ maxRetriesPerTask }}
- name: maxWorkerCount
value: {{ maxWorkerCount }}
- name: sourceJobId
value: "{{ sourceJobId }}"
- name: nameOverride
value: "{{ nameOverride }}"
- name: descriptionOverride
value: "{{ descriptionOverride }}"
- 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
- associate_member_to_job
- disassociate_member_from_job
- update_job
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;
Disassociates a member from a job.
UPDATE aws.deadline.jobs
SET
-- No updatable properties
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;
Updates 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.
UPDATE aws.deadline.jobs
SET
targetTaskRunStatus = '{{ targetTaskRunStatus }}',
priority = {{ priority }},
maxFailedTasksCount = {{ maxFailedTasksCount }},
maxRetriesPerTask = {{ maxRetriesPerTask }},
lifecycleStatus = '{{ lifecycleStatus }}',
maxWorkerCount = {{ maxWorkerCount }},
name = '{{ name }}',
description = '{{ description }}'
WHERE
farm_id = '{{ farm_id }}' --required
AND queue_id = '{{ queue_id }}' --required
AND job_id = '{{ job_id }}' --required
AND region = '{{ region }}' --required
AND `X-Amz-Client-Token` = '{{ X-Amz-Client-Token}}';
Lifecycle Methods
- copy_job_template
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 }}"
}'
;