DescribeJobs - AWS Batch

DescribeJobs

Describes a list of AWS Batch jobs.

Request Syntax

POST /v1/describejobs HTTP/1.1 Content-type: application/json { "jobs": [ "string" ] }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

jobs

A list of up to 100 job IDs.

Type: Array of strings

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "jobs": [ { "arrayProperties": { "index": number, "size": number, "statusSummary": { "string" : number } }, "attempts": [ { "container": { "containerInstanceArn": "string", "exitCode": number, "logStreamName": "string", "networkInterfaces": [ { "attachmentId": "string", "ipv6Address": "string", "privateIpv4Address": "string" } ], "reason": "string", "taskArn": "string" }, "startedAt": number, "statusReason": "string", "stoppedAt": number } ], "container": { "command": [ "string" ], "containerInstanceArn": "string", "environment": [ { "name": "string", "value": "string" } ], "ephemeralStorage": { "sizeInGiB": number }, "executionRoleArn": "string", "exitCode": number, "fargatePlatformConfiguration": { "platformVersion": "string" }, "image": "string", "instanceType": "string", "jobRoleArn": "string", "linuxParameters": { "devices": [ { "containerPath": "string", "hostPath": "string", "permissions": [ "string" ] } ], "initProcessEnabled": boolean, "maxSwap": number, "sharedMemorySize": number, "swappiness": number, "tmpfs": [ { "containerPath": "string", "mountOptions": [ "string" ], "size": number } ] }, "logConfiguration": { "logDriver": "string", "options": { "string" : "string" }, "secretOptions": [ { "name": "string", "valueFrom": "string" } ] }, "logStreamName": "string", "memory": number, "mountPoints": [ { "containerPath": "string", "readOnly": boolean, "sourceVolume": "string" } ], "networkConfiguration": { "assignPublicIp": "string" }, "networkInterfaces": [ { "attachmentId": "string", "ipv6Address": "string", "privateIpv4Address": "string" } ], "privileged": boolean, "readonlyRootFilesystem": boolean, "reason": "string", "repositoryCredentials": { "credentialsParameter": "string" }, "resourceRequirements": [ { "type": "string", "value": "string" } ], "runtimePlatform": { "cpuArchitecture": "string", "operatingSystemFamily": "string" }, "secrets": [ { "name": "string", "valueFrom": "string" } ], "taskArn": "string", "ulimits": [ { "hardLimit": number, "name": "string", "softLimit": number } ], "user": "string", "vcpus": number, "volumes": [ { "efsVolumeConfiguration": { "authorizationConfig": { "accessPointId": "string", "iam": "string" }, "fileSystemId": "string", "rootDirectory": "string", "transitEncryption": "string", "transitEncryptionPort": number }, "host": { "sourcePath": "string" }, "name": "string" } ] }, "createdAt": number, "dependsOn": [ { "jobId": "string", "type": "string" } ], "ecsProperties": { "taskProperties": [ { "containerInstanceArn": "string", "containers": [ { "command": [ "string" ], "dependsOn": [ { "condition": "string", "containerName": "string" } ], "environment": [ { "name": "string", "value": "string" } ], "essential": boolean, "exitCode": number, "image": "string", "linuxParameters": { "devices": [ { "containerPath": "string", "hostPath": "string", "permissions": [ "string" ] } ], "initProcessEnabled": boolean, "maxSwap": number, "sharedMemorySize": number, "swappiness": number, "tmpfs": [ { "containerPath": "string", "mountOptions": [ "string" ], "size": number } ] }, "logConfiguration": { "logDriver": "string", "options": { "string" : "string" }, "secretOptions": [ { "name": "string", "valueFrom": "string" } ] }, "logStreamName": "string", "mountPoints": [ { "containerPath": "string", "readOnly": boolean, "sourceVolume": "string" } ], "name": "string", "networkInterfaces": [ { "attachmentId": "string", "ipv6Address": "string", "privateIpv4Address": "string" } ], "privileged": boolean, "readonlyRootFilesystem": boolean, "reason": "string", "repositoryCredentials": { "credentialsParameter": "string" }, "resourceRequirements": [ { "type": "string", "value": "string" } ], "secrets": [ { "name": "string", "valueFrom": "string" } ], "ulimits": [ { "hardLimit": number, "name": "string", "softLimit": number } ], "user": "string" } ], "ephemeralStorage": { "sizeInGiB": number }, "executionRoleArn": "string", "ipcMode": "string", "networkConfiguration": { "assignPublicIp": "string" }, "pidMode": "string", "platformVersion": "string", "runtimePlatform": { "cpuArchitecture": "string", "operatingSystemFamily": "string" }, "taskArn": "string", "taskRoleArn": "string", "volumes": [ { "efsVolumeConfiguration": { "authorizationConfig": { "accessPointId": "string", "iam": "string" }, "fileSystemId": "string", "rootDirectory": "string", "transitEncryption": "string", "transitEncryptionPort": number }, "host": { "sourcePath": "string" }, "name": "string" } ] } ] }, "eksAttempts": [ { "containers": [ { "exitCode": number, "reason": "string" } ], "initContainers": [ { "exitCode": number, "reason": "string" } ], "nodeName": "string", "podName": "string", "startedAt": number, "statusReason": "string", "stoppedAt": number } ], "eksProperties": { "podProperties": { "containers": [ { "args": [ "string" ], "command": [ "string" ], "env": [ { "name": "string", "value": "string" } ], "exitCode": number, "image": "string", "imagePullPolicy": "string", "name": "string", "reason": "string", "resources": { "limits": { "string" : "string" }, "requests": { "string" : "string" } }, "securityContext": { "privileged": boolean, "readOnlyRootFilesystem": boolean, "runAsGroup": number, "runAsNonRoot": boolean, "runAsUser": number }, "volumeMounts": [ { "mountPath": "string", "name": "string", "readOnly": boolean } ] } ], "dnsPolicy": "string", "hostNetwork": boolean, "initContainers": [ { "args": [ "string" ], "command": [ "string" ], "env": [ { "name": "string", "value": "string" } ], "exitCode": number, "image": "string", "imagePullPolicy": "string", "name": "string", "reason": "string", "resources": { "limits": { "string" : "string" }, "requests": { "string" : "string" } }, "securityContext": { "privileged": boolean, "readOnlyRootFilesystem": boolean, "runAsGroup": number, "runAsNonRoot": boolean, "runAsUser": number }, "volumeMounts": [ { "mountPath": "string", "name": "string", "readOnly": boolean } ] } ], "metadata": { "labels": { "string" : "string" } }, "nodeName": "string", "podName": "string", "serviceAccountName": "string", "shareProcessNamespace": boolean, "volumes": [ { "emptyDir": { "medium": "string", "sizeLimit": "string" }, "hostPath": { "path": "string" }, "name": "string", "secret": { "optional": boolean, "secretName": "string" } } ] } }, "isCancelled": boolean, "isTerminated": boolean, "jobArn": "string", "jobDefinition": "string", "jobId": "string", "jobName": "string", "jobQueue": "string", "nodeDetails": { "isMainNode": boolean, "nodeIndex": number }, "nodeProperties": { "mainNode": number, "nodeRangeProperties": [ { "container": { "command": [ "string" ], "environment": [ { "name": "string", "value": "string" } ], "ephemeralStorage": { "sizeInGiB": number }, "executionRoleArn": "string", "fargatePlatformConfiguration": { "platformVersion": "string" }, "image": "string", "instanceType": "string", "jobRoleArn": "string", "linuxParameters": { "devices": [ { "containerPath": "string", "hostPath": "string", "permissions": [ "string" ] } ], "initProcessEnabled": boolean, "maxSwap": number, "sharedMemorySize": number, "swappiness": number, "tmpfs": [ { "containerPath": "string", "mountOptions": [ "string" ], "size": number } ] }, "logConfiguration": { "logDriver": "string", "options": { "string" : "string" }, "secretOptions": [ { "name": "string", "valueFrom": "string" } ] }, "memory": number, "mountPoints": [ { "containerPath": "string", "readOnly": boolean, "sourceVolume": "string" } ], "networkConfiguration": { "assignPublicIp": "string" }, "privileged": boolean, "readonlyRootFilesystem": boolean, "repositoryCredentials": { "credentialsParameter": "string" }, "resourceRequirements": [ { "type": "string", "value": "string" } ], "runtimePlatform": { "cpuArchitecture": "string", "operatingSystemFamily": "string" }, "secrets": [ { "name": "string", "valueFrom": "string" } ], "ulimits": [ { "hardLimit": number, "name": "string", "softLimit": number } ], "user": "string", "vcpus": number, "volumes": [ { "efsVolumeConfiguration": { "authorizationConfig": { "accessPointId": "string", "iam": "string" }, "fileSystemId": "string", "rootDirectory": "string", "transitEncryption": "string", "transitEncryptionPort": number }, "host": { "sourcePath": "string" }, "name": "string" } ] }, "ecsProperties": { "taskProperties": [ { "containers": [ { "command": [ "string" ], "dependsOn": [ { "condition": "string", "containerName": "string" } ], "environment": [ { "name": "string", "value": "string" } ], "essential": boolean, "image": "string", "linuxParameters": { "devices": [ { "containerPath": "string", "hostPath": "string", "permissions": [ "string" ] } ], "initProcessEnabled": boolean, "maxSwap": number, "sharedMemorySize": number, "swappiness": number, "tmpfs": [ { "containerPath": "string", "mountOptions": [ "string" ], "size": number } ] }, "logConfiguration": { "logDriver": "string", "options": { "string" : "string" }, "secretOptions": [ { "name": "string", "valueFrom": "string" } ] }, "mountPoints": [ { "containerPath": "string", "readOnly": boolean, "sourceVolume": "string" } ], "name": "string", "privileged": boolean, "readonlyRootFilesystem": boolean, "repositoryCredentials": { "credentialsParameter": "string" }, "resourceRequirements": [ { "type": "string", "value": "string" } ], "secrets": [ { "name": "string", "valueFrom": "string" } ], "ulimits": [ { "hardLimit": number, "name": "string", "softLimit": number } ], "user": "string" } ], "ephemeralStorage": { "sizeInGiB": number }, "executionRoleArn": "string", "ipcMode": "string", "networkConfiguration": { "assignPublicIp": "string" }, "pidMode": "string", "platformVersion": "string", "runtimePlatform": { "cpuArchitecture": "string", "operatingSystemFamily": "string" }, "taskRoleArn": "string", "volumes": [ { "efsVolumeConfiguration": { "authorizationConfig": { "accessPointId": "string", "iam": "string" }, "fileSystemId": "string", "rootDirectory": "string", "transitEncryption": "string", "transitEncryptionPort": number }, "host": { "sourcePath": "string" }, "name": "string" } ] } ] }, "instanceTypes": [ "string" ], "targetNodes": "string" } ], "numNodes": number }, "parameters": { "string" : "string" }, "platformCapabilities": [ "string" ], "propagateTags": boolean, "retryStrategy": { "attempts": number, "evaluateOnExit": [ { "action": "string", "onExitCode": "string", "onReason": "string", "onStatusReason": "string" } ] }, "schedulingPriority": number, "shareIdentifier": "string", "startedAt": number, "status": "string", "statusReason": "string", "stoppedAt": number, "tags": { "string" : "string" }, "timeout": { "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.

jobs

The list of jobs.

Type: Array of JobDetail objects

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) or one of the AWS SDKs to make requests to AWS, these tools automatically sign the requests for you with the access key that you specify when you configure the tools. When you use these tools, you don't need to learn how to sign requests yourself.

Example

This example describes a job with the specified job ID.

Sample Request

POST /v1/describejobs HTTP/1.1 Host: batch.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: [content-length] Authorization: [authorization-params] X-Amz-Date: 20170327T151323Z User-Agent: aws-cli/1.11.22 Python/2.7.12 Darwin/16.1.0 botocore/1.4.79 { "jobs": [ "0668da57-1bcc-478b-bc14-5d4f1c1cef48" ] }

Sample Response

HTTP/1.1 200 OK Date: Mon, 27 Mar 2017 15:13:13 GMT Content-Type: application/json Content-Length: [content-length] Connection: keep-alive x-amzn-RequestId: [request-id] X-Amzn-Trace-Id: [trace-id] X-Cache: Miss from cloudfront Via: 1.1 8a78b675adb2cce925860f2fe4383e71.cloudfront.net (CloudFront) X-Amz-Cf-Id: TaW8k7yrDyXHgEU2udEEOAbliIY1iPmQr4LpN80ULdqyVGR6qP0q4Q== { "jobs": [ { "jobName": "EchoAttemptNumber", "jobId": "0668da57-1bcc-478b-bc14-5d4f1c1cef48", "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/HighPriority", "status": "FAILED", "attempts": [ { "container": { "containerInstanceArn": "arn:aws:ecs:us-east-1:123456789012:container-instance/90bfe527-119c-494a-b8fe-f5999c66d214", "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/af37d830-6978-4a2b-b796-e890e9b477b3", "exitCode": 1 }, "startedAt": 1490627002951, "stoppedAt": 1490627003065, "statusReason": "Essential container in task exited" }, { "container": { "containerInstanceArn": "arn:aws:ecs:us-east-1:123456789012:container-instance/90bfe527-119c-494a-b8fe-f5999c66d214", "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/3dfd4d0e-a177-4798-9c13-21b7148217bc", "exitCode": 2 }, "startedAt": 1490627019948, "stoppedAt": 1490627020059, "statusReason": "Essential container in task exited" }, { "container": { "containerInstanceArn": "arn:aws:ecs:us-east-1:123456789012:container-instance/90bfe527-119c-494a-b8fe-f5999c66d214", "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/22857040-182c-4af3-85f5-bb2c71edd282", "exitCode": 3 }, "startedAt": 1490627034798, "stoppedAt": 1490627034949, "statusReason": "Essential container in task exited" } ], "statusReason": "Essential container in task exited", "createdAt": 1490626709525, "retryStrategy": { "attempts": 3 }, "startedAt": 1490627034798, "stoppedAt": 1490627034949, "dependsOn": [], "jobDefinition": "arn:aws:batch:us-east-1:123456789012:job-definition/EchoAttemptNumber:1", "parameters": {}, "container": { "image": "amazonlinux", "vcpus": 1, "memory": 2, "command": [ "/bin/bash", "-c", "exit $AWS_BATCH_JOB_ATTEMPT" ], "volumes": [], "environment": [], "mountPoints": [], "ulimits": [], "exitCode": 3, "containerInstanceArn": "arn:aws:ecs:us-east-1:123456789012:container-instance/90bfe527-119c-494a-b8fe-f5999c66d214", "taskArn": "arn:aws:ecs:us-east-1:123456789012:task/22857040-182c-4af3-85f5-bb2c71edd282" } } ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: