AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.

You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateJobQueueAsync.

Namespace: Amazon.Batch
Assembly: AWSSDK.Batch.dll
Version: 3.x.y.z

Syntax

C#
public abstract CreateJobQueueResponse CreateJobQueue(
         CreateJobQueueRequest request
)

Parameters

request
Type: Amazon.Batch.Model.CreateJobQueueRequest

Container for the necessary parameters to execute the CreateJobQueue service method.

Return Value


The response from the CreateJobQueue service method, as returned by Batch.

Exceptions

ExceptionCondition
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.
ServerException These errors are usually caused by a server issue.

Examples

This example creates a job queue called LowPriority that uses the M4Spot compute environment.

To create a job queue with a single compute environment


var client = new AmazonBatchClient();
var response = client.CreateJobQueue(new CreateJobQueueRequest 
{
    ComputeEnvironmentOrder = new List<ComputeEnvironmentOrder> {
        new ComputeEnvironmentOrder {
            ComputeEnvironment = "M4Spot",
            Order = 1
        }
    },
    JobQueueName = "LowPriority",
    Priority = 1,
    State = "ENABLED"
});

string jobQueueArn = response.JobQueueArn;
string jobQueueName = response.JobQueueName;

            

This example creates a job queue called HighPriority that uses the C4OnDemand compute environment with an order of 1 and the M4Spot compute environment with an order of 2.

To create a job queue with multiple compute environments


var client = new AmazonBatchClient();
var response = client.CreateJobQueue(new CreateJobQueueRequest 
{
    ComputeEnvironmentOrder = new List<ComputeEnvironmentOrder> {
        new ComputeEnvironmentOrder {
            ComputeEnvironment = "C4OnDemand",
            Order = 1
        },
        new ComputeEnvironmentOrder {
            ComputeEnvironment = "M4Spot",
            Order = 2
        }
    },
    JobQueueName = "HighPriority",
    Priority = 10,
    State = "ENABLED"
});

string jobQueueArn = response.JobQueueArn;
string jobQueueName = response.JobQueueName;

            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also