Skip to main content

service_jobs

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

Overview

Nameservice_jobs
TypeResource
Idaws.batch.service_jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
attemptsarrayA list of job attempts associated with the service job.
capacity_usagearrayThe configured capacity for the service job, such as the number of instances. The number of instances should be the same value as the serviceRequestPayload.InstanceCount field.
created_atinteger (int64)The Unix timestamp (in milliseconds) for when the service job was created.
is_terminatedbooleanIndicates whether the service job has been terminated.
job_arnstringThe Amazon Resource Name (ARN) of the service job.
job_idstringThe job ID for the service job.
job_namestringThe name of the service job.
job_queuestringThe ARN of the job queue that the service job is associated with.
latest_attemptobjectThe latest attempt associated with the service job.
preemption_configurationobjectSpecifies the service job behavior when preempted.
preemption_summaryobjectSummarizes the preemptions of the service job. This field appears on a service job when it has been preempted.
quota_share_namestringThe name of the quota share that the service job is associated with.
retry_strategyobjectThe retry strategy to use for failed service jobs that are submitted with this service job.
scheduled_atinteger (int64)The Unix timestamp (in milliseconds) for when the service job was scheduled. This represents when the service job was dispatched to SageMaker and the service job transitioned to the SCHEDULED state.
scheduling_priorityintegerThe scheduling priority of the service job.
service_job_typestringThe type of service job. For SageMaker Training jobs, this value is SAGEMAKER_TRAINING. (SAGEMAKER_TRAINING)
service_request_payloadstringThe request, in JSON, for the service that the SubmitServiceJob operation is queueing.
share_identifierstringThe share identifier for the service job. This is used for fair-share scheduling.
started_atinteger (int64)The Unix timestamp (in milliseconds) for when the service job was started.
statusstringThe current status of the service job. (SUBMITTED, PENDING, RUNNABLE, SCHEDULED, STARTING, RUNNING, SUCCEEDED, FAILED)
status_reasonstringA short, human-readable string to provide more details for the current status of the service job.
stopped_atinteger (int64)The Unix timestamp (in milliseconds) for when the service job stopped running.
tagsobjectThe tags that are associated with the service job. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources.
timeout_configobjectThe timeout configuration for the service job.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_service_jobselectregionThe details of a service job.
list_service_jobsselectregionReturns a list of service jobs for a specified job queue.
update_service_jobupdateregion, jobId, schedulingPriorityUpdates the priority of a specified service job in an Batch job queue.
terminate_service_jobdeleteregionTerminates a service job in a job queue.

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
regionstringAWS region (default: us-east-1)

SELECT examples

The details of a service job.

SELECT
attempts,
capacity_usage,
created_at,
is_terminated,
job_arn,
job_id,
job_name,
job_queue,
latest_attempt,
preemption_configuration,
preemption_summary,
quota_share_name,
retry_strategy,
scheduled_at,
scheduling_priority,
service_job_type,
service_request_payload,
share_identifier,
started_at,
status,
status_reason,
stopped_at,
tags,
timeout_config
FROM aws.batch.service_jobs
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Updates the priority of a specified service job in an Batch job queue.

UPDATE aws.batch.service_jobs
SET
jobId = '{{ jobId }}',
schedulingPriority = {{ schedulingPriority }}
WHERE
region = '{{ region }}' --required
AND jobId = '{{ jobId }}' --required
AND schedulingPriority = '{{ schedulingPriority }}' --required
RETURNING
job_arn,
job_id,
job_name;

DELETE examples

Terminates a service job in a job queue.

DELETE FROM aws.batch.service_jobs
WHERE region = '{{ region }}' --required
;