16
16
under the License.
17
17
18
18
19
- .. _howto/operator:AWSDataSyncOperator :
19
+ .. _howto/operator:DataSyncOperator :
20
20
21
21
AWS DataSync Operator
22
22
=====================
@@ -25,13 +25,13 @@ Overview
25
25
--------
26
26
27
27
Two example_dags are provided which showcase the
28
- :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator `
28
+ :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator `
29
29
in action.
30
30
31
31
- example_datasync_1.py
32
32
- example_datasync_2.py
33
33
34
- Both examples use the :class: `~airflow.providers.amazon.aws.hooks.datasync.AWSDataSyncHook `
34
+ Both examples use the :class: `~airflow.providers.amazon.aws.hooks.datasync.DataSyncHook `
35
35
to create a boto3 DataSync client. This hook in turn uses the :class: `~airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook `
36
36
37
37
Note this guide differentiates between an *Airflow task * (identified by a task_id on Airflow),
@@ -65,7 +65,7 @@ These examples rely on the following variables, which can be passed via OS envir
65
65
Get DataSync Tasks
66
66
""""""""""""""""""
67
67
68
- The :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator ` can execute a specific
68
+ The :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator ` can execute a specific
69
69
TaskArn by specifying the ``task_arn `` parameter. This is useful when you know the TaskArn you want to execute.
70
70
71
71
.. exampleinclude :: /../../airflow/providers/amazon/aws/example_dags/example_datasync_1.py
@@ -80,7 +80,7 @@ Alternatively, the operator can search in AWS DataSync for a Task based on
80
80
81
81
In AWS, DataSync Tasks are linked to source and destination Locations. A location has a LocationURI and
82
82
is referenced by a LocationArn much like other AWS resources.
83
- The :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator `
83
+ The :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator `
84
84
can iterate all DataSync Tasks for their source and destination LocationArns. Then it checks
85
85
each LocationArn to see if its the URIs match the desired source / destination URI.
86
86
@@ -103,7 +103,7 @@ Purpose
103
103
"""""""
104
104
105
105
Show how DataSync Tasks and Locations can be automatically created, deleted and updated using the
106
- :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator `.
106
+ :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator `.
107
107
108
108
Find and update a DataSync Task, or create one if it doesn't exist. Update the Task, then execute it.
109
109
Finally, delete it.
@@ -121,7 +121,7 @@ This example relies on the following variables, which can be passed via OS envir
121
121
Get, Create, Update, Run and Delete DataSync Tasks
122
122
""""""""""""""""""""""""""""""""""""""""""""""""""
123
123
124
- The :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator ` is used
124
+ The :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator ` is used
125
125
as before but with some extra arguments.
126
126
127
127
Most of the arguments (``CREATE_*_KWARGS ``) provide a way for the operator to automatically create a Task
@@ -149,7 +149,7 @@ Operator behaviour
149
149
DataSync Task execution behaviour
150
150
"""""""""""""""""""""""""""""""""
151
151
152
- Once the :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator ` has identified
152
+ Once the :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator ` has identified
153
153
the correct TaskArn to run (either because you specified it, or because it was found), it will then be
154
154
executed. Whenever an AWS DataSync Task is executed it creates an AWS DataSync TaskExecution, identified
155
155
by a TaskExecutionArn.
@@ -163,7 +163,7 @@ for inspection.
163
163
Finally, both the TaskArn and the TaskExecutionArn are returned from the ``execute() `` method, and pushed to
164
164
an XCom automatically if ``do_xcom_push=True ``.
165
165
166
- The :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator ` supports
166
+ The :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator ` supports
167
167
optional passing of additional kwargs to the underlying ``boto3.start_task_execution() `` API.
168
168
This is done with the ``task_execution_kwargs `` parameter.
169
169
This is useful for example to limit bandwidth or filter included files - refer to the boto3 Datasync
@@ -172,12 +172,12 @@ documentation for more details.
172
172
TaskArn selection behaviour
173
173
"""""""""""""""""""""""""""
174
174
175
- The :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator `
175
+ The :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator `
176
176
may find 0, 1, or many AWS DataSync Tasks with a matching ``source_location_uri `` and
177
177
``destination_location_uri ``. The operator must decide what to do in each of these scenarios.
178
178
179
179
To override the default behaviour, simply create an operator which inherits
180
- :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator `
180
+ :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator `
181
181
and re-implement the ``choose_task `` and ``choose_location `` methods
182
182
to suit your use case.
183
183
@@ -204,7 +204,7 @@ TaskArn creation behaviour
204
204
"""""""""""""""""""""""""""
205
205
206
206
When creating a Task, the
207
- :class: `~airflow.providers.amazon.aws.operators.datasync.AWSDataSyncOperator ` will try to find
207
+ :class: `~airflow.providers.amazon.aws.operators.datasync.DataSyncOperator ` will try to find
208
208
and use existing LocationArns rather than creating new ones. If multiple LocationArns match the
209
209
specified URIs then we need to choose one to use. In this scenario, the operator behaves similarly
210
210
to how it chooses a single Task from many Tasks:
0 commit comments