8784: Fix test for latest firefox.
[arvados.git] / doc / api / methods / pipeline_templates.html.textile.liquid
1 ---
2 layout: default
3 navsection: api
4 navmenu: API Methods
5 title: "pipeline_templates"
6
7 ...
8
9 API endpoint base: @https://{{ site.arvados_api_host }}/arvados/v1/pipeline_templates@
10
11 Object type: @p5p6p@
12
13 Example UUID: @zzzzz-p5p6p-0123456789abcde@
14
15 h2. Resource
16
17 Deprecated.  A pipeline template is a collection of jobs that can be instantiated as a pipeline_instance.
18
19 Each PipelineTemplate has, in addition to the "Common resource fields":{{site.baseurl}}/api/resources.html:
20
21 table(table table-bordered table-condensed).
22 |_. Attribute|_. Type|_. Description|_. Example|
23 |name|string|||
24 |components|hash|||
25
26 The pipeline template consists of "name" and "components".
27
28 table(table table-bordered table-condensed).
29 |_. Attribute    |_. Type |_. Accepted values                           |_. Required|_. Description|
30 |name            |string  |any                                          |yes        |The human-readable name of the pipeline template.|
31 |components      |object  |JSON object containing job submission objects|yes        |The component jobs that make up the pipeline, with the component name as the key. |
32
33 h3. Components
34
35 The components field of the pipeline template is a JSON object which describes the individual steps that make up the pipeline.  Each component is an Arvados job submission.  "Parameters for job submissions are described on the job method page.":{{site.baseurl}}/api/methods/jobs.html#create  In addition, a component can have the following parameters:
36
37 table(table table-bordered table-condensed).
38 |_. Attribute    |_. Type          |_. Accepted values |_. Required|_. Description|
39 |output_name     |string or boolean|string or false    |no         |If a string is provided, use this name for the output collection of this component.  If the value is false, do not create a permanent output collection (an temporary intermediate collection will still be created).  If not provided, a default name will be assigned to the output.|
40
41 h3. Script parameters
42
43 When used in a pipeline, each parameter in the 'script_parameters' attribute of a component job can specify that the input parameter must be supplied by the user, or the input parameter should be linked to the output of another component.  To do this, the value of the parameter should be JSON object containing one of the following attributes:
44
45 table(table table-bordered table-condensed).
46 |_. Attribute    |_. Type |_. Accepted values                               |_. Description|
47 |default         |any     |any                                              |The default value for this parameter.|
48 |required        |boolean |true or false                                    |Specifies whether the parameter is required to have a value or not.|
49 |dataclass       |string  |One of 'Collection', 'File' [1], 'number', or 'text' |Data type of this parameter.|
50 |search_for      |string  |any string                                       |Substring to use as a default search string when choosing inputs.|
51 |output_of       |string  |the name of another component in the pipeline    |Specifies that the value of this parameter should be set to the 'output' attribute of the job that corresponds to the specified component.|
52 |title           |string  |any string                                       |User friendly title to display when choosing parameter values|
53 |description     |string  |any string                                       |Extended text description for describing expected/valid values for the script parameter|
54 |link_name       |string  |any string                                       |User friendly name to display for the parameter value instead of the actual parameter value|
55
56 The 'output_of' parameter is especially important, as this is how components are actually linked together to form a pipeline.  Component jobs that depend on the output of other components do not run until the parent job completes and has produced output.  If the parent job fails, the entire pipeline fails.
57
58 fn1. The 'File' type refers to a specific file within a Keep collection in the form 'collection_hash/filename', for example '887cd41e9c613463eab2f0d885c6dd96+83/bob.txt'.
59
60 The 'search_for' parameter is meaningful only when input dataclass of type Collection or File is used. If a value is provided, this will be preloaded into the input data chooser dialog in Workbench. For example, if your input dataclass is a File and you are interested in a certain filename extention, you can preconfigure it in this attribute.
61
62 h3. Examples
63
64 This is a pipeline named "Filter MD5 hash values" with two components, "do_hash" and "filter".  The "input" script parameter of the "do_hash" component is required to be filled in by the user, and the expected data type is "Collection".  This also specifies that the "input" script parameter of the "filter" component is the output of "do_hash", so "filter" will not run until "do_hash" completes successfully.  When the pipeline runs, past jobs that meet the criteria described above may be substituted for either or both components to avoid redundant computation.
65
66 <notextile><pre>
67 {
68   "name": "Filter MD5 hash values",
69   "components": {
70     "do_hash": {
71       "script": "hash.py",
72       "repository": "<b>you</b>/<b>you</b>",
73       "script_version": "master",
74       "script_parameters": {
75         "input": {
76           "required": true,
77           "dataclass": "Collection",
78           "search_for": ".fastq.gz",
79           "title":"Please select a fastq file"
80         }
81       },
82     },
83     "filter": {
84       "script": "0-filter.py",
85       "repository": "<b>you</b>/<b>you</b>",
86       "script_version": "master",
87       "script_parameters": {
88         "input": {
89           "output_of": "do_hash"
90         }
91       },
92     }
93   }
94 }
95 </pre></notextile>
96
97 This pipeline consists of three components.  The components "thing1" and "thing2" both depend on "cat_in_the_hat".  Once the "cat_in_the_hat" job is complete, both "thing1" and "thing2" can run in parallel, because they do not depend on each other.
98
99 <notextile><pre>
100 {
101   "name": "Wreck the house",
102   "components": {
103     "cat_in_the_hat": {
104       "script": "cat.py",
105       "repository": "<b>you</b>/<b>you</b>",
106       "script_version": "master",
107       "script_parameters": { }
108     },
109     "thing1": {
110       "script": "thing1.py",
111       "repository": "<b>you</b>/<b>you</b>",
112       "script_version": "master",
113       "script_parameters": {
114         "input": {
115           "output_of": "cat_in_the_hat"
116         }
117       },
118     },
119     "thing2": {
120       "script": "thing2.py",
121       "repository": "<b>you</b>/<b>you</b>",
122       "script_version": "master",
123       "script_parameters": {
124         "input": {
125           "output_of": "cat_in_the_hat"
126         }
127       },
128     },
129   }
130 }
131 </pre></notextile>
132
133 This pipeline consists of three components.  The component "cleanup" depends on "thing1" and "thing2".  Both "thing1" and "thing2" are started immediately and can run in parallel, because they do not depend on each other, but "cleanup" cannot begin until both "thing1" and "thing2" have completed.
134
135 <notextile><pre>
136 {
137   "name": "Clean the house",
138   "components": {
139     "thing1": {
140       "script": "thing1.py",
141       "repository": "<b>you</b>/<b>you</b>",
142       "script_version": "master",
143       "script_parameters": { }
144     },
145     "thing2": {
146       "script": "thing2.py",
147       "repository": "<b>you</b>/<b>you</b>",
148       "script_version": "master",
149       "script_parameters": { }
150     },
151     "cleanup": {
152       "script": "cleanup.py",
153       "repository": "<b>you</b>/<b>you</b>",
154       "script_version": "master",
155       "script_parameters": {
156         "mess1": {
157           "output_of": "thing1"
158         },
159         "mess2": {
160           "output_of": "thing2"
161         }
162       }
163     }
164   }
165 }
166 </pre></notextile>
167
168 h2. Methods
169
170 See "Common resource methods":{{site.baseurl}}/api/methods.html for more information about @create@, @delete@, @get@, @list@, and @update@.
171
172 Required arguments are displayed in %{background:#ccffcc}green%.
173
174 h3. create
175
176 Create a new PipelineTemplate.
177
178 Arguments:
179
180 table(table table-bordered table-condensed).
181 |_. Argument |_. Type |_. Description |_. Location |_. Example |
182 |pipeline_template|object||query||
183
184 h3. delete
185
186 Delete an existing PipelineTemplate.
187
188 Arguments:
189
190 table(table table-bordered table-condensed).
191 |_. Argument |_. Type |_. Description |_. Location |_. Example |
192 {background:#ccffcc}.|uuid|string|The UUID of the PipelineTemplate in question.|path||
193
194 h3. get
195
196 Gets a PipelineTemplate's metadata by UUID.
197
198 Arguments:
199
200 table(table table-bordered table-condensed).
201 |_. Argument |_. Type |_. Description |_. Location |_. Example |
202 {background:#ccffcc}.|uuid|string|The UUID of the PipelineTemplate in question.|path||
203
204 h3. list
205
206 List pipeline_templates.
207
208 See "common resource list method.":{{site.baseurl}}/api/methods.html#index
209
210 h3. update
211
212 Update attributes of an existing PipelineTemplate.
213
214 Arguments:
215
216 table(table table-bordered table-condensed).
217 |_. Argument |_. Type |_. Description |_. Location |_. Example |
218 {background:#ccffcc}.|uuid|string|The UUID of the PipelineTemplate in question.|path||
219 |pipeline_template|object||query||