cancelMLTaskRun method

Future<CancelMLTaskRunResponse> cancelMLTaskRun({
  1. required String taskRunId,
  2. required String transformId,
})

Cancels (stops) a task run. Machine learning task runs are asynchronous tasks that AWS Glue runs on your behalf as part of various machine learning workflows. You can cancel a machine learning task run at any time by calling CancelMLTaskRun with a task run's parent transform's TransformID and the task run's TaskRunId.

May throw EntityNotFoundException. May throw InvalidInputException. May throw OperationTimeoutException. May throw InternalServiceException.

Parameter taskRunId : A unique identifier for the task run.

Parameter transformId : The unique identifier of the machine learning transform.

Implementation

Future<CancelMLTaskRunResponse> cancelMLTaskRun({
  required String taskRunId,
  required String transformId,
}) async {
  ArgumentError.checkNotNull(taskRunId, 'taskRunId');
  _s.validateStringLength(
    'taskRunId',
    taskRunId,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(transformId, 'transformId');
  _s.validateStringLength(
    'transformId',
    transformId,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.CancelMLTaskRun'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TaskRunId': taskRunId,
      'TransformId': transformId,
    },
  );

  return CancelMLTaskRunResponse.fromJson(jsonResponse.body);
}