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 AWS 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 in which the AWS 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 PCL 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, such as using an action or resource on behalf of a user that doesn't have permission to use the action or resource, or specifying an identifier that is 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 response = client.CreateJobQueue(new CreateJobQueueRequest 
{
    ComputeEnvironmentOrder = new List {
        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 response = client.CreateJobQueue(new CreateJobQueueRequest 
{
    ComputeEnvironmentOrder = new List {
        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

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also