createRunGroup method

Future<CreateRunGroupResponse> createRunGroup({
  1. int? maxCpus,
  2. int? maxDuration,
  3. int? maxGpus,
  4. int? maxRuns,
  5. String? name,
  6. String? requestId,
  7. Map<String, String>? tags,
})

Creates a run group to limit the compute resources for the runs that are added to the group. Returns an ARN, ID, and tags for the run group.

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

Parameter maxCpus : The maximum number of CPUs that can run concurrently across all active runs in the run group.

Parameter maxDuration : The maximum time for each run (in minutes). If a run exceeds the maximum run time, the run fails automatically.

Parameter maxGpus : The maximum number of GPUs that can run concurrently across all active runs in the run group.

Parameter maxRuns : The maximum number of runs that can be running at the same time.

Parameter name : A name for the group.

Parameter requestId : To ensure that requests don't run multiple times, specify a unique ID for each request.

Parameter tags : Tags for the group.

Implementation

Future<CreateRunGroupResponse> createRunGroup({
  int? maxCpus,
  int? maxDuration,
  int? maxGpus,
  int? maxRuns,
  String? name,
  String? requestId,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (maxCpus != null) 'maxCpus': maxCpus,
    if (maxDuration != null) 'maxDuration': maxDuration,
    if (maxGpus != null) 'maxGpus': maxGpus,
    if (maxRuns != null) 'maxRuns': maxRuns,
    if (name != null) 'name': name,
    'requestId': requestId ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/runGroup',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRunGroupResponse.fromJson(response);
}