aspera-cli 4.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3592 -0
  3. data/bin/ascli +7 -0
  4. data/bin/asession +89 -0
  5. data/docs/Makefile +59 -0
  6. data/docs/README.erb.md +3012 -0
  7. data/docs/README.md +13 -0
  8. data/docs/diagrams.txt +49 -0
  9. data/docs/secrets.make +38 -0
  10. data/docs/test_env.conf +117 -0
  11. data/docs/transfer_spec.html +99 -0
  12. data/examples/aoc.rb +17 -0
  13. data/examples/proxy.pac +60 -0
  14. data/examples/transfer.rb +115 -0
  15. data/lib/aspera/api_detector.rb +60 -0
  16. data/lib/aspera/ascmd.rb +151 -0
  17. data/lib/aspera/ats_api.rb +43 -0
  18. data/lib/aspera/cli/basic_auth_plugin.rb +38 -0
  19. data/lib/aspera/cli/extended_value.rb +88 -0
  20. data/lib/aspera/cli/formater.rb +238 -0
  21. data/lib/aspera/cli/listener/line_dump.rb +17 -0
  22. data/lib/aspera/cli/listener/logger.rb +20 -0
  23. data/lib/aspera/cli/listener/progress.rb +52 -0
  24. data/lib/aspera/cli/listener/progress_multi.rb +91 -0
  25. data/lib/aspera/cli/main.rb +304 -0
  26. data/lib/aspera/cli/manager.rb +440 -0
  27. data/lib/aspera/cli/plugin.rb +90 -0
  28. data/lib/aspera/cli/plugins/alee.rb +24 -0
  29. data/lib/aspera/cli/plugins/ats.rb +231 -0
  30. data/lib/aspera/cli/plugins/bss.rb +71 -0
  31. data/lib/aspera/cli/plugins/config.rb +806 -0
  32. data/lib/aspera/cli/plugins/console.rb +62 -0
  33. data/lib/aspera/cli/plugins/cos.rb +106 -0
  34. data/lib/aspera/cli/plugins/faspex.rb +377 -0
  35. data/lib/aspera/cli/plugins/faspex5.rb +93 -0
  36. data/lib/aspera/cli/plugins/node.rb +438 -0
  37. data/lib/aspera/cli/plugins/oncloud.rb +937 -0
  38. data/lib/aspera/cli/plugins/orchestrator.rb +169 -0
  39. data/lib/aspera/cli/plugins/preview.rb +464 -0
  40. data/lib/aspera/cli/plugins/server.rb +216 -0
  41. data/lib/aspera/cli/plugins/shares.rb +63 -0
  42. data/lib/aspera/cli/plugins/shares2.rb +114 -0
  43. data/lib/aspera/cli/plugins/sync.rb +65 -0
  44. data/lib/aspera/cli/plugins/xnode.rb +115 -0
  45. data/lib/aspera/cli/transfer_agent.rb +251 -0
  46. data/lib/aspera/cli/version.rb +5 -0
  47. data/lib/aspera/colors.rb +39 -0
  48. data/lib/aspera/command_line_builder.rb +137 -0
  49. data/lib/aspera/fasp/aoc.rb +24 -0
  50. data/lib/aspera/fasp/connect.rb +99 -0
  51. data/lib/aspera/fasp/error.rb +21 -0
  52. data/lib/aspera/fasp/error_info.rb +60 -0
  53. data/lib/aspera/fasp/http_gw.rb +81 -0
  54. data/lib/aspera/fasp/installation.rb +240 -0
  55. data/lib/aspera/fasp/listener.rb +11 -0
  56. data/lib/aspera/fasp/local.rb +377 -0
  57. data/lib/aspera/fasp/manager.rb +69 -0
  58. data/lib/aspera/fasp/node.rb +88 -0
  59. data/lib/aspera/fasp/parameters.rb +235 -0
  60. data/lib/aspera/fasp/resume_policy.rb +76 -0
  61. data/lib/aspera/fasp/uri.rb +51 -0
  62. data/lib/aspera/faspex_gw.rb +196 -0
  63. data/lib/aspera/hash_ext.rb +28 -0
  64. data/lib/aspera/log.rb +80 -0
  65. data/lib/aspera/nagios.rb +71 -0
  66. data/lib/aspera/node.rb +14 -0
  67. data/lib/aspera/oauth.rb +319 -0
  68. data/lib/aspera/on_cloud.rb +421 -0
  69. data/lib/aspera/open_application.rb +72 -0
  70. data/lib/aspera/persistency_action_once.rb +42 -0
  71. data/lib/aspera/persistency_folder.rb +91 -0
  72. data/lib/aspera/preview/file_types.rb +300 -0
  73. data/lib/aspera/preview/generator.rb +258 -0
  74. data/lib/aspera/preview/image_error.png +0 -0
  75. data/lib/aspera/preview/options.rb +35 -0
  76. data/lib/aspera/preview/utils.rb +131 -0
  77. data/lib/aspera/preview/video_error.png +0 -0
  78. data/lib/aspera/proxy_auto_config.erb.js +287 -0
  79. data/lib/aspera/proxy_auto_config.rb +34 -0
  80. data/lib/aspera/rest.rb +296 -0
  81. data/lib/aspera/rest_call_error.rb +13 -0
  82. data/lib/aspera/rest_error_analyzer.rb +98 -0
  83. data/lib/aspera/rest_errors_aspera.rb +58 -0
  84. data/lib/aspera/ssh.rb +53 -0
  85. data/lib/aspera/sync.rb +82 -0
  86. data/lib/aspera/temp_file_manager.rb +37 -0
  87. data/lib/aspera/uri_reader.rb +25 -0
  88. metadata +288 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a932b26d5c19e6b77936291378b23bb1bff0c98cc7bccb784320a7209edf5a39
