updateTask method
Updates the configuration of a task, which defines where and how DataSync transfers your data.
May throw InternalException.
May throw InvalidRequestException.
Parameter taskArn :
Specifies the ARN of the task that you want to update.
Parameter cloudWatchLogGroupArn :
Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group
for monitoring your task.
For Enhanced mode tasks, you must use /aws/datasync as your
log group name. For example:
arn:aws:logs:us-east-1:111222333444:log-group:/aws/datasync:*
For more information, see Monitoring data transfers with CloudWatch Logs.
Parameter excludes :
Specifies exclude filters that define the files, objects, and folders in
your source location that you don't want DataSync to transfer. For more
information and examples, see Specifying
what DataSync transfers by using filters.
Parameter includes :
Specifies include filters define the files, objects, and folders in your
source location that you want DataSync to transfer. For more information
and examples, see Specifying
what DataSync transfers by using filters.
Parameter manifestConfig :
Configures a manifest, which is a list of files or objects that you want
DataSync to transfer. For more information and configuration examples, see
Specifying
what DataSync transfers by using a manifest.
When using this parameter, your caller identity (the IAM role that you're
using DataSync with) must have the iam:PassRole permission.
The AWSDataSyncFullAccess
policy includes this permission.
To remove a manifest configuration, specify this parameter as empty.
Parameter name :
Specifies the name of your task.
Parameter schedule :
Specifies a schedule for when you want your task to run. For more
information, see Scheduling
your task.
Parameter taskReportConfig :
Specifies how you want to configure a task report, which provides detailed
information about your DataSync transfer. For more information, see Monitoring
your DataSync transfers with task reports.
When using this parameter, your caller identity (the IAM role that you're
using DataSync with) must have the iam:PassRole permission.
The AWSDataSyncFullAccess
policy includes this permission.
To remove a task report configuration, specify this parameter as empty.
Implementation
Future<void> updateTask({
required String taskArn,
String? cloudWatchLogGroupArn,
List<FilterRule>? excludes,
List<FilterRule>? includes,
ManifestConfig? manifestConfig,
String? name,
Options? options,
TaskSchedule? schedule,
TaskReportConfig? taskReportConfig,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'FmrsService.UpdateTask'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'TaskArn': taskArn,
if (cloudWatchLogGroupArn != null)
'CloudWatchLogGroupArn': cloudWatchLogGroupArn,
if (excludes != null) 'Excludes': excludes,
if (includes != null) 'Includes': includes,
if (manifestConfig != null) 'ManifestConfig': manifestConfig,
if (name != null) 'Name': name,
if (options != null) 'Options': options,
if (schedule != null) 'Schedule': schedule,
if (taskReportConfig != null) 'TaskReportConfig': taskReportConfig,
},
);
}