create_task
¶
create_task(
source_location_arn: LocationArn,
destination_location_arn: LocationArn,
*,
config_overrides: Optional[DataSyncClientConfig] = None,
cloud_watch_log_group_arn: Optional[LogGroupArn] = None,
name: Optional[TagValue] = None,
options: Optional[Options] = None,
excludes: Optional[FilterList] = None,
schedule: Optional[TaskSchedule] = None,
tags: Optional[InputTagList] = None,
includes: Optional[FilterList] = None,
manifest_config: Optional[ManifestConfig] = None,
task_report_config: Optional[TaskReportConfig] = None,
task_mode: Optional[TaskMode] = None,
) -> CreateTaskResponse
Configures a task, which defines where and how DataSync transfers your data.
A task includes a source location, destination location, and transfer options (such as bandwidth limits, scheduling, and more).
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 before you begin.
Parameters:
-
source_location_arn(LocationArn) –Specifies the ARN of your transfer's source location.
-
destination_location_arn(LocationArn) –Specifies the ARN of your transfer's destination location.
-
cloud_watch_log_group_arn(Optional[LogGroupArn], default:None) –Specifies the Amazon Resource Name (ARN) of an Amazon CloudWatch log group for monitoring your task.
For Enhanced mode tasks, you don't need to specify anything. DataSync automatically sends logs to a CloudWatch log group named
/aws/datasync. -
name(Optional[TagValue], default:None) –Specifies the name of your task.
-
options(Optional[Options], default:None) –Specifies your task's settings, such as preserving file metadata, verifying data integrity, among other options.
-
excludes(Optional[FilterList], default:None) –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.
-
schedule(Optional[TaskSchedule], default:None) –Specifies a schedule for when you want your task to run. For more information, see Scheduling your task.
-
tags(Optional[InputTagList], default:None) –Specifies the tags that you want to apply to your task.
Tags are key-value pairs that help you manage, filter, and search for your DataSync resources.
-
includes(Optional[FilterList], default:None) –Specifies include filters that 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.
-
manifest_config(Optional[ManifestConfig], default:None) –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:PassRolepermission. The AWSDataSyncFullAccess policy includes this permission. -
task_report_config(Optional[TaskReportConfig], default:None) –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:PassRolepermission. The AWSDataSyncFullAccess policy includes this permission. -
task_mode(Optional[TaskMode], default:None) –Specifies one of the following task modes for your data transfer:
-
ENHANCED- Transfer virtually unlimited numbers of objects with higher performance than Basic mode. Enhanced mode tasks optimize the data transfer process by listing, preparing, transferring, and verifying data in parallel. Enhanced mode is currently available for all transfers except those that use Amazon S3 on Outposts.To create an Enhanced mode task, the IAM role that you use to call the
CreateTaskoperation must have theiam:CreateServiceLinkedRolepermission. -
BASIC(default) - Transfer files or objects between Amazon Web Services storage and all other supported DataSync locations. Basic mode tasks are subject to quotas on the number of files, objects, and directories in a dataset. Basic mode sequentially prepares, transfers, and verifies data, making it slower than Enhanced mode for most workloads.
For more information, see Understanding task mode differences.
-
Raises:
-
InternalException–This exception is thrown when an error occurs in the DataSync service.
-
InvalidRequestException–This exception is thrown when the client submits a malformed request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_datasync/_services/data_sync.py
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | |