createQueue method

Future<CreateQueueResponse> createQueue({
  1. required String displayName,
  2. required String farmId,
  3. List<String>? allowedStorageProfileIds,
  4. String? clientToken,
  5. DefaultQueueBudgetAction? defaultBudgetAction,
  6. String? description,
  7. JobAttachmentSettings? jobAttachmentSettings,
  8. JobRunAsUser? jobRunAsUser,
  9. List<String>? requiredFileSystemLocationNames,
  10. String? roleArn,
  11. SchedulingConfiguration? schedulingConfiguration,
  12. Map<String, String>? tags,
})

Creates a queue to coordinate the order in which jobs run on a farm. A queue can also specify where to pull resources and indicate where to output completed jobs.

May throw AccessDeniedException. May throw InternalServerErrorException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter displayName : The display name of the queue.

Parameter farmId : The farm ID of the farm to connect to the queue.

Parameter allowedStorageProfileIds : The storage profile IDs to include in the queue.

Parameter clientToken : The unique token which the server uses to recognize retries of the same request.

Parameter defaultBudgetAction : The default action to take on a queue if a budget isn't configured.

Parameter description : The description of the queue.

Parameter jobAttachmentSettings : The job attachment settings for the queue. These are the Amazon S3 bucket name and the Amazon S3 prefix.

Parameter jobRunAsUser : The jobs in the queue run as the specified POSIX user.

Parameter requiredFileSystemLocationNames : The file system location name to include in the queue.

Parameter roleArn : The IAM role ARN that workers will use while running jobs for this queue.

Parameter schedulingConfiguration : The scheduling configuration for the queue. This configuration determines how workers are assigned to jobs in the queue.

If not specified, the queue defaults to the priorityFifo scheduling configuration.

Parameter tags : Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.

Implementation

Future<CreateQueueResponse> createQueue({
  required String displayName,
  required String farmId,
  List<String>? allowedStorageProfileIds,
  String? clientToken,
  DefaultQueueBudgetAction? defaultBudgetAction,
  String? description,
  JobAttachmentSettings? jobAttachmentSettings,
  JobRunAsUser? jobRunAsUser,
  List<String>? requiredFileSystemLocationNames,
  String? roleArn,
  SchedulingConfiguration? schedulingConfiguration,
  Map<String, String>? tags,
}) async {
  final headers = <String, String>{
    if (clientToken != null) 'X-Amz-Client-Token': clientToken.toString(),
  };
  final $payload = <String, dynamic>{
    'displayName': displayName,
    if (allowedStorageProfileIds != null)
      'allowedStorageProfileIds': allowedStorageProfileIds,
    if (defaultBudgetAction != null)
      'defaultBudgetAction': defaultBudgetAction.value,
    if (description != null) 'description': description,
    if (jobAttachmentSettings != null)
      'jobAttachmentSettings': jobAttachmentSettings,
    if (jobRunAsUser != null) 'jobRunAsUser': jobRunAsUser,
    if (requiredFileSystemLocationNames != null)
      'requiredFileSystemLocationNames': requiredFileSystemLocationNames,
    if (roleArn != null) 'roleArn': roleArn,
    if (schedulingConfiguration != null)
      'schedulingConfiguration': schedulingConfiguration,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/queues',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return CreateQueueResponse.fromJson(response);
}