StartTaskExecution
Starts an AWS DataSync transfer task. For each task, you can only run one task execution at a time.
There are several steps to a task execution. For more information, see Task execution statuses.
Important
If you're planning to transfer data to or from an Amazon S3 location, review
how
DataSync can affect your S3 request charges and the DataSync pricing page
Request Syntax
{
"Excludes": [
{
"FilterType": "string
",
"Value": "string
"
}
],
"Includes": [
{
"FilterType": "string
",
"Value": "string
"
}
],
"ManifestConfig": {
"Action": "string
",
"Format": "string
",
"Source": {
"S3": {
"BucketAccessRoleArn": "string
",
"ManifestObjectPath": "string
",
"ManifestObjectVersionId": "string
",
"S3BucketArn": "string
"
}
}
},
"OverrideOptions": {
"Atime": "string
",
"BytesPerSecond": number
,
"Gid": "string
",
"LogLevel": "string
",
"Mtime": "string
",
"ObjectTags": "string
",
"OverwriteMode": "string
",
"PosixPermissions": "string
",
"PreserveDeletedFiles": "string
",
"PreserveDevices": "string
",
"SecurityDescriptorCopyFlags": "string
",
"TaskQueueing": "string
",
"TransferMode": "string
",
"Uid": "string
",
"VerifyMode": "string
"
},
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
],
"TaskArn": "string
",
"TaskReportConfig": {
"Destination": {
"S3": {
"BucketAccessRoleArn": "string
",
"S3BucketArn": "string
",
"Subdirectory": "string
"
}
},
"ObjectVersionIds": "string
",
"OutputType": "string
",
"Overrides": {
"Deleted": {
"ReportLevel": "string
"
},
"Skipped": {
"ReportLevel": "string
"
},
"Transferred": {
"ReportLevel": "string
"
},
"Verified": {
"ReportLevel": "string
"
}
},
"ReportLevel": "string
"
}
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- Excludes
-
Specifies a list of filter rules that determines which files to exclude from a task. The list contains a single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for example,
"/folder1|/folder2"
.Type: Array of FilterRule objects
Array Members: Minimum number of 0 items. Maximum number of 1 item.
Required: No
- Includes
-
Specifies a list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for example,
"/folder1|/folder2"
.Type: Array of FilterRule objects
Array Members: Minimum number of 0 items. Maximum number of 1 item.
Required: No
- 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 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 with an empty value.
Type: ManifestConfig object
Required: No
- OverrideOptions
-
Indicates how your transfer task is configured. These options include how DataSync handles files, objects, and their associated metadata during your transfer. You also can specify how to verify data integrity, set bandwidth limits for your task, among other options.
Each option has a default value. Unless you need to, you don't have to configure any option before calling StartTaskExecution.
You also can override your task options for each task execution. For example, you might want to adjust the
LogLevel
for an individual execution.Type: Options object
Required: No
- Tags
-
Specifies the tags that you want to apply to the Amazon Resource Name (ARN) representing the task execution.
Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.
Type: Array of TagListEntry objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
Required: No
- TaskArn
-
Specifies the Amazon Resource Name (ARN) of the task that you want to start.
Type: String
Length Constraints: Maximum length of 128.
Pattern:
^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]*:[0-9]{12}:task/task-[0-9a-f]{17}$
Required: Yes
- 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 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.
Type: TaskReportConfig object
Required: No
Response Syntax
{
"TaskExecutionArn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- TaskExecutionArn
-
The ARN of the running task execution.
Type: String
Length Constraints: Maximum length of 128.
Pattern:
^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\-0-9]*:[0-9]{12}:task/task-[0-9a-f]{17}/execution/exec-[0-9a-f]{17}$
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalException
-
This exception is thrown when an error occurs in the AWS DataSync service.
HTTP Status Code: 500
- InvalidRequestException
-
This exception is thrown when the client submits a malformed request.
HTTP Status Code: 400
Examples
Sample Request
The following example starts a task execution using the default options for the specified task.
{ "OverrideOptions": { "Atime": "BEST_EFFORT", "BytesPerSecond": 1000, "Gid": "NONE", "Mtime": "PRESERVE", "PosixPermissions": "PRESERVE", "PreserveDevices": "NONE", "PreserveDeletedFiles": "PRESERVE", "Uid": "NONE", "VerifyMode": "POINT_IN_TIME_CONSISTENT" }, "TaskArn": "arn:aws:datasync:us-east-2:111222333444:task/task-08de6e6697796f026" }
Sample Response
This example illustrates one usage of StartTaskExecution.
{ "TaskExecutionArn": "arn:aws:datasync:us-east-2:111222333444:task/task-08de6e6697796f026/execution/exec-04ce9d516d69bd52f" }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: