@@ -89,20 +89,16 @@ A possible input payload looks like the following:
8989 "id" : " my-task/workflow-my-task/5427299e5b635537f33c07e0ad32fb87" ,
9090 "process" : [
9191 {
92+ "upload_options" : {
93+ "path_template" : " s3://my-bucket/${collection}/${year}/${month}/${day}/${id}"
94+ },
9295 "collection_matchers" : [
9396 {
9497 "type" : " jsonpath" ,
9598 "pattern" : " $[?(@.id =~ '.*')]" ,
9699 "collection_name" : " my-collection"
97100 }
98101 ],
99- "collection_options" : {
100- "my-collection" : {
101- "upload_options" : {
102- "path_template" : " {collection}/{year}/{month}/{day}/{item_id}"
103- }
104- }
105- },
106102 "tasks" : {
107103 "my-task" : {
108104 "item_id" : " G23923"
@@ -117,16 +113,15 @@ collection. More than one matcher can be defined, and the first one that matches
117113used. In this case, we only have one matcher defined that matches on any Item ``id ``
118114value. Collection assignment occurs after the Tasks's ``process `` method is called.
119115
120- The ``collection_options `` object defines AWS S3 upload options for Item assets for each
121- collection. In this case, we define a path template that uses the collection ID, year ,
122- month, day, and Item ID to construct the S3 key for the Item assets. Our example Task
123- does not upload any Item assets to S3, so the upload options are not used and could
116+ The ``upload_options `` object defines AWS S3 upload options for Item assets In this
117+ case, the only option defined is a `` path_template `` that uses an Item's collection ID,
118+ year, month, day, and ID to construct the S3 key for the Item's assets. Our example Task
119+ does not upload any Item assets to S3, so the `` upload_options `` are not used and could
124120be an empty object in this case.
125121
126122Running the example module defined above with ``python my-task.py run in.json `` results
127123in the following output JSON, which contains the original input payload plus a new
128- ``features `` attribute array containing the Item created by the Task's ``process ``
129- method.
124+ ``features `` array containing the Item created by the Task's ``process `` method.
130125
131126.. code-block :: json
132127
0 commit comments