createQueue method

Future<CreateQueueResponse> createQueue({
  1. required String clusterIdentifier,
  2. required String queueName,
  3. String? clientToken,
  4. List<ComputeNodeGroupConfiguration>? computeNodeGroupConfigurations,
  5. QueueSlurmConfigurationRequest? slurmConfiguration,
  6. Map<String, String>? tags,
})

Creates a job queue. You must associate 1 or more compute node groups with the queue. You can associate 1 compute node group with multiple queues.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter clusterIdentifier : The name or ID of the cluster for which to create a queue.

Parameter queueName : A name to identify the queue.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.

Parameter computeNodeGroupConfigurations : The list of compute node group configurations to associate with the queue. Queues assign jobs to associated compute node groups.

Parameter slurmConfiguration : Additional options related to the Slurm scheduler.

Parameter tags : 1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.

Implementation

Future<CreateQueueResponse> createQueue({
  required String clusterIdentifier,
  required String queueName,
  String? clientToken,
  List<ComputeNodeGroupConfiguration>? computeNodeGroupConfigurations,
  QueueSlurmConfigurationRequest? slurmConfiguration,
  Map<String, String>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSParallelComputingService.CreateQueue'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'clusterIdentifier': clusterIdentifier,
      'queueName': queueName,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (computeNodeGroupConfigurations != null)
        'computeNodeGroupConfigurations': computeNodeGroupConfigurations,
      if (slurmConfiguration != null)
        'slurmConfiguration': slurmConfiguration,
      if (tags != null) 'tags': tags,
    },
  );

  return CreateQueueResponse.fromJson(jsonResponse.body);
}