Menu
AWS Batch
API Reference (API Version 2016-08-10)

DescribeJobDefinitions

Describes a list of job definitions. You can specify a status (such as ACTIVE) to only return job definitions that match that status.

Request Syntax

POST /v1/describejobdefinitions HTTP/1.1
Content-type: application/json

{
   "jobDefinitionName": "string",
   "jobDefinitions": [ "string" ],
   "maxResults": number,
   "nextToken": "string",
   "status": "string"
}

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

jobDefinitionName

The name of the job definition to describe.

Type: String

Required: No

jobDefinitions

A space-separated list of up to 100 job definition names or full Amazon Resource Name (ARN) entries.

Type: Array of strings

Required: No

maxResults

The maximum number of results returned by DescribeJobDefinitions in paginated output. When this parameter is used, DescribeJobDefinitions only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeJobDefinitions request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then DescribeJobDefinitions returns up to 100 results and a nextToken value if applicable.

Type: Integer

Required: No

nextToken

The nextToken value returned from a previous paginated DescribeJobDefinitions request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

Note

This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.

Type: String

Required: No

status

The status with which to filter job definitions.

Type: String

Required: No

Response Syntax

HTTP/1.1 200
Content-type: application/json

{
   "jobDefinitions": [ 
      { 
         "containerProperties": { 
            "command": [ "string" ],
            "environment": [ 
               { 
                  "name": "string",
                  "value": "string"
               }
            ],
            "image": "string",
            "jobRoleArn": "string",
            "memory": number,
            "mountPoints": [ 
               { 
                  "containerPath": "string",
                  "readOnly": boolean,
                  "sourceVolume": "string"
               }
            ],
            "privileged": boolean,
            "readonlyRootFilesystem": boolean,
            "ulimits": [ 
               { 
                  "hardLimit": number,
                  "name": "string",
                  "softLimit": number
               }
            ],
            "user": "string",
            "vcpus": number,
            "volumes": [ 
               { 
                  "host": { 
                     "sourcePath": "string"
                  },
                  "name": "string"
               }
            ]
         },
         "jobDefinitionArn": "string",
         "jobDefinitionName": "string",
         "parameters": { 
            "string" : "string" 
         },
         "retryStrategy": { 
            "attempts": number
         },
         "revision": number,
         "status": "string",
         "type": "string"
      }
   ],
   "nextToken": "string"
}

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.

jobDefinitions

The list of job definitions.

Type: Array of JobDefinition objects

nextToken

The nextToken value to include in a future DescribeJobDefinitions request. When the results of a DescribeJobDefinitions request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

Type: String

Errors

ClientException

These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid.

HTTP Status Code: 400

ServerException

These errors are usually caused by a server issue.

HTTP Status Code: 500

Example

In the following example or examples, the Authorization header contents (AUTHPARAMS) 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 all of your active job definitions.

Sample Request

POST /v1/describejobdefinitions HTTP/1.1
Host: batch.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 20
Authorization: AUTHPARAMS
X-Amz-Date: 20161128T221855Z
User-Agent: aws-cli/1.11.21 Python/2.7.12 Darwin/16.1.0 botocore/1.4.78

{
  "status": "ACTIVE"
}

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 351
Connection: keep-alive
Date: Mon, 28 Nov 2016 22:18:55 GMT
x-amzn-RequestId: a6856a57-b5b8-11e6-b057-0594e7a2cf06
X-Amzn-Trace-Id: Root=1-583cad4f-d67ae20374b79d9adbaca1fb
X-Cache: Miss from cloudfront
Via: 1.1 688936cc730f240888e6a59a81892a3d.cloudfront.net (CloudFront)
X-Amz-Cf-Id: hd-CAMqfaCJt-1oH7tBu9j5c-IhLQuMjFHFPck6F0MMt5CBea8mQBQ==

{
	"jobDefinitions": [{
		"jobDefinitionName": "sleep60",
		"jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1",
		"revision": 1,
		"status": "ACTIVE",
		"type": "container",
		"containerProperties": {
			"image": "busybox",
			"vcpus": 1,
			"memory": 128,
			"command": ["sleep", "60"],
			"volumes": [],
			"environment": [],
			"mountPoints": [],
			"ulimits": []
		}
	}]
}

See Also

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