createQuotaShare method

Future<CreateQuotaShareResponse> createQuotaShare({
  1. required List<QuotaShareCapacityLimit> capacityLimits,
  2. required String jobQueue,
  3. required QuotaSharePreemptionConfiguration preemptionConfiguration,
  4. required String quotaShareName,
  5. required QuotaShareResourceSharingConfiguration resourceSharingConfiguration,
  6. QuotaShareState? state,
  7. Map<String, String>? tags,
})

Creates an Batch quota share. Each quota share operates as a virtual queue with a configured compute capacity, resource sharing strategy, and borrow limits.

May throw ClientException. May throw ServerException.

Parameter capacityLimits : A list that specifies the quantity and type of compute capacity allocated to the quota share.

Parameter jobQueue : The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the VALID state before you can associate it with a quota share.

Parameter preemptionConfiguration : Specifies the preemption behavior for jobs in a quota share.

Parameter quotaShareName : The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).

Parameter resourceSharingConfiguration : Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.

Parameter state : The state of the quota share. If the quota share is ENABLED, it is able to accept jobs. If the quota share is DISABLED, new jobs won't be accepted but jobs already submitted can finish. The default state is ENABLED.

Parameter tags : The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources in Batch User Guide.

Implementation

Future<CreateQuotaShareResponse> createQuotaShare({
  required List<QuotaShareCapacityLimit> capacityLimits,
  required String jobQueue,
  required QuotaSharePreemptionConfiguration preemptionConfiguration,
  required String quotaShareName,
  required QuotaShareResourceSharingConfiguration
      resourceSharingConfiguration,
  QuotaShareState? state,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'capacityLimits': capacityLimits,
    'jobQueue': jobQueue,
    'preemptionConfiguration': preemptionConfiguration,
    'quotaShareName': quotaShareName,
    'resourceSharingConfiguration': resourceSharingConfiguration,
    if (state != null) 'state': state.value,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/createquotashare',
    exceptionFnMap: _exceptionFns,
  );
  return CreateQuotaShareResponse.fromJson(response);
}