DescribeServiceJob
The details of a service job.
Request Syntax
POST /v1/describeservicejob HTTP/1.1
Content-type: application/json
{
"jobId": "string
"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- jobId
-
The job ID for the service job to describe.
Type: String
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"attempts": [
{
"serviceResourceId": {
"name": "string",
"value": "string"
},
"startedAt": number,
"statusReason": "string",
"stoppedAt": number
}
],
"createdAt": number,
"isTerminated": boolean,
"jobArn": "string",
"jobId": "string",
"jobName": "string",
"jobQueue": "string",
"latestAttempt": {
"serviceResourceId": {
"name": "string",
"value": "string"
}
},
"retryStrategy": {
"attempts": number,
"evaluateOnExit": [
{
"action": "string",
"onStatusReason": "string"
}
]
},
"schedulingPriority": number,
"serviceJobType": "string",
"serviceRequestPayload": "string",
"shareIdentifier": "string",
"startedAt": number,
"status": "string",
"statusReason": "string",
"stoppedAt": number,
"tags": {
"string" : "string"
},
"timeoutConfig": {
"attemptDurationSeconds": number
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- attempts
-
A list of job attempts associated with the service job.
Type: Array of ServiceJobAttemptDetail objects
- createdAt
-
The Unix timestamp (in milliseconds) for when the service job was created.
Type: Long
- isTerminated
-
Indicates whether the service job has been terminated.
Type: Boolean
- jobArn
-
The Amazon Resource Name (ARN) of the service job.
Type: String
- jobId
-
The job ID for the service job.
Type: String
- jobName
-
The name of the service job.
Type: String
- jobQueue
-
The ARN of the job queue that the service job is associated with.
Type: String
- latestAttempt
-
The latest attempt associated with the service job.
Type: LatestServiceJobAttempt object
- retryStrategy
-
The retry strategy to use for failed service jobs that are submitted with this service job.
Type: ServiceJobRetryStrategy object
- schedulingPriority
-
The scheduling priority of the service job.
Type: Integer
- serviceJobType
-
The type of service job. For SageMaker Training jobs, this value is
SAGEMAKER_TRAINING
.Type: String
Valid Values:
SAGEMAKER_TRAINING
- serviceRequestPayload
-
The request, in JSON, for the service that the
SubmitServiceJob
operation is queueing.Type: String
-
The share identifier for the service job. This is used for fair-share scheduling.
Type: String
- startedAt
-
The Unix timestamp (in milliseconds) for when the service job was started.
Type: Long
- status
-
The current status of the service job.
Type: String
Valid Values:
SUBMITTED | PENDING | RUNNABLE | SCHEDULED | STARTING | RUNNING | SUCCEEDED | FAILED
- statusReason
-
A short, human-readable string to provide more details for the current status of the service job.
Type: String
- stoppedAt
-
The Unix timestamp (in milliseconds) for when the service job stopped running.
Type: Long
-
The tags that are associated with the service job. Each tag consists of a key and an optional value. For more information, see Tagging your AWS Batch resources.
Type: String to string map
Map Entries: Maximum number of 50 items.
Key Length Constraints: Minimum length of 1. Maximum length of 128.
Value Length Constraints: Maximum length of 256.
- timeoutConfig
-
The timeout configuration for the service job.
Type: ServiceJobTimeout object
Errors
- ClientException
-
These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.
HTTP Status Code: 400
- ServerException
-
These errors are usually caused by a server issue.
HTTP Status Code: 500
Examples
In the following example or examples, the Authorization header contents
(
[authorization-params]
) must be replaced with an AWS Signature Version 4
signature. For more information about creating these signatures, see Signature Version 4 Signing Process in the
AWS
General Reference.
You only need to learn how to sign HTTP requests if you intend to manually create them. When you use the AWS Command Line Interface (AWS CLI)
Example
This example describes the specified service job.
Sample Request
POST /v1/describeservicejob HTTP/1.1
Host: batch.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: [content-length]
Authorization: [authorization-params]
X-Amz-Date: 20250801T092145Z
User-Agent: aws-cli/2.27.33 Python/3.13.4 Darwin/24.3.0
{
"jobId": "a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d"
}
Sample Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: [content-length]
Connection: keep-alive
Date: Fri, 01 Aug 2025 09:21:46 GMT
x-amzn-RequestId: [request-id]
X-Amzn-Trace-Id: [trace-id]
X-Cache: Miss from cloudfront
Via: 1.1 49j3k6m2n8p5q7r4s1t9w2f76dsexample.cloudfront.net (CloudFront)
X-Amz-Cf-Id: def3ghi6jkl9mno2pqr5stu8vwx2yz5012cdefghijklmnopqrexample
{
"jobId": "a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d",
"jobName": "sagemaker-training-job-example",
"jobArn": "arn:aws:batch:us-east-1:123456789012:service-job/a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d",
"jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/sagemaker-training-queue",
"status": "SUCCEEDED",
"statusReason": "Job completed successfully",
"serviceJobType": "SAGEMAKER_TRAINING",
"schedulingPriority": 100,
"isTerminated": false,
"createdAt": 1722507600000,
"startedAt": 1722507660000,
"stoppedAt": 1722511260000,
"serviceRequestPayload": "{\"TrainingJobName\": \"sagemaker-training-job-example\", \"AlgorithmSpecification\": {\"TrainingImage\": \"123456789012.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference:1.8.0-cpu-py3\", \"TrainingInputMode\": \"File\", \"ContainerEntrypoint\": [\"sleep\", \"1\"]}, \"RoleArn\":\"arn:aws:iam::123456789012:role/SageMakerExecutionRole\", \"OutputDataConfig\": {\"S3OutputPath\": \"s3://example-bucket/model-output/\"}, \"ResourceConfig\": {\"InstanceType\": \"ml.m5.large\", \"InstanceCount\": 1, \"VolumeSizeInGB\": 1}}",
"latestAttempt": {
"serviceResourceId": {
"name": "TrainingJobArn",
"value": "arn:aws:sagemaker:us-east-1:123456789012:training-job/sagemaker-training-job-example"
}
},
"attempts": [
{
"serviceResourceId": {
"name": "TrainingJobArn",
"value": "arn:aws:sagemaker:us-east-1:123456789012:training-job/sagemaker-training-job-example"
},
"startedAt": 1722507660000,
"stoppedAt": 1722511260000,
"statusReason": "Completed"
}
],
"tags": {}
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: