Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use UpdateJobQueue with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use UpdateJobQueue with an AWS SDK or CLI

The following code examples show how to use UpdateJobQueue.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

CLI
AWS CLI

To update a job queue

This example disables a job queue so that it can be deleted.

Command:

aws batch update-job-queue --job-queue GPGPU --state DISABLED

Output:

{ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU", "jobQueueName": "GPGPU" }
Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Disables the specified job queue asynchronously. * * @param jobQueueArn the Amazon Resource Name (ARN) of the job queue to be disabled * @return a {@link CompletableFuture} that completes when the job queue update operation is complete, * or completes exceptionally if an error occurs during the operation */ public CompletableFuture<Void> disableJobQueueAsync(String jobQueueArn) { UpdateJobQueueRequest updateRequest = UpdateJobQueueRequest.builder() .jobQueue(jobQueueArn) .state(JQState.DISABLED) .build(); CompletableFuture<UpdateJobQueueResponse> responseFuture = getAsyncClient().updateJobQueue(updateRequest); return responseFuture.whenComplete((updateResponse, ex) -> { if (ex != null) { throw new RuntimeException("Failed to update job queue: " + ex.getMessage(), ex); } }).thenApply(updateResponse -> null); }
  • For API details, see UpdateJobQueue in AWS SDK for Java 2.x API Reference.

AWS CLI

To update a job queue

This example disables a job queue so that it can be deleted.

Command:

aws batch update-job-queue --job-queue GPGPU --state DISABLED

Output:

{ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU", "jobQueueName": "GPGPU" }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.