cancelMLModelTrainingJob method

Future<CancelMLModelTrainingJobOutput> cancelMLModelTrainingJob({
  1. required String id,
  2. bool? clean,
  3. String? neptuneIamRoleArn,
})

Cancels a Neptune ML model training job. See Model training using the modeltraining command.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:CancelMLModelTrainingJob IAM action in that cluster.

May throw BadRequestException. May throw ClientTimeoutException. May throw ConstraintViolationException. May throw IllegalArgumentException. May throw InvalidArgumentException. May throw InvalidParameterException. May throw MissingParameterException. May throw MLResourceNotFoundException. May throw PreconditionsFailedException. May throw TooManyRequestsException. May throw UnsupportedOperationException.

Parameter id : The unique identifier of the model-training job to be canceled.

Parameter clean : If set to TRUE, this flag specifies that all Amazon S3 artifacts should be deleted when the job is stopped. The default is FALSE.

Parameter neptuneIamRoleArn : The ARN of an IAM role that provides Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will occur.

Implementation

Future<CancelMLModelTrainingJobOutput> cancelMLModelTrainingJob({
  required String id,
  bool? clean,
  String? neptuneIamRoleArn,
}) async {
  final $query = <String, List<String>>{
    if (clean != null) 'clean': [clean.toString()],
    if (neptuneIamRoleArn != null) 'neptuneIamRoleArn': [neptuneIamRoleArn],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/ml/modeltraining/${Uri.encodeComponent(id)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return CancelMLModelTrainingJobOutput.fromJson(response);
}