4
+ data.tar.gz: 1cd95ca0ce6d6b05b0861df3ae3b364cc584a44fea70ad09ccf8af2029dcbb93
5
+ SHA512:
6
+ metadata.gz: bf1501637093af5158ba5426a67bd2e8aa2733b5806a32b0a52c5ba1a04a365f2915063e80cc69746fa5160bafcca51b16f3c8fec6a2f578a645b52c51b694aa
7
+ data.tar.gz: 12ce81b38b945998c4273123a42f4717da1d976fbbe05b93497646ffb2b92e1e80f3d8e5712ad9a7b9f473db4e7ab8d1afed95cf6bcd4d6a5a8ee41b22c2f08e
@@ -0,0 +1,3592 @@
1
+ [comment1]: # (Do not edit this README.md, edit docs/README.erb.md, for details, read docs/README.md)
2
+
3
+
4
+ # `ascli` : a Command Line for IBM Aspera products
5
+
6
+ Version : 4.0.0.pre1
7
+
8
+ _Laurent/2016-2020_
9
+
10
+ This gem provides a command line interface to Aspera Applications.
11
+
12
+ Location (once released):
13
+ [https://rubygems.org/gems/aspera-cli](https://rubygems.org/gems/aspera-cli)
14
+
15
+ Disclaimers:
16
+
17
+ * This has not yet been officially released so things may change
18
+
19
+ That being said, `ascli` is very powerful and gets things done, it's also a great tool to learn Aspera APIs.
20
+
21
+ This manual addresses three parts:
22
+
23
+ * `ascli` : The command line tool
24
+ * `asession` : starting a FASP Session with JSON parameters
25
+ * `Aspera` : includes a Ruby "FASPManager"
26
+
27
+ In examples, command line operations (starting with `$`) are shown using a standard shell: `bash` or `zsh`.
28
+
29
+ Command line parameters in example beginning with `my_`, like `my_param_value` are user-provided value and not fixed value commands.
30
+
31
+ # Quick Start
32
+
33
+ This section guides you from installation, first use and advanced use.
34
+
35
+ First, follow the section: [Installation](#installation) (Ruby, Gem, FASP) to start using `ascli`.
36
+
37
+ Once the gem is installed, `ascli` shall be accessible:
38
+
39
+ ```
40
+ $ ascli --version
41
+ 4.0.0.pre1
42
+ ```
43
+
44
+ ## First use
45
+
46
+ Once installation is completed, you can proceed to the first use with a demo server:
47
+
48
+ If you want to test with Aspera on Cloud, jump to section: [Wizard](#aocwizard)
49
+
50
+ If you want to test with Aspera demo transfer server, a default configuration is created on first use:
51
+
52
+ ```
53
+ $ ascli server browse /
54
+ :............:...........:......:........:...........................:.......................:
55
+ : zmode : zuid : zgid : size : mtime : name :
56
+ :............:...........:......:........:...........................:.......................:
57
+ : dr-xr-xr-x : asperaweb : fasp : 4096 : 2014-04-10 19:44:05 +0200 : aspera-test-dir-tiny :
58
+ : drwxr-xr-x : asperaweb : fasp : 176128 : 2018-03-15 12:20:10 +0100 : Upload :
59
+ : dr-xr-xr-x : asperaweb : fasp : 4096 : 2015-04-01 00:37:22 +0200 : aspera-test-dir-small :
60
+ : dr-xr-xr-x : asperaweb : fasp : 4096 : 2018-05-04 14:26:55 +0200 : aspera-test-dir-large :
61
+ :............:...........:......:........:...........................:.......................:
62
+ ```
63
+
64
+ If you want to use `ascli` with another server, and in order to make further calls more convenient, it is advised to define a [option preset](#lprt) for the server's authentication options. The following example will:
65
+
66
+ * create a [option preset](#lprt)
67
+ * define it as default for "server" plugin
68
+ * list files in a folder
69
+ * download a file
70
+
71
+ ```
72
+ $ ascli config id myserver update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
73
+ updated: myserver
74
+ $ ascli config id default set server myserver
75
+ updated: default→server to myserver
76
+ $ ascli server browse /aspera-test-dir-large
77
+ :............:...........:......:..............:...........................:............................:
78
+ : zmode : zuid : zgid : size : mtime : name :
79
+ :............:...........:......:..............:...........................:............................:
80
+ : -rw-rw-rw- : asperaweb : fasp : 10133504 : 2018-05-04 14:16:24 +0200 : ctl_female_2.fastq.partial :
81
+ : -rw-r--r-- : asperaweb : fasp : 209715200 : 2014-04-10 19:49:27 +0200 : 200MB :
82
+ : -rw-r--r-- : asperaweb : fasp : 524288000 : 2014-04-10 19:44:15 +0200 : 500MB :
83
+ : -rw-r--r-- : asperaweb : fasp : 5368709120 : 2014-04-10 19:45:52 +0200 : 5GB :
84
+ : -rw-r--r-- : asperaweb : fasp : 500000000000 : 2017-06-14 20:09:57 +0200 : 500GB :
85
+ : -rw-rw-rw- : asperaweb : fasp : 13606912 : 2018-05-04 14:20:21 +0200 : ctl_male_2.fastq.partial :
86
+ : -rw-rw-rw- : asperaweb : fasp : 76 : 2018-05-04 14:13:18 +0200 : ctl_female_2.fastq.haspx :
87
+ : -rw-rw-rw- : asperaweb : fasp : 647348 : 2018-05-04 14:26:39 +0200 : ctl_female_2.gz :
88
+ : -rw-rw-rw- : asperaweb : fasp : 74 : 2018-05-04 14:16:00 +0200 : ctl_male_2.fastq.haspx :
89
+ : -rw-r--r-- : asperaweb : fasp : 1048576000 : 2014-04-10 19:49:23 +0200 : 1GB :
90
+ : -rw-r--r-- : asperaweb : fasp : 104857600 : 2014-04-10 19:49:29 +0200 : 100MB :
91
+ : -rw-r--r-- : asperaweb : fasp : 10737418240 : 2014-04-10 19:49:04 +0200 : 10GB :
92
+ :............:...........:......:..............:...........................:............................:
93
+ $ ascli server download /aspera-test-dir-large/200MB
94
+ Time: 00:00:02 ========================================================================================================== 100% 100 Mbps Time: 00:00:00
95
+ complete
96
+ ```
97
+
98
+ ## Going further
99
+
100
+ Get familiar with configuration, options, commands : [Command Line Interface](#cli).
101
+
102
+ Then, follow the section relative to the product you want to interact with ( Aspera on Cloud, Faspex, ...) : [Application Plugins](plugins)
103
+
104
+ # <a name="installation"></a>Installation
105
+
106
+ In order to use the tool or the gem, it is necessary to install those components:
107
+
108
+ * [Ruby](#ruby)
109
+ * [aspera-cli](#the_gem)
110
+ * [FASP](#fasp_prot)
111
+
112
+ The following sections provide information on the installation.
113
+
114
+ ## <a name="ruby"></a>Ruby
115
+
116
+ A ruby interpreter is required to run the tool or to use the gem and tool.
117
+ It is required to have privilege to install gems.
118
+ Ruby 2.5+ is prefered, but it should also work with 2.1+.
119
+ Any type of Ruby installation can be used.
120
+
121
+ Refer to the following sections for a proposed method for specific operating systems.
122
+
123
+ ### macOS
124
+
125
+
126
+ MacOS 10.13+ (High Sierra) comes with a recent Ruby, so you can use it directly, you will need to install aspera-cli using `sudo` :
127
+
128
+ ```
129
+ $ sudo gem install aspera-cli
130
+ ```
131
+
132
+ Alternatively, if you use [Homebrew](https://brew.sh/) already you can install Ruby with it:
133
+
134
+ ```
135
+ $ brew install ruby
136
+ ```
137
+
138
+ ### Windows
139
+
140
+ Install Latest stable Ruby using [https://rubyinstaller.org/](https://rubyinstaller.org/).
141
+
142
+ Go to "Downloads".
143
+
144
+ Select the version "without devkit", x64 corresponding to the one recommended "with devkit".
145
+
146
+ During installation, skip the installation of "MSys2".
147
+
148
+ ### Linux
149
+
150
+ Install Latest Ruby using "rvm" [https://rvm.io/](https://rvm.io/) .
151
+ It installs by default in /usr/local/rvm , but you can install in another location:
152
+
153
+ ```
154
+ curl -sSL https://get.rvm.io | bash -s -- --path /usr/local
155
+ ```
156
+
157
+ Once installed, you can install latest ruby:
158
+
159
+ ```
160
+ # rvm install ruby
161
+ ```
162
+
163
+ If you dont want all users to have ruby by default,
164
+ rename the file: `/etc/profile.d/rvm.sh` with another extension, and source it to get rvm.
165
+
166
+ Alternatively, only if you know what you do, on RPM based systems (CentOs, Redhat), install the ruby provided by yum which may be 2.0.
167
+
168
+ ```
169
+ # yum install -y ruby rubygems ruby-json
170
+ ```
171
+
172
+ If necessary, pre-install jwt for older Ruby < 2.1.
173
+
174
+ ```
175
+ # gem install jwt -v 1.5.6
176
+ ```
177
+
178
+ You can cleanup your whole yum-installed ruby environment like this to uninstall:
179
+
180
+ ```
181
+ gem uninstall $(ls $(gem env gemdir)/gems/|sed -e 's/-[^-]*$//'|sort -u)
182
+ yum remove -y ruby ruby-libs
183
+ ```
184
+
185
+ ### Other Unixes: Aix, etc...
186
+
187
+ If your unix do not provide a pre-built ruby, you can get using one of those
188
+ [methods](https://www.ruby-lang.org/en/documentation/installation/)
189
+
190
+ For instance to build from source, and install in `/opt/ruby` :
191
+
192
+ ```
193
+ # wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
194
+ # gzip -d ruby-2.7.2.tar.gz
195
+ # tar xvf ruby-2.7.2.tar
196
+ # cd ruby-2.7.2
197
+ # ./configure --prefix=/opt/ruby
198
+ # make ruby.imp
199
+ # make
200
+ # make install
201
+ ```
202
+
203
+ ## <a name="the_gem"></a>`aspera-cli` gem
204
+
205
+ Once you have Ruby and rights to install gems: Install the gem and its dependencies:
206
+
207
+ ```
208
+ # gem install aspera-cli
209
+ ```
210
+
211
+ To upgrade to the latest version:
212
+
213
+ ```
214
+ # gem update aspera-cli
215
+ ```
216
+
217
+ ## <a name="fasp_prot"></a>FASP Protocol
218
+
219
+ Most file transfers will be done using the FASP protocol. Only two additional files are required to perform
220
+ an Aspera Transfer:
221
+
222
+ * ascp
223
+ * aspera-license (in same folder, or ../etc)
224
+
225
+ Those can be found in one of IBM Asprea transfer server or client with its license file (some are free):
226
+
227
+ * IBM Aspera Connect Client (Free)
228
+ * IBM Aspera Desktop Client (Free)
229
+ * IBM Aspera CLI (Free)
230
+ * IBM Aspera High Speed Transfer Server (Licensed)
231
+ * IBM Aspera High Speed Transfer EndPoint (Licensed)
232
+
233
+ For instance, Aspera Connect Client can be installed
234
+ by visiting the page: [http://downloads.asperasoft.com/connect2/](http://downloads.asperasoft.com/connect2/).
235
+
236
+ `ascli` will detect most of Aspera transfer products in standard locations and use the first one found.
237
+ Refer to section [FASP](#client) for details on how to select a client or set path to the FASP protocol.
238
+
239
+ Several methods are provided on how to start a transfer. Use of a local client is one of them, but
240
+ other methods are available. Refer to section: [Transfer Agents](#agents)
241
+
242
+ # <a name="cli"></a>Command Line Interface: `ascli`
243
+
244
+ The `aspera-cli` Gem provides a command line interface (CLI) which interacts with Aspera Products (mostly using REST APIs):
245
+
246
+ * IBM Aspera High Speed Transfer Server (FASP and Node)
247
+ * IBM Aspera on Cloud (including ATS)
248
+ * IBM Aspera Faspex
249
+ * IBM Aspera Shares
250
+ * IBM Aspera Console
251
+ * IBM Aspera Orchestrator
252
+ * and more...
253
+
254
+ `ascli` provides the following features:
255
+
256
+ * Supports most Aspera server products (on-premise and SaaS)
257
+ * Any command line options (products URL, credentials or any option) can be provided on command line, in configuration file, in env var, in files
258
+ * Supports Commands, Option values and Parameters shortcuts
259
+ * FASP [Transfer Agents](#agents) can be: FaspManager (local ascp), or Connect Client, or any transfer node
260
+ * Transfer parameters can be altered by modification of _transfer-spec_, this includes requiring multi-session
261
+ * Allows transfers from products to products, essentially at node level (using the node transfer agent)
262
+ * Supports FaspStream creation (using Node API)
263
+ * Supports Watchfolder creation (using Node API)
264
+ * Additional command plugins can be written by the user
265
+ * Supports download of faspex and Aspera on Cloud "external" links
266
+ * Supports "legacy" ssh based FASP transfers and remote commands (ascmd)
267
+
268
+ Basic usage is displayed by executing:
269
+
270
+ ```
271
+ $ ascli -h
272
+ ```
273
+
274
+ Refer to sections: [Usage](#usage) and [Sample Commands](#commands).
275
+
276
+ Not all `ascli` features are fully documented here, the user may explore commands on the command line.
277
+
278
+ ## Arguments : Commands and options
279
+
280
+ Arguments are the units of command line, as parsed by the shell, typically separated by spaces (and called "argv").
281
+
282
+ There are two types of arguments: Commands and Options. Example :
283
+
284
+ ```
285
+ $ ascli command --option-name=VAL1 VAL2
286
+ ```
287
+
288
+ * executes _command_: `command`
289
+ * with one _option_: `option_name`
290
+ * this option has a _value_ of: `VAL1`
291
+ * the command has one additional _argument_: `VAL2`
292
+
293
+ When the value of a command, option or argument is constrained by a fixed list of values, it is possible to use the first letters of the value only, provided that it uniquely identifies a value. For example `ascli conf ov` is the same as `ascli config overview`.
294
+
295
+ The value of options and arguments is evaluated with the [Extended Value Syntax](#extended).
296
+
297
+ ### Options
298
+
299
+ All options, e.g. `--log-level=debug`, are command line arguments that:
300
+
301
+ * start with `--`
302
+ * have a name, in lowercase, using `-` as word separator in name (e.g. `--log-level=debug`)
303
+ * have a value, separated from name with a `=`
304
+ * can be used by prefix, provided that it is unique. E.g. `--log-l=debug` is the same as `--log-level=debug`
305
+
306
+ Exceptions:
307
+
308
+ * some options accept a short form, e.g. `-Ptoto` is equivalent to `--preset=toto`, refer to the manual or `-h`.
309
+ * some options (flags) don't take a value, e.g. `-r`
310
+ * the special option `--` stops option processing and is ignored, following command line arguments are taken as arguments, including the ones starting with a `-`. Example:
311
+
312
+ ```
313
+ $ ascli config echo -- --sample
314
+ "--sample"
315
+ ```
316
+
317
+ Note that `--sample` is taken as an argument, and not option.
318
+
319
+ Options can be optional or mandatory, with or without (hardcoded) default value. Options can be placed anywhere on comand line and evaluated in order.
320
+
321
+ The value for _any_ options can come from the following locations (in this order, last value evaluated overrides previous value):
322
+
323
+ * [Configuration file](#configfile).
324
+ * Environment variable
325
+ * Command line
326
+
327
+ Environment variable starting with prefix: ASCLI_ are taken as option values,
328
+ e.g. `ASCLI_OPTION_NAME` is for `--option-name`.
329
+
330
+ Options values can be displayed for a given command by providing the `--show-config` option: `ascli node --show-config`
331
+
332
+ ### Commands and Arguments
333
+
334
+ Command line arguments that are not options are either commands or arguments. If an argument must begin with `-`, then either use the `@val:` syntax (see [Extended Values](#extended)), or use the `--` separator (see above).
335
+
336
+ ## Interactive Input
337
+
338
+ Some options and parameters are mandatory and other optional. By default, the tool will ask for missing mandatory options or parameters for interactive execution.
339
+
340
+ The behaviour can be controlled with:
341
+
342
+ * --interactive=&lt;yes|no&gt; (default=yes if STDIN is a terminal, else no)
343
+ * yes : missing mandatory parameters/options are asked to the user
344
+ * no : missing mandatory parameters/options raise an error message
345
+ * --ask-options=&lt;yes|no&gt; (default=no)
346
+ * optional parameters/options are asked to user
347
+
348
+ ## Output
349
+
350
+ Command execution will result in output (terminal, stdout/stderr).
351
+ The information displayed depends on the action.
352
+
353
+ ### Types of output data
354
+
355
+ Depending on action, the output will contain:
356
+
357
+ * `single_object` : displayed as a 2 dimensional table: one line per attribute, first column is attribute name, and second is atteribute value. Nested hashes are collapsed.
358
+ * `object_list` : displayed as a 2 dimensional table: one line per item, one colum per attribute.
359
+ * `value_list` : a table with one column.
360
+ * `empty` : nothing
361
+ * `status` : a message
362
+ * `other_struct` : a complex structure that cannot be displayed as an array
363
+
364
+ ### Format of output
365
+
366
+ By default, result of type single_object and object_list are displayed using format `table`.
367
+ The table style can be customized with parameter: `table_style` (horizontal, vertical and intersection characters) and is `:.:` by default.
368
+
369
+ In a table format, when displaying "objects" (single, or list), by default, sub object are
370
+ flatten (option flat_hash). So, object {"user":{"id":1,"name":"toto"}} will have attributes: user.id and user.name. Setting `flat_hash` to `false` will only display one
371
+ field: "user" and value is the sub hash table. When in flatten mode, it is possible to
372
+ filter fields by "dotted" field name.
373
+
374
+ The style of output can be set using the `format` parameter, supporting:
375
+
376
+ * `table` : Text table
377
+ * `ruby` : Ruby code
378
+ * `json` : JSON code
379
+ * `jsonpp` : JSON pretty printed
380
+ * `yaml` : YAML
381
+ * `csv` : Comma Separated Values
382
+
383
+ ### Filtering columns for `object_list`
384
+
385
+ Table output can be filtered using the `select` parameter. Example:
386
+
387
+ ```
388
+ $ ascli aspera admin res user list --fields=name,email,ats_admin --query=@json:'{"per_page":1000,"page":1,"sort":"name"}' --select=@json:'{"ats_admin":true}'
389
+ :...............................:..................................:...........:
390
+ : name : email : ats_admin :
391
+ :...............................:..................................:...........:
392
+ : John Custis : john@example.com : true :
393
+ : Laurent Martin : laurent@example.com : true :
394
+ :...............................:..................................:...........:
395
+ ```
396
+
397
+ Note that `select` filters selected elements from the result of API calls, while the `query` parameters gives filtering parameters to the API when listing elements.
398
+
399
+ ### Verbosity of output
400
+
401
+ Outpout messages are categorized in 3 types:
402
+
403
+ * `info` output contain additional information, such as number of elements in a table
404
+ * `data` output contain the actual output of the command (object, or list of objects)
405
+ * `error`output contain error messages
406
+
407
+ The option `display` controls the level of output:
408
+
409
+ * `info` displays all messages
410
+ * `data` display `data` and `error` messages
411
+ * `error` display only error messages.
412
+
413
+ ### Selection of output object properties
414
+
415
+ By default, a table output will display one line per entry, and columns for each entries. Depending on the command, columns may include by default all properties, or only some selected properties. It is possible to define specific colums to be displayed, by setting the `fields` option to one of the following value:
416
+
417
+ * DEF : default display of columns (that's the default, when not set)
418
+ * ALL : all columns available
419
+ * a,b,c : the list of attributes specified by the comma separated list
420
+ * Array extended value: for instance, @json:'["a","b","c"]' same as above
421
+ * +a,b,c : add selected properties to the default selection.
422
+
423
+ ## <a name="extended"></a>Extended Value Syntax
424
+
425
+ Usually, values of options and arguments are specified by a simple string. But sometime it is convenient to read a value from a file, or decode it, or have a value more complex than a string (e.g. Hash table).
426
+
427
+ The extended value syntax is:
428
+
429
+ ```
430
+ <0 or more decoders><0 or 1 reader><nothing or some text value>
431
+ ```
432
+
433
+ The difference between reader and decoder is order and ordinality. Both act like a function of value on right hand side. Decoders are at the beginning of the value, followed by a single optional reader, followed by the optional value.
434
+
435
+ The following "readers" are supported:
436
+
437
+ * @val:VALUE , prevent further special prefix processing, e.g. `--username=@val:laurent` sets the option `username` to value `laurent`.
438
+ * @file:PATH , read value from a file (prefix "~/" is replaced with the users home folder), e.g. --key=@file:~/.ssh/mykey
439
+ * @path:PATH , performs path expansion (prefix "~/" is replaced with the users home folder), e.g. --config-file=@path:~/sample_config.yml
440
+ * @env:ENVVAR , read from a named env var, e.g.--password=@env:MYPASSVAR
441
+ * @stdin: , read from stdin (no value on right)
442
+ * @preset:NAME , get whole option preset value by name
443
+
444
+ In addition it is possible to decode a value, using one or multiple decoders :
445
+
446
+ * @base64: decode a base64 encoded string
447
+ * @json: decode JSON values (convenient to provide complex structures)
448
+ * @zlib: uncompress data
449
+ * @ruby: execute ruby code
450
+ * @csvt: decode a titled CSV value
451
+ * @lines: split a string in multiple lines and return an array
452
+ * @list: split a string in multiple items taking first character as separator and return an array
453
+ * @incps: include values of presets specified by key include_presets in hash
454
+
455
+ To display the result of an extended value, use the `config echo` command.
456
+
457
+ Example: read the content of the specified file, then, base64 decode, then unzip:
458
+
459
+ ```
460
+ $ ascli config echo @zlib:@base64:@file:myfile.dat
461
+ ```
462
+
463
+ Example: create a value as a hash, with one key and the value is read from a file:
464
+
465
+ ```
466
+ $ ascli config echo @ruby:'{"token_verification_key"=>File.read("pubkey.txt")}'
467
+ ```
468
+
469
+ Example: read a csv file and create a list of hash for bulk provisioning:
470
+
471
+ ```
472
+ $ cat test.csv
473
+ name,email
474
+ lolo,laurent@example.com
475
+ toto,titi@tutu.tata
476
+ $ ascli config echo @csvt:@file:test.csv
477
+ :......:.....................:
478
+ : name : email :
479
+ :......:.....................:
480
+ : lolo : laurent@example.com :
481
+ : toto : titi@tutu.tata :
482
+ :......:.....................:
483
+ ```
484
+
485
+ Example: create a hash and include values from preset named "config" of config file
486
+
487
+ ```
488
+ $ ascli config echo @incps:@json:'{"hello":true,"incps":["config"]}'
489
+ {"version"=>"0.9", "hello"=>true}
490
+ ```
491
+
492
+ Note that `@incps:@json:'{"incps":["config"]}'` or `@incps:@ruby:'{"incps"=>["config"]}'` is equivalent to: `@preset:config`
493
+
494
+ ## <a name="native"></a>Structured Value
495
+
496
+ Some options and parameters expect a _Structured Value_, i.e. a value more complex than a simple string. This is usually a Hash table or an Array, which could also contain sub structures.
497
+
498
+ For instance, a [_transfer-spec_](#transferspec) is expected to be a _Structured Value_.
499
+
500
+ Structured values shall be described using the [Extended Value Syntax](#extended).
501
+ A convenient way to specify a _Structured Value_ is to use the `@json:` decoder, and describe the value in JSON format. The `@ruby:` decoder can also be used. For an array of hash tables, the `@csvt:` decoder can be used.
502
+
503
+ It is also possible to provide a _Structured Value_ in a file using `@json:@file:<path>`
504
+
505
+ ## <a name="conffolder"></a>Configuration and Persistency Folder
506
+
507
+ `ascli` configuration and other runtime files (token cache, file lists, persistency files)
508
+ are stored in folder `$HOME/.aspera/ascli`. The folder can be displayed using :
509
+
510
+ ```
511
+ $ ascli config folder
512
+ /Users/kenji/.aspera/ascli
513
+ ```
514
+
515
+ ## <a name="configfile"></a>Configuration file
516
+
517
+ On the first execution of `ascli`, an empty configuration file is created in the configuration folder.
518
+ Nevertheless, there is no mandatory information required in this file, the use of it is optional as any option can be provided on the command line.
519
+
520
+ Although the file is a standard YAML file, `ascli` provides commands to read and modify it
521
+ using the `config` command.
522
+
523
+ All options for `ascli` commands can be set on command line, or by env vars, or using [option presets](#lprt) in the configuratin file.
524
+
525
+ A configuration file provides a way to define default values, especially
526
+ for authentication parameters, thus avoiding to always having to specify those parameters on the command line.
527
+
528
+ The default configuration file is: `$HOME/.aspera/ascli/config.yaml`
529
+ (this can be overriden with option `--config-file=path` or equivalent env var).
530
+
531
+ So, finally, the configuration file is simply a catalog of pre-defined lists of options,
532
+ called: [option presets](#lprt). Then, instead of specifying some common options on the command line (e.g. address, credentials), it is possible to invoke the ones of a [option preset](#lprt) (e.g. `mypreset`) using the option: `-Pmypreset` or `--preset=mypreset`.
533
+
534
+ ### <a name="lprt"></a>Option preset
535
+
536
+ A [option preset](#lprt) is simply a collection of parameters and their associated values in a named section in the configuration file.
537
+
538
+ A named [option preset](#lprt) can be modified directly using `ascli`, which will update the configuration file :
539
+
540
+ ```
541
+ $ ascli config id <option preset> set|delete|show|initialize|update
542
+ ```
543
+
544
+ The command `update` allows the easy creation of [option preset](#lprt) by simply providing the options in their command line format, e.g. :
545
+
546
+ ```
547
+ $ ascli config id demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera --ts=@json:'{"precalculate_job_size":true}'
548
+ ```
549
+
550
+ * This creates a [option preset](#lprt) `demo_server` with all provided options.
551
+
552
+ The command `set` allows setting individual options in a [option preset](#lprt).
553
+
554
+ ```
555
+ $ ascli config id demo_server set password demoaspera
556
+ ```
557
+
558
+ The command `initialize`, like `update` allows to set several parameters at once, but it deletes an existing configuration instead of updating it, and expects a _[Structured Value](#native)_.
559
+
560
+ ```
561
+ $ ascli config id demo_server initialize @json:'{"url":"ssh://demo.asperasoft.com:33001","username":"asperaweb","password":"demoaspera","ts":{"precalculate_job_size":true}}'
562
+ ```
563
+
564
+ A good practice is to not manually edit the configuration file and use modification commands instead.
565
+ If necessary, the configuration file can be edited (or simply consulted) with:
566
+
567
+ ```
568
+ $ ascli config open
569
+ ```
570
+
571
+ A full terminal based overview of the configuration can be displayed using:
572
+
573
+ ```
574
+ $ ascli config over
575
+ ```
576
+
577
+ A list of [option preset](#lprt) can be displayed using:
578
+
579
+ ```
580
+ $ ascli config list
581
+ ```
582
+
583
+ ### <a name="lprtconf"></a>Special Option preset: config
584
+
585
+ This preset name is reserved and contains a single key: `version`. This is the version of `ascli` which created the file.
586
+
587
+ ### <a name="lprtdef"></a>Special Option preset: default
588
+
589
+ This preset name is reserved and contains an array of key-value , where the key is the name of a plugin, and the value is the name of another preset.
590
+
591
+ When a plugin is invoked, the preset associated with the name of the plugin is loaded, unless the option --no-default (or -N) is used.
592
+
593
+ Note that special plugin name: `config` can be associated with a preset that is loaded initially, typically used for default values.
594
+
595
+ Operations on this preset are done using regular `config` operations:
596
+
597
+ ```
598
+ $ ascli config id default set _plugin_name_ _defauklt_preset_for_plugin_
599
+ $ ascli config id default get _plugin_name_
600
+ "_defauklt_preset_for_plugin_"
601
+ ```
602
+
603
+ ### Format of file
604
+
605
+ The configuration file is a hash in a YAML file. Example:
606
+
607
+ ```yaml
608
+ config:
609
+ version: 0.3.7
610
+ default:
611
+ config: cli_default
612
+ server: demo_server
613
+ cli_default:
614
+ interactive: no
615
+ demo_server:
616
+ url: ssh://demo.asperasoft.com:33001
617
+ username: asperaweb
618
+ password: demoaspera
619
+ ```
620
+
621
+ We can see here:
622
+
623
+ * The configuration was created with CLI version 0.3.7
624
+ * the default [option preset](#lprt) to load for plugin "server" is : `demo_server`
625
+ * the [option preset](#lprt) `demo_server` defines some parameters: the URL and credentials
626
+ * the default [option preset](#lprt) to load in any case is : `cli_default`
627
+
628
+ Two [option presets](#lprt) are reserved:
629
+
630
+ * `config` contains a single value: `version` showing the CLI
631
+ version used to create the configuration file. It is used to check compatibility.
632
+ * `default` is reserved to define the default [option preset](#lprt) name used for known plugins.
633
+
634
+ The user may create as many [option presets](#lprt) as needed. For instance, a particular [option preset](#lprt) can be created for a particular application instance and contain URL and credentials.
635
+
636
+ Values in the configuration also follow the [Extended Value Syntax](#extended).
637
+
638
+ Note: if the user wants to use the [Extended Value Syntax](#extended) inside the configuration file, using the `config id update` command, the user shall use the `@val:` prefix. Example:
639
+
640
+ ```
641
+ $ ascli config id my_aoc_org set private_key @val:@file:"$HOME/.aspera/ascli/aocapikey"
642
+ ```
643
+
644
+ This creates the [option preset](#lprt):
645
+
646
+ ```
647
+ ...
648
+ my_aoc_org:
649
+ private_key: @file:"/Users/laurent/.aspera/ascli/aocapikey"
650
+ ...
651
+ ```
652
+
653
+ So, the key file will be read only at execution time, but not be embedded in the configuration file.
654
+
655
+ Options are loaded using this algorithm:
656
+
657
+ * if option '--preset=xxxx' is specified (or -Pxxxx), this reads the [option preset](#lprt) specified from the configuration file.
658
+ * else if option --no-default (or -N) is specified, then dont load default
659
+ * else it looks for the name of the default [option preset](#lprt) in section "default" and loads it
660
+ * environment variables are evaluated
661
+ * command line options are evaluated
662
+
663
+ Parameters are evaluated in the order of command line.
664
+
665
+ To avoid loading the default [option preset](#lprt) for a plugin, just specify a non existing configuration: `-Pnone`
666
+
667
+ On command line, words in parameter names are separated by a dash, in configuration file, separator
668
+ is an underscore. E.g. --xxx-yyy on command line gives xxx_yyy in configuration file.
669
+
670
+ Note: before version 0.4.5, some keys could be ruby symbols, from 0.4.5 all keys are strings. To
671
+ convert olver versions, remove the leading ":" in front of keys.
672
+
673
+ The main plugin name is *config*, so it is possible to define a default [option preset](#lprt) for
674
+ the main plugin with:
675
+
676
+ ```
677
+ $ ascli config id cli_default set interactive no
678
+ $ ascli config id default set config cli_default
679
+ ```
680
+
681
+ A [option preset](#lprt) value can be removed with `unset`:
682
+
683
+ ```
684
+ $ ascli config id cli_default unset interactive
685
+ ```
686
+
687
+
688
+ ### Examples
689
+
690
+ For Faspex, Shares, Node (including ATS, Aspera Transfer Service), Console,
691
+ only username/password and url are required (either on command line, or from config file).
692
+ Those can usually be provided on the command line:
693
+
694
+ ```
695
+ $ ascli shares repo browse / --url=https://10.25.0.6 --username=john --password=4sp3ra
696
+ ```
697
+
698
+ This can also be provisioned in a config file:
699
+
700
+ ```
701
+ 1$ ascli config id shares06 set url https://10.25.0.6
702
+ 2$ ascli config id shares06 set username john
703
+ 3$ ascli config id shares06 set password 4sp3ra
704
+ 4$ ascli config id default set shares shares06
705
+ 5$ ascli config overview
706
+ 6$ ascli shares repo browse /
707
+ ```
708
+
709
+ The three first commands build a [option preset](#lprt).
710
+ Note that this can also be done with one single command:
711
+
712
+ ```
713
+ $ ascli config id shares06 init @json:'{"url":"https://10.25.0.6","username":"john","password":"4sp3ra"}'
714
+ ```
715
+
716
+ The fourth command defines this [option preset](#lprt) as the default [option preset](#lprt) for the
717
+ specified application ("shares"). The 5th command displays the content of configuration file in table format.
718
+ Alternative [option presets](#lprt) can be used with option "-P&lt;[option preset](#lprt)&gt;"
719
+ (or --preset=&lt;[option preset](#lprt)&gt;)
720
+
721
+ Eventually, the last command shows a call to the shares application using default parameters.
722
+
723
+
724
+ ## Plugins
725
+
726
+ The CLI tool uses a plugin mechanism. The first level command (just after `ascli` on the command line) is the name of the concerned plugin which will execute the command. Each plugin usually represent commands sent to a specific application.
727
+ For instance, the plugin "faspex" allows operations on the application "Aspera Faspex".
728
+
729
+ ### Create your own plugin
730
+ ```
731
+ $ mkdir -p ~/.aspera/ascli/plugins
732
+ $ cat<<EOF>~/.aspera/ascli/plugins/test.rb
733
+ require 'aspera/cli/plugin'
734
+ module Aspera
735
+ module Cli
736
+ module Plugins
737
+ class Test < Plugin
738
+ ACTIONS=[]
739
+ def execute_action; puts "Hello World!"; end
740
+ end # Test
741
+ end # Plugins
742
+ end # Cli
743
+ end # Aspera
744
+ EOF
745
+ ```
746
+
747
+ ## Debugging
748
+
749
+ The gem is equipped with traces. By default logging level is "warn". To increase debug level, use parameter `log_level`, so either command line `--log-level=xx` or env var `ASCLI_LOG_LEVEL`.
750
+
751
+ ## Learning Aspera Product APIs (REST)
752
+
753
+ This CLI uses REST APIs.
754
+ To display HTTP calls, use argument `-r` or `--rest-debug`, this is useful to display
755
+ exact content or HTTP requests and responses.
756
+
757
+ In order to get traces of execution, use argument : `--log-level=debug`
758
+
759
+ ## <a name="graphical"></a>Graphical Interactions: Browser and Text Editor
760
+
761
+ Some actions may require the use of a graphical tool:
762
+
763
+ * a browser for Aspera on Cloud authentication (web auth method)
764
+ * a text editor for configuration file edition
765
+
766
+ By default the CLI will assume that a graphical environment is available on windows,
767
+ and on other systems, rely on the presence of the "DISPLAY" environment variable.
768
+ It is also possible to force the graphical mode with option --ui :
769
+
770
+ * `--ui=graphical` forces a graphical environment, a browser will be opened for URLs or
771
+ a text editor for file edition.
772
+ * `--ui=text` forces a text environment, the URL or file path to open is displayed on
773
+ terminal.
774
+
775
+ ## HTTP proxy for REST
776
+
777
+ To specify a HTTP proxy, set the HTTP_PROXY environment variable (or HTTPS_PROXY), those are honoured by Ruby when calling REST APIs.
778
+
779
+ ## Proxy auto config
780
+
781
+ The `fpac` option allows specification of a Proxy Auto Configuration (PAC) file, by its URL for local FASP agent. Supported schemes are : http:, https: and file:.
782
+
783
+ The PAC file can be tested with command: `config proxy_check` , example:
784
+
785
+ ```
786
+ $ ascli config proxy_check --fpac=file:///./proxy.pac http://www.example.com
787
+ PROXY proxy.example.com:8080
788
+ ```
789
+
790
+ This is not yet implemented to specify http proxy, so use `http_proxy` env vars.
791
+
792
+ ## <a name="client"></a>FASP configuration
793
+
794
+ The `config` plugin also allows specification for the use of a local FASP client. It provides the following commands for `ascp` subcommand:
795
+
796
+ * `show` : shows the path of ascp used
797
+ * `use` : list,download connect client versions available on internet
798
+ * `products` : list Aspera transfer products available locally
799
+ * `connect` : list,download connect client versions available on internet
800
+
801
+ ### Show path of currently used `ascp`
802
+
803
+ ```
804
+ $ ascli config ascp show
805
+ /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
806
+ ```
807
+
808
+ ### Selection of local `ascp`
809
+
810
+ To temporarily use an alternate ascp path use option `ascp_path` (`--ascp-path=`)
811
+
812
+ To permanently use another ascp:
813
+
814
+ ```
815
+ $ ascli config ascp use '/Users/laurent/Applications/Aspera CLI/bin/ascp'
816
+ saved to default global preset /Users/laurent/Applications/Aspera CLI/bin/ascp
817
+ ```
818
+
819
+ This sets up a global default.
820
+
821
+ ### List locally installed Aspera Transfer products
822
+
823
+ Locally installed Aspera products can be listed with:
824
+
825
+ ```
826
+ $ ascli config ascp products list
827
+ :.........................................:................................................:
828
+ : name : app_root :
829
+ :.........................................:................................................:
830
+ : Aspera Connect : /Users/laurent/Applications/Aspera Connect.app :
831
+ : IBM Aspera CLI : /Users/laurent/Applications/Aspera CLI :
832
+ : IBM Aspera High-Speed Transfer Endpoint : /Library/Aspera :
833
+ : Aspera Drive : /Applications/Aspera Drive.app :
834
+ :.........................................:................................................:
835
+ ```
836
+
837
+ ### Selection of local client
838
+
839
+ If no ascp is selected, this is equivalent to using option: `--use-product=FIRST`.
840
+
841
+ Using the option use_product finds the ascp binary of the selected product.
842
+
843
+ To permanently use the ascp of a product:
844
+
845
+ ```
846
+ $ ascli config ascp products use 'Aspera Connect'
847
+ saved to default global preset /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
848
+ ```
849
+
850
+ ### Installation of Connect Client on command line
851
+
852
+ ```
853
+ $ ascli config ascp connect list
854
+ :...............................................:......................................:..............:
855
+ : id : title : version :
856
+ :...............................................:......................................:..............:
857
+ : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows : 3.7.0.138427 :
858
+ : urn:uuid:A3820D20-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows 64-bit : 3.7.0.138427 :
859
+ : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows XP : 3.7.0.138427 :
860
+ : urn:uuid:55425020-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows XP 64-bit : 3.7.0.138427 :
861
+ : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel 10.6 : 3.6.1.111259 :
862
+ : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel : 3.7.0.138427 :
863
+ : urn:uuid:213C9370-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 32 : 3.6.2.117442 :
864
+ : urn:uuid:97F94DF0-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 64 : 3.7.2.141527 :
865
+ :...............................................:......................................:..............:
866
+ $ ascli config ascp connect id 'Aspera Connect for Mac Intel 10.6' links list
867
+ :.............................................:..........................:.......................................................................:..........:...............:
868
+ : title : type : href : hreflang : rel :
869
+ :.............................................:..........................:.......................................................................:..........:...............:
870
+ : Mac Intel Installer : application/octet-stream : bin/AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg : en : enclosure :
871
+ : Aspera Connect for Mac HTML Documentation : text/html : : en : documentation :
872
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/ja-jp/pdf/Connect_User_3.7.0_OSX_ja-jp.pdf : ja-jp : documentation :
873
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/en/pdf/Connect_User_3.7.0_OSX.pdf : en : documentation :
874
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/es-es/pdf/Connect_User_3.7.0_OSX_es-es.pdf : es-es : documentation :
875
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/fr-fr/pdf/Connect_User_3.7.0_OSX_fr-fr.pdf : fr-fr : documentation :
876
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/zh-cn/pdf/Connect_User_3.7.0_OSX_zh-cn.pdf : zh-cn : documentation :
877
+ : Aspera Connect for Mac Release Notes : text/html : http://www.asperasoft.com/en/release_notes/default_1/release_notes_54 : en : release-notes :
878
+ :.............................................:..........................:.......................................................................:..........:...............:
879
+ $ ascli config ascp connect id 'Aspera Connect for Mac Intel 10.6' links id 'Mac Intel Installer' download --to-folder=.
880
+ downloaded: AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg
881
+ ```
882
+
883
+ ## <a name="agents"></a>Transfer Agents
884
+
885
+ Some of the actions on Aspera Applications lead to file transfers (upload and download) using the FASP protocol (`ascp`).
886
+
887
+ When a transfer needs to be started, a [_transfer-spec_](#transferspec) has been internally prepared.
888
+ This [_transfer-spec_](#transferspec) will be executed by a transfer client, here called "Transfer Agent".
889
+
890
+ There are currently 3 agents:
891
+
892
+ * `direct` : a local execution of `ascp`
893
+ * `connect` : use of a local Connect Client
894
+ * `node` : use of an Aspera Transfer Node (potentially _remote_).
895
+ * `httpgw` : use of an Aspera HTTP Gateway
896
+
897
+ Note that all transfer operation are seen from the point of view of the agent.
898
+ For instance, a node agent making an "upload", or "package send" operation,
899
+ will effectively push files to the related server from the agent node.
900
+
901
+ `ascli` standadizes on the use of a [_transfer-spec_](#transferspec) instead of _raw_ ascp options to provide parameters for a transfer session, as a common method for those three Transfer Agents.
902
+
903
+
904
+ ### <a name="direct"></a>Direct (local ascp using FASPManager API)
905
+
906
+ By default the CLI will use a local FASP protocol, equivalent to specifying `--transfer=direct`.
907
+ `ascli` will detect locally installed Aspera products.
908
+ Refer to section [FASP](#client).
909
+
910
+ To specify a FASP proxy (only supported with the `direct` agent), set the appropriate [_transfer-spec_](#transferspec) parameter:
911
+
912
+ * `EX_fasp_proxy_url`
913
+ * `EX_http_proxy_url` (proxy for legacy http fallback)
914
+ * `EX_ascp_args`
915
+
916
+ The `transfer-info` optionally provides the following auto resume parameters:
917
+
918
+ <table>
919
+ <tr><th>Name</th><th>Default</th><th>Feature</th><th>Description</th></tr>
920
+ <tr><td>iter_max</td>. <td>7</td><td>Resume</td><td>Max number of retry on error</td></tr>
921
+ <tr><td>sleep_initial</td><td>2</td><td>Resume</td><td>First Sleep before retry</td></tr>
922
+ <tr><td>sleep_factor</td> <td>2</td><td>Resume</td><td>Multiplier of Sleep</td></tr>
923
+ <tr><td>sleep_max</td>. <td>60</td><td>Resume</td><td>Maximum sleep</td></tr>
924
+ <tr><td>wss</td> <td>false</td><td>Web Socket Session</td><td>Enable use of web socket session in case it is available</td></tr>
925
+ </table>
926
+
927
+ ### IBM Aspera Connect Client GUI
928
+
929
+ By specifying option: `--transfer=connect`, `ascli` will start transfers
930
+ using the locally installed Aspera Connect Client.
931
+
932
+ ### Aspera Node API : Node to node transfers
933
+
934
+ By specifying option: `--transfer=node`, the CLI will start transfers in an Aspera
935
+ Transfer Server using the Node API, either on a local or remote node.
936
+
937
+ If a default node has been configured
938
+ in the configuration file, then this node is used by default else the parameter
939
+ `--transfer-info` is required. The node specification shall be a hash table with
940
+ three keys: url, username and password, corresponding to the URL of the node API
941
+ and associated credentials (node user or access key).
942
+
943
+ The `--transfer-info` parameter can directly specify a pre-configured [option preset](#lprt) :
944
+ `--transfer-info=@preset:<psetname>` or specified using the option syntax :
945
+ `--transfer-info=@json:'{"url":"https://...","username":"theuser","password":"thepass"}'`
946
+
947
+ ### <a name="trinfoaoc"></a>Aspera on cloud
948
+
949
+ By specifying option: `--transfer=aoc`, WORK IN PROGRESS
950
+
951
+ ### <a name="httpgw"></a>HTTP Gateway
952
+
953
+ If it possible to send using a HTTP gateway, in case FASP is not allowed.
954
+
955
+ Example:
956
+
957
+ ```
958
+ $ ascli faspex package recv --id=323 --transfer=httpgw --transfer-info=@json:'{"url":"https://eudemo.asperademo.com:9443/aspera/http-gwy/v1"}'
959
+ ```
960
+
961
+ ## <a name="transferspec"></a>Transfer Specification
962
+
963
+ Some commands lead to file transfer (upload/download), all parameters necessary for this transfer
964
+ is described in a _transfer-spec_ (Transfer Specification), such as:
965
+
966
+ * server address
967
+ * transfer user name
968
+ * credentials
969
+ * file list
970
+ * etc...
971
+
972
+ `ascli` builds a default _transfer-spec_ internally, so it is not necessary to provide additional parameters on the command line for this transfer.
973
+
974
+ If needed, it is possible to modify or add any of the supported _transfer-spec_ parameter using the `ts` option. The `ts` option accepts a [Structured Value](#native) containing one or several _transfer-spec_ parameters.
975
+
976
+ It is possible to specify ascp options when the `transfer` option is set to `direct` using the special [_transfer-spec_](#transferspec) parameter: `EX_ascp_args`. Example: `--ts=@json:'{"EX_ascp_args":["-l","100m"]}'`. This is espacially useful for ascp command line parameters not supported yet in the transfer spec.
977
+
978
+ The use of a _transfer-spec_ instead of `ascp` parameters has the advantage of:
979
+
980
+ * common to all [Transfer Agent](#agents)
981
+ * not dependent on command line limitations (special characters...)
982
+
983
+ A [_transfer-spec_](#transferspec) is a Hash table, so it is described on the command line with the [Extended Value Syntax](#extended).
984
+
985
+ ## <a name="transferparams"></a>Transfer Parameters
986
+
987
+ All standard _transfer-spec_ parameters can be overloaded. To display parameters,
988
+ run in debug mode (--log-level=debug). [_transfer-spec_](#transferspec) can
989
+ also be saved/overridden in the config file.
990
+
991
+
992
+ <p>
993
+ Columns:
994
+ <ul>
995
+ <li>F=Fasp Manager(local FASP execution)</li>
996
+ <li>N=remote node(node API)</li>
997
+ <li>C=Connect Client(web plugin)</li>
998
+ </ul>
999
+ </p>
1000
+ <p>
1001
+ Req/Def : Required or default value (- means emty)
1002
+ </p>
1003
+ <p>
1004
+ Fields with EX_ prefix are specific extensions to local mode.
1005
+ </p>
1006
+ <p>
1007
+ arg: related ascp argument or env var suffix (PASS for ASPERA_SCP_PASS)
1008
+ </p>
1009
+ <p>
1010
+ UNDER CONSTRUCTION<br/>
1011
+ <a href="https://developer.ibm.com/api/view/aspera-prod:ibm-aspera:title-IBM_Aspera#id90944">Documentation&rarr;Node API&rarr;/opt/transfers</a><br/>
1012
+ </p>
1013
+
1014
+ <table>
1015
+ <tr><th>Field</th><th>Req/Def</th><th>Type</th><th>F</th><th>N</th><th>C</th><th>arg</th><th>Description</th></tr>
1016
+ <tr><td>direction</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--mode</td><td>Direction: "send" or "receive"</td></tr>
1017
+ <tr><td>remote_host</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--host</td><td>IP or fully qualified domain name of the remote server</td></tr>
1018
+ <tr><td>remote_user</td><td>Required</td><td>string</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--user</td><td>Remote user. Default value is "xfer" on node or connect.</td></tr>
1019
+ <tr><td>destination_root</td><td>Required</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>last arg</td><td>Destination root directory.</td></tr>
1020
+ <tr><td>title</td><td>-</td><td>string</td><td class="no">N</td><td class="yes">Y</td><td class="yes">Y</td><td>-</td><td>Title of the transfer</td></tr>
1021
+ <tr><td>tags</td><td>-</td><td>hash</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--tags<br>--tags64</td><td>Metadata for transfer</td></tr>
1022
+ <tr><td>token</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>TOKEN<br/>-W</td><td>Authorization token: Bearer, Basic or ATM</td></tr>
1023
+ <tr><td>cookie</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>COOKIE</td><td>Metadata for transfer (older,string)</td></tr>
1024
+ <tr><td>remote_access_key</td><td>TODO</td><td>string</td><td></td><td></td><td></td><td>?</td><td>Node only?</td></tr>
1025
+ <tr><td>source_root</td><td>-</td><td>string</td><td></td><td></td><td></td><td>--source-prefix<br/>--source-prefix64</td><td>Source root directory.(TODO: verify option)</td></tr>
1026
+ <tr><td>fasp_port</td><td>33001</td><td>integer</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-O</td><td>Specifies fasp (UDP) port.</td></tr>
1027
+ <tr><td>ssh_port</td><td>22 or 33001</td><td>integer</td></td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-P</td><td>Specifies ssh (TCP) port.</td></tr>
1028
+ <tr><td>rate_policy</td><td>server config</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--policy</td><td>Valid literals include "low","fair","high" and "fixed".</td></tr>
1029
+ <tr><td>symlink_policy</td><td>follow</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--symbolic-links</td><td>copy, follow, copy+force, skip. Default is follow. Handle source side symbolic links by following the link (follow), copying the link itself (copy), skipping (skip), or forcibly copying the link itself (copy+force).</td></tr>
1030
+ <tr><td>target_rate_kbps</td><td>-</td><td>integer</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-l</td><td>Specifies desired speed for the transfer.</td></tr>
1031
+ <tr><td>min_rate_kbps</td><td>0</td><td>integer</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-m</td><td>Set the minimum transfer rate in kilobits per second.</td></tr>
1032
+ <tr><td>cipher</td><td>none</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-c</td><td>in transit encryption type.<br/>none, aes-128, aes-256</td></tr>
1033
+ <tr><td>content_protection</td><td>encrypt<br/>decrypt</td><td>string</td><td></td><td></td><td></td><td>--file-crypt=</td><td>encryption at rest</td></tr>
1034
+ <tr><td>content_protection_password</td><td>-</td><td>string</td><td></td><td></td><td></td><td>PASS</td><td>Specifies a string password.</td></tr>
1035
+ <tr><td>overwrite</td><td>diff</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--overwrite</td><td>Overwrite destination files with the source files of the same name.<br/>never, always, diff, older, or diff+older</td></tr>
1036
+ <tr><td>retry_duration</td><td></td><td>string</td><td></td><td></td><td></td><td>TODO</td><td>Specifies how long to wait before retrying transfer. (e.g. "5min")</td></tr>
1037
+ <tr><td>http_fallback</td><td></td><td>bool (node), integer</td><td></td><td></td><td></td><td>-y<br/>TODO</td><td>When true(1), attempts to perform an HTTP transfer if a fasp transfer cannot be performed.</td></tr>
1038
+ <tr><td>create_dir</td><td></td><td>boolean</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-d</td><td>Specifies whether to create new directories.</td></tr>
1039
+ <tr><td>precalculate_job_size</td><td>srv. def.</td><td>boolean</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>--precalculate-job-size</td><td>Specifies whether to precalculate the job size.</td></tr>
1040
+ <tr><td>delete_source</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>?</td></tr>
1041
+ <tr><td>remove_after_transfer</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>Specifies whether to remove file after transfer.</td></tr>
1042
+ <tr><td>remove_empty_directories</td><td></td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>?</td><td>Specifies whether to remove empty directories.</td></tr>
1043
+ <tr><td>multi_session</td><td>1</td><td>integer</td><td class="no">N</td><td class="yes">Y</td><td class="no">N</td><td>-C</td><td>Specifies how many parts the transfer is in.</td></tr>
1044
+ <tr><td>multi_session_threshold</td><td>null</td><td>integer</td><td class="no">N</td><td class="yes">Y</td><td class="no">N</td><td>-</td><td>in bytes</td></tr>
1045
+ <tr><td>exclude_newer_than</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>--exclude-newer-than</td><td>-</td></tr>
1046
+ <tr><td>exclude_older_than</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>--exclude-older-than</td><td>-</td></tr>
1047
+ <tr><td>preserve_acls</td><td></td><td>string</td><td class="yes">Y</td><td></td><td></td><td>--preserve-acls</td><td>-</td></tr>
1048
+ <tr><td>dgram_size</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>-Z</td><td>in bytes</td></tr>
1049
+ <tr><td>compression</td><td></td><td>integer</td><td></td><td></td><td></td><td></td><td>ascp4 only, 0 / 1?</td></tr>
1050
+ <tr><td>read_threads</td><td></td><td>integer</td><td></td><td></td><td></td><td>-</td><td>ascp4 only</td></tr>
1051
+ <tr><td>write_threads</td><td></td><td>integer</td><td></td><td></td><td></td><td>-</td><td>ascp4 only</td></tr>
1052
+ <tr><td>use_ascp4</td><td>false</td><td>boolean</td><td></td><td class="yes">Y</td><td></td><td>-</td><td>specify version of protocol</td></tr>
1053
+ <tr><td>paths</td><td>source files (dest)</td><td>array</td><td></td><td></td><td></td><td>positional<br/>--file-list<br/>--file-pair-list</td><td>Contains a path to the source (required) and a path to the destination.</td></tr>
1054
+ <tr><td>http_fallback_port</td><td></td><td>integer</td><td class="yes">Y</td><td></td><td></td><td>-t</td><td>Specifies http port.</td></tr>
1055
+ <tr><td>https_fallback_port</td><td></td><td>integer</td><td></td><td></td><td></td><td>todo</td><td>Specifies https port.</td></tr>
1056
+ <tr><td>cipher_allowed</td><td></td><td>string</td><td></td><td></td><td></td><td>-</td><td>returned by node API. Valid literals include "aes-128" and "none".</td></tr>
1057
+ <tr><td>target_rate_cap_kbps</td><td></td><td></td><td class="no">N</td><td class="no">?</td><td class="yes">?</td><td>-</td><td>Returned by upload/download_setup node api.</td></tr>
1058
+ <tr><td>rate_policy_allowed</td><td></td><td></td><td></td><td></td><td></td><td>-</td><td>returned by node API. Specifies most aggressive rate policy that is allowed. Valid literals include "low", "fair","high" and "fixed".</td></tr>
1059
+ <tr><td>ssh_private_key</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>KEY</td><td>Private key used for SSH authentication, Shall look like: `-----BEGIN RSA PRIVATE KEY-----\nMII`<br/>Note the JSON encoding `\` + `n` for newlines.</td></tr>
1060
+ <tr><td>remote_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>PASS</td><td>SSH session password</td></tr>
1061
+ <tr><td>resume_policy</td><td>faspmgr:<br/>none<br/>other:<br/>sparse_csum</td><td>string</td><td class="yes">Y</td><td class="yes">Y</td><td class="yes">Y</td><td>-k</td><td>none,attrs,sparse_csum,full_csum</td></tr>
1062
+ <tr><td>authentication</td><td>-</td><td class="no">N</td><td class="no">N</td><td class="yes">Y</td><td>-</td><td>token: Aspera web keys are provided to allow transparent web based session initiation. on connect: password is not asked. Else, password is asked, and keys are not provided.</td></tr>
1063
+ <tr><td>EX_ssh_key_paths</td><td>-</td><td>array</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-i</td><td>Use public key authentication and specify the private key file</td></tr>
1064
+ <tr><td>EX_at_rest_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>FILEPASS</td><td>Passphrase used for at rest encryption or decryption</td></tr>
1065
+ <tr><td>EX_proxy_password</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>PROXY_PASS</td><td>TODO</td></tr>
1066
+ <tr><td>EX_fasp_proxy_url</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--proxy</td><td>Specify the address of the Aspera high-speed proxy server</td></tr>
1067
+ <tr><td>EX_http_proxy_url</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-x</td><td>Specify the proxy server address used by HTTP Fallback</td></tr>
1068
+ <tr><td>EX_ascp_args</td><td>-</td><td>array</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>same</td><td>Add command line arguments to ascp</td></tr>
1069
+ <tr><td>EX_http_transfer_jpeg</td><td>0</td><td>integer</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-j</td><td>HTTP transfers as JPEG file</td></tr>
1070
+ <tr><td>EX_license_text</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>LICENSE</td><td>license file text</td></tr>
1071
+ <tr><td>EX_file_list</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--file-list</td><td>source file list</td></tr>
1072
+ <tr><td>EX_file_pair_list</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--file-pair-list</td><td>source file pair list</td></tr>
1073
+ <tr><td>EX_multi_session_part</td><td>-</td><td>string</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>-C</td><td>part for multisession</td></tr>
1074
+ <tr><td>EX_no_read</td><td>-</td><td>-</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--no-read</td><td>no read source</td></tr>
1075
+ <tr><td>EX_no_write</td><td>-</td><td>-</td><td class="yes">Y</td><td class="no">N</td><td class="no">N</td><td>--no-write</td><td>no write estination</td></tr>
1076
+ </table>
1077
+
1078
+
1079
+ ### Destination folder for transfers
1080
+
1081
+ The destination folder is set by `ascli` by default to:
1082
+
1083
+ * `.` for downloads
1084
+ * `/` for uploads
1085
+
1086
+ It is specified by the [_transfer-spec_](#transferspec) parameter `destination_root`.
1087
+ As such, it can be modified with option: `--ts=@json:'{"destination_root":"<path>"}'`.
1088
+ The option `to_folder` provides an equivalent and convenient way to change this parameter:
1089
+ `--to-folder=<path>` .
1090
+
1091
+ ### List of files for transfers
1092
+
1093
+ When uploading, downloading or sending files, the user must specify
1094
+ the list of files to transfer. Most of the time, the list of files to transfer will be simply specified on the command line:
1095
+
1096
+ ```
1097
+ $ ascli server upload ~/mysample.file secondfile
1098
+ ```
1099
+
1100
+ This is equivalent to:
1101
+
1102
+ ```
1103
+ $ ascli server upload --sources=@args ~/mysample.file secondfile
1104
+ ```
1105
+
1106
+ More advanced options are provided to adapt to various cases. In fact, list of files to transfer are conveyed using the [_transfer-spec_](#transferspec) using the field: "paths" which is a list (array) of pairs of "source" (mandatory) and "destination" (optional).
1107
+
1108
+ Note that this is different from the "ascp" command line. The paradigm used by `ascli` is: all transfer parameters are kept in [_transfer-spec_](#transferspec) so that execution of a transfer is independent of the transfer agent. Note that other IBM Aspera interfaces use this: connect, node, transfer sdk.
1109
+
1110
+ For ease of use and flexibility, the list of files to transfer is specified by the option `sources`. Accepted values are:
1111
+
1112
+ * `@args` : (default value) the list of files is directly provided at the end of the command line (see at the beginning of this section).
1113
+
1114
+ * an [Extended Value](#extended) holding an *Array of String*. Examples:
1115
+
1116
+ ```
1117
+ --sources=@json:'["file1","file2"]'
1118
+ --sources=@lines:@stdin:
1119
+ --sources=@ruby:'File.read("myfilelist").split("\n")'
1120
+ ```
1121
+
1122
+ * `@ts` : the user provides the list of files directly in the `ts` option, in its `paths` field. Example:
1123
+
1124
+ ```
1125
+ --sources=@ts --ts=@json:'{"paths":[{"source":"file1"},{"source":"file2"}]}'
1126
+ ```
1127
+
1128
+ * Although not recommended, because it applies *only* to the `local` transfer agent (i.e. bare ascp), it is possible to specify bare ascp arguments using the pseudo [_transfer-spec_](#transferspec) parameter `EX_ascp_args`. In that case, one must specify a dummy list in the [_transfer-spec_](#transferspec), which will be overriden by the bare ascp command line provided.
1129
+
1130
+ ```
1131
+ --sources=@ts --ts=@json:'{"paths":[{"source":"dummy"}],"EX_ascp_args":["--file-list","myfilelist"]}'
1132
+ ```
1133
+
1134
+ In case the file list is provided on the command line (i.e. using `--sources=@args` or `--sources=<Array>`, but not `--sources=@ts`), the list of files will be used either as a simple file list or a file pair list depending on the value of the option: `src_type`:
1135
+
1136
+ * `list` : (default) the path of destination is the same as source
1137
+ * `pair` : in that case, the first element is the first source, the second element is the first destination, and so on.
1138
+
1139
+ Example:
1140
+
1141
+ ```
1142
+ $ ascli server upload --src-type=pair ~/Documents/Samples/200KB.1 /Upload/sample1
1143
+ ```
1144
+
1145
+ Note the special case when the source files are located on "Aspera on Cloud", i.e. using access keys and the `file id` API:
1146
+
1147
+ * All files must be in the same source folder.
1148
+ * If there is a single file : specify the full path
1149
+ * For multiple files, specify the source folder as first item in the list followed by the list of file names.
1150
+
1151
+ Source files are located on "Aspera on cloud", when :
1152
+
1153
+ * the server is Aspera on Cloud, and making a download / recv
1154
+ * the agent is Aspera on Cloud, and making an upload / send
1155
+
1156
+ ### <a name="multisession"></a>Support of multi-session
1157
+
1158
+ Multi session, i.e. starting a transfer of a file set using multiple sessions is supported on "direct" and "node" agents, not yet on connect.
1159
+
1160
+ * when agent=node :
1161
+
1162
+ ```
1163
+ --ts=@json:'{"multi_session":10,"multi_session_threshold":1}'
1164
+ ```
1165
+
1166
+ Multi-session is directly supported by the node daemon.
1167
+
1168
+ * when agent=direct :
1169
+
1170
+ ```
1171
+ --ts=@json:'{"multi_session":5,"multi_session_threshold":1,"resume_policy":"none"}'
1172
+ ```
1173
+
1174
+ Note: resume policy of "attr" may cause problems. "none" or "sparse_csum"
1175
+ shall be preferred.
1176
+
1177
+ Multi-session spawn is done by `ascli`.
1178
+
1179
+
1180
+ ### Examples
1181
+
1182
+ * Change target rate
1183
+
1184
+ ```
1185
+ --ts=@json:'{"target_rate_kbps":500000}'
1186
+ ```
1187
+
1188
+ * Override the FASP SSH port to a specific TCP port:
1189
+
1190
+ ```
1191
+ --ts=@json:'{"ssh_port":33002}'
1192
+ ```
1193
+
1194
+ * Force http fallback mode:
1195
+
1196
+ ```
1197
+ --ts=@json:'{"http_fallback":"force"}'
1198
+ ```
1199
+
1200
+ * Activate progress when not activated by default on server
1201
+
1202
+ ```
1203
+ --ts=@json:'{"precalculate_job_size":true}'
1204
+ ```
1205
+
1206
+
1207
+
1208
+ ## <a name="scheduling"></a>Scheduling an exclusive execution
1209
+
1210
+ It is possible to ensure that a given command is only run once at a time with parameter: `--lock-port=nnnn`. This is especially usefull when scheduling a command on a regular basis, for instance involving transfers, and a transfer may last longer than the execution period.
1211
+
1212
+ This opens a local TCP server port, and fails if this port is already used, providing a local lock.
1213
+
1214
+ This option is used when the tools is executed automatically, for instance with "preview" generation.
1215
+
1216
+ Usually the OS native scheduler shall already provide some sort of such protection (windows scheduler has it natively, linux cron can leverage `flock`).
1217
+
1218
+ ## <a name="commands"></a>Sample Commands
1219
+
1220
+ A non complete list of commands used in unit tests:
1221
+
1222
+ ```
1223
+ ascli
1224
+ ascli -h
1225
+ ascli ats access_key --id=ak_aws delete
1226
+ ascli ats access_key --id=akibmcloud --secret=somesecret cluster
1227
+ ascli ats access_key --id=akibmcloud --secret=somesecret node browse /
1228
+ ascli ats access_key --id=akibmcloud delete
1229
+ ascli ats access_key create --cloud=aws --region=MY_AWS_REGION --params=@json:'{"id":"ak_aws","name":"my test key AWS","storage":{"type":"aws_s3","bucket":"MY_AWS_BUCKET","credentials":{"access_key_id":"MY_AWS_ACCESS_KEY","secret_access_key":"MY_AWS_SECRET_KEY"},"path":"/"}}'
1230
+ ascli ats access_key create --cloud=softlayer --region=MY_ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"my test key","storage":{"type":"ibm-s3","bucket":"MY_ICOS_BUCKET","credentials":{"access_key_id":"MY_ICOS_AK_ID","secret_access_key":"MY_ICOS_SECRET_AK"},"path":"/"}}'
1231
+ ascli ats access_key list --fields=name,id
1232
+ ascli ats api_key create
1233
+ ascli ats api_key instances
1234
+ ascli ats api_key list
1235
+ ascli ats cluster clouds
1236
+ ascli ats cluster list
1237
+ ascli ats cluster show --cloud=aws --region=eu-west-1
1238
+ ascli ats cluster show --id=1f412ae7-869a-445c-9c05-02ad16813be2
1239
+ ascli conf flush_tokens
1240
+ ascli conf wiz --url=https://MY_AOC_ORG.ibmaspera.com --config-file=SAMPLE_CONFIG_FILE --pkeypath='' --username=MY_AOC_USER --test-mode=yes
1241
+ ascli conf wiz --url=https://MY_AOC_ORG.ibmaspera.com --config-file=SAMPLE_CONFIG_FILE --pkeypath='' --username=MY_AOC_USER --test-mode=yes --use-generic-client=yes
1242
+ ascli config ascp connect id 'Aspera Connect for Windows' info
1243
+ ascli config ascp connect id 'Aspera Connect for Windows' links id 'Windows Installer' download --to-folder=DIR_TMP/.
1244
+ ascli config ascp connect id 'Aspera Connect for Windows' links list
1245
+ ascli config ascp connect list
1246
+ ascli config ascp products list
1247
+ ascli config ascp show
1248
+ ascli config email_test aspera.user1@gmail.com
1249
+ ascli config export
1250
+ ascli config genkey DIR_TMP/mykey
1251
+ ascli config plugins
1252
+ ascli config proxy_check --fpac=file:///DIR_TOP/examples/proxy.pac https://eudemo.asperademo.com
1253
+ ascli console transfer current list
1254
+ ascli console transfer smart list
1255
+ ascli console transfer smart sub 112 @json:'{"source":{"paths":["10MB.1"]},"source_type":"user_selected"}'
1256
+ ascli cos node -N --bucket=MY_ICOS_BUCKET --service-credentials=@json:@file:DIR_PRIV/service_creds.json --region=MY_ICOS_REGION info
1257
+ ascli cos node access_key --id=self show
1258
+ ascli cos node download MY_LOCAL_SAMPLE_FILENAME --to-folder=DIR_TMP/.
1259
+ ascli cos node info
1260
+ ascli cos node upload MY_LOCAL_SAMPLE_FILEPATH
1261
+ ascli faspex nagios_check
1262
+ ascli faspex package list
1263
+ ascli faspex package list --box=sent --fields=package_id --format=csv --display=data|tail -n 1);\
1264
+ ascli faspex package recv --box=sent --to-folder=DIR_TMP/. --id="my_package_id"
1265
+ ascli faspex package recv --to-folder=DIR_TMP/. --id="my_package_id"
1266
+ ascli faspex package recv --to-folder=DIR_TMP/. --id=ALL --once-only=yes
1267
+ ascli faspex package recv --to-folder=DIR_TMP/. --link="my_faspex_publink_recv_from_fxuser"
1268
+ ascli faspex package send --delivery-info=@json:'{"title":"PKG_TEST_TITLE","recipients":["MY_EMAIL_ADDR"]}' MY_LOCAL_SAMPLE_FILEPATH
1269
+ ascli faspex package send --link="my_faspex_publink_send_to_dropbox" --delivery-info=@json:'{"title":"PKG_TEST_TITLE"}' MY_LOCAL_SAMPLE_FILEPATH
1270
+ ascli faspex package send --link="my_faspex_publink_send_to_fxuser" --delivery-info=@json:'{"title":"PKG_TEST_TITLE"}' MY_LOCAL_SAMPLE_FILEPATH
1271
+ ascli faspex source name "Server Files" node br /
1272
+ ascli faspex5 node list --value=@json:'{"type":"received","subtype":"mypackages"}'
1273
+ ascli faspex5 package list --value=@json:'{"state":["released"]}'
1274
+ ascli faspex5 package receive --id="my_package_id" --to-folder=DIR_TMP/.
1275
+ ascli faspex5 package send --value=@json:'{"title":"test title","recipients":["admin"]}' MY_LOCAL_SAMPLE_FILEPATH
1276
+ ascli node -N -Ptst_node_preview access_key create --value=@json:'{"id":"aoc_1","storage":{"type":"local","path":"/"}}'
1277
+ ascli node -N -Ptst_node_preview access_key delete --id=aoc_1
1278
+ ascli node async --id=1 bandwidth
1279
+ ascli node async --id=1 counters
1280
+ ascli node async --id=1 files
1281
+ ascli node async list
1282
+ ascli node async show --id=1
1283
+ ascli node async show --id=ALL
1284
+ ascli node basic_token
1285
+ ascli node browse / -r
1286
+ ascli node delete MY_HSTS_FOLDER_UPLOAD/10MB.1
1287
+ ascli node delete MY_HSTS_FOLDER_UPLOAD/MY_LOCAL_SAMPLE_FILENAME
1288
+ ascli node download --to-folder=DIR_TMP/. MY_HSTS_FOLDER_UPLOAD/MY_LOCAL_SAMPLE_FILENAME
1289
+ ascli node info
1290
+ ascli node nagios_check
1291
+ ascli node search / --value=@json:'{"sort":"mtime"}'
1292
+ ascli node service --id=service1 delete
1293
+ ascli node service create @json:'{"id":"service1","type":"WATCHD","run_as":{"user":"user1"}}'
1294
+ ascli node service list
1295
+ ascli node transfer list --value=@json:'{"active_only":true}'
1296
+ ascli node upload --to-folder="MY_HSTS_FOLDER_UPLOAD" --sources=@ts --ts=@json:'{"paths":[{"source":"/aspera-test-dir-small/10MB.1"}],"precalculate_job_size":true}' --transfer=node --transfer-info=@json:'{"url":"my_node_url","username":"my_node_user","password":"my_node_pass"}'
1297
+ ascli node upload --to-folder=MY_HSTS_FOLDER_UPLOAD --ts=@json:'{"target_rate_cap_kbps":10000}' MY_LOCAL_SAMPLE_FILEPATH
1298
+ ascli oncloud admin analytics transfers --query=@json:'{"status":"completed","direction":"receive"}'
1299
+ ascli oncloud admin ats access_key --id=akibmcloud --secret=somesecret node browse /
1300
+ ascli oncloud admin ats access_key --id=akibmcloud delete
1301
+ ascli oncloud admin ats access_key create --cloud=aws --region=MY_AWS_REGION --params=@json:'{"id":"ak_aws","name":"my test key AWS","storage":{"type":"aws_s3","bucket":"MY_AWS_BUCKET","credentials":{"access_key_id":"MY_AWS_ACCESS_KEY","secret_access_key":"MY_AWS_SECRET_KEY"},"path":"/"}}'
1302
+ ascli oncloud admin ats access_key create --cloud=softlayer --region=MY_ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"my test key","storage":{"type":"ibm-s3","bucket":"MY_ICOS_BUCKET","credentials":{"access_key_id":"MY_ICOS_AK_ID","secret_access_key":"MY_ICOS_SECRET_AK"},"path":"/"}}'
1303
+ ascli oncloud admin ats access_key list --fields=name,id
1304
+ ascli oncloud admin ats cluster clouds
1305
+ ascli oncloud admin ats cluster list
1306
+ ascli oncloud admin ats cluster show --cloud=aws --region=eu-west-1
1307
+ ascli oncloud admin ats cluster show --id=1f412ae7-869a-445c-9c05-02ad16813be2
1308
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v3 access_key create --value=@json:'{"id":"testsub1","storage":{"path":"/folder1"}}'
1309
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v3 access_key delete --id=testsub1
1310
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v3 events
1311
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v4 browse /
1312
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v4 delete /folder1
1313
+ ascli oncloud admin resource node --name=MY_AOC_NODE1_NAME --secret=MY_AOC_NODE1_SECRET v4 mkdir /folder1
1314
+ ascli oncloud admin resource workspace list
1315
+ ascli oncloud admin resource workspace_membership list --fields=ALL --query=@json:'{"page":1,"per_page":50,"embed":"member","inherited":false,"workspace_id":11363,"sort":"name"}'
1316
+ ascli oncloud apiinfo
1317
+ ascli oncloud automation workflow --id="my_wf_id" action create --value=@json:'{"name":"toto"}' | tee action.info
1318
+ ascli oncloud automation workflow create --value=@json:'{"name":"test_workflow"}'
1319
+ ascli oncloud automation workflow delete --id="my_wf_id"
1320
+ ascli oncloud automation workflow list
1321
+ ascli oncloud automation workflow list --select=@json:'{"name":"test_workflow"}' --fields=id --format=csv --display=data > xyz
1322
+ ascli oncloud automation workflow list --value=@json:'{"show_org_workflows":"true"}' --scope=admin:all
1323
+ ascli oncloud bearer_token --display=data --scope=user:all
1324
+ ascli oncloud faspex
1325
+ ascli oncloud files bearer /
1326
+ ascli oncloud files browse /
1327
+ ascli oncloud files browse / -N --link=MY_AOC_PUBLINK_FOLDER
1328
+ ascli oncloud files delete /testsrc
1329
+ ascli oncloud files download --transfer=connect /200KB.1
1330
+ ascli oncloud files file 18891
1331
+ ascli oncloud files find / --value='\.partial$'
1332
+ ascli oncloud files http_node_download --to-folder=DIR_TMP/. /200KB.1
1333
+ ascli oncloud files mkdir /testsrc
1334
+ ascli oncloud files rename /somefolder testdst
1335
+ ascli oncloud files short_link create --to-folder=/testdst --value=private
1336
+ ascli oncloud files short_link create --to-folder=/testdst --value=public
1337
+ ascli oncloud files short_link list --value=@json:'{"purpose":"shared_folder_auth_link"}'
1338
+ ascli oncloud files transfer --from-folder=/testsrc --to-folder=/testdst MY_LOCAL_SAMPLE_FILENAME
1339
+ ascli oncloud files upload --to-folder=/testsrc MY_LOCAL_SAMPLE_FILEPATH
1340
+ ascli oncloud files upload -N --to-folder=/ MY_LOCAL_SAMPLE_FILEPATH --link=MY_AOC_PUBLINK_FOLDER
1341
+ ascli oncloud files v3 info
1342
+ ascli oncloud org -N --link=MY_AOC_PUBLINK_RECV_PACKAGE
1343
+ ascli oncloud organization
1344
+ ascli oncloud packages list
1345
+ ascli oncloud packages list --format=csv --fields=id --display=data|head -n 1);\
1346
+ ascli oncloud packages recv --id="my_package_id" --to-folder=DIR_TMP/.
1347
+ ascli oncloud packages recv --id=ALL --to-folder=DIR_TMP/. --once-only=yes --lock-port=12345
1348
+ ascli oncloud packages send --value=@json:'{"name":"PKG_TEST_TITLE","recipients":["MY_AOC_EXTERNAL_EMAIL"]}' --new-user-option=@json:'{"package_contact":true}' MY_LOCAL_SAMPLE_FILEPATH
1349
+ ascli oncloud packages send --value=@json:'{"name":"PKG_TEST_TITLE","recipients":["MY_EMAIL_ADDR"],"note":"my note"}' MY_LOCAL_SAMPLE_FILEPATH
1350
+ ascli oncloud packages send --workspace="MY_AOC_SH_BX_WS" --value=@json:'{"name":"PKG_TEST_TITLE","recipients":["MY_AOC_SH_BX_NAME"]}' MY_LOCAL_SAMPLE_FILEPATH
1351
+ ascli oncloud packages send -N --value=@json:'{"name":"PKG_TEST_TITLE"}' MY_LOCAL_SAMPLE_FILEPATH --link=MY_AOC_PUBLINK_SEND_DROPBOX
1352
+ ascli oncloud packages send -N --value=@json:'{"name":"PKG_TEST_TITLE"}' MY_LOCAL_SAMPLE_FILEPATH --link=MY_AOC_PUBLINK_SEND_USER
1353
+ ascli oncloud user info modify @json:'{"name":"dummy change"}'
1354
+ ascli oncloud user info show
1355
+ ascli oncloud workspace
1356
+ ascli orchestrator info
1357
+ ascli orchestrator plugins
1358
+ ascli orchestrator processes
1359
+ ascli orchestrator workflow --id=MY_ORCH_WORKFLOW_ID inputs
1360
+ ascli orchestrator workflow --id=MY_ORCH_WORKFLOW_ID start --params=@json:'{"Param":"world !"}'
1361
+ ascli orchestrator workflow --id=MY_ORCH_WORKFLOW_ID start --params=@json:'{"Param":"world !"}' --result=ResultStep:Complete_status_message
1362
+ ascli orchestrator workflow --id=MY_ORCH_WORKFLOW_ID status
1363
+ ascli orchestrator workflow list
1364
+ ascli orchestrator workflow status
1365
+ ascli preview check --skip-types=office
1366
+ ascli preview folder 1 --skip-types=office --log-level=info --file-access=remote --ts=@json:'{"target_rate_kbps":1000000}'
1367
+ ascli preview scan --skip-types=office --log-level=info
1368
+ ascli preview test --case=xyz mp4 "MY_TSTFILE_MXF" --video-conversion=blend --log-level=debug
1369
+ ascli preview test --case=xyz mp4 "MY_TSTFILE_MXF" --video-conversion=clips --log-level=debug
1370
+ ascli preview test --case=xyz mp4 "MY_TSTFILE_MXF" --video-conversion=reencode --log-level=debug
1371
+ ascli preview test --case=xyz png "MY_TSTFILE_DCM" --log-level=debug
1372
+ ascli preview test --case=xyz png "MY_TSTFILE_DOCX" --log-level=debug
1373
+ ascli preview test --case=xyz png "MY_TSTFILE_MXF" --video-png-conv=animated --log-level=debug
1374
+ ascli preview test --case=xyz png "MY_TSTFILE_MXF" --video-png-conv=fixed --log-level=debug
1375
+ ascli preview test --case=xyz png "MY_TSTFILE_PDF" --log-level=debug
1376
+ ascli preview trevents --once-only=yes --skip-types=office --log-level=info
1377
+ ascli server -N -Ptst_hstsfaspex_ssh -Plocal_user ctl all:status
1378
+ ascli server -N -Ptst_hstsfaspex_ssh -Plocal_user nagios app_services --format=nagios
1379
+ ascli server -N -Ptst_hstsfaspex_ssh -Plocal_user nodeadmin -- -l
1380
+ ascli server -N -Ptst_server_bykey -Plocal_user br /
1381
+ ascli server browse /
1382
+ ascli server browse MY_HSTS_FOLDER_UPLOAD/target_hot
1383
+ ascli server cp NEW_SERVER_FOLDER/MY_LOCAL_SAMPLE_FILENAME MY_HSTS_FOLDER_UPLOAD/200KB.2
1384
+ ascli server delete MY_HSTS_FOLDER_UPLOAD/target_hot
1385
+ ascli server delete MY_HSTS_FOLDER_UPLOAD/to.delete
1386
+ ascli server delete NEW_SERVER_FOLDER
1387
+ ascli server df
1388
+ ascli server download NEW_SERVER_FOLDER/MY_LOCAL_SAMPLE_FILENAME --to-folder=DIR_TMP/.
1389
+ ascli server download NEW_SERVER_FOLDER/MY_LOCAL_SAMPLE_FILENAME --to-folder=MY_HSTS_FOLDER_UPLOAD --transfer=node
1390
+ ascli server du /
1391
+ ascli server info
1392
+ ascli server md5sum NEW_SERVER_FOLDER/MY_LOCAL_SAMPLE_FILENAME
1393
+ ascli server mkdir MY_HSTS_FOLDER_UPLOAD/target_hot
1394
+ ascli server mkdir NEW_SERVER_FOLDER --logger=stdout
1395
+ ascli server mv MY_HSTS_FOLDER_UPLOAD/200KB.2 MY_HSTS_FOLDER_UPLOAD/to.delete
1396
+ ascli server nagios transfer --to-folder=MY_HSTS_FOLDER_UPLOAD --format=nagios
1397
+ ascli server upload --sources=@ts --ts=@json:'{"paths":[{"source":"MY_LOCAL_SAMPLE_FILEPATH","destination":"NEW_SERVER_FOLDER/othername"}]}'
1398
+ ascli server upload --src-type=pair --sources=@json:'["MY_LOCAL_SAMPLE_FILEPATH","NEW_SERVER_FOLDER/othername"]'
1399
+ ascli server upload --src-type=pair MY_LOCAL_SAMPLE_FILEPATH NEW_SERVER_FOLDER/othername
1400
+ ascli server upload --to-folder=MY_HSTS_FOLDER_UPLOAD/target_hot --lock-port=12345 --ts=@json:'{"EX_ascp_args":["--remove-after-transfer","--remove-empty-directories","--exclude-newer-than=-8","--src-base","source_hot"]}' source_hot
1401
+ ascli server upload MY_LOCAL_SAMPLE_FILEPATH --to-folder=NEW_SERVER_FOLDER
1402
+ ascli shares repository browse /
1403
+ ascli shares repository delete /MY_SHARES_UPLOAD/MY_LOCAL_SAMPLE_FILENAME
1404
+ ascli shares repository download --to-folder=DIR_TMP/. /MY_SHARES_UPLOAD/MY_LOCAL_SAMPLE_FILENAME
1405
+ ascli shares repository upload --to-folder=/MY_SHARES_UPLOAD MY_LOCAL_SAMPLE_FILEPATH
1406
+ ascli shares2 appinfo
1407
+ ascli shares2 organization list
1408
+ ascli shares2 project list --organization=Sport
1409
+ ascli shares2 repository browse /
1410
+ ascli shares2 userinfo
1411
+ ascli sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"remote_dir":"/sync_test","local_dir":"DIR_TMP/contents","host":"my_remote_host","tcp_port":33001,"user":"my_remote_user","private_key_path":"my_local_user_key"}]}'
1412
+
1413
+ ...and more
1414
+ ```
1415
+
1416
+ ## <a name="usage"></a>Usage
1417
+
1418
+ ```
1419
+ $ ascli -h
1420
+ NAME
1421
+ ascli -- a command line tool for Aspera Applications (v4.0.0.pre1)
1422
+
1423
+ SYNOPSIS
1424
+ ascli COMMANDS [OPTIONS] [ARGS]
1425
+
1426
+ DESCRIPTION
1427
+ Use Aspera application to perform operations on command line.
1428
+ Documentation and examples: https://rubygems.org/gems/aspera-cli
1429
+ execute: ascli conf doc
1430
+ or visit: http://www.rubydoc.info/gems/aspera-cli
1431
+
1432
+ COMMANDS
1433
+ To list first level commands, execute: ascli
1434
+ Note that commands can be written shortened (provided it is unique).
1435
+
1436
+ OPTIONS
1437
+ Options begin with a '-' (minus), and value is provided on command line.
1438
+ Special values are supported beginning with special prefix, like: @base64: @json: @zlib: @ruby: @csvt: @lines: @list: @val: @file: @path: @env: @stdin:.
1439
+ Dates format is 'DD-MM-YY HH:MM:SS', or 'now' or '-<num>h'
1440
+
1441
+ ARGS
1442
+ Some commands require mandatory arguments, e.g. a path.
1443
+
1444
+ OPTIONS: global
1445
+ --interactive=ENUM use interactive input of missing params: yes, no
1446
+ --ask-options=ENUM ask even optional options: yes, no
1447
+ --format=ENUM output format: table, ruby, json, jsonpp, yaml, csv, nagios
1448
+ --display=ENUM output only some information: info, data, error
1449
+ --fields=VALUE comma separated list of fields, or ALL, or DEF
1450
+ --select=VALUE select only some items in lists, extended value: hash (column, value)
1451
+ --table-style=VALUE table display style
1452
+ --flat-hash=ENUM display hash values as additional keys: yes, no
1453
+ -h, --help Show this message.
1454
+ --bash-comp generate bash completion for command
1455
+ --show-config Display parameters used for the provided action.
1456
+ -r, --rest-debug more debug for HTTP calls
1457
+ -v, --version display version
1458
+ -w, --warnings check for language warnings
1459
+ --ui=ENUM method to start browser: text, graphical
1460
+ --log-level=ENUM Log level: info, error, fatal, unknown, debug, warn
1461
+ --logger=ENUM log method: stderr, stdout, syslog
1462
+ --lock-port=VALUE prevent dual execution of a command, e.g. in cron
1463
+ --query=VALUE additional filter for API calls (extended value) (some commands)
1464
+ --insecure=ENUM do not validate HTTPS certificate: yes, no
1465
+ --once-only=ENUM process only new items (some commands): yes, no
1466
+
1467
+ COMMAND: config
1468
+ SUBCOMMANDS: gem_path genkey plugins flush_tokens list overview open echo id documentation wizard export_to_cli detect coffee ascp email_test smtp_settings proxy_check folder file
1469
+ OPTIONS:
1470
+ --value=VALUE extended value for create, update, list filter
1471
+ --property=VALUE name of property to set
1472
+ --id=VALUE resource identifier (modify,delete,show)
1473
+ --config-file=VALUE read parameters from file in YAML format, current=/Users/gegles/.aspera/ascli/config.yaml
1474
+ --override=ENUM override existing value: yes, no
1475
+ -N, --no-default do not load default configuration for plugin
1476
+ --use-generic-client=ENUM wizard: AoC: use global or org specific jwt client id: yes, no
1477
+ --pkeypath=VALUE path to private key for JWT (wizard)
1478
+ --ascp-path=VALUE path to ascp
1479
+ --use-product=VALUE use ascp from specified product
1480
+ --smtp=VALUE smtp configuration (extended value: hash)
1481
+ --fpac=VALUE proxy auto configuration URL
1482
+ -P, --presetVALUE load the named option preset from current config file
1483
+ --default=VALUE set as default configuration for specified plugin
1484
+ --secret=VALUE access key secret for node
1485
+ --secrets=VALUE access key secret for node
1486
+ --test-mode=ENUM skip user validation in wizard mode: yes, no
1487
+ --ts=VALUE override transfer spec values (Hash, use @json: prefix), current={}
1488
+ --local-resume=VALUE set resume policy (Hash, use @json: prefix), current=
1489
+ --to-folder=VALUE destination folder for downloaded files
1490
+ --sources=VALUE list of source files (see doc)
1491
+ --transfer-info=VALUE additional information for transfer client
1492
+ --src-type=ENUM type of file list: list, pair
1493
+ --transfer=ENUM type of transfer: direct, httpgw, connect, node, aoc
1494
+ --progress=ENUM type of progress bar: none, native, multi
1495
+
1496
+
1497
+ COMMAND: shares
1498
+ SUBCOMMANDS: repository admin
1499
+ OPTIONS:
1500
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1501
+ --username=VALUE username to log in
1502
+ --password=VALUE user's password
1503
+
1504
+
1505
+ COMMAND: node
1506
+ SUBCOMMANDS: postprocess stream transfer cleanup forward access_key watch_folder service async central asperabrowser basic_token browse upload download api_details nagios_check events space info license mkdir mklink mkfile rename delete search
1507
+ OPTIONS:
1508
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1509
+ --username=VALUE username to log in
1510
+ --password=VALUE user's password
1511
+ --validator=VALUE identifier of validator (optional for central)
1512
+ --asperabrowserurl=VALUE URL for simple aspera web ui
1513
+ --name=VALUE sync name
1514
+ --token=ENUM todo: type of token used for transfers: aspera, basic, auto
1515
+
1516
+
1517
+ COMMAND: orchestrator
1518
+ SUBCOMMANDS: info workflow plugins processes
1519
+ OPTIONS:
1520
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1521
+ --username=VALUE username to log in
1522
+ --password=VALUE user's password
1523
+ --params=VALUE parameters hash table, use @json:{"param":"value"}
1524
+ --result=VALUE specify result value as: 'work step:parameter'
1525
+ --synchronous=ENUM work step:parameter expected as result: yes, no
1526
+ --ret-style=ENUM how return type is requested in api: header, arg, ext
1527
+ --auth-style=ENUM authentication type: arg_pass, head_basic, apikey
1528
+
1529
+
1530
+ COMMAND: bss
1531
+ SUBCOMMANDS: subscription
1532
+ OPTIONS:
1533
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1534
+ --username=VALUE username to log in
1535
+ --password=VALUE user's password
1536
+
1537
+
1538
+ COMMAND: alee
1539
+ SUBCOMMANDS: entitlement
1540
+ OPTIONS:
1541
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1542
+ --username=VALUE username to log in
1543
+ --password=VALUE user's password
1544
+
1545
+
1546
+ COMMAND: xnode
1547
+ SUBCOMMANDS: postprocess cleanup forward
1548
+ OPTIONS:
1549
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1550
+ --username=VALUE username to log in
1551
+ --password=VALUE user's password
1552
+ --filter-transfer=VALUE Ruby expression for filter at transfer level (cleanup)
1553
+ --filter-file=VALUE Ruby expression for filter at file level (cleanup)
1554
+
1555
+
1556
+ COMMAND: ats
1557
+ SUBCOMMANDS: cluster access_key api_key aws_trust_policy
1558
+ OPTIONS:
1559
+ --ibm-api-key=VALUE IBM API key, see https://cloud.ibm.com/iam/apikeys
1560
+ --instance=VALUE ATS instance in ibm cloud
1561
+ --ats-key=VALUE ATS key identifier (ats_xxx)
1562
+ --ats-secret=VALUE ATS key secret
1563
+ --params=VALUE Parameters access key creation (@json:)
1564
+ --cloud=VALUE Cloud provider
1565
+ --region=VALUE Cloud region
1566
+
1567
+
1568
+ COMMAND: faspex5
1569
+ SUBCOMMANDS: node package
1570
+ OPTIONS:
1571
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1572
+ --username=VALUE username to log in
1573
+ --password=VALUE user's password
1574
+
1575
+
1576
+ COMMAND: cos
1577
+ SUBCOMMANDS: node
1578
+ OPTIONS:
1579
+ --bucket=VALUE IBM Cloud Object storage bucket
1580
+ --endpoint=VALUE storage endpoint url
1581
+ --apikey=VALUE storage API key
1582
+ --crn=VALUE ressource instance id
1583
+ --service-credentials=VALUE IBM Cloud service credentials (Hash)
1584
+ --region=VALUE IBM Cloud Object storage region
1585
+
1586
+
1587
+ COMMAND: oncloud
1588
+ SUBCOMMANDS: apiinfo bearer_token organization tier_restrictions user workspace packages files gateway admin automation servers
1589
+ OPTIONS:
1590
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1591
+ --username=VALUE username to log in
1592
+ --password=VALUE user's password
1593
+
1594
+ COMMAND: ats
1595
+ SUBCOMMANDS: cluster access_key api_key aws_trust_policy
1596
+ OPTIONS:
1597
+ --ibm-api-key=VALUE IBM API key, see https://cloud.ibm.com/iam/apikeys
1598
+ --instance=VALUE ATS instance in ibm cloud
1599
+ --ats-key=VALUE ATS key identifier (ats_xxx)
1600
+ --ats-secret=VALUE ATS key secret
1601
+ --params=VALUE Parameters access key creation (@json:)
1602
+ --cloud=VALUE Cloud provider
1603
+ --region=VALUE Cloud region
1604
+ --auth=ENUM type of Oauth authentication: body_userpass, header_userpass, web, jwt, url_token, ibm_apikey
1605
+ --operation=ENUM client operation for transfers: push, pull
1606
+ --client-id=VALUE API client identifier in application
1607
+ --client-secret=VALUE API client passcode
1608
+ --redirect-uri=VALUE API client redirect URI
1609
+ --private-key=VALUE RSA private key PEM value for JWT (prefix file path with @val:@file:)
1610
+ --workspace=VALUE name of workspace
1611
+ --eid=VALUE identifier
1612
+ --name=VALUE resource name
1613
+ --link=VALUE public link to shared resource
1614
+ --new-user-option=VALUE new user creation option
1615
+ --from-folder=VALUE share to share source folder
1616
+ --scope=VALUE scope for AoC API calls
1617
+ --notify=VALUE notify users that file was received
1618
+ --bulk=ENUM bulk operation: yes, no
1619
+ --default-ports=ENUM use standard FASP ports or get from node api: yes, no
1620
+
1621
+
1622
+ COMMAND: faspex
1623
+ SUBCOMMANDS: nagios_check package source me dropbox v4 address_book login_methods
1624
+ OPTIONS:
1625
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1626
+ --username=VALUE username to log in
1627
+ --password=VALUE user's password
1628
+ --link=VALUE public link for specific operation
1629
+ --delivery-info=VALUE package delivery information (extended value)
1630
+ --source-name=VALUE create package from remote source (by name)
1631
+ --storage=VALUE Faspex local storage definition
1632
+ --box=ENUM package box: inbox, sent, archive
1633
+
1634
+
1635
+ COMMAND: shares2
1636
+ SUBCOMMANDS: repository organization project team share appinfo userinfo admin
1637
+ OPTIONS:
1638
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1639
+ --username=VALUE username to log in
1640
+ --password=VALUE user's password
1641
+ --organization=VALUE organization
1642
+ --project=VALUE project
1643
+ --share=VALUE share
1644
+
1645
+
1646
+ COMMAND: preview
1647
+ SUBCOMMANDS: scan events trevents check test
1648
+ OPTIONS:
1649
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1650
+ --username=VALUE username to log in
1651
+ --password=VALUE user's password
1652
+ --skip-format=ENUM skip this preview format (multiple possible): png, mp4
1653
+ --folder-reset-cache=ENUM force detection of generated preview by refresh cache: no, header, read
1654
+ --skip-types=VALUE skip types in comma separated list
1655
+ --previews-folder=VALUE preview folder in storage root
1656
+ --temp-folder=VALUE path to temp folder
1657
+ --skip-folders=VALUE list of folder to skip
1658
+ --case=VALUE basename of output for for test
1659
+ --scan-path=VALUE subpath in folder id to start scan in (default=/)
1660
+ --scan-id=VALUE forder id in storage to start scan in, default is access key main folder id
1661
+ --overwrite=ENUM when to overwrite result file: always, never, mtime
1662
+ --file-access=ENUM how to read and write files in repository: local, remote
1663
+ --max-size=VALUE maximum size (in bytes) of preview file
1664
+ --thumb-vid-scale=VALUE png: video: size (ffmpeg scale argument)
1665
+ --thumb-vid-fraction=VALUE png: video: position of snapshot
1666
+ --thumb-img-size=VALUE png: non-video: height (and width)
1667
+ --video-conversion=ENUM mp4: method for preview generation: reencode, blend, clips
1668
+ --video-png-conv=ENUM mp4: method for thumbnail generation: fixed, animated
1669
+ --video-start-sec=VALUE mp4: start offset (seconds) of video preview
1670
+ --video-scale=VALUE mp4: video scale (ffmpeg)
1671
+ --blend-keyframes=VALUE mp4: blend: # key frames
1672
+ --blend-pauseframes=VALUE mp4: blend: # pause frames
1673
+ --blend-transframes=VALUE mp4: blend: # transition blend frames
1674
+ --blend-fps=VALUE mp4: blend: frame per second
1675
+ --clips-count=VALUE mp4: clips: number of clips
1676
+ --clips-length=VALUE mp4: clips: length in seconds of each clips
1677
+
1678
+
1679
+ COMMAND: sync
1680
+ SUBCOMMANDS: start admin
1681
+ OPTIONS:
1682
+ --parameters=VALUE extended value for session set definition
1683
+ --session-name=VALUE name of session to use for admin commands, by default first one
1684
+
1685
+
1686
+ COMMAND: server
1687
+ SUBCOMMANDS: nagios nodeadmin userdata configurator ctl download upload browse delete rename ls rm mv du info mkdir cp df md5sum
1688
+ OPTIONS:
1689
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1690
+ --username=VALUE username to log in
1691
+ --password=VALUE user's password
1692
+ --ssh-keys=VALUE ssh key path list (Array or single)
1693
+ --ssh-options=VALUE ssh options (Hash)
1694
+ --cmd-prefix=VALUE prefix to add for as cmd execution, e.g. sudo or /opt/aspera/bin
1695
+
1696
+
1697
+ COMMAND: console
1698
+ SUBCOMMANDS: transfer nagios_check
1699
+ OPTIONS:
1700
+ --url=VALUE URL of application, e.g. https://org.asperafiles.com
1701
+ --username=VALUE username to log in
1702
+ --password=VALUE user's password
1703
+ --filter-from=DATE only after date
1704
+ --filter-to=DATE only before date
1705
+
1706
+
1707
+ ```
1708
+
1709
+ Note that actions and parameter values can be written in short form.
1710
+
1711
+ # <a name="plugins"></a>Plugins: Application URL and Authentication
1712
+
1713
+ `ascli` comes with several Aspera application plugins.
1714
+
1715
+ REST APIs of Aspera legacy applications (Aspera Node, Faspex, Shares, Console, Orchestrator, Server) use simple username/password authentication: HTTP Basic Authentication.
1716
+
1717
+ Those are using options:
1718
+
1719
+ * url
1720
+ * username
1721
+ * password
1722
+
1723
+ Those can be provided using command line, parameter set, env var, see section above.
1724
+
1725
+ Aspera on Cloud relies on Oauth, refer to the [Aspera on Cloud](#aoc) section.
1726
+
1727
+ # <a name="aoc"></a>Plugin: Aspera on Cloud
1728
+
1729
+ Aspera on Cloud uses the more advanced Oauth v2 mechanism for authentication (HTTP Basic authentication is not supported).
1730
+
1731
+ It is recommended to use the wizard to set it up, but manual configuration is also possible.
1732
+
1733
+ ## <a name="aocwizard"></a>Configuration: using Wizard
1734
+
1735
+ `ascli` provides a configuration wizard. Here is a sample invocation :
1736
+
1737
+ ```
1738
+ $ ascli config wizard
1739
+ option: url> https://myorg.ibmaspera.com
1740
+ Detected: Aspera on Cloud
1741
+ Preparing preset: aoc_myorg
1742
+ Please provide path to your private RSA key, or empty to generate one:
1743
+ option: pkeypath>
1744
+ using existing key:
1745
+ /Users/myself/.aspera/ascli/aspera_on_cloud_key
1746
+ Using global client_id.
1747
+ option: username> john@example.com
1748
+ Updating profile with new key
1749
+ creating new config preset: aoc_myorg
1750
+ Setting config preset as default for aspera
1751
+ saving config file
1752
+ Done.
1753
+ You can test with:
1754
+ $ ascli aspera user info show
1755
+ ```
1756
+
1757
+ Optionally, it is possible to create a new organization-specific "integration".
1758
+ For this, specify the option: `--use-generic-client=no`.
1759
+
1760
+ This will guide you through the steps to create.
1761
+
1762
+ ## <a name="aocwizard"></a>Configuration: using manual setup
1763
+
1764
+ If you used the wizard (recommended): skip this section.
1765
+
1766
+ ### Configuration details
1767
+
1768
+ Several types of OAuth authentication are supported:
1769
+
1770
+ * JSON Web Token (JWT) : authentication is secured by a private key (recommended for CLI)
1771
+ * Web based authentication : authentication is made by user using a browser
1772
+ * URL Token : external users authentication with url tokens (public links)
1773
+
1774
+ The authentication method is controled by option `auth`.
1775
+
1776
+ For a _quick start_, follow the mandatory and sufficient section: [API Client Registration](#clientreg) (auth=web) as well as [[option preset](#lprt) for Aspera on Cloud](#aocpreset).
1777
+
1778
+ For a more convenient, browser-less, experience follow the [JWT](#jwt) section (auth=jwt) in addition to Client Registration.
1779
+
1780
+ In Oauth, a "Bearer" token are generated to authenticate REST calls. Bearer tokens are valid for a period of time.`ascli` saves generated tokens in its configuration folder, tries to re-use them or regenerates them when they have expired.
1781
+
1782
+ ### <a name="clientreg"></a>Optional: API Client Registration
1783
+
1784
+ If you use the built-in client_id and client_secret, skip this and do not set them in next section.
1785
+
1786
+ Else you can use a specific OAuth API client_id, the first step is to declare `ascli` in Aspera on Cloud using the admin interface.
1787
+
1788
+ (official documentation: <https://ibmaspera.com/help/admin/organization/registering_an_api_client> ).
1789
+
1790
+ Let's start by a registration with web based authentication (auth=web):
1791
+
1792
+ * Open a web browser, log to your instance: e.g. `https://myorg.ibmaspera.com/`
1793
+ * Go to Apps&rarr;Admin&rarr;Organization&rarr;Integrations
1794
+ * Click "Create New"
1795
+ * Client Name: `ascli`
1796
+ * Redirect URIs: `http://localhost:12345`
1797
+ * Origins: `localhost`
1798
+ * uncheck "Prompt users to allow client to access"
1799
+ * leave the JWT part for now
1800
+ * Save
1801
+
1802
+ Note: for web based authentication, `ascli` listens on a local port (e.g. specified by the redirect_uri, in this example: 12345), and the browser will provide the OAuth code there. For ``ascli`, HTTP is required, and 12345 is the default port.
1803
+
1804
+ Once the client is registered, a "Client ID" and "Secret" are created, these values will be used in the next step.
1805
+
1806
+ ### <a name="aocpreset"></a>[option preset](#lprt) for Aspera on Cloud
1807
+
1808
+ If you did not use the wizard, you can also manually create a [option preset](#lprt) for `ascli` in its configuration file.
1809
+
1810
+ Lets create an [option preset](#lprt) called: `my_aoc_org` using `ask` interactive input (client info from previous step):
1811
+
1812
+ ```
1813
+ $ ascli config id my_aoc_org ask url client_id client_secret
1814
+ option: url> https://myorg.ibmaspera.com/
1815
+ option: client_id> BJLPObQiFw
1816
+ option: client_secret> yFS1mu-crbKuQhGFtfhYuoRW...
1817
+ updated: my_aoc_org
1818
+ ```
1819
+
1820
+ (This can also be done in one line using the command `config id my_aoc_org update --url=...`)
1821
+
1822
+ Define this [option preset](#lprt) as default configuration for the `aspera` plugin:
1823
+
1824
+ ```
1825
+ $ ascli config id default set aspera my_aoc_org
1826
+ ```
1827
+
1828
+ Note: Default `auth` method is `web` and default `redirect_uri` is `http://localhost:12345`. Leave those default values.
1829
+
1830
+ ### <a name="jwt"></a>Activation of JSON Web Token (JWT) for direct authentication
1831
+
1832
+ For a Browser-less, Private Key-based authentication, use the following steps.
1833
+
1834
+ #### Key Pair Generation
1835
+
1836
+ In order to use JWT for Aspera on Cloud API client authentication,
1837
+ a private/public key pair must be generated (without passphrase)
1838
+ This can be done using any of the following method:
1839
+
1840
+ (TODO: add passphrase protection as option).
1841
+
1842
+ * using the CLI:
1843
+
1844
+ ```
1845
+ $ ascli config genkey ~/.aspera/ascli/aocapikey
1846
+ ```
1847
+
1848
+ * `ssh-keygen`:
1849
+
1850
+ ```
1851
+ $ ssh-keygen -t rsa -f ~/.aspera/ascli/aocapikey -N ''
1852
+ ```
1853
+
1854
+ * `openssl`
1855
+
1856
+ (on some openssl implementation (mac) there is option: -nodes (no DES))
1857
+
1858
+ ```
1859
+ $ APIKEY=~/.aspera/ascli/aocapikey
1860
+ $ openssl genrsa -passout pass:dummypassword -out ${APIKEY}.protected 2048
1861
+ $ openssl rsa -passin pass:dummypassword -in ${APIKEY}.protected -out ${APIKEY}
1862
+ $ openssl rsa -pubout -in ${APIKEY} -out ${APIKEY}.pub
1863
+ $ rm -f ${APIKEY}.protected
1864
+ ```
1865
+
1866
+ #### API Client JWT activation
1867
+
1868
+ If you are not using the built-in client_id and secret, JWT needs to be authorized in Aspera on Cloud. This can be done in two manners:
1869
+
1870
+ * Graphically
1871
+
1872
+ * Open a web browser, log to your instance: https://myorg.ibmaspera.com/
1873
+ * Go to Apps&rarr;Admin&rarr;Organization&rarr;Integrations
1874
+ * Click on the previously created application
1875
+ * select tab : "JSON Web Token Auth"
1876
+ * Modify options if necessary, for instance: activate both options in section "Settings"
1877
+ * Click "Save"
1878
+
1879
+ * Using command line
1880
+
1881
+ ```
1882
+ $ ascli aspera admin res client list
1883
+ :............:.........:
1884
+ : id : name :
1885
+ :............:.........:
1886
+ : BJLPObQiFw : ascli :
1887
+ :............:.........:
1888
+ $ ascli aspera admin res client --id=BJLPObQiFw modify @json:'{"jwt_grant_enabled":true,"explicit_authorization_required":false}'
1889
+ modified
1890
+ ```
1891
+
1892
+ ### User key registration
1893
+
1894
+ The public key must be assigned to your user. This can be done in two manners:
1895
+
1896
+ * Graphically
1897
+
1898
+ open the previously generated public key located here: `$HOME/.aspera/ascli/aocapikey.pub`
1899
+
1900
+ * Open a web browser, log to your instance: https://myorg.ibmaspera.com/
1901
+ * Click on the user's icon (top right)
1902
+ * Select "Account Settings"
1903
+ * Paste the _Public Key_ in the "Public Key" section
1904
+ * Click on "Submit"
1905
+
1906
+ * Using command line
1907
+
1908
+ ```
1909
+ $ ascli aspera admin res user list
1910
+ :........:................:
1911
+ : id : name :
1912
+ :........:................:
1913
+ : 109952 : Tech Support :
1914
+ : 109951 : LAURENT MARTIN :
1915
+ :........:................:
1916
+ $ ascli aspera user info modify @ruby:'{"public_key"=>File.read(File.expand_path("~/.aspera/ascli/aocapikey.pub"))}'
1917
+ modified
1918
+ ```
1919
+
1920
+ Note: the `aspera user info show` command can be used to verify modifications.
1921
+
1922
+ ### [option preset](#lprt) modification for JWT
1923
+
1924
+ To activate default use of JWT authentication for `ascli` using the [option preset](#lprt), do the folowing:
1925
+
1926
+ * change auth method to JWT
1927
+ * provide location of private key
1928
+ * provide username to login as (OAuthg "subject")
1929
+
1930
+ Execute:
1931
+
1932
+ ```
1933
+ $ ascli config id my_aoc_org update --auth=jwt --private-key=@val:@file:~/.aspera/ascli/aocapikey --username=laurent.martin.aspera@fr.ibm.com
1934
+ ```
1935
+
1936
+ Note: the private key argument represents the actual PEM string. In order to read the content from a file, use the @file: prefix. But if the @file: argument is used as is, it will read the file and set in the config file. So to keep the "@file" tag in the configuration file, the @val: prefix is added.
1937
+
1938
+ After this last step, commands do not require web login anymore.
1939
+
1940
+
1941
+ ### <a name="aocfirst"></a>First Use
1942
+
1943
+ Once client has been registered and [option preset](#lprt) created: `ascli` can be used:
1944
+
1945
+ ```
1946
+ $ ascli aspera files br /
1947
+ Current Workspace: Default Workspace (default)
1948
+ empty
1949
+ ```
1950
+
1951
+
1952
+ ### Administration
1953
+
1954
+ The `admin` command allows several administrative tasks (and require admin privilege).
1955
+
1956
+ It allows actions (create, update, delete) on "resources": users, group, nodes, workspace, etc... with the `admin resource` command.
1957
+
1958
+ Bulk operations are possible using option `bulk` (yes,no(default)): currently: create only. In that case, the operation expects an Array of Hash instead of a simple Hash using the [Extended Value Syntax](#extended).
1959
+
1960
+ To get more resources when doing request add:
1961
+
1962
+ ```
1963
+ --query=@json:'{"per_page":10000}'
1964
+ ```
1965
+
1966
+ other query parameters can be used:
1967
+ ```
1968
+ --query=@json:'{"member_of_any_workspace":true}'
1969
+ --query=@json:'{"q":"laurent"}'
1970
+ ```
1971
+
1972
+ Refer to the AoC API for full list of query parameters.
1973
+
1974
+ #### Access Key secrets
1975
+
1976
+ In order to access some administrative actions on "nodes" (in fact, access keys), the associated
1977
+ secret is required, it is usually provided using the `secret` option. For example in a command like:
1978
+
1979
+ ```
1980
+ $ ascli aspera admin res node --id="access_key1" --secret="secret1" v3 info
1981
+ ```
1982
+
1983
+ It is also possible to provide a set of secrets used on a regular basis. This can be done using the `secrets` option. The value provided shall be a Hash, where keys are access key ids, and values are the associated secrets.
1984
+
1985
+ First choose a repository name, for example `my_secrets`, and populate it like this:
1986
+
1987
+ ```
1988
+ $ ascli conf id my_secrets set 'access_key1' 'secret1'
1989
+ $ ascli conf id my_secrets set 'access_key2' 'secret2'
1990
+ $ ascli conf id default get config
1991
+ "cli_default"
1992
+ ```
1993
+
1994
+ Here above, one already has set a `config` global preset to preset `cli_default` (refer to earlier in documentation), then the repository can be read by default like this (note the prefix `@val:` to avoid the evaluation of prefix `@preset:`):
1995
+
1996
+ ```
1997
+ $ ascli conf id cli_default set secrets @val:@preset:my_secrets
1998
+ ```
1999
+
2000
+ A secret repository can always be selected at runtime using `--secrets=@preset:xxxx`, or `--secrets=@json:'{"accesskey1":"secret1"}'`
2001
+
2002
+ #### Examples
2003
+
2004
+ * Bulk creation
2005
+
2006
+ ```
2007
+ $ ascli aspera admin res user create --bulk=yes @json:'[{"email":"dummyuser1@example.com"},{"email":"dummyuser2@example.com"}]'
2008
+ :.......:.........:
2009
+ : id : status :
2010
+ :.......:.........:
2011
+ : 98398 : created :
2012
+ : 98399 : created :
2013
+ :.......:.........:
2014
+ ```
2015
+
2016
+ * Find with filter and delete
2017
+
2018
+ ```
2019
+ $ ascli aspera admin res user list --query='@json:{"q":"dummyuser"}' --fields=id,email
2020
+ :.......:........................:
2021
+ : id : email :
2022
+ :.......:........................:
2023
+ : 98398 : dummyuser1@example.com :
2024
+ : 98399 : dummyuser2@example.com :
2025
+ :.......:........................:
2026
+ $ thelist=$(echo $(ascli aspera admin res user list --query='@json:{"q":"dummyuser"}' --fields=id,email --field=id --format=csv)|tr ' ' ,)
2027
+ $ echo $thelist
2028
+ 98398,98399
2029
+ $ ascli aspera admin res user --bulk=yes --id=@json:[$thelist] delete
2030
+ :.......:.........:
2031
+ : id : status :
2032
+ :.......:.........:
2033
+ : 98398 : deleted :
2034
+ : 98399 : deleted :
2035
+ :.......:.........:
2036
+ ```
2037
+
2038
+ * Display current user's workspaces
2039
+
2040
+ ```
2041
+ $ ascli aspera user workspaces
2042
+ :......:............................:
2043
+ : id : name :
2044
+ :......:............................:
2045
+ : 16 : Engineering :
2046
+ : 17 : Marketing :
2047
+ : 18 : Sales :
2048
+ :......:............................:
2049
+ ```
2050
+
2051
+ * Create a sub access key in a "node"
2052
+
2053
+ Creation of a sub-access key is like creation of access key with the following difference: authentication to node API is made with accesskey (master access key) and only the path parameter is provided: it is relative to the storage root of the master key. (id and secret are optional)
2054
+
2055
+ ```
2056
+ $ ascli aspera admin resource node --name=_node_name_ --secret=_secret_ v4 access_key create --value=@json:'{"storage":{"path":"/folder1"}}'
2057
+ ```
2058
+
2059
+ * Display transfer events (ops/transfer)
2060
+
2061
+ ```
2062
+ $ ascli aspera admin res node --secret=_secret_ v3 transfer list --value=@json:'[["q","*"],["count",5]]'
2063
+ ```
2064
+
2065
+ # page=1&per_page=10&q=type:(file_upload+OR+file_delete+OR+file_download+OR+file_rename+OR+folder_create+OR+folder_delete+OR+folder_share+OR+folder_share_via_public_link)&sort=-date
2066
+ #events=@api_files.read('events',{'q'=>'type:(file_upload OR file_download)'})[:data]
2067
+ # can add filters: tag=aspera.files.package_id%3DLA8OU3p8w
2068
+ #'tag'=>'aspera.files.package_id%3DJvbl0w-5A'
2069
+ # filter= 'id', 'short_summary', or 'summary'
2070
+ # count=nnn
2071
+ # tag=x.y.z%3Dvalue
2072
+ # iteration_token=nnn
2073
+ # after_time=2016-05-01T23:53:09Z
2074
+ # active_only=true|false
2075
+
2076
+
2077
+ * Display node events (events)
2078
+
2079
+ ```
2080
+ $ ascli aspera admin res node --secret=_secret_ v3 events
2081
+ ```
2082
+
2083
+ * display members of a workspace
2084
+
2085
+ ```
2086
+ $ ascli aspera admin res workspace_membership list --fields=member_type,manager,member.email --query=@json:'{"page":1,"per_page":50,"embed":"member","inherited":false,"workspace_id":11363,"sort":"name"}'
2087
+ :.............:.........:..................................:
2088
+ : member_type : manager : member.email :
2089
+ :.............:.........:..................................:
2090
+ : user : true : john.curtis@email.com :
2091
+ : user : false : laurent.martin.aspera@fr.ibm.com :
2092
+ : user : false : jean.dupont@me.com :
2093
+ : user : false : another.user@example.com :
2094
+ : group : false : :
2095
+ : user : false : aspera.user@gmail.com :
2096
+ :.............:.........:..................................:
2097
+ ```
2098
+
2099
+ other query parameters:
2100
+
2101
+ ```
2102
+ {"workspace_membership_through":true,"include_indirect":true}
2103
+ ```
2104
+
2105
+ * <a name="aoc_sample_member"></a>add all members of a workspace to another workspace
2106
+
2107
+ a- get id of first workspace
2108
+
2109
+ ```
2110
+ WS1='First Workspace'
2111
+ WS1ID=$(ascli aspera admin res workspace list --query=@json:'{"q":"'"$WS1"'"}' --select=@json:'{"name":"'"$WS1"'"}' --fields=id --format=csv)
2112
+ ```
2113
+
2114
+ b- get id of second workspace
2115
+
2116
+ ```
2117
+ WS2='Second Workspace'
2118
+ WS2ID=$(ascli aspera admin res workspace list --query=@json:'{"q":"'"$WS2"'"}' --select=@json:'{"name":"'"$WS2"'"}' --fields=id --format=csv)
2119
+ ```
2120
+
2121
+ c- extract membership information and change workspace id
2122
+
2123
+ ```
2124
+ $ ascli aspera admin res workspace_membership list --fields=manager,member_id,member_type,workspace_id --query=@json:'{"per_page":10000,"workspace_id":'"$WS1ID"'}' --format=jsonpp > ws1_members.json
2125
+ ```
2126
+
2127
+ d- convert to creation data for second workspace:
2128
+
2129
+ ```
2130
+ grep -Eve '(direct|effective_manager|_count|storage|"id")' ws1_members.json|sed '/workspace_id/ s/"'"$WS1ID"'"/"'"$WS2ID"'"/g' > ws2_members.json
2131
+ ```
2132
+
2133
+ or, using jq:
2134
+
2135
+ ```
2136
+ jq '[.[] | {member_type,member_id,workspace_id,manager,workspace_id:"'"$WS2ID"'"}]' ws1_members.json > ws2_members.json
2137
+ ```
2138
+
2139
+ e- add members to second workspace
2140
+
2141
+ ```
2142
+ $ ascli aspera admin res workspace_membership create --bulk=yes @json:@file:ws2_members.json
2143
+ ```
2144
+
2145
+ * get users who did not log since a date
2146
+
2147
+ ```
2148
+ $ ascli aspera admin res user list --fields=email --query=@json:'{"per_page":10000,"q":"last_login_at:<2018-05-28"}'
2149
+ :...............................:
2150
+ : email :
2151
+ :...............................:
2152
+ : John.curtis@acme.com :
2153
+ : Jean.Dupont@tropfort.com :
2154
+ :...............................:
2155
+ ```
2156
+
2157
+ * list "Limited" users
2158
+
2159
+ ```
2160
+ $ ascli aspera admin res user list --fields=email --query=@json:'{"per_page":10000}' --select=@json:'{"member_of_any_workspace":false}'
2161
+ ```
2162
+
2163
+ * Perform a multi Gbps transfer between two remote shared folders
2164
+
2165
+ In this example, a user has access to a workspace where two shared folders are located on differente sites, e.g. different cloud regions.
2166
+
2167
+ First, setup the environment (skip if already done)
2168
+
2169
+ ```
2170
+ $ ascli conf wizard --url=https://sedemo.ibmaspera.com --username=laurent.martin.aspera@fr.ibm.com
2171
+ Detected: Aspera on Cloud
2172
+ Preparing preset: aoc_sedemo
2173
+ Using existing key:
2174
+ /Users/laurent/.aspera/ascli/aspera_on_cloud_key
2175
+ Using global client_id.
2176
+ Please Login to your Aspera on Cloud instance.
2177
+ Navigate to your "Account Settings"
2178
+ Check or update the value of "Public Key" to be:
2179
+ -----BEGIN PUBLIC KEY-----
2180
+ SOME PUBLIC KEY PEM DATA HERE
2181
+ -----END PUBLIC KEY-----
2182
+ Once updated or validated, press enter.
2183
+
2184
+ creating new config preset: aoc_sedemo
2185
+ Setting config preset as default for aspera
2186
+ saving config file
2187
+ Done.
2188
+ You can test with:
2189
+ $ ascli aspera user info show
2190
+ ```
2191
+
2192
+ This creates the option preset "aoc_&lt;org name&gt;" to allow seamless command line access and sets it as default for aspera on cloud.
2193
+
2194
+ Then, create two shared folders located in two regions, in your files home, in a workspace.
2195
+
2196
+ Then, transfer between those:
2197
+
2198
+ ```
2199
+ $ ascli -Paoc_show aspera files transfer --from-folder='IBM Cloud SJ' --to-folder='AWS Singapore' 100GB.file --ts=@json:'{"target_rate_kbps":"1000000","multi_session":10,"multi_session_threshold":1}'
2200
+ ```
2201
+
2202
+ * create registration key to register a node
2203
+ ```
2204
+ $ ascli aspera admin res admin/client create @json:'{"data":{"name":"laurentnode","client_subject_scopes":["alee","aejd"],"client_subject_enabled":true}}' --fields=token --format=csv
2205
+ jfqslfdjlfdjfhdjklqfhdkl
2206
+ ```
2207
+
2208
+ * delete all registration keys
2209
+
2210
+ ```
2211
+ $ ascli aspera admin res admin/client list --fields=id --format=csv|ascli aspera admin res admin/client delete --bulk=yes --id=@lines:@stdin:
2212
+ +-----+---------+
2213
+ | id | status |
2214
+ +-----+---------+
2215
+ | 99 | deleted |
2216
+ | 100 | deleted |
2217
+ | 101 | deleted |
2218
+ | 102 | deleted |
2219
+ +-----+---------+
2220
+ ```
2221
+
2222
+ ## Shared folders
2223
+
2224
+ * list shared folders in node
2225
+
2226
+ ```
2227
+ $ ascli aspera admin res node --id=8669 shared_folders
2228
+ ```
2229
+
2230
+ * list shared folders in workspace
2231
+
2232
+ ```
2233
+ $ ascli aspera admin res workspace --id=10818 shared_folders
2234
+ ```
2235
+
2236
+ * list members of shared folder
2237
+
2238
+ ```
2239
+ $ ascli aspera admin res node --id=8669 v4 perm 82 show
2240
+ ```
2241
+
2242
+ ## Send a Package
2243
+
2244
+ Send a package:
2245
+
2246
+ ```
2247
+ $ ascli aspera packages send --value=@json:'{"name":"my title","note":"my note","recipients":["laurent.martin.aspera@fr.ibm.com","other@example.com"]}' --sources=@args my_file.dat
2248
+ ```
2249
+
2250
+ Notes:
2251
+
2252
+ * the `value` parameter can contain any supported package creation parameter. Refer to the API, or display an existing package.
2253
+ * to list recipients use fields: "recipients" and/or "bcc_recipients". ascli will resolve the list of email addresses to expected user ids. If a recipient is not already registered and the workspace allows external users, then the package is sent to an external user, and
2254
+ * if the option `new_user_option` is `@json:{"package_contact":true}` (default), then a public link is sent and the external user does not need to create an account.
2255
+ * if the option `new_user_option` is `@json:{}`, then external users are invited to join the workspace
2256
+
2257
+ ## <a name="aoccargo"></a>Receive only new packages
2258
+
2259
+ It is possible to automatically download new packages, like using Aspera Cargo:
2260
+
2261
+ ```
2262
+ $ ascli aspera packages recv --id=ALL --once-only=yes --lock-port=12345
2263
+ ```
2264
+
2265
+ * `--id=ALL` (case sensitive) will download all packages
2266
+ * `--once-only=yes` keeps memory of any downloaded package in persistency files located in the configuration folder.
2267
+ * `--lock-port=12345` ensures that only one instance is started at the same time, to avoid collisions
2268
+
2269
+ Typically, one would regularly execute this command on a regular basis, using the method oif your choice:
2270
+
2271
+ * Windows scheduler
2272
+ * cron
2273
+ * etc...
2274
+
2275
+ ## Download Files
2276
+
2277
+ Download of files is straightforward with a specific syntax for the `aspera files download` action: Like other commands the source file list is provided as a list with the `sources` option. Nevertheless, consider this:
2278
+
2279
+ * if only one source is provided, it is downloaded
2280
+ * if multiple sources must be downloaded, then the first in list is the path of the source folder, and the remaining items are the file names in this folder (without path).
2281
+
2282
+ ## Find Files
2283
+
2284
+ The command `aspera files find [--value=expression]` will recursively scan storage to find files matching the expression criteria. It works also on node resource using the v4 command. (see examples)
2285
+
2286
+ The expression can be of 3 formats:
2287
+
2288
+ * empty (default) : all files, equivalent to: `exec:true`
2289
+ * not starting with `exec:` : the expression is a regular expression, using ruby regex syntax. equivalent to: `exec:f['name'].match(/expression/)`
2290
+
2291
+ For instance, to find files with a special extension, use `--value='\.myext$'`
2292
+
2293
+ * starting with `exec:` : the ruby code after the prefix is executed for each entry found. the entry variable name is `f`. the file is displayed if the result is true;
2294
+
2295
+ Examples of expressions: (think to prefix with `exec:` and put in single quotes using bash)
2296
+
2297
+ * find files more recent than 100 days
2298
+
2299
+ ```
2300
+ f["type"].eql?("file") and (DateTime.now-DateTime.parse(f["modified_time"]))<100
2301
+ ```
2302
+
2303
+ * expression to find files older than 1 year on a given node and store in file list
2304
+
2305
+ ```
2306
+ $ ascli aspera admin res node --name='my node name' --secret='my secret' v4 find / --fields=path --value='exec:f["type"].eql?("file") and (DateTime.now-DateTime.parse(f["modified_time"]))<100' --format=csv > my_file_list.txt
2307
+ ```
2308
+
2309
+ * delete the files, one by one
2310
+
2311
+ ```
2312
+ $ cat my_file_list.txt|while read path;do echo ascli aspera admin res node --name='my node name' --secret='my secret' v4 delete "$path" ;done
2313
+ ```
2314
+
2315
+ * delete the files in bulk
2316
+
2317
+ ```
2318
+ cat my_file_list.txt | ascli aspera admin res node --name='my node name' --secret='my secret' v3 delete @lines:@stdin:
2319
+ ```
2320
+
2321
+ ## Activity
2322
+
2323
+ The activity app can be queried with:
2324
+
2325
+ ```
2326
+ $ ascli aspera admin analytics transfers
2327
+ ```
2328
+
2329
+ It can also support filters and send notification email with a template:
2330
+
2331
+ ```
2332
+ $ ascli aspera admin analytics transfers --once-only=yes --lock-port=123455 \
2333
+ --query=@json:'{"status":"completed","direction":"receive"}' \
2334
+ --notify=@json:'{"to":"<''%=transfer[:user_email.to_s]%>","subject":"<''%=transfer[:files_completed.to_s]%> files received","body":"Dear <''%=transfer[:user_email.to_s]%>\nWe received <''%=transfer[:files_completed.to_s]%> files for a total of <''%=transfer[:transferred_bytes.to_s]%> bytes, starting with file:\n<''%=transfer[:content.to_s]%>\n\nThank you."}'
2335
+ ```
2336
+
2337
+ * `once_only` keep track of last date it was called, so next call will get only new events
2338
+ * `query` filter (on API call)
2339
+ * `notify` send an email as specified by template, this could be places in a file with the `@file` modifier.
2340
+
2341
+ Note this must not be executed in less than 5 minutes because the analytics interface accepts only a period of time between 5 minutes and 6 months. here the period is [date of previous execution]..[now].
2342
+
2343
+ ## Using specific transfer ports
2344
+
2345
+ By default transfer nodes are expected to use ports TCP/UDP 33001. The web UI enforces that. The option `default_ports` ([yes]/no) allows ascli to retrieve the server ports from an API call (download_setup) which reads the information from `aspera.conf` on the server.
2346
+
2347
+
2348
+ # Plugin: Aspera Transfer Service
2349
+
2350
+ ATS is usable either :
2351
+
2352
+ * from an AoC subscription : ascli aspera admin ats
2353
+
2354
+ * or from an IBM Cloud subscription : ascli ats
2355
+
2356
+ ## IBM Cloud ATS : creation of api key
2357
+
2358
+ First get your IBM Cloud APIkey. For instance, it can be created using the IBM Cloud web interface, or using command line:
2359
+
2360
+ ```
2361
+ $ ibmcloud iam api-key-create mykeyname -d 'my sample key'
2362
+ OK
2363
+ API key mykeyname was created
2364
+
2365
+ Please preserve the API key! It cannot be retrieved after it's created.
2366
+
2367
+ Name mykeyname
2368
+ Description my sample key
2369
+ Created At 2019-09-30T12:17+0000
2370
+ API Key my_secret_api_key_here_8f8d9fdakjhfsashjk678
2371
+ Locked false
2372
+ UUID ApiKey-05b8fadf-e7fe-4bc4-93a9-6fd348c5ab1f
2373
+ ```
2374
+
2375
+ References:
2376
+
2377
+ * [https://console.bluemix.net/docs/iam/userid_keys.html#userapikey](https://console.bluemix.net/docs/iam/userid_keys.html#userapikey)
2378
+ * [https://ibm.ibmaspera.com/helpcenter/transfer-service](https://ibm.ibmaspera.com/helpcenter/transfer-service)
2379
+
2380
+
2381
+ Then, to register the key by default for the ats plugin, create a preset. Execute:
2382
+
2383
+ ```
2384
+ $ ascli config id my_ibm_ats update --ibm-api-key=my_secret_api_key_here_8f8d9fdakjhfsashjk678
2385
+ $ ascli config id default set ats my_ibm_ats
2386
+ $ ascli ats api_key instances
2387
+ +--------------------------------------+
2388
+ | instance |
2389
+ +--------------------------------------+
2390
+ | aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee |
2391
+ +--------------------------------------+
2392
+ $ ascli config id my_ibm_ats update --instance=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
2393
+ $ ascli ats api_key create
2394
+ +--------+----------------------------------------------+
2395
+ | key | value |
2396
+ +--------+----------------------------------------------+
2397
+ | id | ats_XXXXXXXXXXXXXXXXXXXXXXXX |
2398
+ | secret | YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY |
2399
+ +--------+----------------------------------------------+
2400
+ $ ascli config id my_ibm_ats update --ats-key=ats_XXXXXXXXXXXXXXXXXXXXXXXX --ats-secret=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
2401
+ ```
2402
+
2403
+ ## Examples
2404
+
2405
+ Example: create access key on softlayer:
2406
+
2407
+ ```
2408
+ $ ascli ats access_key create --cloud=softlayer --region=ams --params=@json:'{"storage":{"type":"softlayer_swift","container":"_container_name_","credentials":{"api_key":"value","username":"_name_:_usr_name_"},"path":"/"},"id":"_optional_id_","name":"_optional_name_"}'
2409
+ ```
2410
+
2411
+ Example: create access key on AWS:
2412
+
2413
+ ```
2414
+ $ ascli ats access_key create --cloud=aws --region=eu-west-1 --params=@json:'{"id":"testkey3","name":"laurent key AWS","storage":{"type":"aws_s3","bucket":"my-bucket","credentials":{"access_key_id":"AKIA_MY_API_KEY","secret_access_key":"my/secret/here"},"path":"/laurent"}}'
2415
+
2416
+ ```
2417
+
2418
+ Example: create access key on Azure SAS:
2419
+
2420
+ ```
2421
+ $ ascli ats access_key create --cloud=azure --region=eastus --params=@json:'{"id":"testkeyazure","name":"laurent key azure","storage":{"type":"azure_sas","credentials":{"shared_access_signature":"https://containername.blob.core.windows.net/blobname?sr=c&..."},"path":"/"}}'
2422
+
2423
+ ```
2424
+
2425
+ (Note that the blob name is mandatory after server address and before parameters. and that parameter sr=c is mandatory.)
2426
+
2427
+ Example: create access key on Azure:
2428
+
2429
+ ```
2430
+ $ ascli ats access_key create --cloud=azure --region=eastus --params=@json:'{"id":"testkeyazure","name":"laurent key azure","storage":{"type":"azure","credentials":{"account":"myaccount","key":"myaccesskey","storage_endpoint":"myblob"},"path":"/"}}'
2431
+
2432
+ ```
2433
+
2434
+ delete all my access keys:
2435
+
2436
+ ```
2437
+ for k in $(ascli ats access_key list --field=id --format=csv);do ascli ats access_key id $k delete;done
2438
+ ```
2439
+
2440
+ # Plugin: IBM Aspera High Speed Transfer Server (transfer)
2441
+
2442
+ This plugin works at FASP level (SSH/ascp/ascmd) and does not use the node API.
2443
+
2444
+ ## Authentication
2445
+
2446
+ Both password and SSH keys auth are supported.
2447
+
2448
+ Multiple SSH key paths can be provided. The value of the parameter `ssh_keys` can be a single value or an array. Each value is a path to a private key and is expanded ("~" is replaced with the user's home folder).
2449
+
2450
+ Examples:
2451
+
2452
+ ```
2453
+ $ ascli server --ssh-keys=~/.ssh/id_rsa
2454
+ $ ascli server --ssh-keys=@list:,~/.ssh/id_rsa
2455
+ $ ascli server --ssh-keys=@json:'["~/.ssh/id_rsa"]'
2456
+ ```
2457
+
2458
+ The underlying ssh library `net::ssh` provides several options that may be used
2459
+ depending on environment. By default the ssh library expect that an ssh-agent is running, but if you get the error message:
2460
+
2461
+ ```
2462
+ ERROR -- net.ssh.authentication.agent: could not connect to ssh-agent: Agent not configured
2463
+ ```
2464
+
2465
+ This means that you dont have such agent, check env var: `SSH_AGENT_SOCK`, check if the key is protected with a passphrase. [check the manual](https://net-ssh.github.io/ssh/v1/chapter-2.html#s2)
2466
+
2467
+ To diable use of `ssh-agent`, use the option `ssh_option` like this (or set in preset):
2468
+
2469
+ ```
2470
+ $ ascli server --ssh-options=@ruby:'{use_agent: false}' ...
2471
+ ```
2472
+
2473
+ ## Example
2474
+
2475
+ One can test the "server" application using the well known demo server:
2476
+
2477
+ ```
2478
+ $ ascli config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
2479
+ $ ascli config id default set server aspera_demo_server
2480
+ $ ascli server browse /aspera-test-dir-large
2481
+ $ ascli server download /aspera-test-dir-large/200MB
2482
+ ```
2483
+
2484
+ This creates a [option preset](#lprt) "aspera_demo_server" and set it as default for application "server"
2485
+
2486
+
2487
+ # Plugin: IBM Aspera High Speed Transfer Server (node)
2488
+
2489
+ This plugin gives access to capabilities provided by HSTS node API.
2490
+
2491
+ ## Simple Operations
2492
+
2493
+ It is possible to:
2494
+ * browse
2495
+ * transfer (upload / download)
2496
+ * ...
2497
+
2498
+ ## Central
2499
+
2500
+ The central subcommand uses the "reliable query" API (session and file). It allows listing transfer sessions and transfered files.
2501
+
2502
+ Filtering can be applied:
2503
+ ```
2504
+ $ ascli node central file list
2505
+ ```
2506
+
2507
+ by providing the `validator` option, offline transfer validation can be done.
2508
+
2509
+ ## FASP Stream
2510
+
2511
+ It is possible to start a FASPStream session using the node API:
2512
+
2513
+ Use the "node stream create" command, then arguments are provided as a [_transfer-spec_](#transferspec).
2514
+
2515
+ ```
2516
+ $ ascli node stream create --ts=@json:'{"direction":"send","source":"udp://233.3.3.4:3000?loopback=1&ttl=2","destination":"udp://233.3.3.3:3001/","remote_host":"localhost","remote_user":"stream","remote_password":"XXXX"}' --preset=stream
2517
+ ```
2518
+
2519
+ ## Watchfolder
2520
+
2521
+ Refer to [Aspera documentation](https://download.asperasoft.com/download/docs/entsrv/3.7.4/es_admin_linux/webhelp/index.html#watchfolder_external/dita/json_conf.html) for watch folder creation.
2522
+
2523
+ `ascli` supports remote operations through the node API. Operations are:
2524
+
2525
+ * Start watchd and watchfolderd services running as a system user having access to files
2526
+ * configure a watchfolder to define automated transfers
2527
+
2528
+
2529
+ ```
2530
+ $ ascli node service create @json:'{"id":"mywatchd","type":"WATCHD","run_as":{"user":"user1"}}'
2531
+ $ ascli node service create @json:'{"id":"mywatchfolderd","type":"WATCHFOLDERD","run_as":{"user":"user1"}}'
2532
+ $ ascli node watch_folder create @json:'{"id":"mywfolder","source_dir":"/watch1","target_dir":"/","transport":{"host":"10.25.0.4","user":"user1","pass":"mypassword"}}'
2533
+ ```
2534
+
2535
+ ## Out of Transfer File Validation
2536
+
2537
+ Follow the Aspera Transfer Server configuration to activate this feature.
2538
+
2539
+ ```
2540
+ $ ascli node central file list --validator=ascli --data=@json:'{"file_transfer_filter":{"max_result":1}}'
2541
+ :..............:..............:............:......................................:
2542
+ : session_uuid : file_id : status : path :
2543
+ :..............:..............:............:......................................:
2544
+ : 1a74444c-... : 084fb181-... : validating : /home/xfer.../PKG - my title/200KB.1 :
2545
+ :..............:..............:............:......................................:
2546
+ $ ascli node central file update --validator=ascli --data=@json:'{"files":[{"session_uuid": "1a74444c-...","file_id": "084fb181-...","status": "completed"}]}'
2547
+ updated
2548
+ ```
2549
+
2550
+ ## Example: SHOD to ATS
2551
+
2552
+ Access to a "Shares on Demand" (SHOD) server on AWS is provided by a partner. And we need to
2553
+ transfer files from this third party SHOD instance into our Azure BLOB storage.
2554
+ Simply create an "Aspera Transfer Service" instance (https://ts.asperasoft.com), which
2555
+ provides access to the node API.
2556
+ Then create a configuration for the "SHOD" instance in the configuration file: in section
2557
+ "shares", a configuration named: awsshod.
2558
+ Create another configuration for the Azure ATS instance: in section "node", named azureats.
2559
+ Then execute the following command:
2560
+
2561
+ ```
2562
+ $ ascli node download /share/sourcefile --to-folder=/destinationfolder --preset=awsshod --transfer=node --transfer-info=@preset:azureats
2563
+ ```
2564
+
2565
+ This will get transfer information from the SHOD instance and tell the Azure ATS instance
2566
+ to download files.
2567
+
2568
+ ## Create access key
2569
+
2570
+ ```
2571
+ $ ascli node access_key create --value=@json:'{"id":"eudemo-sedemo","secret":"mystrongsecret","storage":{"type":"local","path":"/data/asperafiles"}}'
2572
+ ```
2573
+
2574
+ # Plugin: IBM Aspera Faspex
2575
+
2576
+ Note that the command "v4" requires the use of APIv4, refer to the Faspex Admin manual on how to activate.
2577
+
2578
+ ## Sending a Package
2579
+
2580
+ Provide delivery info in JSON, example:
2581
+
2582
+ ```
2583
+ --delivery-info=@json:'{"title":"my title","recipients":["laurent.martin.aspera@fr.ibm.com"]}'
2584
+ ```
2585
+
2586
+ a note can be added: `"note":"Please ..."`
2587
+
2588
+ metadata: `"metadata":{"Meta1":"Val1","Meta2":"Val2"}`
2589
+
2590
+
2591
+ Note for full details, refer to:
2592
+ [Reference on Developer Site](https://developer.asperasoft.com/web/faspex/sending)
2593
+
2594
+ ## operation on dropboxes
2595
+
2596
+ Example:
2597
+
2598
+ ```
2599
+ $ ascli faspex v4 dropbox create --value=@json:'{"dropbox":{"e_wg_name":"test1","e_wg_desc":"test1"}}'
2600
+ $ ascli faspex v4 dropbox list
2601
+ $ ascli faspex v4 dropbox delete --id=36
2602
+ ```
2603
+
2604
+ ## remote sources
2605
+
2606
+ Faspex lacks an API to list the contents of a remote source (available in web UI). To workaround this,
2607
+ the node API is used, for this it is required to add a section ":storage" that links
2608
+ a storage name to a node config and sub path.
2609
+
2610
+ Example:
2611
+
2612
+ ```yaml
2613
+ my_faspex_conf:
2614
+ url: https://10.25.0.3/aspera/faspex
2615
+ username: admin
2616
+ password: MyPassword
2617
+ storage:
2618
+ testlaurent:
2619
+ node: "@preset:my_faspex_node"
2620
+ path: /myfiles
2621
+ my_faspex_node:
2622
+ url: https://10.25.0.3:9092
2623
+ username: node_faspex
2624
+ password: MyPassword
2625
+ ```
2626
+
2627
+ In this example, a faspex storage named "testlaurent" exists in Faspex, and is located
2628
+ under the docroot in "/myfiles" (this must be the same as configured in Faspex).
2629
+ The node configuration name is "my_faspex_node" here.
2630
+
2631
+ Note: the v4 API provide an API for nodes and shares.
2632
+
2633
+ ## Automated package download (cargo)
2634
+
2635
+ It is possible to tell `ascli` to download newly received packages, much like the official
2636
+ cargo client, or drive. Refer to the [same section](#aoccargo) in the Aspera on Cloud plugin:
2637
+
2638
+ ```
2639
+ $ ascli faspex packages recv --id=ALL --once-only=yes --lock-port=12345
2640
+ ```
2641
+
2642
+ # Plugin: IBM Aspera Shares
2643
+
2644
+ Aspera Shares supports the "node API" for the file transfer part. (Shares 1 and 2)
2645
+
2646
+ In Shares2, users, groups listing are paged, to display sequential pages:
2647
+
2648
+ ```
2649
+ $ for p in 1 2 3;do ascli shares2 admin users list --value=@json:'{"page":'$p'}';done
2650
+ ```
2651
+
2652
+ # Plugin: IBM Cloud Object Storage
2653
+
2654
+ The IBM Cloud Object Storage provides the possibility to execute transfers using FASP.
2655
+
2656
+ Required options are either:
2657
+
2658
+ * `bucket` bucket name
2659
+ * `endpoint` storage endpoint url, e.g. https://s3.hkg02.cloud-object-storage.appdomain.cloud
2660
+ * `apikey` API Key
2661
+ * `crn` resource instance id
2662
+
2663
+ or:
2664
+
2665
+ * `bucket` bucket name
2666
+ * `region` bucket region, e.g. eu-de
2667
+ * `service_credentials` see below
2668
+
2669
+ Service credentials are directly created using the IBM cloud web ui. Navigate to:
2670
+
2671
+ Navigation Menu &rarr; Resource List &rarr; Storage &rarr; Cloud Object Storage &rarr; Service Credentials &rarr; &lt;select or create credentials&gt; &rarr; view credentials &rarr; copy
2672
+
2673
+ Then save the copied value to a file, e.g. : `$HOME/cos_service_creds.json`
2674
+
2675
+ or using the CLI:
2676
+
2677
+ ```
2678
+ $ ibmcloud resource service-keys
2679
+ $ ibmcloud resource service-key aoclaurent --output JSON|jq '.[0].credentials'>$HOME/service_creds.json
2680
+ ```
2681
+
2682
+ (if you dont have `jq` installed, extract the structure as follows)
2683
+
2684
+ It consists in the following structure:
2685
+
2686
+ ```
2687
+ {
2688
+ "apikey": "xxxxxxx.....",
2689
+ "cos_hmac_keys": {
2690
+ "access_key_id": "xxxxxxx.....",
2691
+ "secret_access_key": "xxxxxxx....."
2692
+ },
2693
+ "endpoints": "https://control.cloud-object-storage.cloud.ibm.com/v2/endpoints",
2694
+ "iam_apikey_description": "my description ...",
2695
+ "iam_apikey_name": "my key name",
2696
+ "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
2697
+ "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/xxxxxxx.....",
2698
+ "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/xxxxxxx....."
2699
+ }
2700
+ ```
2701
+
2702
+ The field `resource_instance_id` is for option `crn`
2703
+
2704
+ The field `apikey` is for option `apikey`
2705
+
2706
+ Endpoints for regions can be found by querying the `endpoints` URL.
2707
+
2708
+ For convenience, let us create a default configuration, for example:
2709
+
2710
+ ```
2711
+ $ ascli conf id mycos update --service-credentials=@val:@json:@file:$HOME/service_creds.json --region=us-south --bucket=laurent
2712
+ $ ascli conf id default set cos mycos
2713
+ ```
2714
+
2715
+ Now, Ready to do operations, a subset of "node" plugin operations are supported, basically node API:
2716
+
2717
+ ```
2718
+ $ ascli cos node browse /
2719
+ $ ascli cos node upload myfile.txt
2720
+ ```
2721
+
2722
+ # Plugin: IBM Aspera Sync
2723
+
2724
+ A basic plugin to start an "async" using `ascli`. The main advantage is the possibility
2725
+ to start from ma configuration file, using `ascli` standard options.
2726
+
2727
+ # Plugin: Preview
2728
+
2729
+ The `preview` generates "previews" of graphical files, i.e. thumbnails (office, images, video) and video previews on an Aspera HSTS for use primarily in the Aspera on Cloud application.
2730
+ This is based on the "node API" of Aspera HSTS when using Access Keys only inside it's "storage root".
2731
+ Several parameters can be used to tune several aspects:
2732
+
2733
+ * methods for detection of new files needing generation
2734
+ * methods for generation of video preview
2735
+ * parameters for video handling
2736
+
2737
+ ## Aspera Server configuration
2738
+
2739
+ Specify the previews folder as shown in:
2740
+
2741
+ <https://ibmaspera.com/help/admin/organization/installing_the_preview_maker>
2742
+
2743
+ By default, the `preview` plugin expects previews to be generated in a folder named `previews` located in the storage root. On the transfer server execute:
2744
+
2745
+ ```
2746
+ # /opt/aspera/bin/asconfigurator -x "server;preview_dir,previews"
2747
+ # /opt/aspera/bin/asnodeadmin --reload
2748
+ ```
2749
+
2750
+ Note: the configuration `preview_dir` is *relative* to the storage root, no need leading or trailing `/`. In general just set the value to `previews`
2751
+
2752
+ If another folder is configured on the HSTS, then specify it to `ascli` using the option `previews_folder`.
2753
+
2754
+ The HSTS node API limits any preview file to a parameter: `max_request_file_create_size_kb` (1 KB is 1024 bytes).
2755
+ This size is internally capped to `1<<24` Bytes (16777216) , i.e. 16384 KBytes.
2756
+
2757
+ To change this parameter in `aspera.conf`, use `asconfigurator`. To display the value, use `asuserdata`:
2758
+
2759
+ ```
2760
+ # /opt/aspera/bin/asuserdata -a | grep max_request_file_create_size_kb
2761
+ max_request_file_create_size_kb: "1024"
2762
+ # /opt/aspera/bin/asconfigurator -x "server; max_request_file_create_size_kb,16384"
2763
+ ```
2764
+
2765
+ If you use a value different than 16777216, then specify it using option `max_size`.
2766
+
2767
+ Note: the HSTS parameter (max_request_file_create_size_kb) is in kilobytes while the generator parameter is in bytes (factor of 1024).
2768
+
2769
+ ## <a name="prev_ext"></a>External tools: Linux
2770
+
2771
+ The tool requires the following external tools available in the `PATH`:
2772
+
2773
+ * ImageMagick : `convert` `composite`
2774
+ * OptiPNG : `optipng`
2775
+ * FFmpeg : `ffmpeg` `ffprobe`
2776
+ * Libreoffice : `libreoffice`
2777
+
2778
+ Here shown on Redhat/CentOS.
2779
+
2780
+ Other OSes should work as well, but are note tested.
2781
+
2782
+ To check if all tools are found properly, execute:
2783
+
2784
+ ```
2785
+ $ ascli preview check
2786
+ ```
2787
+
2788
+ ### Image: Imagemagick and optipng
2789
+
2790
+ ```
2791
+ yum install -y ImageMagick optipng
2792
+ ```
2793
+
2794
+ ### Video: FFmpeg
2795
+
2796
+ ```
2797
+ curl -s https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz|(mkdir -p /opt && cd /opt && tar xJvf - && rm -f /opt/ffmpeg /usr/bin/{ffmpeg,ffprobe} && ln -s ffmpeg-* ffmpeg && ln -s /opt/ffmpeg/{ffmpeg,ffprobe} /usr/bin)
2798
+ ```
2799
+
2800
+ ### Office: Unoconv and Libreoffice
2801
+
2802
+ If you dont want to have preview for office dpcuments or if it is too complex you can skip office document preview generation by using option: `--skip-types=office`
2803
+
2804
+ The generation of preview in based on the use of `unoconv` and `libreoffice`
2805
+
2806
+ * Centos 8
2807
+
2808
+ ```
2809
+ # dnf install unoconv
2810
+ ```
2811
+
2812
+
2813
+ ## Configuration
2814
+
2815
+ Like any `ascli` commands, parameters can be passed on command line or using a configuration [option preset](#lprt). Note that if you use the `ascli` run as `xfer` user, like here, the configuration file must be created as the same user. Example using a [option preset](#lprt) named `my_preset_name` (choose any name relevant to you, e.g. the AoC node name, and replace in the following lines):
2816
+
2817
+ ```
2818
+ # su -s /bin/bash - xfer
2819
+ $ ascli config id my_preset_name update --url=https://localhost:9092 --username=my_access_key --password=my_secret --skip-types=office --lock-port=12346
2820
+ $ ascli config id default set preview my_preset_name
2821
+ ```
2822
+
2823
+ Here we assume that Office file generation is disabled, else remove the option. For the `lock_port` option refer to a previous section in thsi manual.
2824
+
2825
+ Once can check if the access key is well configured using:
2826
+
2827
+ ```
2828
+ $ ascli -Pmy_preset_name node browse /
2829
+ ```
2830
+
2831
+ This shall list the contents of the storage root of the access key.
2832
+
2833
+ ## Execution
2834
+
2835
+ The tool intentionally supports only a "one shot" mode in order to avoid having a hanging process or using too many resources (calling REST api too quickly during the scan or event method).
2836
+ It needs to be run regularly to create or update preview files. For that use your best
2837
+ reliable scheduler. For instance use "CRON" on Linux or Task Scheduler on Windows.
2838
+
2839
+ Typically, for "Access key" access, the system/transfer is `xfer`. So, in order to be consiustent have generate the appropriate access rights, the generation process
2840
+ should be run as user `xfer`.
2841
+
2842
+ Lets do a one shot test, using the configuration previously created:
2843
+
2844
+ ```
2845
+ # su -s /bin/bash - xfer
2846
+ $ ascli preview scan --overwrite=always
2847
+ ```
2848
+
2849
+ When the preview generator is first executed it will create a file: `.aspera_access_key`
2850
+ which contains the access key used.
2851
+ On subsequent run it reads this file and check that previews are generated for the same access key, else it fails. This is to prevent clash of different access keys using the same root.
2852
+
2853
+ ## Configuration for Execution in scheduler
2854
+
2855
+ Here is an example of configuration for use with cron on Linux. Adapt the scripts to your own preference.
2856
+
2857
+ We assume here that a configuration preset was created as shown previously.
2858
+
2859
+ Here the cronjob is created for `root`, and changes the user to `xfer`, also overriding the shell which should be `aspshell`. (adapt the command below, as it would override existing crontab). It is also up to you to use directly the `xfer` user's crontab. This is an example only.
2860
+
2861
+ ```
2862
+ # crontab<<EOF
2863
+ 2-59 * * * * su -s /bin/bash - xfer -c 'nice +10 timeout 10m ascli preview event --log-level=info --logger=syslog --iteration-file=/tmp/preview_restart.txt'
2864
+ 0 * * * * su -s /bin/bash - xfer -c 'nice +10 timeout 30m ascli preview scan --log-level=info --logger=syslog'
2865
+ EOF
2866
+ ```
2867
+
2868
+ Nopte that the options here may be located in the config preset, but it was left on the command line to keep stdout for command line execution of preview.
2869
+
2870
+ ## Candidate detection for creation or update (or deletion)
2871
+
2872
+ The tool will find candidates for preview generation using three commands:
2873
+
2874
+ * `trevents` : only recently uploaded files will be tested (transfer events)
2875
+ * `events` : only recently uploaded files will be tested (file events: not working)
2876
+ * `scan` : deeply scan all files under the access key&apos;s "storage root"
2877
+ * `folder` : same as `scan`, but only on the specified folder&apos;s "file identifier"
2878
+ * `file` : for an individual file generation
2879
+
2880
+ Note that for the `event`, the option `iteration_file` should be specified so that
2881
+ successive calls only process new events. This file will hold an identifier
2882
+ telling from where to get new events.
2883
+
2884
+ It is also possible to test a local file, using the `test` command.
2885
+
2886
+ Once candidate are selected, once candidates are selected,
2887
+ a preview is always generated if it does not exist already,
2888
+ else if a preview already exist, it will be generated
2889
+ using one of three overwrite method:
2890
+
2891
+ * `always` : preview is always generated, even if it already exists and is newer than original
2892
+ * `never` : preview is generated only if it does not exist already
2893
+ * `mtime` : preview is generated only if the original file is newer than the existing
2894
+
2895
+ Deletion of preview for deleted source files: not implemented yet.
2896
+
2897
+ If the `scan` or `events` detection method is used, then the option : `skip_folders` can be used
2898
+ to skip some folders. It expects a list of path starting with slash, use the `@json:` notation, example:
2899
+
2900
+ ```
2901
+ $ ascli preview scan --skip-folders=@json:'["/not_here"]'
2902
+ ```
2903
+
2904
+ The option `folder_reset_cache` forces the node service to refresh folder contents using various methods.
2905
+
2906
+ ## output preview Files types
2907
+
2908
+ Two types of preview can be generated:
2909
+
2910
+ * png: thumbnail
2911
+ * mp4: video preview (only for video)
2912
+
2913
+ To skip generation of a format use option `skip_format`
2914
+
2915
+ ## Supported input Files types
2916
+
2917
+ The preview generator supports redering of those file categories:
2918
+
2919
+ * image
2920
+ * pdf
2921
+ * plaintext
2922
+ * office
2923
+ * video
2924
+
2925
+ To avoid generation for some categories, specify a list using option `skip_types`.
2926
+
2927
+ Each category has a specific rendering method to produce the png thumbnail.
2928
+
2929
+ The mp4 video preview file is only for category `video`
2930
+
2931
+ File type is primarily based on file extension detected by the node API and translated info a mime type returned by the node API.
2932
+
2933
+ The tool can also locally detect the mime type using gem `mimemagic`.
2934
+
2935
+ ## Access to original files and preview creation
2936
+
2937
+ Standard open source tools are used to create thumnails and video previews.
2938
+ Those tools require that original files are accessible in the local file system and also write generated files on the local file system.
2939
+ The tool provides 2 ways to read and write files with the option: `file_access`
2940
+
2941
+ If the preview generator is run on a system that has direct access to the file system, then the value `local` can be used. In this case, no transfer happen, source files are directly read from the storage, and preview files
2942
+ are directly written to the storage.
2943
+
2944
+ If the preview generator does not have access to files on the file system (it is remote, no mount, or is an object storage), then the original file is first downloaded, then the result is uploaded, use method `remote`.
2945
+
2946
+
2947
+ # SMTP for email notifications
2948
+
2949
+ Aspera CLI can send email, for that setup SMTP configuration. This is done with option `smtp`.
2950
+
2951
+ The `smtp` option is a hash table (extended value) with the following fields:
2952
+ <table>
2953
+ <tr><th>field</th><th>default</th><th>example</th><th>description</th></tr>
2954
+ <tr><td>server</td><td>-</td><td>smtp.gmail.com</td><td>SMTP server address</td></tr>
2955
+ <tr><td>tls</td><td>true</td><td>false</td><td>use of TLS</td></tr>
2956
+ <tr><td>port</td><td>587 for tls<br/>25 else</td><td>587</td><td>port for service</td></tr>
2957
+ <tr><td>domain</td><td>domain of server</td><td>gmail.com</td><td>email domain of user</td></tr>
2958
+ <tr><td>username</td><td>-</td><td>john@example.com</td><td>user to authenticate on SMTP server, leave empty for open auth.</td></tr>
2959
+ <tr><td>password</td><td>-</td><td>MyP@ssword</td><td>password for above username</td></tr>
2960
+ <tr><td>from\_email</td><td>username if defined</td><td>laurent.martin.l@gmail.com</td><td>address used if received replies</td></tr>
2961
+ <tr><td>from\_name</td><td>same as email</td><td>John Wayne</td><td>display name of sender</td></tr>
2962
+ </table>
2963
+
2964
+ ## Example of configuration:
2965
+
2966
+ ```
2967
+ $ ascli config id smtp_google set server smtp.google.com
2968
+ $ ascli config id smtp_google set username john@gmail.com
2969
+ $ ascli config id smtp_google set password P@ssw0rd
2970
+ ```
2971
+
2972
+ or
2973
+
2974
+ ```
2975
+ $ ascli config id smtp_google init @json:'{"server":"smtp.google.com","username":"john@gmail.com","password":"P@ssw0rd"}'
2976
+ ```
2977
+
2978
+ or
2979
+
2980
+ ```
2981
+ $ ascli config id smtp_google update --server=smtp.google.com --username=john@gmail.com --password=P@ssw0rd
2982
+ ```
2983
+
2984
+ Set this configation as global default, for instance:
2985
+
2986
+ ```
2987
+ $ ascli config id cli_default set smtp @val:@preset:smtp_google
2988
+ $ ascli config id default set config cli_default
2989
+ ```
2990
+
2991
+ ## Test
2992
+
2993
+ Check settings with `smtp_settings` command. Send test email with `email_test`.
2994
+
2995
+ ```
2996
+ $ ascli config --smtp=@preset:smtp_google smtp
2997
+ $ ascli config --smtp=@preset:smtp_google email sample.dest@example.com
2998
+ ```
2999
+
3000
+ # Tool: `asession`
3001
+
3002
+ This gem comes with a second executable tool providing a simplified standardized interface
3003
+ to start a FASP session: `asession`.
3004
+
3005
+ It aims at simplifying the startup of a FASP session from a programmatic stand point as formating a [_transfer-spec_](#transferspec) is:
3006
+
3007
+ * common to Aspera Node API (HTTP POST /ops/transfer)
3008
+ * common to Aspera Connect API (browser javascript startTransfer)
3009
+ * easy to generate by using any third party language specific JSON library
3010
+
3011
+ Hopefully, IBM integrates this diectly in `ascp`, and this tool is made redundant.
3012
+
3013
+ This makes it easy to integrate with any language provided that one can spawn a sub process, write to its STDIN, read from STDOUT, generate and parse JSON.
3014
+
3015
+ The tool expect one single argument: a [_transfer-spec_](#transferspec).
3016
+
3017
+ If not argument is provided, it assumes a value of: `@json:@stdin:`, i.e. a JSON formated [_transfer-spec_](#transferspec) on stdin.
3018
+
3019
+ Note that if JSON is the format, one has to specify `@json:` to tell the tool to decode the hash using JSON.
3020
+
3021
+ During execution, it generates all low level events, one per line, in JSON format on stdout.
3022
+
3023
+ Note that there are special "extended" [_transfer-spec_](#transferspec) parameters supported by `asession`:
3024
+
3025
+ * `EX_loglevel` to change log level of the tool
3026
+ * `EX_file_list_folder` to set the folder used to store (exclusively, because of garbage collection) generated file lists. By default it is `[system tmp folder]/[username]_asession_filelists`
3027
+
3028
+ Note that in addition, many "EX_" [_transfer-spec_](#transferspec) parameters are supported for the "local" transfer agent (used by `asession`), refer to section [_transfer-spec_](#transferspec).
3029
+
3030
+ ## Comparison of interfaces
3031
+
3032
+ <table>
3033
+ <tr><th>feature/tool</th><th>asession</th><th>ascp</th><th>FaspManager</th><th>Transfer SDK</th></tr>
3034
+ <tr><td>language integration</td><td>any</td><td>any</td><td>C/C++<br/>C#/.net<br/>Go<br/>Python<br/>java<br/></td><td>any</td></tr>
3035
+ <tr><td>additional components to ascp</td><td>Ruby<br/>Aspera</td><td>-</td><td>library<br/>(headers)</td><td>daemon</td></tr>
3036
+ <tr><td>startup</td><td>JSON on stdin<br/>(standard APIs:<br/>JSON.generate<br/>Process.spawn)</td><td>command line arguments</td><td>API</td><td>daemon</td></tr>
3037
+ <tr><td>events</td><td>JSON on stdout</td><td>none by default<br/>or need to open management port<br/>and proprietary text syntax</td><td>callback</td><td>callback</td></tr>
3038
+ <tr><td>platforms</td><td>any with ruby and ascp</td><td>any with ascp</td><td>any with ascp</td><td>any with ascp and transferdaemon</td></tr></table>
3039
+
3040
+ ## Simple session
3041
+
3042
+ ```
3043
+ MY_TSPEC='{"remote_host":"demo.asperasoft.com","remote_user":"asperaweb","ssh_port":33001,"remote_password":"demoaspera","direction":"receive","destination_root":"./test.dir","paths":[{"source":"/aspera-test-dir-tiny/200KB.1"}],"resume_level":"none"}'
3044
+
3045
+ echo "${MY_TSPEC}"|asession
3046
+ ```
3047
+
3048
+ ## Asynchronous commands and Persistent session
3049
+
3050
+ `asession` also supports asynchronous commands (on the management port). Instead of the traditional text protocol as described in ascp manual, the format for commands is: one single line per command, formatted in JSON, where parameters shall be "snake" style, for example: `LongParameter` -&gt; `long_parameter`
3051
+
3052
+ This is particularly useful for a persistent session ( with the [_transfer-spec_](#transferspec) parameter: `"keepalive":true` )
3053
+
3054
+ ```
3055
+ $ asession
3056
+ {"remote_host":"demo.asperasoft.com","ssh_port":33001,"remote_user":"asperaweb","remote_password":"demoaspera","direction":"receive","destination_root":".","keepalive":true,"resume_level":"none"}
3057
+ {"type":"START","source":"/aspera-test-dir-tiny/200KB.2"}
3058
+ {"type":"DONE"}
3059
+ ```
3060
+
3061
+ (events from FASP are not shown in above example. They would appear after each command)
3062
+
3063
+ ## Example of language wrapper
3064
+
3065
+ Nodejs: [https://www.npmjs.com/package/aspera](https://www.npmjs.com/package/aspera)
3066
+
3067
+ ## Help
3068
+
3069
+ ```
3070
+ $ asession -h
3071
+ USAGE
3072
+ asession
3073
+ asession -h|--help
3074
+ asession <transfer spec extended value>
3075
+
3076
+ If no argument is provided, default will be used: @json:@stdin
3077
+ -h, --help display this message
3078
+ <transfer spec extended value> a JSON value for transfer_spec, using the prefix: @json:
3079
+ The value can be either:
3080
+ the JSON description itself, e.g. @json:'{"xx":"yy",...}'
3081
+ @json:@stdin, if the JSON is provided from stdin
3082
+ @json:@file:<path>, if the JSON is provided from a file
3083
+ Asynchronous commands can be provided on STDIN, examples:
3084
+ {"type":"START","source":"/aspera-test-dir-tiny/200KB.2"}
3085
+ {"type":"START","source":"xx","destination":"yy"}
3086
+ {"type":"DONE"}
3087
+ Note: debug information can be placed on STDERR, using the "EX_loglevel" parameter in transfer spec (debug=0)
3088
+ EXAMPLES
3089
+ asession @json:'{"remote_host":"demo.asperasoft.com","remote_user":"asperaweb","ssh_port":33001,"remote_password":"demoaspera","direction":"receive","destination_root":"./test.dir","paths":[{"source":"/aspera-test-dir-tiny/200KB.1"}]}'
3090
+ echo '{"remote_host":...}'|asession @json:@stdin
3091
+
3092
+ ```
3093
+
3094
+ # Hot folder
3095
+
3096
+ ## Requirements
3097
+
3098
+ `ascli` maybe used as a simple hot folder engine. A hot folder being defined as a tool that:
3099
+
3100
+ * locally (or remotely) detects new files in a top folder
3101
+ * send detected files to a remote (respectively, local) repository
3102
+ * only sends new files, do not re-send already sent files
3103
+ * optionally: sends only files that are not still "growing"
3104
+ * optionally: after transfer of files, deletes or moves to an archive
3105
+
3106
+ In addition: the detection should be made "continuously" or on specific time/date.
3107
+
3108
+ ## Setup procedure
3109
+
3110
+ The general idea is to rely on :
3111
+
3112
+ * existing `ascp` features for detection and transfer
3113
+ * take advantage of `ascli` configuration capabilities and server side knowledge
3114
+ * the OS scheduler for reliability and continuous operation
3115
+
3116
+ ### ascp features
3117
+
3118
+ Interesting ascp features are found in its arguments: (see ascp manual):
3119
+
3120
+ * `ascp` already takes care of sending only "new" files: option `-k 1,2,3`, or transfer_spec: `resume_policy`
3121
+ * `ascp` has some options to remove or move files after transfer: `--remove-after-transfer`, `--move-after-transfer`, `--remove-empty-directories`
3122
+ * `ascp` has an option to send only files not modified since the last X seconds: `--exclude-newer-than` (--exclude-older-than)
3123
+ * `--src-base` if top level folder name shall not be created on destination
3124
+
3125
+ Note that:
3126
+
3127
+ * `ascli` takes transfer parameters exclusively as a transfer_spec, with `--ts` parameter.
3128
+ * not all native ascp arguments are available as standard transfer_spec parameters
3129
+ * native ascp arguments can be provided with the [_transfer-spec_](#transferspec) parameter: EX_ascp_args (array), only for the "local" transfer agent (not connect or node)
3130
+
3131
+ ### server side and configuration
3132
+
3133
+ Virtually any transfer on a "repository" on a regular basis might emulate a hot folder. Note that file detection is not based on events (inotify, etc...), but on a stateless scan on source side.
3134
+
3135
+ Note: parameters may be saved in a [option preset](#lprt) and used with `-P`.
3136
+
3137
+ ### Scheduling
3138
+
3139
+ Once `ascli` parameters are defined, run the command using the OS native scheduler, e.g. every minutes, or 5 minutes, etc... Refer to section [_Scheduling_](#_scheduling_).
3140
+
3141
+ ## Example
3142
+
3143
+ ```
3144
+ $ ascli server upload source_hot --to-folder=/Upload/target_hot --lock-port=12345 --ts=@json:'{"EX_ascp_args":["--remove-after-transfer","--remove-empty-directories","--exclude-newer-than=-8","--src-base","source_hot"]}'
3145
+
3146
+ ```
3147
+
3148
+ The local (here, relative path: source_hot) is sent (upload) to basic fasp server, source files are deleted after transfer. growing files will be sent only once they dont grow anymore (based ona 8 second cooloff period). If a transfer takes more than the execution period, then the subsequent execution is skipped (lock-port).
3149
+
3150
+ # Module: `Aspera`
3151
+
3152
+ Main components:
3153
+
3154
+ * `Aspera` generic classes for REST and OAuth
3155
+ * `Aspera::Fasp`: starting and monitoring transfers. It can be considered as a FASPManager class for Ruby.
3156
+ * `Aspera::Cli`: `ascli`.
3157
+
3158
+ A working example can be found in the gem, example:
3159
+
3160
+ ```
3161
+ $ ascli config gem_path
3162
+ $ cat $(ascli config gem_path)/../examples/transfer.rb
3163
+ ```
3164
+
3165
+ This sample code shows some example of use of the API as well as
3166
+ REST API.
3167
+ Note: although nice, it's probably a good idea to use RestClient for REST.
3168
+
3169
+ # History
3170
+
3171
+ When I joined Aspera, there was only one CLI: `ascp`, which is the implementation of the FASP protocol, but there was no CLI to access the various existing products (Server, Faspex, Shares). Once, Serban (founder) provided a shell script able to create a Faspex Package using Faspex REST API. Since all products relate to file transfers using FASP (ascp), I thought it would be interesting to have a unified CLI for transfers using FASP. Also, because there was already the `ascp` tool, I thought of an extended tool : `eascp.pl` which was accepting all `ascp` options for transfer but was also able to transfer to Faspex and Shares (destination was a kind of URI for the applications).
3172
+
3173
+ There were a few pitfalls:
3174
+
3175
+ * The tool was written in the aging `perl` language while most Aspera application products (but the Transfer Server) are written in `ruby`.
3176
+ * The tool was only for transfers, but not able to call other products APIs
3177
+
3178
+ So, it evolved into `ascli`:
3179
+
3180
+ * portable: works on platforms supporting `ruby` (and `ascp`)
3181
+ * easy to install with the `gem` utility
3182
+ * supports transfers with multiple [Transfer Agents](#agents), that&apos;s why transfer parameters moved from ascp command line to [_transfer-spec_](#transferspec) (more reliable , more standard)
3183
+ * `ruby` is consistent with other Aspera products
3184
+
3185
+
3186
+
3187
+ # Release Notes
3188
+
3189
+ * 4.0.0.pre1
3190
+
3191
+ * now available as open source at [https://github.com/IBM/aspera-cli](https://github.com/IBM/aspera-cli) with general cleanup
3192
+ * changed default tool name from `mlia` to `ascli`
3193
+ * changed `aspera` command to `oncloud`
3194
+ * changed gem name from `asperalm` to `aspera-cli`
3195
+ * changed module name from `Asperalm` to `Aspera`
3196
+ * removed command `folder` in `preview`, merged to `scan`
3197
+ * persistency files go to sub folder instead of main folder
3198
+
3199
+ * 0.11.8
3200
+
3201
+ * Simplified to use `unoconv` instead of bare `libreoffice` for office conversion, as `unoconv` does not require a X server (previously using Xvfb
3202
+
3203
+ * 0.11.7
3204
+
3205
+ * rework on rest call error handling
3206
+ * use option `display` with value `data` to remove out of extraneous information
3207
+ * fixed option `lock_port` not working
3208
+ * generate special icon if preview failed
3209
+ * possibility to choose transfer progress bar type with option `progress`
3210
+ * AoC package creation now output package id
3211
+
3212
+ * 0.11.6
3213
+
3214
+ * orchestrator : added more choice in auth type
3215
+ * preview: cleanup in generator (removed and renamed parameters)
3216
+ * preview: better documentation
3217
+ * preview: animated thumbnails for video (option: `video_png_conv=animated`)
3218
+ * preview: new event trigger: `trevents` (`events` seems broken)
3219
+ * preview: unique tmp folder to avoid clash of multiple instances
3220
+ * repo: added template for secrets used for testing
3221
+
3222
+ * 0.11.5
3223
+
3224
+ * added option `default_ports` for AoC (see manual)
3225
+ * allow bulk delete in `aspera files` with option `bulk=yes`
3226
+ * fix getting connect versions
3227
+ * added section for Aix
3228
+ * support all ciphers for `local`ascp (incl. gcm, etc..)
3229
+ * added transfer spec param `apply_local_docroot` for `local`
3230
+
3231
+ * 0.11.4
3232
+
3233
+ * possibility to give shared inbox name when sending a package (else use id and type)
3234
+
3235
+ * 0.11.3
3236
+
3237
+ * minor fixes on multi-session: avoid exception on progress bar
3238
+
3239
+ * 0.11.2
3240
+
3241
+ * fixes on multi-session: progress bat and transfer spec param for "direct"
3242
+
3243
+ * 0.11.1
3244
+
3245
+ * enhanced short_link creation commands (see examples)
3246
+
3247
+ * 0.11
3248
+
3249
+ * add option to provide file list directly to ascp like this (only for direct transfer agent):
3250
+
3251
+ ```
3252
+ ... --sources=@ts --ts=@json:'{"paths":[],"EX_file_list":"filelist"}'
3253
+ ```
3254
+
3255
+ * 0.10.18
3256
+
3257
+ * new option in. `server` : `ssh_options`
3258
+
3259
+ * 0.10.17
3260
+
3261
+ * fixed problem on `server` for option `ssh_keys`, now accepts both single value and list.
3262
+ * new modifier: `@list:<saparator>val1<separator>...`
3263
+
3264
+ * 0.10.16
3265
+
3266
+ * added list of shared inboxes in workspace (or global), use `--query=@json:'{}'`
3267
+
3268
+ * 0.10.15
3269
+
3270
+ * in case of command line error, display the error cause first, and non-parsed argument second
3271
+ * AoC : Activity / Analytics
3272
+
3273
+ * 0.10.14
3274
+
3275
+ * added missing bss plugin
3276
+
3277
+ * 0.10.13
3278
+
3279
+ * added Faspex5 (use option `value` to give API arguments)
3280
+
3281
+ * 0.10.12
3282
+
3283
+ * added support for AoC node registration keys
3284
+ * replaced option : `local_resume` with `transfer_info` for agent `direct`
3285
+ * Transfer agent is no more a Singleton instance, but only one is used in CLI
3286
+ * `@incps` : new extended value modifier
3287
+ * ATS: no more provides access keys secrets: now user must provide it
3288
+ * begin work on "aoc" transfer agent
3289
+
3290
+ * 0.10.11
3291
+
3292
+ * minor refactor and fixes
3293
+
3294
+ * 0.10.10
3295
+
3296
+ * fix on documentation
3297
+
3298
+ * 0.10.9.1
3299
+
3300
+ * add total number of items for AoC resource list
3301
+ * better gem version dependency (and fixes to support Ruby 2.0.0)
3302
+ * removed aoc search_nodes
3303
+
3304
+ * 0.10.8
3305
+
3306
+ * removed option: `fasp_proxy`, use pseudo transfer spec parameter: `EX_fasp_proxy_url`
3307
+ * removed option: `http_proxy`, use pseudo transfer spec parameter: `EX_http_proxy_url`
3308
+ * several other changes..
3309
+
3310
+ * 0.10.7
3311
+
3312
+ * fix: ascli fails when username cannot be computed on Linux.
3313
+
3314
+ * 0.10.6
3315
+
3316
+ * FaspManager: transfer spec `authentication` no more needed for local tranfer to use aspera public keys. public keys will be used if there is a token and no key or password is provided.
3317
+ * gem version requirements made more open
3318
+
3319
+ * 0.10.5
3320
+
3321
+ * fix faspex package receive command not working
3322
+
3323
+ * 0.10.4
3324
+
3325
+ * new options for AoC : `secrets`
3326
+ * ACLI-533 temp file list folder to use file lists is set by default, and used by asession
3327
+
3328
+ * 0.10.3
3329
+
3330
+ * included user name in oauth bearer token cache for AoC when JWT is used.
3331
+
3332
+ * 0.10.2
3333
+
3334
+ * updated `search_nodes` to be more generic, so it can search not only on access key, but also other queries.
3335
+ * added doc for "cargo" like actions
3336
+ * added doc for multi-session
3337
+
3338
+ * 0.10.1
3339
+
3340
+ * AoC and node v4 "browse" works now on non-folder items: file, link
3341
+ * initial support for AoC automation (do not use yet)
3342
+
3343
+ * 0.10
3344
+
3345
+ * support for transfer using IBM Cloud Object Storage
3346
+ * improved `find` action using arbitrary expressions
3347
+
3348
+ * 0.9.36
3349
+
3350
+ * added option to specify file pair lists
3351
+
3352
+ * 0.9.35
3353
+
3354
+ * updated plugin `preview` , changed parameter names, added documentation
3355
+ * fix in `ats` plugin : instance id needed in request header
3356
+
3357
+ * 0.9.34
3358
+
3359
+ * parser "@preset" can be used again in option "transfer_info"
3360
+ * some documentation re-organizing
3361
+
3362
+ * 0.9.33
3363
+
3364
+ * new command to display basic token of node
3365
+ * new command to display bearer token of node in AoC
3366
+ * the --fields= option, support +_fieldname_ to add a field to default fields
3367
+ * many small changes
3368
+
3369
+ * 0.9.32
3370
+
3371
+ * all Faspex public links are now supported
3372
+ * removed faspex operation recv_publink
3373
+ * replaced with option `link` (consistent with AoC)
3374
+
3375
+ * 0.9.31
3376
+
3377
+ * added more support for public link: receive and send package, to user or dropbox and files view.
3378
+ * delete expired file lists
3379
+ * changed text table gem from text-table to terminal-table because it supports multiline values
3380
+
3381
+ * 0.9.27
3382
+
3383
+ * basic email support with SMTP
3384
+ * basic proxy auto config support
3385
+
3386
+ * 0.9.26
3387
+
3388
+ * table display with --fields=ALL now includes all column names from all lines, not only first one
3389
+ * unprocessed argument shows error even if there is an error beforehand
3390
+
3391
+ * 0.9.25
3392
+
3393
+ * the option `value` of command `find`, to filter on name, is not optional
3394
+ * `find` now also reports all types (file, folder, link)
3395
+ * `find` now is able to report all fields (type, size, etc...)
3396
+
3397
+ * 0.9.24
3398
+
3399
+ * fix bug where AoC node to node transfer did not work
3400
+ * fix bug on error if ED25519 private key is defined in .ssh
3401
+
3402
+ * 0.9.23
3403
+
3404
+ * defined REST error handlers, more error conditions detected
3405
+ * commands to select specific ascp location
3406
+
3407
+ * 0.9.21
3408
+
3409
+ * supports simplified wizard using global client
3410
+ * only ascp binary is required, other SDK (keys) files are now generated
3411
+
3412
+ * 0.9.20
3413
+
3414
+ * improved wizard (prepare for AoC global client id)
3415
+ * preview generator: addedoption : --skip-format=&lt;png,mp4&gt;
3416
+ * removed outdated pictures from this doc
3417
+
3418
+ * 0.9.19
3419
+
3420
+ * added command aspera bearer --scope=xx
3421
+
3422
+ * 0.9.18
3423
+
3424
+ * enhanced aspera admin events to support query
3425
+
3426
+ * 0.9.16
3427
+
3428
+ * AoC transfers are now reported in activity app
3429
+ * new interface for Rest class authentication (keep backward compatibility)
3430
+
3431
+ * 0.9.15
3432
+
3433
+ * new feature: "find" command in aspera files
3434
+ * sample code for transfer API
3435
+
3436
+ * 0.9.12
3437
+
3438
+ * add nagios commands
3439
+ * support of ATS for IBM Cloud, removed old version based on aspera id
3440
+
3441
+ * 0.9.11
3442
+
3443
+ * Breaking change: @stdin is now @stdin:
3444
+ * support of ATS for IBM Cloud, removed old version based on aspera id
3445
+
3446
+
3447
+ * 0.9.10
3448
+
3449
+ * Breaking change: parameter transfer-node becomes more generic: transfer-info
3450
+ * Display SaaS storage usage with command: aspera admin res node --id=nn info
3451
+ * cleaner way of specifying source file list for transfers
3452
+ * Breaking change: replaced download_mode option with http_download action
3453
+
3454
+ * 0.9.9
3455
+
3456
+ * Breaking change: "aspera package send" parameter deprecated, use the --value option instead with "recipients" value. See example.
3457
+ * Now supports "cargo" for Aspera on Cloud (automatic package download)
3458
+
3459
+ * 0.9.8
3460
+
3461
+ * Faspex: use option once_only set to yes to enable cargo like function. id=NEW deprecated.
3462
+ * AoC: share to share transfer with command "transfer"
3463
+
3464
+ * 0.9.7
3465
+
3466
+ * homogeneous [_transfer-spec_](#transferspec) for node and local
3467
+ * preview persistency goes to unique file by default
3468
+ * catch mxf extension in preview as video
3469
+ * Faspex: possibility to download all paclages by specifying id=ALL
3470
+ * Faspex: to come: cargo-like function to download only new packages with id=NEW
3471
+
3472
+ * 0.9.6
3473
+
3474
+ * Breaking change: `@param:`is now `@preset:` and is generic
3475
+ * AoC: added command to display current workspace information
3476
+
3477
+ * 0.9.5
3478
+
3479
+ * new parameter: new_user_option used to choose between public_link and invite of external users.
3480
+ * fixed bug in wizard, and wizard uses now product detection
3481
+
3482
+ * 0.9.4
3483
+
3484
+ * Breaking change: onCloud file list follow --source convention as well (plus specific case for download when first path is source folder, and other are source file names).
3485
+ * AoC Package send supports external users
3486
+ * new command to export AoC config to Aspera CLI config
3487
+
3488
+ * 0.9.3
3489
+
3490
+ * REST error message show host and code
3491
+ * option for quiet display
3492
+ * modified transfer interface and allow token re-generation on error
3493
+ * async add admin command
3494
+ * async add db parameters
3495
+ * Breaking change: new option "sources" to specify files to transfer
3496
+
3497
+ * 0.9.2
3498
+
3499
+ * Breaking change: changed AoC package creation to match API, see AoC section
3500
+
3501
+ * 0.9.1
3502
+
3503
+ * Breaking change: changed faspex package creation to match API, see Faspex section
3504
+
3505
+ * 0.9
3506
+
3507
+ * Renamed the CLI from aslmcli to `ascli`
3508
+ * Automatic rename and conversion of former config folder from aslmcli to `ascli`
3509
+
3510
+ * 0.7.6
3511
+
3512
+ * add "sync" plugin
3513
+
3514
+ * 0.7
3515
+
3516
+ * Breaking change: AoC package recv take option if for package instead of argument.
3517
+ * Breaking change: Rest class and Oauth class changed init parameters
3518
+ * AoC: receive package from public link
3519
+ * select by col value on output
3520
+ * added rename (AoC, node)
3521
+
3522
+ * 0.6.19
3523
+
3524
+ Breaking change:
3525
+
3526
+ * ats server list provisioned &rarr; ats cluster list
3527
+ * ats server list clouds &rarr; ats cluster clouds
3528
+ * ats server list instance --cloud=x --region=y &rarr; ats cluster show --cloud=x --region=y
3529
+ * ats server id xxx &rarr; ats cluster show --id=xxx
3530
+ * ats subscriptions &rarr; ats credential subscriptions
3531
+ * ats api_key repository list &rarr; ats credential cache list
3532
+ * ats api_key list &rarr; ats credential list
3533
+ * ats access_key id xxx &rarr; ats access_key --id=xxx
3534
+
3535
+ * 0.6.18
3536
+
3537
+ * some commands take now --id option instead of id command.
3538
+
3539
+ * 0.6.15
3540
+
3541
+ * Breaking change: "files" application renamed to "aspera" (for "Aspera on Cloud"). "repository" renamed to "files". Default is automatically reset, e.g. in config files and change key "files" to "aspera" in [option preset](#lprt) "default".
3542
+
3543
+ # BUGS
3544
+
3545
+ * This is best effort code without official support, dont expect full capabilities. This code is not supported by IBM/Aspera. You can contact the author for bugs or features.
3546
+
3547
+ ## only one value for any option
3548
+
3549
+ Some commands and sub commands may ask for the same option name.
3550
+ Currently, since option definition is position independant (last one wins), it is not possible
3551
+ to give an option to a command and the same option with different value to a sub command.
3552
+
3553
+ For instance, if an entity is identified by the option `id` but later on the command line another `id` option is required, the later will override the earlier one, and both entity will use the same id.
3554
+ As a workaround use another option, if available, to identify the entity.
3555
+
3556
+ This happens typically for the `node` sub command, e.g. identify the node by name instead of id.
3557
+
3558
+
3559
+ ## ED255519 key not supported
3560
+
3561
+ ED255519 keys are deactivated since version 0.9.24 so this type of key will just be ignored.
3562
+ Without this deactivation, if such key was present the following error was generated:
3563
+
3564
+ ```
3565
+ OpenSSH keys only supported if ED25519 is available
3566
+ ```
3567
+
3568
+ Which meant that you do not have ruby support for ED25519 SSH keys.
3569
+ You may either install the suggested Gems, or remove your ed25519 key from your `.ssh` folder to solve the issue.
3570
+
3571
+ # TODO
3572
+
3573
+ * remove rest and oauth classes and use ruby standard gems:
3574
+
3575
+ * oauth
3576
+ * https://github.com/rest-client/rest-client
3577
+
3578
+ * use Thor or any standard Ruby CLI manager
3579
+
3580
+ * provide metadata in packages
3581
+
3582
+ * deliveries to dropboxes
3583
+
3584
+ * Going through proxy: use env var http_proxy and https_proxy, no_proxy
3585
+
3586
+ * easier use with https://github.com/pmq20/ruby-packer
3587
+
3588
+ # Contribution
3589
+
3590
+ Send comments !
3591
+
3592
+ Create your own plugin !