baolsen commented on a change in pull request #6773: [AIRFLOW-6038] AWS 
DataSync example_dags added
URL: https://github.com/apache/airflow/pull/6773#discussion_r359157782
 
 

 ##########
 File path: airflow/providers/amazon/aws/operators/datasync.py
 ##########
 @@ -18,34 +16,48 @@
 # under the License.
 
 """
-Get, Create, Update, Delete and execute an AWS DataSync Task.
+Create, get, update, execute and delete an AWS DataSync Task.
 """
 
+import random
+
 from airflow.exceptions import AirflowException
 from airflow.models import BaseOperator
 from airflow.providers.amazon.aws.hooks.datasync import AWSDataSyncHook
 from airflow.utils.decorators import apply_defaults
 
 
-class AWSDataSyncCreateTaskOperator(BaseOperator):
-    r"""Create an AWS DataSync Task.
+# pylint: disable=too-many-instance-attributes, too-many-arguments
+class AWSDataSyncOperator(BaseOperator):
+    r"""Find, Create, Update, Execute and Delete AWS DataSync Tasks.
 
-    If there are existing Locations which match the specified
-    source and destination URIs then these will be used for the Task.
-    Otherwise, new Locations can be created automatically,
-    depending on input parameters.
+    If ``do_xcom_push`` is True, then the DataSync TaskArn and TaskExecutionArn
+    which were executed will be pushed to an XCom.
 
-    If ``do_xcom_push`` is True, the TaskArn which is created
-    will be pushed to an XCom.
+    .. seealso::
+        For more information on how to use this operator, take a look at the 
guide:
+        :ref:`howto/operator:AWSDataSyncOperator`
+
+    .. note:: There may be 0, 1, or many existing DataSync Tasks defined in 
your AWS
+        environment. The default behavior is to create a new Task if there are 
0, or
+        execute the Task if there was 1 Task, or fail if there were many Tasks.
 
     :param str aws_conn_id: AWS connection to use.
-    :param str source_location_uri: Source location URI.
+    :param int wait_interval_seconds: Time to wait between two
+        consecutive calls to check TaskExecution status.
+    :param str task_arn: AWS DataSync TaskArn to use. If None, then this 
operator will
+        attempt to either search for an existing Task or attempt to create a 
new Task.
+    :param str source_location_uri: Source location URI to search for. All 
DataSync
+        Tasks with a LocationArn with this URI will be considered.
         Example: ``smb://server/subdir``
-    :param str destination_location_uri: Destination location URI.
+    :param str destination_location_uri: Destination location URI to search 
for.
+        All DataSync Tasks with a LocationArn with this URI will be considered.
         Example: ``s3://airflow_bucket/stuff``
-    :param bool case_sensitive_location_search: Whether or not to do a
-        case-sensitive search for each Location URI.
-    :param dict create_task_kwargs: If no suitable TaskArn is found,
+    :param str choose_task_strategy: If multiple Tasks match, one must be 
chosen to
 
 Review comment:
   Thanks for the great feedback. I'll give it some thought

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to