createJob method

Future<CreateJobResponse> createJob({
  1. required AlgorithmSpecification algorithmSpecification,
  2. required DeviceConfig deviceConfig,
  3. required InstanceConfig instanceConfig,
  4. required String jobName,
  5. required JobOutputDataConfig outputDataConfig,
  6. required String roleArn,
  7. List<Association>? associations,
  8. JobCheckpointConfig? checkpointConfig,
  9. String? clientToken,
  10. Map<String, String>? hyperParameters,
  11. List<InputFileConfig>? inputDataConfig,
  12. JobStoppingCondition? stoppingCondition,
  13. Map<String, String>? tags,
})

Creates an Amazon Braket hybrid job.

May throw AccessDeniedException. May throw ConflictException. May throw DeviceOfflineException. May throw DeviceRetiredException. May throw InternalServiceException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter algorithmSpecification : Definition of the Amazon Braket job to be created. Specifies the container image the job uses and information about the Python scripts used for entry and training.

Parameter deviceConfig : The quantum processing unit (QPU) or simulator used to create an Amazon Braket hybrid job.

Parameter instanceConfig : Configuration of the resource instances to use while running the hybrid job on Amazon Braket.

Parameter jobName : The name of the Amazon Braket hybrid job.

Parameter outputDataConfig : The path to the S3 location where you want to store hybrid job artifacts and the encryption key used to store them.

Parameter roleArn : The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output results and hybrid job details to the users' s3 buckets.

Parameter associations : The list of Amazon Braket resources associated with the hybrid job.

Parameter checkpointConfig : Information about the output locations for hybrid job checkpoint data.

Parameter clientToken : The client token associated with this request that guarantees that the request is idempotent.

Parameter hyperParameters : Algorithm-specific parameters used by an Amazon Braket hybrid job that influence the quality of the training job. The values are set with a map of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of the hyperparameter.

Parameter inputDataConfig : A list of parameters that specify the name and type of input data and where it is located.

Parameter stoppingCondition : The user-defined criteria that specifies when a hybrid job stops running.

Parameter tags : Tags to be added to the hybrid job you're creating.

Implementation

Future<CreateJobResponse> createJob({
  required AlgorithmSpecification algorithmSpecification,
  required DeviceConfig deviceConfig,
  required InstanceConfig instanceConfig,
  required String jobName,
  required JobOutputDataConfig outputDataConfig,
  required String roleArn,
  List<Association>? associations,
  JobCheckpointConfig? checkpointConfig,
  String? clientToken,
  Map<String, String>? hyperParameters,
  List<InputFileConfig>? inputDataConfig,
  JobStoppingCondition? stoppingCondition,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'algorithmSpecification': algorithmSpecification,
    'deviceConfig': deviceConfig,
    'instanceConfig': instanceConfig,
    'jobName': jobName,
    'outputDataConfig': outputDataConfig,
    'roleArn': roleArn,
    if (associations != null) 'associations': associations,
    if (checkpointConfig != null) 'checkpointConfig': checkpointConfig,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (hyperParameters != null) 'hyperParameters': hyperParameters,
    if (inputDataConfig != null) 'inputDataConfig': inputDataConfig,
    if (stoppingCondition != null) 'stoppingCondition': stoppingCondition,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/job',
    exceptionFnMap: _exceptionFns,
  );
  return CreateJobResponse.fromJson(response);
}