StartTaskExecution
Starts an AWS DataSync task. For each task, you can only run one task execution at a time.
There are several phases to a task execution. For more information, see Task execution statuses.
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
"
}
],
"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
"
}
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
- OverrideOptions
-
Configures your AWS DataSync task settings. These options include how DataSync handles files, objects, and their associated metadata. You also can specify how DataSync verifies data integrity, set bandwidth limits for your task, among other options.
Each task setting has a default value. Unless you need to, you don't have to configure any of these
Options
before starting your task.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
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: