-
Notifications
You must be signed in to change notification settings - Fork 1
/
export.yml
48 lines (44 loc) · 1.96 KB
/
export.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This example workflow demonstrates how to create a parameterized Google Sheets Export job.
# The required API input parameters for the export job can be found here: https://civis-python.readthedocs.io/en/stable/api_resources.html#civis.resources._resources.Imports.post
# and here: https://civis-python.readthedocs.io/en/stable/api_resources.html#civis.resources._resources.Imports.post_syncs
#
# Workflows in the Civis Platform are written in YAML and a workflow DSL
# (domain specific language) called Mistral.
#
# See this website, https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html,
# for an introduction to YAML.
#
# See the Mistral documentation, https://docs.openstack.org/mistral/train/user/wf_lang_v2.html,
# for a description of the Mistral DSL.
version: '2.0' # you always need this key to specify version 2 of the mistral DSL
workflow: # this must be called 'workflow' otherwise Platform won't list 'input' as parameters
input: # any items you add here will show up as parameters
- species: "versicolor,virginica,setosa" # specify default values
tasks:
export_to_google:
action: civis.import
# run the export once for each element in `species`
# exporting each output to a different sheet
with-items: 'class in <% $.species.split(",") %>'
input:
name: 'Export Irises [<% $.class %>]'
sync_type: GdocExport
is_outbound: true
destination:
remote_host_id: 219
credential_id: 0
source:
remote_host_id: 32
credential_id: 0
syncs:
- advanced_options:
export_action: updatewksht
sql_query: >-
select *
from pcooman.iris
where class = 'Iris-<% $.class %>'
destination:
google_worksheet:
spreadsheet: Workflow Demo -- Export to Google Sheet
worksheet: <% $.class %>
source: