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 transfers between Amazon S3 locations, transfers between Azure Blob and Amazon S3 without an agent, and transfers between other clouds and Amazon S3 without an agent.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
1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 | |