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.
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
public virtual CreateJobQueueResponse CreateJobQueue( CreateJobQueueRequest request )
Container for the necessary parameters to execute the CreateJobQueue service method.
| Exception | Condition |
|---|---|
| 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. |
This example creates a job queue called LowPriority that uses the M4Spot 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.
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;
.NET Framework:
Supported in: 4.7.2 and newer