Use DeleteJobQueue 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.

Use DeleteJobQueue with an AWS SDK or CLI

The following code examples show how to use DeleteJobQueue.

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 delete a job queue

This example deletes the GPGPU job queue.

Command:

aws batch delete-job-queue --job-queue 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.

/** * Deletes a Batch job queue asynchronously. * * @param jobQueueArn The Amazon Resource Name (ARN) of the job queue to delete. * @return A CompletableFuture that represents the asynchronous deletion of the job queue. * The future completes when the job queue has been successfully deleted or if an error occurs. * If successful, the future will be completed with a {@code Void} value. * If an error occurs, the future will be completed exceptionally with the thrown exception. */ public CompletableFuture<Void> deleteJobQueueAsync(String jobQueueArn) { DeleteJobQueueRequest deleteRequest = DeleteJobQueueRequest.builder() .jobQueue(jobQueueArn) .build(); CompletableFuture<DeleteJobQueueResponse> responseFuture = getAsyncClient().deleteJobQueue(deleteRequest); return responseFuture.whenComplete((deleteResponse, ex) -> { if (ex != null) { throw new RuntimeException("Failed to delete job queue: " + ex.getMessage(), ex); } }).thenApply(deleteResponse -> null); }
  • For API details, see DeleteJobQueue in AWS SDK for Java 2.x API Reference.