Merge branch '8784-dir-listings'
[arvados.git] / doc / sdk / cli / subcommands.html.textile.liquid
1 ---
2 layout: default
3 navsection: sdk
4 navmenu: CLI
5 title: "arv subcommands"
6
7 ...
8 {% comment %}
9 Copyright (C) The Arvados Authors. All rights reserved.
10
11 SPDX-License-Identifier: CC-BY-SA-3.0
12 {% endcomment %}
13
14 _In order to use the @arv@ command, make sure that you have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html_
15
16 h3(#arv-create). arv create
17
18 @arv create@ can be used to create Arvados objects from the command line. Arv create opens up the editor of your choice (set the EDITOR environment variable) and allows you to type or paste a json or yaml description. When saved the object will be created on the API server, if it passes validation.
19
20 <notextile>
21 <pre>
22 $ <code class="userinput">arv create --help</code>
23 Options:
24   --project-uuid, -p &lt;s&gt;:   Project uuid in which to create the object
25               --help, -h:   Show this message
26 </pre>
27 </notextile>
28
29 h3(#arv-get). arv get
30
31 @arv get@ can be used to get a textual representation of Arvados objects from the command line. The output can be limited to a subset of the object's fields. This command can be used with only the knowledge of an object's UUID.
32
33 <notextile>
34 <pre>
35 $ <code class="userinput">arv get --help</code>
36 Usage: arv [--format json|yaml] get [uuid] [fields...]
37
38 Fetch the specified Arvados object, select the specified fields,
39 and print a text representation.
40 </pre>
41 </notextile>
42
43 h3(#arv-edit). arv edit
44
45 @arv edit@ can be used to edit Arvados objects from the command line. Arv edit opens up the editor of your choice (set the EDITOR environment variable) with the json or yaml description of the object. Saving the file will update the Arvados object on the API server, if it passes validation.
46
47 <notextile>
48 <pre>
49 $ <code class="userinput">arv edit --help</code>
50 Arvados command line client
51 Usage: arv edit [uuid] [fields...]
52
53 Fetch the specified Arvados object, select the specified fields,
54 open an interactive text editor on a text representation (json or
55 yaml, use --format) and then update the object.  Will use 'nano'
56 by default, customize with the EDITOR or VISUAL environment variable.
57 </pre>
58 </notextile>
59
60 h3(#arv-copy). arv copy
61
62 @arv copy@ can be used to copy a pipeline instance, template or collection from one Arvados instance to another. It takes care of copying the object and all its dependencies.
63
64 <notextile>
65 <pre>
66 $ <code class="userinput">arv copy --help</code>
67 usage: arv_copy.py [-h] [-v] [--progress] [--no-progress] [-f] --src
68                    SOURCE_ARVADOS --dst DESTINATION_ARVADOS [--recursive]
69                    [--no-recursive] [--dst-git-repo DST_GIT_REPO]
70                    [--project-uuid PROJECT_UUID] [--retries RETRIES]
71                    object_uuid
72
73 Copy a pipeline instance, template or collection from one Arvados instance to
74 another.
75
76 positional arguments:
77   object_uuid           The UUID of the object to be copied.
78
79 optional arguments:
80   -h, --help            show this help message and exit
81   -v, --verbose         Verbose output.
82   --progress            Report progress on copying collections. (default)
83   --no-progress         Do not report progress on copying collections.
84   -f, --force           Perform copy even if the object appears to exist at
85                         the remote destination.
86   --src SOURCE_ARVADOS  The name of the source Arvados instance (required) -
87                         points at an Arvados config file. May be either a
88                         pathname to a config file, or (for example) "foo" as
89                         shorthand for $HOME/.config/arvados/foo.conf.
90   --dst DESTINATION_ARVADOS
91                         The name of the destination Arvados instance
92                         (required) - points at an Arvados config file. May be
93                         either a pathname to a config file, or (for example)
94                         "foo" as shorthand for $HOME/.config/arvados/foo.conf.
95   --recursive           Recursively copy any dependencies for this object.
96                         (default)
97   --no-recursive        Do not copy any dependencies. NOTE: if this option is
98                         given, the copied object will need to be updated
99                         manually in order to be functional.
100   --dst-git-repo DST_GIT_REPO
101                         The name of the destination git repository. Required
102                         when copying a pipeline recursively.
103   --project-uuid PROJECT_UUID
104                         The UUID of the project at the destination to which
105                         the pipeline should be copied.
106   --retries RETRIES     Maximum number of times to retry server requests that
107                         encounter temporary failures (e.g., server down).
108                         Default 3.
109 </pre>
110 </notextile>
111
112 h3(#arv-tag). arv tag
113
114 @arv tag@ is used to tag Arvados objects.
115
116 <notextile>
117 <pre>
118 $ <code class="userinput">arv tag --help</code>
119
120 Usage:
121 arv tag add tag1 [tag2 ...] --object object_uuid1 [object_uuid2...]
122 arv tag remove tag1 [tag2 ...] --object object_uuid1 [object_uuid2...]
123 arv tag remove --all
124
125   --dry-run, -n:   Don't actually do anything
126   --verbose, -v:   Print some things on stderr
127      --uuid, -u:   Return the UUIDs of the objects in the response, one per
128                    line (default)
129      --json, -j:   Return the entire response received from the API server, as
130                    a JSON object
131     --human, -h:   Return the response received from the API server, as a JSON
132                    object with whitespace added for human consumption
133    --pretty, -p:   Synonym of --human
134      --yaml, -y:   Return the response received from the API server, in YAML
135                    format
136      --help, -e:   Show this message
137 </pre>
138 </notextile>
139
140
141 h3(#arv-ws). arv ws
142
143 @arv ws@ provides access to the websockets event stream.
144
145 <notextile>
146 <pre>
147 $ <code class="userinput">arv ws --help</code>
148 usage: arv-ws [-h] [-u UUID] [-f FILTERS]
149               [--poll-interval POLL_INTERVAL | --no-poll]
150               [-p PIPELINE | -j JOB]
151
152 optional arguments:
153   -h, --help            show this help message and exit
154   -u UUID, --uuid UUID  Filter events on object_uuid
155   -f FILTERS, --filters FILTERS
156                         Arvados query filter to apply to log events (JSON
157                         encoded)
158   --poll-interval POLL_INTERVAL
159                         If websockets is not available, specify the polling
160                         interval, default is every 15 seconds
161   --no-poll             Do not poll if websockets are not available, just fail
162   -p PIPELINE, --pipeline PIPELINE
163                         Supply pipeline uuid, print log output from pipeline
164                         and its jobs
165   -j JOB, --job JOB     Supply job uuid, print log output from jobs
166 </pre>
167 </notextile>
168
169 h3(#arv-keep). arv keep
170
171 @arv keep@ provides access to the Keep storage service.
172
173 <notextile>
174 <pre>
175 $ <code class="userinput">arv keep --help</code>
176 Usage: arv keep [method] [--parameters]
177 Use 'arv keep [method] --help' to get more information about specific methods.
178
179 Available methods: ls, get, put, docker
180 </pre>
181 </notextile>
182
183 h3(#arv-keep-ls). arv keep ls
184
185 <notextile>
186 <pre>
187 $ <code class="userinput">arv keep ls --help</code>
188 usage: arv-ls [-h] [--retries RETRIES] [-s] locator
189
190 List contents of a manifest
191
192 positional arguments:
193   locator            Collection UUID or locator
194
195 optional arguments:
196   -h, --help         show this help message and exit
197   --retries RETRIES  Maximum number of times to retry server requests that
198                      encounter temporary failures (e.g., server down). Default
199                      3.
200   -s                 List file sizes, in KiB.
201 </pre>
202 </notextile>
203
204 h3(#arv-keep-get). arv keep get
205
206 <notextile>
207 <pre>
208 $ <code class="userinput">arv keep get --help</code>
209 usage: arv-get [-h] [--retries RETRIES]
210                [--progress | --no-progress | --batch-progress]
211                [--hash HASH | --md5sum] [-n] [-r] [-f | --skip-existing]
212                locator [destination]
213
214 Copy data from Keep to a local file or pipe.
215
216 positional arguments:
217   locator            Collection locator, optionally with a file path or
218                      prefix.
219   destination        Local file or directory where the data is to be written.
220                      Default: /dev/stdout.
221
222 optional arguments:
223   -h, --help         show this help message and exit
224   --retries RETRIES  Maximum number of times to retry server requests that
225                      encounter temporary failures (e.g., server down). Default
226                      3.
227   --progress         Display human-readable progress on stderr (bytes and, if
228                      possible, percentage of total data size). This is the
229                      default behavior when it is not expected to interfere
230                      with the output: specifically, stderr is a tty _and_
231                      either stdout is not a tty, or output is being written to
232                      named files rather than stdout.
233   --no-progress      Do not display human-readable progress on stderr.
234   --batch-progress   Display machine-readable progress on stderr (bytes and,
235                      if known, total data size).
236   --hash HASH        Display the hash of each file as it is read from Keep,
237                      using the given hash algorithm. Supported algorithms
238                      include md5, sha1, sha224, sha256, sha384, and sha512.
239   --md5sum           Display the MD5 hash of each file as it is read from
240                      Keep.
241   -n                 Do not write any data -- just read from Keep, and report
242                      md5sums if requested.
243   -r                 Retrieve all files in the specified collection/prefix.
244                      This is the default behavior if the "locator" argument
245                      ends with a forward slash.
246   -f                 Overwrite existing files while writing. The default
247                      behavior is to refuse to write *anything* if any of the
248                      output files already exist. As a special case, -f is not
249                      needed to write to /dev/stdout.
250   --skip-existing    Skip files that already exist. The default behavior is to
251                      refuse to write *anything* if any files exist that would
252                      have to be overwritten. This option causes even devices,
253                      sockets, and fifos to be skipped.
254 </pre>
255 </notextile>
256
257 h3(#arv-keep-put). arv keep put
258
259 <notextile>
260 <pre>
261 $ <code class="userinput">arv keep put --help</code>
262 usage: arv-put [-h] [--max-manifest-depth N | --normalize]
263                [--as-stream | --stream | --as-manifest | --in-manifest | --manifest | --as-raw | --raw]
264                [--use-filename FILENAME] [--filename FILENAME]
265                [--portable-data-hash] [--replication N]
266                [--project-uuid UUID] [--name NAME]
267                [--progress | --no-progress | --batch-progress]
268                [--resume | --no-resume] [--retries RETRIES]
269                [path [path ...]]
270
271 Copy data from the local filesystem to Keep.
272
273 positional arguments:
274   path                  Local file or directory. Default: read from standard
275                         input.
276
277 optional arguments:
278   -h, --help            show this help message and exit
279   --max-manifest-depth N
280                         Maximum depth of directory tree to represent in the
281                         manifest structure. A directory structure deeper than
282                         this will be represented as a single stream in the
283                         manifest. If N=0, the manifest will contain a single
284                         stream. Default: -1 (unlimited), i.e., exactly one
285                         manifest stream per filesystem directory that contains
286                         files.
287   --normalize           Normalize the manifest by re-ordering files and
288                         streams after writing data.
289   --as-stream           Synonym for --stream.
290   --stream              Store the file content and display the resulting
291                         manifest on stdout. Do not write the manifest to Keep
292                         or save a Collection object in Arvados.
293   --as-manifest         Synonym for --manifest.
294   --in-manifest         Synonym for --manifest.
295   --manifest            Store the file data and resulting manifest in Keep,
296                         save a Collection object in Arvados, and display the
297                         manifest locator (Collection uuid) on stdout. This is
298                         the default behavior.
299   --as-raw              Synonym for --raw.
300   --raw                 Store the file content and display the data block
301                         locators on stdout, separated by commas, with a
302                         trailing newline. Do not store a manifest.
303   --use-filename FILENAME
304                         Synonym for --filename.
305   --filename FILENAME   Use the given filename in the manifest, instead of the
306                         name of the local file. This is useful when "-" or
307                         "/dev/stdin" is given as an input file. It can be used
308                         only if there is exactly one path given and it is not
309                         a directory. Implies --manifest.
310   --portable-data-hash  Print the portable data hash instead of the Arvados
311                         UUID for the collection created by the upload.
312   --replication N       Set the replication level for the new collection: how
313                         many different physical storage devices (e.g., disks)
314                         should have a copy of each data block. Default is to
315                         use the server-provided default (if any) or 2.
316   --project-uuid UUID   Store the collection in the specified project, instead
317                         of your Home project.
318   --name NAME           Save the collection with the specified name.
319   --progress            Display human-readable progress on stderr (bytes and,
320                         if possible, percentage of total data size). This is
321                         the default behavior when stderr is a tty.
322   --no-progress         Do not display human-readable progress on stderr, even
323                         if stderr is a tty.
324   --batch-progress      Display machine-readable progress on stderr (bytes
325                         and, if known, total data size).
326   --resume              Continue interrupted uploads from cached state
327                         (default).
328   --no-resume           Do not continue interrupted uploads from cached state.
329   --retries RETRIES     Maximum number of times to retry server requests that
330                         encounter temporary failures (e.g., server down).
331                         Default 3.
332 </pre>
333 </notextile>
334
335
336 h3(#arv-pipeline-run). arv pipeline run
337
338 @arv pipeline run@ can be used to start a pipeline run from the command line.
339
340 The User Guide has a page with a bit more information on "using arv pipeline run":{{site.baseurl}}/user/topics/running-pipeline-command-line.html.
341
342 <notextile>
343 <pre>
344 $ <code class="userinput">arv pipeline run --help</code>
345 Options:
346         --dry-run, -n:   Do not start any new jobs or wait for existing jobs to
347                          finish. Just find out whether jobs are finished,
348                          queued, or running for each component.
349     --status-text &lt;s&gt;:   Store plain text status in given file. (Default:
350                          /dev/stdout)
351     --status-json &lt;s&gt;:   Store json-formatted pipeline in given file. (Default:
352                          /dev/null)
353             --no-wait:   Do not wait for jobs to finish. Just look up status,
354                          submit new jobs if needed, and exit.
355            --no-reuse:   Do not reuse existing jobs to satisfy pipeline
356                          components. Submit a new job for every component.
357           --debug, -d:   Print extra debugging information on stderr.
358     --debug-level &lt;i&gt;:   Set debug verbosity level.
359        --template &lt;s&gt;:   UUID of pipeline template, or path to local pipeline
360                          template file.
361        --instance &lt;s&gt;:   UUID of pipeline instance.
362              --submit:   Submit the pipeline instance to the server, and exit.
363                          Let the Crunch dispatch service satisfy the components
364                          by finding/running jobs.
365   --run-pipeline-here:   Manage the pipeline instance in-process. Submit jobs
366                          to Crunch as needed. Do not exit until the pipeline
367                          finishes (or fails).
368       --run-jobs-here:   Run jobs in the local terminal session instead of
369                          submitting them to Crunch. Implies
370                          --run-pipeline-here. Note: this results in a
371                          significantly different job execution environment, and
372                          some Crunch features are not supported. It can be
373                          necessary to modify a pipeline in order to make it run
374                          this way.
375            --run-here:   Synonym for --run-jobs-here.
376     --description &lt;s&gt;:   Description for the pipeline instance.
377         --version, -v:   Print version and exit
378            --help, -h:   Show this message
379 </pre>
380 </notextile>
381
382 h3(#arv-run). arv run
383
384 The @arv-run@ command creates Arvados pipelines at the command line that fan out to multiple concurrent tasks across Arvados compute nodes.
385
386 The User Guide has a page on "using arv-run":{{site.baseurl}}/user/topics/arv-run.html.
387
388 <notextile>
389 <pre>
390 $ <code class="userinput">arv run --help</code>
391 usage: arv-run [-h] [--retries RETRIES] [--dry-run] [--local]
392                [--docker-image DOCKER_IMAGE] [--ignore-rcode] [--no-reuse]
393                [--no-wait] [--project-uuid PROJECT_UUID] [--git-dir GIT_DIR]
394                [--repository REPOSITORY] [--script-version SCRIPT_VERSION]
395                ...
396
397 positional arguments:
398   args
399
400 optional arguments:
401   -h, --help            show this help message and exit
402   --retries RETRIES     Maximum number of times to retry server requests that
403                         encounter temporary failures (e.g., server down).
404                         Default 3.
405   --dry-run             Print out the pipeline that would be submitted and
406                         exit
407   --local               Run locally using arv-run-pipeline-instance
408   --docker-image DOCKER_IMAGE
409                         Docker image to use, otherwise use instance default.
410   --ignore-rcode        Commands that return non-zero return codes should not
411                         be considered failed.
412   --no-reuse            Do not reuse past jobs.
413   --no-wait             Do not wait and display logs after submitting command,
414                         just exit.
415   --project-uuid PROJECT_UUID
416                         Parent project of the pipeline
417   --git-dir GIT_DIR     Git repository passed to arv-crunch-job when using
418                         --local
419   --repository REPOSITORY
420                         repository field of component, default 'arvados'
421   --script-version SCRIPT_VERSION
422                         script_version field of component, default 'master'
423 </pre>
424 </notextile>