cancelDataRepositoryTask method

Future<CancelDataRepositoryTaskResponse> cancelDataRepositoryTask({
  1. required String taskId,
})

Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the PENDING or EXECUTING state. When you cancel an export task, Amazon FSx does the following.

  • Any files that FSx has already exported are not reverted.
  • FSx continues to export any files that are in-flight when the cancel operation is received.
  • FSx does not export any files that have not yet been exported.
For a release task, Amazon FSx will stop releasing files upon cancellation. Any files that have already been released will remain in the released state.

May throw BadRequest. May throw DataRepositoryTaskEnded. May throw DataRepositoryTaskNotFound. May throw InternalServerError. May throw UnsupportedOperation.

Parameter taskId : Specifies the data repository task to cancel.

Implementation

Future<CancelDataRepositoryTaskResponse> cancelDataRepositoryTask({
  required String taskId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSimbaAPIService_v20180301.CancelDataRepositoryTask'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TaskId': taskId,
    },
  );

  return CancelDataRepositoryTaskResponse.fromJson(jsonResponse.body);
}