cancelTaskExecution method
Stops an DataSync task execution that's in progress. The transfer of some files are abruptly interrupted. File contents that're transferred to the destination might be incomplete or inconsistent with the source files.
However, if you start a new task execution using the same task and allow it to finish, file content on the destination will be complete and consistent. This applies to other unexpected failures that interrupt a task execution. In all of these cases, DataSync successfully completes the transfer when you start the next task execution.
May throw InternalException.
May throw InvalidRequestException.
Parameter taskExecutionArn :
The Amazon Resource Name (ARN) of the task execution to stop.
Implementation
Future<void> cancelTaskExecution({
required String taskExecutionArn,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'FmrsService.CancelTaskExecution'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'TaskExecutionArn': taskExecutionArn,
},
);
}