aspera-cli 4.4.0 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2095 -1503
  3. data/bin/ascli +2 -1
  4. data/bin/asession +4 -5
  5. data/docs/test_env.conf +3 -0
  6. data/examples/aoc.rb +4 -3
  7. data/examples/faspex4.rb +25 -25
  8. data/examples/proxy.pac +1 -1
  9. data/examples/transfer.rb +17 -17
  10. data/lib/aspera/aoc.rb +238 -185
  11. data/lib/aspera/ascmd.rb +93 -83
  12. data/lib/aspera/ats_api.rb +11 -10
  13. data/lib/aspera/cli/basic_auth_plugin.rb +13 -14
  14. data/lib/aspera/cli/extended_value.rb +42 -33
  15. data/lib/aspera/cli/formater.rb +142 -108
  16. data/lib/aspera/cli/info.rb +17 -0
  17. data/lib/aspera/cli/listener/line_dump.rb +3 -2
  18. data/lib/aspera/cli/listener/logger.rb +2 -1
  19. data/lib/aspera/cli/listener/progress.rb +16 -18
  20. data/lib/aspera/cli/listener/progress_multi.rb +18 -21
  21. data/lib/aspera/cli/main.rb +173 -149
  22. data/lib/aspera/cli/manager.rb +163 -168
  23. data/lib/aspera/cli/plugin.rb +43 -31
  24. data/lib/aspera/cli/plugins/alee.rb +6 -6
  25. data/lib/aspera/cli/plugins/aoc.rb +405 -370
  26. data/lib/aspera/cli/plugins/ats.rb +86 -79
  27. data/lib/aspera/cli/plugins/bss.rb +14 -16
  28. data/lib/aspera/cli/plugins/config.rb +580 -362
  29. data/lib/aspera/cli/plugins/console.rb +23 -19
  30. data/lib/aspera/cli/plugins/cos.rb +18 -18
  31. data/lib/aspera/cli/plugins/faspex.rb +201 -158
  32. data/lib/aspera/cli/plugins/faspex5.rb +80 -57
  33. data/lib/aspera/cli/plugins/node.rb +183 -166
  34. data/lib/aspera/cli/plugins/orchestrator.rb +71 -67
  35. data/lib/aspera/cli/plugins/preview.rb +92 -96
  36. data/lib/aspera/cli/plugins/server.rb +79 -75
  37. data/lib/aspera/cli/plugins/shares.rb +35 -19
  38. data/lib/aspera/cli/plugins/sync.rb +20 -22
  39. data/lib/aspera/cli/transfer_agent.rb +76 -113
  40. data/lib/aspera/cli/version.rb +2 -1
  41. data/lib/aspera/colors.rb +35 -27
  42. data/lib/aspera/command_line_builder.rb +48 -34
  43. data/lib/aspera/cos_node.rb +29 -21
  44. data/lib/aspera/data_repository.rb +3 -2
  45. data/lib/aspera/environment.rb +50 -45
  46. data/lib/aspera/fasp/{manager.rb → agent_base.rb} +28 -25
  47. data/lib/aspera/fasp/{connect.rb → agent_connect.rb} +52 -43
  48. data/lib/aspera/fasp/{local.rb → agent_direct.rb} +58 -72
  49. data/lib/aspera/fasp/{http_gw.rb → agent_httpgw.rb} +37 -43
  50. data/lib/aspera/fasp/{node.rb → agent_node.rb} +35 -16
  51. data/lib/aspera/fasp/agent_trsdk.rb +104 -0
  52. data/lib/aspera/fasp/error.rb +2 -1
  53. data/lib/aspera/fasp/error_info.rb +68 -52
  54. data/lib/aspera/fasp/installation.rb +152 -124
  55. data/lib/aspera/fasp/listener.rb +1 -0
  56. data/lib/aspera/fasp/parameters.rb +87 -92
  57. data/lib/aspera/fasp/parameters.yaml +305 -249
  58. data/lib/aspera/fasp/resume_policy.rb +11 -14
  59. data/lib/aspera/fasp/transfer_spec.rb +26 -0
  60. data/lib/aspera/fasp/uri.rb +22 -21
  61. data/lib/aspera/faspex_gw.rb +55 -89
  62. data/lib/aspera/hash_ext.rb +4 -3
  63. data/lib/aspera/id_generator.rb +8 -7
  64. data/lib/aspera/keychain/encrypted_hash.rb +121 -0
  65. data/lib/aspera/keychain/macos_security.rb +90 -0
  66. data/lib/aspera/log.rb +55 -37
  67. data/lib/aspera/nagios.rb +13 -12
  68. data/lib/aspera/node.rb +30 -25
  69. data/lib/aspera/oauth.rb +175 -226
  70. data/lib/aspera/open_application.rb +4 -3
  71. data/lib/aspera/persistency_action_once.rb +6 -6
  72. data/lib/aspera/persistency_folder.rb +5 -9
  73. data/lib/aspera/preview/file_types.rb +6 -5
  74. data/lib/aspera/preview/generator.rb +25 -24
  75. data/lib/aspera/preview/options.rb +16 -14
  76. data/lib/aspera/preview/utils.rb +98 -98
  77. data/lib/aspera/{proxy_auto_config.erb.js → proxy_auto_config.js} +23 -31
  78. data/lib/aspera/proxy_auto_config.rb +111 -20
  79. data/lib/aspera/rest.rb +154 -135
  80. data/lib/aspera/rest_call_error.rb +2 -2
  81. data/lib/aspera/rest_error_analyzer.rb +23 -25
  82. data/lib/aspera/rest_errors_aspera.rb +15 -14
  83. data/lib/aspera/ssh.rb +12 -10
  84. data/lib/aspera/sync.rb +42 -41
  85. data/lib/aspera/temp_file_manager.rb +18 -14
  86. data/lib/aspera/timer_limiter.rb +2 -1
  87. data/lib/aspera/uri_reader.rb +7 -5
  88. data/lib/aspera/web_auth.rb +79 -76
  89. metadata +116 -29
  90. data/docs/Makefile +0 -66
  91. data/docs/README.erb.md +0 -3973
  92. data/docs/README.md +0 -13
  93. data/docs/diagrams.txt +0 -49
  94. data/docs/doc_tools.rb +0 -58
  95. data/lib/aspera/api_detector.rb +0 -60
  96. data/lib/aspera/cli/plugins/shares2.rb +0 -114
  97. data/lib/aspera/secrets.rb +0 -20
data/docs/README.erb.md DELETED
@@ -1,3973 +0,0 @@
1
- [comment1]: # (Do not edit this README.md, edit docs/README.erb.md, for details, read docs/README.md)
2
- <%load File.join(File.dirname(__FILE__),'doc_tools.rb')-%>
3
- <font size="+12"><center><%=tool%> : Command Line Interface for IBM Aspera products</center></font>
4
-
5
- Version : <%=gemspec.version.to_s%>
6
-
7
- _Laurent/2016-<%=Time.new.year%>_
8
-
9
- This gem provides the <%=tool%> Command Line Interface to IBM Aspera software.
10
-
11
- <%=tool%> is a also great tool to learn Aspera APIs.
12
-
13
- Ruby Gem: [<%=gemspec.metadata['rubygems_uri']%>](<%=gemspec.metadata['rubygems_uri']%>)
14
-
15
- Ruby Doc: [<%=gemspec.metadata['documentation_uri']%>](<%=gemspec.metadata['documentation_uri']%>)
16
-
17
- Required Ruby version: <%=gemspec.required_ruby_version%>
18
-
19
- # <a name="when_to_use"></a>When to use and when not to use
20
-
21
- <%=tool%> is designed to be used as a command line tool to:
22
-
23
- * execute commands on Aspera products
24
- * transfer to/from Aspera products
25
-
26
- So it is designed for:
27
-
28
- * Interactive operations on a text terminal (typically, VT100 compatible)
29
- * Batch operations in (shell) scripts (e.g. cron job)
30
-
31
- <%=tool%> can be seen as a command line tool integrating:
32
-
33
- * a configuration file (config.yaml)
34
- * advanced command line options
35
- * cURL (for REST calls)
36
- * Aspera transfer (ascp)
37
-
38
- One might be tempted to use it as an integration element, e.g. by building a command line programmatically, and then executing it. It is generally not a good idea.
39
- For such integration cases, e.g. performing operations and transfer to aspera products, it is preferred to use [Aspera APIs](https://ibm.biz/aspera_api):
40
-
41
- * Product APIs (REST) : e.g. AoC, Faspex, node
42
- * Transfer SDK : with gRPC interface and laguage stubs (C, C++, Python, .NET/C#, java, ruby, etc...)
43
-
44
- Using APIs (application REST API and transfer SDK) will prove to be easier to develop and maintain.
45
-
46
- For scripting and ad'hoc command line operations, <%=tool%> is perfect.
47
-
48
- # Notations
49
-
50
- In examples, command line operations (starting with `$`) are shown using a standard shell: `bash` or `zsh`.
51
- Prompt `# ` refers to user `root`, prompt `xfer$ ` refer to user `xfer`.
52
-
53
- Command line parameters in examples beginning with `my_`, like `my_param_value` are user-provided value and not fixed value commands.
54
-
55
- # <a name="parsing"></a>Shell and Command line parsing
56
-
57
- <%=tool%> is typically executed in a shell, either interactively or in a script. <%=tool%> receives its arguments from this shell.
58
-
59
- On Linux and Unix environments, this is typically a POSIX shell (bash, zsh, ksh, sh). In this environment shell command line parsing applies before <%=tool%> (Ruby) is executed, e.g. [bash shell operation](https://www.gnu.org/software/bash/manual/bash.html#Shell-Operation). Ruby receives a list parameters and gives it to <%=tool%>. So special character handling (quotes, spaces, env vars, ...) is done in the shell.
60
-
61
- On Windows, `cmd.exe` is typically used. Windows process creation does not receive the list of arguments but just the whole line. It's up to the program to parse arguments. Ruby follows the Microsoft C/C++ parameter parsing rules.
62
-
63
- * [Windows: How Command Line Parameters Are Parsed](https://daviddeley.com/autohotkey/parameters/parameters.htm#RUBY)
64
- * [Understand Quoting and Escaping of Windows Command Line Arguments](http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/)
65
-
66
- In case of doubt of argument values after parsing test like this:
67
-
68
- ```
69
- $ <%=cmd%> conf echo "Hello World" arg2 3
70
- "Hello World"
71
- ERROR: Argument: unprocessed values: ["arg2", "3"]
72
- ```
73
-
74
- `echo` displays the value of the first argument using ruby syntax (strings get double quotes) after command line parsing (shell) and extended value parsing (ascli), next command line arguments are shown in the error message.
75
-
76
- # Quick Start
77
-
78
- This section guides you from installation, first use and advanced use.
79
-
80
- First, follow the section: [Installation](#installation) (Ruby, Gem, FASP) to start using <%=tool%>.
81
-
82
- Once the gem is installed, <%=tool%> shall be accessible:
83
-
84
- ```
85
- $ <%=cmd%> --version
86
- <%=gemspec.version.to_s%>
87
- ```
88
-
89
- ## First use
90
-
91
- Once installation is completed, you can proceed to the first use with a demo server:
92
-
93
- If you want to test with Aspera on Cloud, jump to section: [Wizard](#aocwizard)
94
-
95
- To test with Aspera demo transfer server, setup the environment and then test:
96
-
97
- ```
98
- $ <%=cmd%> config initdemo
99
- $ <%=cmd%> server browse /
100
- :............:...........:......:........:...........................:.......................:
101
- : zmode : zuid : zgid : size : mtime : name :
102
- :............:...........:......:........:...........................:.......................:
103
- : dr-xr-xr-x : asperaweb : fasp : 4096 : 2014-04-10 19:44:05 +0200 : aspera-test-dir-tiny :
104
- : drwxr-xr-x : asperaweb : fasp : 176128 : 2018-03-15 12:20:10 +0100 : Upload :
105
- : dr-xr-xr-x : asperaweb : fasp : 4096 : 2015-04-01 00:37:22 +0200 : aspera-test-dir-small :
106
- : dr-xr-xr-x : asperaweb : fasp : 4096 : 2018-05-04 14:26:55 +0200 : aspera-test-dir-large :
107
- :............:...........:......:........:...........................:.......................:
108
- ```
109
-
110
- If you want to use <%=tool%> with another server, and in order to make further calls more convenient, it is advised to define a <%=prst%> for the server's authentication options. The following example will:
111
-
112
- * create a <%=prst%>
113
- * define it as default for `server` plugin
114
- * list files in a folder
115
- * download a file
116
-
117
- ```
118
- $ <%=cmd%> config id myserver update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_
119
- updated: myserver
120
- $ <%=cmd%> config id default set server myserver
121
- updated: default&rarr;server to myserver
122
- $ <%=cmd%> server browse /aspera-test-dir-large
123
- :............:...........:......:..............:...........................:............................:
124
- : zmode : zuid : zgid : size : mtime : name :
125
- :............:...........:......:..............:...........................:............................:
126
- : -rw-rw-rw- : asperaweb : fasp : 10133504 : 2018-05-04 14:16:24 +0200 : ctl_female_2.fastq.partial :
127
- : -rw-r--r-- : asperaweb : fasp : 209715200 : 2014-04-10 19:49:27 +0200 : 200MB :
128
- : -rw-r--r-- : asperaweb : fasp : 524288000 : 2014-04-10 19:44:15 +0200 : 500MB :
129
- : -rw-r--r-- : asperaweb : fasp : 5368709120 : 2014-04-10 19:45:52 +0200 : 5GB :
130
- : -rw-r--r-- : asperaweb : fasp : 500000000000 : 2017-06-14 20:09:57 +0200 : 500GB :
131
- : -rw-rw-rw- : asperaweb : fasp : 13606912 : 2018-05-04 14:20:21 +0200 : ctl_male_2.fastq.partial :
132
- : -rw-rw-rw- : asperaweb : fasp : 76 : 2018-05-04 14:13:18 +0200 : ctl_female_2.fastq.haspx :
133
- : -rw-rw-rw- : asperaweb : fasp : 647348 : 2018-05-04 14:26:39 +0200 : ctl_female_2.gz :
134
- : -rw-rw-rw- : asperaweb : fasp : 74 : 2018-05-04 14:16:00 +0200 : ctl_male_2.fastq.haspx :
135
- : -rw-r--r-- : asperaweb : fasp : 1048576000 : 2014-04-10 19:49:23 +0200 : 1GB :
136
- : -rw-r--r-- : asperaweb : fasp : 104857600 : 2014-04-10 19:49:29 +0200 : 100MB :
137
- : -rw-r--r-- : asperaweb : fasp : 10737418240 : 2014-04-10 19:49:04 +0200 : 10GB :
138
- :............:...........:......:..............:...........................:............................:
139
- $ <%=cmd%> server download /aspera-test-dir-large/200MB
140
- Time: 00:00:02 ========================================================================================================== 100% 100 Mbps Time: 00:00:00
141
- complete
142
- ```
143
-
144
- ## Going further
145
-
146
- Get familiar with configuration, options, commands : [Command Line Interface](#cli).
147
-
148
- Then, follow the section relative to the product you want to interact with ( Aspera on Cloud, Faspex, ...) : [Application Plugins](plugins)
149
-
150
- # <a name="installation"></a>Installation
151
-
152
- It is possible to install *either* directly on the host operating system (Linux, Windows, Macos) or as a docker container.
153
-
154
- The direct installation is recommended and consists in installing:
155
-
156
- * [Ruby](#ruby) version <%=gemspec.required_ruby_version%>
157
- * [<%=gemspec.name%>](#the_gem)
158
- * [Aspera SDK (ascp)](#fasp_prot)
159
-
160
- The following sections provide information on the various installation methods.
161
-
162
- An internet connection is required for the installation. If you dont have internet for the installation, refer to section [Installation without internet access](#offline_install).
163
-
164
- ## Docker container
165
-
166
- Use this method only if you know what you do, else use the standard recommended method as described here above.
167
-
168
- This method installs a docker image that contains: Ruby, ascli and the FASP sdk.
169
-
170
- The image is: [https://hub.docker.com/r/martinlaurent/ascli](https://hub.docker.com/r/martinlaurent/ascli)
171
-
172
- Ensure that you have Docker installed.
173
-
174
- ```
175
- $ docker --version
176
- ```
177
-
178
- Download the wrapping script:
179
-
180
- ```
181
- $ curl -o <%=cmd%> https://raw.githubusercontent.com/IBM/aspera-cli/develop/bin/dascli
182
- $ chmod a+x <%=cmd%>
183
- ```
184
-
185
- Install the container image:
186
-
187
- ```
188
- $ ./<%=cmd%> install
189
- ```
190
-
191
- Start using it !
192
-
193
- Note that the tool is run in the container, so transfers are also executed in the container, not calling host.
194
-
195
- The wrapping script maps the container folder `/usr/src/app/config` to configuration folder `$HOME/.aspera/<%=cmd%>` on host.
196
-
197
- To transfer to/from the native host, you will need to map a volume in docker or use the config folder (already mapped).
198
- To add local storage as a volume edit the script: ascli and add a `--volume` stanza.
199
-
200
- ## <a name="ruby"></a>Ruby
201
-
202
- Use this method to install on the native host.
203
-
204
- A ruby interpreter is required to run the tool or to use the gem and tool.
205
-
206
- Required Ruby version: <%=gemspec.required_ruby_version%>. Ruby version 3 is also supported.
207
-
208
- *Ruby can be installed using any method* : rpm, yum, dnf, rvm, brew, windows installer, ... .
209
-
210
- Refer to the following sections for a proposed method for specific operating systems.
211
-
212
- The recommended installation method is `rvm` for systems with "bash-like" shell (Linux, Macos, Windows with cygwin, etc...).
213
- If the generic install is not suitable (e.g. Windows, no cygwin), you can use one of OS-specific install method.
214
- If you have a simpler better way to install Ruby version <%=gemspec.required_ruby_version%> : use it !
215
-
216
- ### Generic: RVM: single user installation (not root)
217
-
218
- Use this method which provides more flexibility.
219
-
220
- Install "rvm": follow [https://rvm.io/](https://rvm.io/) :
221
-
222
- Install the 2 keys
223
-
224
- ```
225
- $ gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
226
- ```
227
-
228
- Execute the shell/curl command. As regular user, it install in the user's home: `~/.rvm` .
229
-
230
- ```
231
- $ \curl -sSL https://get.rvm.io | bash -s stable
232
- ```
233
-
234
- If you keep the same terminal (ont needed if re-login):
235
-
236
- ```
237
- $ source ~/.rvm/scripts/rvm
238
- ```
239
-
240
- It is advised to get one of the pre-compiled ruby version, you can list with:
241
-
242
- ```
243
- $ rvm list --remote
244
- ```
245
-
246
- Install the chosen pre-compiled Ruby version:
247
-
248
- ```
249
- $ rvm install 2.7.2 --binary
250
- ```
251
-
252
- Ruby is now installed for the user, go on to Gem installation.
253
-
254
- ### Generic: RVM: global installation (as root)
255
-
256
- Follow the same method as single user install, but execute as "root".
257
-
258
- As root, it installs by default in /usr/local/rvm for all users and creates `/etc/profile.d/rvm.sh`.
259
- One can install in another location with :
260
-
261
- ```
262
- # curl -sSL https://get.rvm.io | bash -s -- --path /usr/local
263
- ```
264
-
265
- As root, make sure this will not collide with other application using Ruby (e.g. Faspex).
266
- If so, one can rename the login script: `mv /etc/profile.d/rvm.sh /etc/profile.d/rvm.sh.ok`.
267
- To activate ruby (and <%=cmd%>) later, source it:
268
-
269
- ```
270
- # source /etc/profile.d/rvm.sh.ok
271
- # rvm version
272
- ```
273
-
274
- ### Windows: Installer
275
-
276
- Install Latest stable Ruby using [https://rubyinstaller.org/](https://rubyinstaller.org/) :
277
-
278
- * Go to "Downloads".
279
- * Select the Ruby 2 version "without devkit", x64 corresponding to the one recommended "with devkit". Devkit is not needed.
280
- * At the end of the installer uncheck the box to skip the installation of "MSys2": not needed.
281
-
282
- ### macOS: pre-installed or `brew`
283
-
284
- MacOS 10.13+ (High Sierra) comes with a recent Ruby. So you can use it directly. You will need to install <%=gemspec.name%> using `sudo` :
285
-
286
- ```
287
- $ sudo gem install <%=gemspec.name%><%=geminstadd%>
288
- ```
289
-
290
- Alternatively, if you use [Homebrew](https://brew.sh/) already you can install Ruby with it:
291
-
292
- ```
293
- $ brew install ruby
294
- ```
295
-
296
- ### Linux: package
297
-
298
- If your Linux distribution provides a standard ruby package, you can use it provided that the version is compatible (check at beginning of section).
299
-
300
- Example:
301
-
302
- ```
303
- # yum install -y ruby rubygems ruby-json
304
- ```
305
-
306
- One can cleanup the whole yum-installed ruby environment like this to uninstall:
307
-
308
- ```
309
- gem uninstall $(ls $(gem env gemdir)/gems/|sed -e 's/-[^-]*$//'|sort -u)
310
- yum remove -y ruby ruby-libs
311
- ```
312
-
313
- ### Other Unixes: Aix, etc...
314
-
315
- If your unix do not provide a pre-built ruby, you can get it using one of those
316
- [methods](https://www.ruby-lang.org/en/documentation/installation/)
317
-
318
- For instance to build from source, and install in `/opt/ruby` :
319
-
320
- ```
321
- # wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
322
- # gzip -d ruby-2.7.2.tar.gz
323
- # tar xvf ruby-2.7.2.tar
324
- # cd ruby-2.7.2
325
- # ./configure --prefix=/opt/ruby
326
- # make ruby.imp
327
- # make
328
- # make install
329
- ```
330
-
331
- ### <a name="offline_install"></a>Installation without internet access
332
-
333
- Note that currently no pre-packaged version exist yet.
334
- A method to build one provided here:
335
-
336
- On a server with the same OS version and with internet access follow the "Generic single user installation" method.
337
-
338
- Then create an archive:
339
-
340
- ```
341
- $ cd
342
- $ tar zcvf rvm-<%=cmd%>.tgz .rvm
343
- ```
344
-
345
- Get the Aspera SDK. Execute:
346
-
347
- ```
348
- $ <%=cmd%> conf --show-config|grep sdk_url
349
- ```
350
-
351
- Then download the SDK archive from that URL.
352
-
353
- Another method for the SDK is to install the SDK (`<%=cmd%> conf ascp install`) on the first system, and archive `$HOME/.aspera`.
354
-
355
- Transfer those 2 archives to the target system without internet access.
356
-
357
- On the target system:
358
-
359
- * Extract the RVM archive either in a global location, or in a user's home folder : `path_to_rvm_root`
360
- * in the user's `.profile` add this line: (replace `path_to_rvm_root` with the actual location)
361
-
362
- ```
363
- source path_to_rvm_root/scripts/rvm
364
- rvm use 2.7.2
365
- ```
366
-
367
- For the SDK, either install from archive:
368
-
369
- ```
370
- $ <%=cmd%> conf ascp install --sdk-url=file:///SDK.zip
371
- ```
372
-
373
- or restore the `$HOME/.aspera` folder for the user.
374
-
375
- ## <a name="the_gem"></a>`<%=gemspec.name%>` gem
376
-
377
- Once you have Ruby and rights to install gems: Install the gem and its dependencies:
378
-
379
- ```
380
- # gem install <%=gemspec.name%><%=geminstadd%>
381
- ```
382
-
383
- To upgrade to the latest version:
384
-
385
- ```
386
- # gem update <%=gemspec.name%>
387
- ```
388
-
389
- <%=tool%> checks every week if a new version is available and notify the user in a WARN log. To de-activate this feature set the option `version_check_days` to `0`, or specify a different period in days.
390
-
391
- To check manually:
392
-
393
- ```
394
- # <%=cmd%> conf check_update
395
- ```
396
-
397
-
398
-
399
- ## <a name="fasp_prot"></a>FASP Protocol
400
-
401
- Most file transfers will be done using the FASP protocol, using `ascp`.
402
- Only two additional files are required to perform an Aspera Transfer, which are part of Aspera SDK:
403
-
404
- * ascp
405
- * aspera-license (in same folder, or ../etc)
406
-
407
- This can be installed either be installing an Aspera transfer sofware, or using an embedded command:
408
-
409
- ```
410
- $ <%=cmd%> conf ascp install
411
- ```
412
-
413
- If a local SDK installation is prefered instead of fetching from internet: one can specify the location of the SDK file:
414
-
415
- ```
416
- $ curl -Lso SDK.zip https://ibm.biz/aspera_sdk
417
- $ <%=cmd%> conf ascp install --sdk-url=file:///SDK.zip
418
- ```
419
-
420
- The format is: `file:///<path>`, where `<path>` can be either a relative path (not starting with `/`), or an absolute path.
421
-
422
- If the embedded method is not used, the following packages are also suitable:
423
-
424
- * IBM Aspera Connect Client (Free)
425
- * IBM Aspera Desktop Client (Free)
426
- * IBM Aspera CLI (Free)
427
- * IBM Aspera High Speed Transfer Server (Licensed)
428
- * IBM Aspera High Speed Transfer EndPoint (Licensed)
429
-
430
- For instance, Aspera Connect Client can be installed
431
- by visiting the page: [https://www.ibm.com/aspera/connect/](https://www.ibm.com/aspera/connect/).
432
-
433
- <%=tool%> will detect most of Aspera transfer products in standard locations and use the first one found.
434
- Refer to section [FASP](#client) for details on how to select a client or set path to the FASP protocol.
435
-
436
- Several methods are provided to start a transfer.
437
- Use of a local client ([`direct`](#direct) transfer agent) is one of them, but other methods are available. Refer to section: [Transfer Agents](#agents)
438
-
439
- ## <a name="offline_install"></a>Offline Installation (without internet)
440
-
441
- The procedure consists in:
442
-
443
- * Follow the non-root installation procedure with RVM, including gem
444
- * archive (zip, tar) the main RVM folder (includes <%=cmd%>):
445
-
446
- ```
447
- $ cd ~
448
- $ tar zcvf rvm_<%=cmd%>.tgz .rvm
449
- ```
450
-
451
- * retrieve the SDK:
452
-
453
- ```
454
- $ curl -Lso SDK.zip https://ibm.biz/aspera_sdk
455
- ```
456
-
457
- * on the system without internet access:
458
-
459
- ```
460
- $ cd ~
461
- $ tar zxvf rvm_<%=cmd%>.tgz
462
- $ source ~/.rvm/scripts/rvm
463
- $ <%=cmd%> conf ascp install --sdk-url=file:///SDK.zip
464
- ```
465
-
466
- # <a name="cli"></a>Command Line Interface: <%=tool%>
467
-
468
- The `<%=gemspec.name%>` Gem provides a command line interface (CLI) which interacts with Aspera Products (mostly using REST APIs):
469
-
470
- * IBM Aspera High Speed Transfer Server (FASP and Node)
471
- * IBM Aspera on Cloud (including ATS)
472
- * IBM Aspera Faspex
473
- * IBM Aspera Shares
474
- * IBM Aspera Console
475
- * IBM Aspera Orchestrator
476
- * and more...
477
-
478
- <%=tool%> provides the following features:
479
-
480
- * Supports most Aspera server products (on-premise and SaaS)
481
- * Any command line options (products URL, credentials or any option) can be provided on command line, in configuration file, in env var, in files
482
- * Supports Commands, Option values and Parameters shortcuts
483
- * FASP [Transfer Agents](#agents) can be: local ascp, or Connect Client, or any transfer node
484
- * Transfer parameters can be altered by modification of _transfer-spec_, this includes requiring multi-session
485
- * Allows transfers from products to products, essentially at node level (using the node transfer agent)
486
- * Supports FaspStream creation (using Node API)
487
- * Supports Watchfolder creation (using Node API)
488
- * Additional command plugins can be written by the user
489
- * Supports download of faspex and Aspera on Cloud "external" links
490
- * Supports "legacy" ssh based FASP transfers and remote commands (ascmd)
491
-
492
- Basic usage is displayed by executing:
493
-
494
- ```
495
- $ <%=cmd%> -h
496
- ```
497
-
498
- Refer to sections: [Usage](#usage) and [Sample Commands](#commands).
499
-
500
- Not all <%=tool%> features are fully documented here, the user may explore commands on the command line.
501
-
502
- ## Arguments : Commands and options
503
-
504
- Arguments are the units of command line, as parsed by the shell, typically separated by spaces (and called "argv").
505
-
506
- There are two types of arguments: Commands and Options. Example :
507
-
508
- ```
509
- $ <%=cmd%> command --option-name=VAL1 VAL2
510
- ```
511
-
512
- * executes _command_: `command`
513
- * with one _option_: `option_name`
514
- * this option has a _value_ of: `VAL1`
515
- * the command has one additional _argument_: `VAL2`
516
-
517
- 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 `<%=cmd%> conf ov` is the same as `<%=cmd%> config overview`.
518
-
519
- The value of options and arguments is evaluated with the [Extended Value Syntax](#extended).
520
-
521
- ### Options
522
-
523
- All options, e.g. `--log-level=debug`, are command line arguments that:
524
-
525
- * start with `--`
526
- * have a name, in lowercase, using `-` as word separator in name (e.g. `--log-level=debug`)
527
- * have a value, separated from name with a `=`
528
- * can be used by prefix, provided that it is unique. E.g. `--log-l=debug` is the same as `--log-level=debug`
529
-
530
- Exceptions:
531
-
532
- * some options accept a short form, e.g. `-Ptoto` is equivalent to `--preset=toto`, refer to the manual or `-h`.
533
- * some options (flags) don't take a value, e.g. `-r`
534
- * the special option `--` stops option processing and is ignored, following command line arguments are taken as arguments, including the ones starting with a `-`. Example:
535
-
536
- ```
537
- $ <%=cmd%> config echo -- --sample
538
- "--sample"
539
- ```
540
-
541
- Note that `--sample` is taken as an argument, and not option.
542
-
543
- Options can be optional or mandatory, with or without (hardcoded) default value. Options can be placed anywhere on comand line and evaluated in order.
544
-
545
- The value for _any_ options can come from the following locations (in this order, last value evaluated overrides previous value):
546
-
547
- * [Configuration file](#configfile).
548
- * Environment variable
549
- * Command line
550
-
551
- Environment variable starting with prefix: <%=evp%> are taken as option values,
552
- e.g. `<%=evp%>OPTION_NAME` is for `--option-name`.
553
-
554
- Options values can be displayed for a given command by providing the `--show-config` option: `<%=cmd%> node --show-config`
555
-
556
- ### Commands and Arguments
557
-
558
- 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).
559
-
560
- ## Interactive Input
561
-
562
- Some options and parameters are mandatory and other optional. By default, the tool will ask for missing mandatory options or parameters for interactive execution.
563
-
564
- The behaviour can be controlled with:
565
-
566
- * --interactive=&lt;yes|no&gt; (default=yes if STDIN is a terminal, else no)
567
- * yes : missing mandatory parameters/options are asked to the user
568
- * no : missing mandatory parameters/options raise an error message
569
- * --ask-options=&lt;yes|no&gt; (default=no)
570
- * optional parameters/options are asked to user
571
-
572
- ## Output
573
-
574
- Command execution will result in output (terminal, stdout/stderr).
575
- The information displayed depends on the action.
576
-
577
- ### Types of output data
578
-
579
- Depending on action, the output will contain:
580
-
581
- * `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.
582
- * `object_list` : displayed as a 2 dimensional table: one line per item, one colum per attribute.
583
- * `value_list` : a table with one column.
584
- * `empty` : nothing
585
- * `status` : a message
586
- * `other_struct` : a complex structure that cannot be displayed as an array
587
-
588
- ### Format of output
589
-
590
- By default, result of type single_object and object_list are displayed using format `table`.
591
- The table style can be customized with parameter: `table_style` (horizontal, vertical and intersection characters) and is `:.:` by default.
592
-
593
- In a table format, when displaying "objects" (single, or list), by default, sub object are
594
- 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
595
- field: "user" and value is the sub hash table. When in flatten mode, it is possible to
596
- filter fields by "dotted" field name.
597
-
598
- The style of output can be set using the `format` parameter, supporting:
599
-
600
- * `table` : Text table
601
- * `ruby` : Ruby code
602
- * `json` : JSON code
603
- * `jsonpp` : JSON pretty printed
604
- * `yaml` : YAML
605
- * `csv` : Comma Separated Values
606
-
607
- ### <a name="option_select"></a>Option: `select`: Filter on columns values for `object_list`
608
-
609
- Table output can be filtered using the `select` parameter. Example:
610
-
611
- ```
612
- $ <%=cmd%> aoc admin res user list --fields=name,email,ats_admin --query=@json:'{"sort":"name"}' --select=@json:'{"ats_admin":true}'
613
- :...............................:..................................:...........:
614
- : name : email : ats_admin :
615
- :...............................:..................................:...........:
616
- : John Custis : john@example.com : true :
617
- : Laurent Martin : laurent@example.com : true :
618
- :...............................:..................................:...........:
619
- ```
620
-
621
- 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.
622
-
623
- ### Verbosity of output
624
-
625
- Outpout messages are categorized in 3 types:
626
-
627
- * `info` output contain additional information, such as number of elements in a table
628
- * `data` output contain the actual output of the command (object, or list of objects)
629
- * `error`output contain error messages
630
-
631
- The option `display` controls the level of output:
632
-
633
- * `info` displays all messages
634
- * `data` display `data` and `error` messages
635
- * `error` display only error messages.
636
-
637
- ### Selection of output object properties
638
-
639
- 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:
640
-
641
- * DEF : default display of columns (that's the default, when not set)
642
- * ALL : all columns available
643
- * a,b,c : the list of attributes specified by the comma separated list
644
- * Array extended value: for instance, @json:'["a","b","c"]' same as above
645
- * +a,b,c : add selected properties to the default selection.
646
- * -a,b,c : remove selected properties from the default selection.
647
-
648
- ## <a name="extended"></a>Extended Value Syntax
649
-
650
- 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).
651
-
652
- The extended value syntax is:
653
-
654
- ```
655
- <0 or more decoders><0 or 1 reader><nothing or some text value>
656
- ```
657
-
658
- 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.
659
-
660
- The following "readers" are supported (returns value in []):
661
-
662
- * @val:VALUE : [String] prevent further special prefix processing, e.g. `--username=@val:laurent` sets the option `username` to value `laurent`.
663
- * @file:PATH : [String] read value from a file (prefix "~/" is replaced with the users home folder), e.g. --key=@file:~/.ssh/mykey
664
- * @path:PATH : [String] performs path expansion (prefix "~/" is replaced with the users home folder), e.g. --config-file=@path:~/sample_config.yml
665
- * @env:ENVVAR : [String] read from a named env var, e.g.--password=@env:MYPASSVAR
666
- * @stdin: : [String] read from stdin (no value on right)
667
- * @preset:NAME : [Hash] get whole <%=opprst%> value by name
668
-
669
- In addition it is possible to decode a value, using one or multiple decoders :
670
-
671
- * @base64: [String] decode a base64 encoded string
672
- * @json: [any] decode JSON values (convenient to provide complex structures)
673
- * @zlib: [String] uncompress data
674
- * @ruby: [any] execute ruby code
675
- * @csvt: [Array] decode a titled CSV value
676
- * @lines: [Array] split a string in multiple lines and return an array
677
- * @list: [Array] split a string in multiple items taking first character as separator and return an array
678
- * @incps: [Hash] include values of presets specified by key `incps` in input hash
679
-
680
- To display the result of an extended value, use the `config echo` command.
681
-
682
- Example: read the content of the specified file, then, base64 decode, then unzip:
683
-
684
- ```
685
- $ <%=cmd%> config echo @zlib:@base64:@file:myfile.dat
686
- ```
687
-
688
- Example: create a value as a hash, with one key and the value is read from a file:
689
-
690
- ```
691
- $ <%=cmd%> config echo @ruby:'{"token_verification_key"=>File.read("pubkey.txt")}'
692
- ```
693
-
694
- Example: read a csv file and create a list of hash for bulk provisioning:
695
-
696
- ```
697
- $ cat test.csv
698
- name,email
699
- lolo,laurent@example.com
700
- toto,titi@tutu.tata
701
- $ <%=cmd%> config echo @csvt:@file:test.csv
702
- :......:.....................:
703
- : name : email :
704
- :......:.....................:
705
- : lolo : laurent@example.com :
706
- : toto : titi@tutu.tata :
707
- :......:.....................:
708
- ```
709
-
710
- Example: create a hash and include values from preset named "config" of config file in this hash
711
-
712
- ```
713
- $ <%=cmd%> config echo @incps:@json:'{"hello":true,"incps":["config"]}'
714
- {"version"=>"0.9", "hello"=>true}
715
- ```
716
-
717
- Note that `@incps:@json:'{"incps":["config"]}'` or `@incps:@ruby:'{"incps"=>["config"]}'` is equivalent to: `@preset:config`
718
-
719
- ## <a name="native"></a>Structured Value
720
-
721
- 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.
722
-
723
- For instance, a [_transfer-spec_](#transferspec) is expected to be a _Structured Value_.
724
-
725
- Structured values shall be described using the [Extended Value Syntax](#extended).
726
- 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.
727
-
728
- It is also possible to provide a _Structured Value_ in a file using `@json:@file:<path>`
729
-
730
- ## <a name="conffolder"></a>Configuration and Persistency Folder
731
-
732
- <%=tool%> configuration and other runtime files (token cache, file lists, persistency files, SDK) are stored in folder `[User's home folder]/.aspera/<%=cmd%>`.
733
-
734
- Note: `[User's home folder]` is found using ruby's `Dir.home` (`rb_w32_home_dir`).
735
- It uses the `HOME` env var primarily, and on MS Windows it also looks at `%HOMEDRIVE%%HOMEPATH%` and `%USERPROFILE%`. <%=tool%> sets the env var `%HOME%` to the value of `%USERPROFILE%` if set and exists. So, on Windows `%USERPROFILE%` is used as it is more reliable than `%HOMEDRIVE%%HOMEPATH%`.
736
-
737
- The main folder can be displayed using :
738
-
739
- ```
740
- $ <%=cmd%> config folder
741
- /Users/kenji/.aspera/<%=cmd%>
742
- ```
743
-
744
- It can be overriden using the envinonment variable `<%=evp%>HOME`.
745
-
746
- Example (Windows):
747
-
748
- ```
749
- $ set <%=evp%>HOME=C:\Users\Kenji\.aspera\<%=cmd%>
750
- $ <%=cmd%> config folder
751
- C:\Users\Kenji\.aspera\<%=cmd%>
752
- ```
753
-
754
- ## <a name="configfile"></a>Configuration file
755
-
756
- On the first execution of <%=tool%>, an empty configuration file is created in the configuration folder.
757
- 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.
758
-
759
- Although the file is a standard YAML file, <%=tool%> provides commands to read and modify it using the `config` command.
760
-
761
- All options for <%=tool%> can be set on command line, or by env vars, or using <%=prsts%> in the configuratin file.
762
-
763
- A configuration file provides a way to define default values, especially for authentication parameters, thus avoiding to always having to specify those parameters on the command line.
764
-
765
- The default configuration file is: `$HOME/.aspera/<%=cmd%>/config.yaml` (this can be overriden with option `--config-file=path` or equivalent env var).
766
-
767
- The configuration file is simply a catalog of pre-defined lists of options, called: <%=prsts%>. Then, instead of specifying some common options on the command line (e.g. address, credentials), it is possible to invoke the ones of a <%=prst%> (e.g. `mypreset`) using the option: `-Pmypreset` or `--preset=mypreset`.
768
-
769
- ### <a name="lprt"></a><%=prstt%>
770
-
771
- A <%=prst%> is simply a collection of parameters and their associated values in a named section in the configuration file.
772
-
773
- A named <%=prst%> can be modified directly using <%=tool%>, which will update the configuration file :
774
-
775
- ```
776
- $ <%=cmd%> config id <<%=opprst%>> set|delete|show|initialize|update
777
- ```
778
-
779
- The command `update` allows the easy creation of <%=prst%> by simply providing the options in their command line format, e.g. :
780
-
781
- ```
782
- $ <%=cmd%> config id demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_ --ts=@json:'{"precalculate_job_size":true}'
783
- ```
784
-
785
- * This creates a <%=prst%> `demo_server` with all provided options.
786
-
787
- The command `set` allows setting individual options in a <%=prst%>.
788
-
789
- ```
790
- $ <%=cmd%> config id demo_server set password _demo_pass_
791
- ```
792
-
793
- 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)_.
794
-
795
- ```
796
- $ <%=cmd%> config id demo_server initialize @json:'{"url":"ssh://demo.asperasoft.com:33001","username":"asperaweb","password":"_demo_pass_","ts":{"precalculate_job_size":true}}'
797
- ```
798
-
799
- A good practice is to not manually edit the configuration file and use modification commands instead.
800
- If necessary, the configuration file can be edited (or simply consulted) with:
801
-
802
- ```
803
- $ <%=cmd%> config open
804
- ```
805
-
806
- A full terminal based overview of the configuration can be displayed using:
807
-
808
- ```
809
- $ <%=cmd%> config over
810
- ```
811
-
812
- A list of <%=prst%> can be displayed using:
813
-
814
- ```
815
- $ <%=cmd%> config list
816
- ```
817
-
818
- ### <a name="lprtconf"></a>Special <%=prstt%>: config
819
-
820
- This preset name is reserved and contains a single key: `version`. This is the version of <%=tool%> which created the file.
821
-
822
- ### <a name="lprtdef"></a>Special <%=prstt%>: default
823
-
824
- 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.
825
-
826
- 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.
827
-
828
- Note that special plugin name: `config` can be associated with a preset that is loaded initially, typically used for default values.
829
-
830
- Operations on this preset are done using regular `config` operations:
831
-
832
- ```
833
- $ <%=cmd%> config id default set _plugin_name_ _default_preset_for_plugin_
834
- $ <%=cmd%> config id default get _plugin_name_
835
- "_default_preset_for_plugin_"
836
- ```
837
-
838
- ### <a name="lprtdef"></a>Special Plugin: config
839
-
840
- Plugin `config` (not to be confused with <%=prstt%> config) is used to configure <%=tool%> but it also contains global options.
841
-
842
- When <%=tool%> starts, it lookjs for the `default` <%=prstt%> and if there is a value for `config`, if so, it loads the option values for any plugin used.
843
-
844
- If no global default is set by the user, the tool will use `global_common_defaults` when setting global parameters (e.g. `conf ascp use`)
845
-
846
- ### Format of file
847
-
848
- The configuration file is a hash in a YAML file. Example:
849
-
850
- ```yaml
851
- config:
852
- version: 0.3.7
853
- default:
854
- config: cli_default
855
- server: demo_server
856
- cli_default:
857
- interactive: no
858
- demo_server:
859
- url: ssh://demo.asperasoft.com:33001
860
- username: asperaweb
861
- password: _demo_pass_
862
- ```
863
-
864
- We can see here:
865
-
866
- * The configuration was created with CLI version 0.3.7
867
- * the default <%=prst%> to load for `server` plugin is : `demo_server`
868
- * the <%=prst%> `demo_server` defines some parameters: the URL and credentials
869
- * the default <%=prst%> to load in any case is : `cli_default`
870
-
871
- Two <%=prsts%> are reserved:
872
-
873
- * `config` contains a single value: `version` showing the CLI
874
- version used to create the configuration file. It is used to check compatibility.
875
- * `default` is reserved to define the default <%=prst%> name used for known plugins.
876
-
877
- The user may create as many <%=prsts%> as needed. For instance, a particular <%=prst%> can be created for a particular application instance and contain URL and credentials.
878
-
879
- Values in the configuration also follow the [Extended Value Syntax](#extended).
880
-
881
- 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:
882
-
883
- ```
884
- $ <%=cmd%> config id my_aoc_org set private_key @val:@file:"$HOME/.aspera/<%=cmd%>/aocapikey"
885
- ```
886
-
887
- This creates the <%=prst%>:
888
-
889
- ```
890
- ...
891
- my_aoc_org:
892
- private_key: @file:"/Users/laurent/.aspera/<%=cmd%>/aocapikey"
893
- ...
894
- ```
895
-
896
- So, the key file will be read only at execution time, but not be embedded in the configuration file.
897
-
898
- ### Options evaluation order
899
-
900
- Some options are global, some options are available only for some plugins. (the plugin is the first level command).
901
-
902
- Options are loaded using this algorithm:
903
-
904
- * If option `--no-default` (or `-N`) is specified, then no default value is loaded is loaded for the plugin
905
- * else it looks for the name of the plugin as key in section `default`, the value is the name of the default <%=prst%> for it, and loads it.
906
- * If option `--preset=<name or extended value hash>` is specified (or `-Pxxxx`), this reads the <%=prst%> specified from the configuration file, or of the value is a Hash, it uses it as options values.
907
- * Environment variables are evaluated
908
- * Command line options are evaluated
909
-
910
- Parameters are evaluated in the order of command line.
911
-
912
- To avoid loading the default <%=prst%> for a plugin, use: `-N`
913
-
914
- On command line, words in parameter names are separated by a dash, in configuration file, separator
915
- is an underscore. E.g. --xxx-yyy on command line gives xxx_yyy in configuration file.
916
-
917
- The main plugin name is `config`, so it is possible to define a default <%=prst%> for the main plugin with:
918
-
919
- ```
920
- $ <%=cmd%> config id cli_default set interactive no
921
- $ <%=cmd%> config id default set config cli_default
922
- ```
923
-
924
- A <%=prst%> value can be removed with `unset`:
925
-
926
- ```
927
- $ <%=cmd%> config id cli_default unset interactive
928
- ```
929
-
930
- Example: Define options using command line:
931
-
932
- ```
933
- $ <%=cmd%> -N --url=x --password=y --username=y node --show-config
934
- ```
935
-
936
- Example: Define options using a hash:
937
-
938
- ```
939
- $ <%=cmd%> -N --preset=@json:'{"url":"x","password":"y","username":"y"}' node --show-config
940
- ```
941
-
942
- ### Examples
943
-
944
- For Faspex, Shares, Node (including ATS, Aspera Transfer Service), Console,
945
- only username/password and url are required (either on command line, or from config file).
946
- Those can usually be provided on the command line:
947
-
948
- ```
949
- $ <%=cmd%> shares repo browse / --url=https://10.25.0.6 --username=john --password=4sp3ra
950
- ```
951
-
952
- This can also be provisioned in a config file:
953
-
954
- ```
955
- 1$ <%=cmd%> config id shares06 set url https://10.25.0.6
956
- 2$ <%=cmd%> config id shares06 set username john
957
- 3$ <%=cmd%> config id shares06 set password 4sp3ra
958
- 4$ <%=cmd%> config id default set shares shares06
959
- 5$ <%=cmd%> config overview
960
- 6$ <%=cmd%> shares repo browse /
961
- ```
962
-
963
- The three first commands build a <%=prst%>.
964
- Note that this can also be done with one single command:
965
-
966
- ```
967
- $ <%=cmd%> config id shares06 init @json:'{"url":"https://10.25.0.6","username":"john","password":"4sp3ra"}'
968
- ```
969
-
970
- The fourth command defines this <%=prst%> as the default <%=prst%> for the
971
- specified application ("shares"). The 5th command displays the content of configuration file in table format.
972
- Alternative <%=prsts%> can be used with option "-P&lt;<%=prst%>&gt;"
973
- (or --preset=&lt;<%=prst%>&gt;)
974
-
975
- Eventually, the last command shows a call to the shares application using default parameters.
976
-
977
-
978
- ## Plugins
979
-
980
- The CLI tool uses a plugin mechanism. The first level command (just after <%=tool%> 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.
981
- For instance, the plugin "faspex" allows operations on the application "Aspera Faspex".
982
-
983
- ### Create your own plugin
984
- ```
985
- $ mkdir -p ~/.aspera/<%=cmd%>/plugins
986
- $ cat<<EOF>~/.aspera/<%=cmd%>/plugins/test.rb
987
- require 'aspera/cli/plugin'
988
- module Aspera
989
- module Cli
990
- module Plugins
991
- class Test < Plugin
992
- ACTIONS=[]
993
- def execute_action; puts "Hello World!"; end
994
- end # Test
995
- end # Plugins
996
- end # Cli
997
- end # Aspera
998
- EOF
999
- ```
1000
-
1001
- ## Debugging
1002
-
1003
- 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 `<%=evp%>LOG_LEVEL`.
1004
-
1005
- It is also possible to activate traces before initialisation using env var `AS_LOG_LEVEL`.
1006
-
1007
- ## Learning Aspera Product APIs (REST)
1008
-
1009
- This CLI uses REST APIs.
1010
- To display HTTP calls, use argument `-r` or `--rest-debug`, this is useful to display
1011
- exact content or HTTP requests and responses.
1012
-
1013
- In order to get traces of execution, use argument : `--log-level=debug`
1014
-
1015
- ## <a name="graphical"></a>Graphical Interactions: Browser and Text Editor
1016
-
1017
- Some actions may require the use of a graphical tool:
1018
-
1019
- * a browser for Aspera on Cloud authentication (web auth method)
1020
- * a text editor for configuration file edition
1021
-
1022
- By default the CLI will assume that a graphical environment is available on windows,
1023
- and on other systems, rely on the presence of the "DISPLAY" environment variable.
1024
- It is also possible to force the graphical mode with option --ui :
1025
-
1026
- * `--ui=graphical` forces a graphical environment, a browser will be opened for URLs or
1027
- a text editor for file edition.
1028
- * `--ui=text` forces a text environment, the URL or file path to open is displayed on
1029
- terminal.
1030
-
1031
- ## HTTP proxy for REST
1032
-
1033
- To specify a HTTP proxy, set the HTTP_PROXY environment variable (or HTTPS_PROXY), those are honoured by Ruby when calling REST APIs.
1034
-
1035
- ## Proxy auto config
1036
-
1037
- 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:.
1038
-
1039
- The PAC file can be tested with command: `config proxy_check` , example:
1040
-
1041
- ```
1042
- $ <%=cmd%> config proxy_check --fpac=file:///./proxy.pac http://www.example.com
1043
- PROXY proxy.example.com:8080
1044
- ```
1045
-
1046
- This is not yet implemented to specify http proxy, so use `http_proxy` env vars.
1047
-
1048
- ## <a name="client"></a>FASP configuration
1049
-
1050
- The `config` plugin also allows specification for the use of a local FASP client. It provides the following commands for `ascp` subcommand:
1051
-
1052
- * `show` : shows the path of ascp used
1053
- * `use` : list,download connect client versions available on internet
1054
- * `products` : list Aspera transfer products available locally
1055
- * `connect` : list,download connect client versions available on internet
1056
-
1057
- ### Show path of currently used `ascp`
1058
-
1059
- ```
1060
- $ <%=cmd%> config ascp show
1061
- /Users/laurent/.aspera/ascli/sdk/ascp
1062
- $ <%=cmd%> config ascp info
1063
- +--------------------+-----------------------------------------------------------+
1064
- | key | value |
1065
- +--------------------+-----------------------------------------------------------+
1066
- | ascp | /Users/laurent/.aspera/ascli/sdk/ascp |
1067
- ...
1068
- ```
1069
-
1070
- ### Selection of `ascp` location for [`direct`](#direct) agent
1071
-
1072
- By default, <%=tool%> uses any found local product with ascp, including SDK.
1073
-
1074
- To temporarily use an alternate ascp path use option `ascp_path` (`--ascp-path=`)
1075
-
1076
- For a permanent change, the command `config ascp use` sets the same parameter for the global default.
1077
-
1078
- Using a POSIX shell:
1079
-
1080
- ```
1081
- $ <%=cmd%> config ascp use '/Users/laurent/Applications/Aspera CLI/bin/ascp'
1082
- ascp version: 4.0.0.182279
1083
- Updated: global_common_defaults: ascp_path <- /Users/laurent/Applications/Aspera CLI/bin/ascp
1084
- Saved to default global preset global_common_defaults
1085
- ```
1086
-
1087
- Windows:
1088
-
1089
- ```
1090
- $ <%=cmd%> config ascp use C:\Users\admin\.aspera\ascli\sdk\ascp.exe
1091
- ascp version: 4.0.0.182279
1092
- Updated: global_common_defaults: ascp_path <- C:\Users\admin\.aspera\ascli\sdk\ascp.exe
1093
- Saved to default global preset global_common_defaults
1094
- ```
1095
-
1096
- If the path has spaces, read section: [Shell and Command line parsing](#parsing).
1097
-
1098
- ### List locally installed Aspera Transfer products
1099
-
1100
- Locally installed Aspera products can be listed with:
1101
-
1102
- ```
1103
- $ <%=cmd%> config ascp products list
1104
- :.........................................:................................................:
1105
- : name : app_root :
1106
- :.........................................:................................................:
1107
- : Aspera Connect : /Users/laurent/Applications/Aspera Connect.app :
1108
- : IBM Aspera CLI : /Users/laurent/Applications/Aspera CLI :
1109
- : IBM Aspera High-Speed Transfer Endpoint : /Library/Aspera :
1110
- : Aspera Drive : /Applications/Aspera Drive.app :
1111
- :.........................................:................................................:
1112
- ```
1113
-
1114
- ### Selection of local client for `ascp` for [`direct`](#direct) agent
1115
-
1116
- If no ascp is selected, this is equivalent to using option: `--use-product=FIRST`.
1117
-
1118
- Using the option use_product finds the ascp binary of the selected product.
1119
-
1120
- To permanently use the ascp of a product:
1121
-
1122
- ```
1123
- $ <%=cmd%> config ascp products use 'Aspera Connect'
1124
- saved to default global preset /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
1125
- ```
1126
-
1127
- ### Installation of Connect Client on command line
1128
-
1129
- ```
1130
- $ <%=cmd%> config ascp connect list
1131
- :...............................................:......................................:..............:
1132
- : id : title : version :
1133
- :...............................................:......................................:..............:
1134
- : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows : 3.7.0.138427 :
1135
- : urn:uuid:A3820D20-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows 64-bit : 3.7.0.138427 :
1136
- : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows XP : 3.7.0.138427 :
1137
- : urn:uuid:55425020-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows XP 64-bit : 3.7.0.138427 :
1138
- : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel 10.6 : 3.6.1.111259 :
1139
- : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel : 3.7.0.138427 :
1140
- : urn:uuid:213C9370-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 32 : 3.6.2.117442 :
1141
- : urn:uuid:97F94DF0-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 64 : 3.7.2.141527 :
1142
- :...............................................:......................................:..............:
1143
- $ <%=cmd%> config ascp connect id 'Aspera Connect for Mac Intel 10.6' links list
1144
- :.............................................:..........................:.......................................................................:..........:...............:
1145
- : title : type : href : hreflang : rel :
1146
- :.............................................:..........................:.......................................................................:..........:...............:
1147
- : Mac Intel Installer : application/octet-stream : bin/AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg : en : enclosure :
1148
- : Aspera Connect for Mac HTML Documentation : text/html : : en : documentation :
1149
- : 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 :
1150
- : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/en/pdf/Connect_User_3.7.0_OSX.pdf : en : documentation :
1151
- : 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 :
1152
- : 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 :
1153
- : 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 :
1154
- : Aspera Connect for Mac Release Notes : text/html : http://www.asperasoft.com/en/release_notes/default_1/release_notes_54 : en : release-notes :
1155
- :.............................................:..........................:.......................................................................:..........:...............:
1156
- $ <%=cmd%> config ascp connect id 'Aspera Connect for Mac Intel 10.6' links id 'Mac Intel Installer' download --to-folder=.
1157
- downloaded: AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg
1158
- ```
1159
-
1160
- ## <a name="agents"></a>Transfer Agents
1161
-
1162
- Some of the actions on Aspera Applications lead to file transfers (upload and download) using the FASP protocol (`ascp`).
1163
-
1164
- When a transfer needs to be started, a [_transfer-spec_](#transferspec) has been internally prepared.
1165
- This [_transfer-spec_](#transferspec) will be executed by a transfer client, here called "Transfer Agent".
1166
-
1167
- There are currently 3 agents:
1168
-
1169
- * [`direct`](#direct) : a local execution of `ascp`
1170
- * `connect` : use of a local Connect Client
1171
- * `node` : use of an Aspera Transfer Node (potentially _remote_).
1172
- * `httpgw` : use of an Aspera HTTP Gateway
1173
-
1174
- Note that all transfer operation are seen from the point of view of the agent.
1175
- For instance, a node agent making an "upload", or "package send" operation,
1176
- will effectively push files to the related server from the agent node.
1177
-
1178
- <%=tool%> 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.
1179
-
1180
-
1181
- ### <a name="direct"></a>Direct (local ascp execution)
1182
-
1183
- By default <%=tool%> uses a local ascp, equivalent to specifying `--transfer=direct`.
1184
- <%=tool%> will detect locally installed Aspera products.
1185
- Refer to section [FASP](#client).
1186
-
1187
- To specify a FASP proxy (only supported with the `direct` agent), set the appropriate [_transfer-spec_](#transferspec) parameter:
1188
-
1189
- * `EX_fasp_proxy_url`
1190
- * `EX_http_proxy_url` (proxy for legacy http fallback)
1191
- * `EX_ascp_args`
1192
-
1193
- The `transfer-info` accepts the following optional parameters:
1194
-
1195
- <table>
1196
- <tr><th>Name</th><th>Type</th><th>Default</th><th>Feature</th><th>Description</th></tr>
1197
- <tr><td>spawn_timeout_sec</td><td>Float</td><td>3</td><td>Multi session</td><td>Verification time that ascp is running</td></tr>
1198
- <tr><td>spawn_delay_sec</td><td>Float</td><td>2</td><td>Multi session</td><td>Delay between startup of sessions</td></tr>
1199
- <tr><td>wss</td><td>Bool</td><td>false</td><td>Web Socket Session</td><td>Enable use of web socket session in case it is available</td></tr>
1200
- <tr><td>multi_incr_udp</td><td>Bool</td><td>true</td><td>Multi Session</td><td>Increment UDP port on multi-session<br/>If true, each session will have a different UDP port starting at `fasp_port` (or default 33001)<br/>Else, each session will use `fasp_port` (or `ascp` default)</td></tr>
1201
- <tr><td>resume</td><td>Hash</td><td>nil</td><td>Resumer parameters</td><td>See below</td></tr>
1202
- </table>
1203
-
1204
- Resume parameters:
1205
-
1206
- In case of transfer interruption, the agent will resume a transfer up to `iter_max` time.
1207
- Sleep between iteration is:
1208
-
1209
- ```
1210
- max( sleep_max , sleep_initial * sleep_factor ^ (iter_index-1) )
1211
- ```
1212
-
1213
- <table>
1214
- <tr><th>Name</th><th>Type</th><th>Default</th><th>Feature</th><th>Description</th></tr>
1215
- <tr><td>iter_max</td><td>int</td><td>7</td><td>Resume</td><td>Max number of retry on error</td></tr>
1216
- <tr><td>sleep_initial</td><td>int</td><td>2</td><td>Resume</td><td>First Sleep before retry</td></tr>
1217
- <tr><td>sleep_factor</td><td>int</td><td>2</td><td>Resume</td><td>Multiplier of Sleep</td></tr>
1218
- <tr><td>sleep_max</td><td>int</td><td>60</td><td>Resume</td><td>Maximum sleep</td></tr>
1219
- </table>
1220
-
1221
- Examples:
1222
-
1223
- ```
1224
- $ <%=cmd%> ... --transfer-info=@json:'{"wss":true,"resume":{"iter_max":10}}'
1225
- $ <%=cmd%> ... --transfer-info=@json:'{"spawn_delay_sec":2.5,"multi_incr_udp":false}'
1226
- ```
1227
-
1228
- ### IBM Aspera Connect Client GUI
1229
-
1230
- By specifying option: `--transfer=connect`, <%=tool%> will start transfers
1231
- using the locally installed Aspera Connect Client.
1232
-
1233
- ### Aspera Node API : Node to node transfers
1234
-
1235
- By specifying option: `--transfer=node`, the CLI will start transfers in an Aspera
1236
- Transfer Server using the Node API, either on a local or remote node.
1237
-
1238
- If a default node has been configured
1239
- in the configuration file, then this node is used by default else the parameter
1240
- `--transfer-info` is required. The node specification shall be a hash table with
1241
- three keys: url, username and password, corresponding to the URL of the node API
1242
- and associated credentials (node user or access key).
1243
-
1244
- The `--transfer-info` parameter can directly specify a pre-configured <%=prst%> :
1245
- `--transfer-info=@preset:<psetname>` or specified using the option syntax :
1246
- `--transfer-info=@json:'{"url":"https://...","username":"theuser","password":"thepass"}'`
1247
-
1248
- ### <a name="trinfoaoc"></a>Aspera on cloud
1249
-
1250
- By specifying option: `--transfer=aoc`, WORK IN PROGRESS
1251
-
1252
- ### <a name="httpgw"></a>HTTP Gateway
1253
-
1254
- If it possible to send using a HTTP gateway, in case FASP is not allowed.
1255
-
1256
- Example:
1257
-
1258
- ```
1259
- $ <%=cmd%> faspex package recv --id=323 --transfer=httpgw --transfer-info=@json:'{"url":"https://asperagw.example.com:9443/aspera/http-gwy/v1"}'
1260
- ```
1261
-
1262
- Note that the gateway only supports transfers authorized with a token.
1263
-
1264
- ## <a name="transferspec"></a>Transfer Specification
1265
-
1266
- Some commands lead to file transfer (upload/download), all parameters necessary for this transfer
1267
- is described in a _transfer-spec_ (Transfer Specification), such as:
1268
-
1269
- * server address
1270
- * transfer user name
1271
- * credentials
1272
- * file list
1273
- * etc...
1274
-
1275
- <%=tool%> builds a default _transfer-spec_ internally, so it is not necessary to provide additional parameters on the command line for this transfer.
1276
-
1277
- 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. Multiple `ts` options on command line are cummulative.
1278
-
1279
- It is possible to specify ascp options when the `transfer` option is set to [`direct`](#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.
1280
-
1281
- The use of a _transfer-spec_ instead of `ascp` parameters has the advantage of:
1282
-
1283
- * common to all [Transfer Agent](#agents)
1284
- * not dependent on command line limitations (special characters...)
1285
-
1286
- A [_transfer-spec_](#transferspec) is a Hash table, so it is described on the command line with the [Extended Value Syntax](#extended).
1287
-
1288
- ## <a name="transferparams"></a>Transfer Parameters
1289
-
1290
- All standard _transfer-spec_ parameters can be speficied.
1291
- [_transfer-spec_](#transferspec) can also be saved/overridden in the config file.
1292
-
1293
- References:
1294
-
1295
- * [Aspera Node API Documentation](https://developer.ibm.com/apis/catalog?search=%22aspera%20node%20api%22)&rarr;/opt/transfers
1296
- * [Aspera Transfer SDK Documentation](https://developer.ibm.com/apis/catalog?search=%22aspera%20transfer%20sdk%22)&rarr;Guides&rarr;API Ref&rarr;Transfer Spec V1
1297
-
1298
- Parameters can be displayed with commands:
1299
-
1300
- ```
1301
- $ <%=cmd%> config ascp spec
1302
- $ <%=cmd%> config ascp spec --select=@json:'{"f":"Y"}' --fields=-f,n,c
1303
- ```
1304
-
1305
- Columns:
1306
-
1307
- * D=Direct (local `ascp` execution)
1308
- * N=Node API
1309
- * C=Connect Client
1310
- * arg=`ascp` argument or environment variable
1311
-
1312
- Fields with EX_ prefix are extensions to transfer agent [`direct`](#direct). (only in <%=tool%>).
1313
-
1314
- <%=spec_table%>
1315
-
1316
- ### Destination folder for transfers
1317
-
1318
- The destination folder is set by <%=tool%> by default to:
1319
-
1320
- * `.` for downloads
1321
- * `/` for uploads
1322
-
1323
- It is specified by the [_transfer-spec_](#transferspec) parameter `destination_root`.
1324
- As such, it can be modified with option: `--ts=@json:'{"destination_root":"<path>"}'`.
1325
- The option `to_folder` provides an equivalent and convenient way to change this parameter:
1326
- `--to-folder=<path>` .
1327
-
1328
- ### List of files for transfers
1329
-
1330
- When uploading, downloading or sending files, the user must specify the list of files to transfer. The option to specify the list of files (Extensed value) is `sources`, the default value is `@args`, which means: take remain non used arguments (not starting with `-` as list of files.
1331
- So, by default, the list of files to transfer will be simply specified on the command line:
1332
-
1333
- ```
1334
- $ <%=cmd%> server upload ~/mysample.file secondfile
1335
- ```
1336
-
1337
- This is equivalent to:
1338
-
1339
- ```
1340
- $ <%=cmd%> server upload --sources=@args ~/mysample.file secondfile
1341
- ```
1342
-
1343
- More advanced options are provided to adapt to various cases. In fact, list of files to transfer are normally conveyed using the [_transfer-spec_](#transferspec) using the field: "paths" which is a list (array) of pairs of "source" (mandatory) and "destination" (optional).
1344
-
1345
- Note that this is different from the "ascp" command line. The paradigm used by <%=tool%> is:
1346
- 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.
1347
-
1348
- For ease of use and flexibility, the list of files to transfer is specified by the option `sources`. Accepted values are:
1349
-
1350
- * `@args` : (default value) the list of files is directly provided at the end of the command line (see at the beginning of this section).
1351
-
1352
- * an [Extended Value](#extended) holding an *Array of String*. Examples:
1353
-
1354
- ```
1355
- --sources=@json:'["file1","file2"]'
1356
- --sources=@lines:@stdin:
1357
- --sources=@ruby:'File.read("myfilelist").split("\n")'
1358
- ```
1359
-
1360
- * `@ts` : the user provides the list of files directly in the `ts` option, in its `paths` field. Example:
1361
-
1362
- ```
1363
- --sources=@ts --ts=@json:'{"paths":[{"source":"file1"},{"source":"file2"}]}'
1364
- ```
1365
-
1366
- * Not recommended: It is possible to specify bare ascp arguments using the pseudo [_transfer-spec_](#transferspec) parameter `EX_ascp_args`.
1367
-
1368
- ```
1369
- --sources=@ts --ts=@json:'{"paths":[{"source":"dummy"}],"EX_ascp_args":["--file-list","myfilelist"]}'
1370
- ```
1371
-
1372
- This method avoids creating a copy of the file list, but has drawbacks: it applies *only* to the [`direct`](#direct) transfer agent (i.e. bare ascp) and not for Aspera on Cloud. One must specify a dummy list in the [_transfer-spec_](#transferspec), which will be overriden by the bare ascp command line provided. (TODO) In next version, dummy source paths can be removed.
1373
-
1374
- In case the file list is provided on the command line i.e. using `--sources=@args` or `--sources=<Array>` (but not `--sources=@ts`), then 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`:
1375
-
1376
- * `list` : (default) the path of destination is the same as source
1377
- * `pair` : in that case, the first element is the first source, the second element is the first destination, and so on.
1378
-
1379
- Example:
1380
-
1381
- ```
1382
- $ <%=cmd%> server upload --src-type=pair ~/Documents/Samples/200KB.1 /Upload/sample1
1383
- ```
1384
-
1385
- Internally, when transfer agent [`direct`](#direct) is used, a temporary file list (or pair) file is generated and provided to ascp, unless `--file-list` or `--file-pait-list` is provided in `ts` in `EX_ascp_args`.
1386
-
1387
- Note the special case when the source files are located on "Aspera on Cloud", i.e. using access keys and the `file id` API:
1388
-
1389
- * All files must be in the same source folder.
1390
- * If there is a single file : specify the full path
1391
- * For multiple files, specify the source folder as first item in the list followed by the list of file names.
1392
-
1393
- Source files are located on "Aspera on cloud", when :
1394
-
1395
- * the server is Aspera on Cloud, and making a download / recv
1396
- * the agent is Aspera on Cloud, and making an upload / send
1397
-
1398
- ### <a name="multisession"></a>Support of multi-session
1399
-
1400
- Multi session, i.e. starting a transfer of a file set using multiple sessions (one ascp process per session) is supported on "direct" and "node" agents, not yet on connect.
1401
-
1402
- * when agent=node :
1403
-
1404
- ```
1405
- --ts=@json:'{"multi_session":10,"multi_session_threshold":1}'
1406
- ```
1407
-
1408
- Multi-session is directly supported by the node daemon.
1409
-
1410
- * when agent=direct :
1411
-
1412
- ```
1413
- --ts=@json:'{"multi_session":5,"multi_session_threshold":1,"resume_policy":"none"}'
1414
- ```
1415
-
1416
- Note: resume policy of "attr" may cause problems. "none" or "sparse_csum"
1417
- shall be preferred.
1418
-
1419
- Multi-session spawn is done by <%=tool%>.
1420
-
1421
- When multi-session is used, one separate UDP port is used per session (refer to `ascp` manual page).
1422
-
1423
- ### Examples
1424
-
1425
- * Change target rate
1426
-
1427
- ```
1428
- --ts=@json:'{"target_rate_kbps":500000}'
1429
- ```
1430
-
1431
- * Override the FASP SSH port to a specific TCP port:
1432
-
1433
- ```
1434
- --ts=@json:'{"ssh_port":33002}'
1435
- ```
1436
-
1437
- * Force http fallback mode:
1438
-
1439
- ```
1440
- --ts=@json:'{"http_fallback":"force"}'
1441
- ```
1442
-
1443
- * Activate progress when not activated by default on server
1444
-
1445
- ```
1446
- --ts=@json:'{"precalculate_job_size":true}'
1447
- ```
1448
-
1449
-
1450
-
1451
- ## <a name="scheduling"></a>Lock for exclusive execution
1452
-
1453
- In some conditions, it may be desirable to ensure that <%=tool%> is not executed several times in parallel.
1454
-
1455
- For instance when <%=tool%> is executed automatically on a schedule basis, one generally desire that a new execution is not started if a previous execution is still running because an on-going operation may last longer than the scheduling period:
1456
-
1457
- * Executing instances may pile-up and kill the system
1458
- * The same file may be transfered by multiple instances at the same time.
1459
- * `preview` may generate the same files in multiple instances.
1460
-
1461
- Usually the OS native scheduler already provides some sort of protection against parallel execution:
1462
-
1463
- * The Windows scheduler does this by default
1464
- * Linux cron can leverage the utility [`flock`](https://linux.die.net/man/1/flock) to do the same:
1465
-
1466
- ```
1467
- /usr/bin/flock -w 0 /var/cron.lock ascli ...
1468
- ```
1469
-
1470
- <%=tool%> natively supports a locking mechanism with option `lock_port`.
1471
- (Technically, this opens a local TCP server port, and fails if this port is already used, providing a local lock. Lock is released when process exits).
1472
-
1473
- Example:
1474
-
1475
- Run this same command in two separate terminals within less than 30 seconds:
1476
-
1477
- ```
1478
- ascli config echo @ruby:'sleep(30)' --lock-port=12345
1479
- ```
1480
-
1481
- The first instance will sleep 30 seconds, the second one will immediately exit like this:
1482
-
1483
- ```
1484
- WARN -- : Another instance is already running (Address already in use - bind(2) for "127.0.0.1" port 12345).
1485
- ```
1486
-
1487
- ## "Proven&ccedil;ale"
1488
-
1489
- `ascp`, the underlying executable implementing Aspera file transfer using FASP, has a capability to not only access the local file system (using system's `open`,`read`,`write`,`close` primitives), but also to do the same operations on other data storage such as S3, Hadoop and others. This mechanism is call *PVCL*. Several *PVCL* adapters are available, some are embedded in `ascp`
1490
- , some are provided om shared libraries and must be activated. (e.g. using `trapd`)
1491
-
1492
- The list of supported *PVCL* adapters can be retried with command:
1493
-
1494
- ```
1495
- $ <%=cmd%> conf ascp info
1496
- +--------------------+-----------------------------------------------------------+
1497
- | key | value |
1498
- +--------------------+-----------------------------------------------------------+
1499
- -----8<----snip---------
1500
- | product_name | IBM Aspera SDK |
1501
- | product_version | 4.0.1.182389 |
1502
- | process | pvcl |
1503
- | shares | pvcl |
1504
- | noded | pvcl |
1505
- | faux | pvcl |
1506
- | file | pvcl |
1507
- | stdio | pvcl |
1508
- | stdio-tar | pvcl |
1509
- +--------------------+-----------------------------------------------------------+
1510
- ```
1511
-
1512
- Here we can see the adapters: `process`, `shares`, `noded`, `faux`, `file`, `stdio`, `stdio-tar`.
1513
-
1514
- Those adapters can be used wherever a file path is used in `ascp` including configuration. They act as a pseudo "drive".
1515
-
1516
- The simplified format is:
1517
-
1518
- ```
1519
- <adapter>:///<sub file path>?<arg1>=<val1>&...
1520
- ```
1521
-
1522
- One of the adapters, used in this manual, for testing, is `faux`. It is a pseudo file system allowing generation of file data without actual storage (on source or destination).
1523
-
1524
- ## <a name="faux_testing"></a>`faux:` for testing
1525
-
1526
- This is an extract of the man page of `ascp`. This feature is a feature of `ascp`, not <%=tool%>
1527
-
1528
- This adapter can be used to simulate a file or a directory.
1529
-
1530
- To send uninitialized data in place of an actual source file, the source file is replaced with an argument of the form `faux:///fname?fsize` where:
1531
-
1532
- * `fname` is the name that will be assigned to the file on the destination
1533
- * `fsize` is the number of bytes that will be sent (in decimal).
1534
-
1535
- Note that the character `?` is a special shell character (wildcard), so `faux` file specification on command line shall be protected (using `\?` and `\&` or using quotes). If not, the shell may give error: `no matches found` or equivalent.
1536
-
1537
- For all sizes, a suffix can be added (case insensitive) to the size: k,m,g,t,p,e (values are power of 2, e.g. 1M is 2^20, i.e. 1 mebibyte, not megabyte). The maximum allowed value is 8*2^60. Very large `faux` file sizes (petabyte range and above) will likely fail due to lack of system memory unless `faux://`.
1538
-
1539
- To send uninitialized data in place of a source directory, the source argument is replaced with an argument of the form:
1540
-
1541
- ```
1542
- faux:///dirname?<arg1>=<val1>&...
1543
- ```
1544
-
1545
- `dirname` is the folder name and can contain `/` to specify a subfolder.
1546
-
1547
- Supported arguments are:
1548
-
1549
- <table>
1550
- <tr><th>name</th><th>type</th><th>default</th><th>description</th></tr>
1551
- <tr><td>count</td><td>int</td><td>mandatory</td><td>number of files</td></tr>
1552
- <tr><td>file</td><td>string</td><td>file</td><td>basename for files</td></tr>
1553
- <tr><td>size</td><td>int</td><td>0</td><td>size of first file.</td></tr>
1554
- <tr><td>inc</td><td>int</td><td>0</td><td>increment applied to determine next file size</td></tr>
1555
- <tr><td>seq</td><td>sequential<br/>random</td><td>sequential</td><td>sequence in determining next file size</td></tr>
1556
- <tr><td>buf_init</td><td>none<br/>zero<br/>random</td><td>zero</td><td>how source data initialized.<br/>Option 'none' is not allowed for downloads.</td></tr>
1557
- </table>
1558
-
1559
-
1560
- The sequence parameter is applied as follows:
1561
-
1562
- * If `seq` is `random` then each file size is:
1563
-
1564
- * size +/- (inc * rand())
1565
- * Where rand is a random number between 0 and 1
1566
- * Note that file size must not be negative, inc will be set to size if it is greater than size
1567
- * Similarly, overall file size must be less than 8 * 2^60. If size + inc is greater, inc will be reduced to limit size + inc to 7 * 2^60.
1568
-
1569
- * If `seq` is `sequential` then each file size is:
1570
-
1571
- * size + ((fileindex - 1) * inc)
1572
- * Where first file is index 1
1573
- * So file1 is size bytes, file2 is size + inc bytes, file3 is size + inc * 2 bytes, etc.
1574
- * As with random, inc will be adjusted if size + (count * inc) is not less then 8 ^ 2^60.
1575
-
1576
- Filenames generated are of the form: `<file>_<00000 . . . count>_<filesize>`
1577
-
1578
- To discard data at the destination, the destination argument is set to `faux://` .
1579
-
1580
- Examples:
1581
-
1582
- * Upload 20 gigabytes of random data to file myfile to directory /Upload
1583
-
1584
- ```
1585
- $ <%=cmd%> server upload faux:///myfile\?20g --to-folder=/Upload
1586
- ```
1587
-
1588
- * Upload a file /tmp/sample but do not save results to disk (no docroot on destination)
1589
-
1590
- ```
1591
- $ <%=cmd%> server upload /tmp/sample --to-folder=faux://
1592
- ```
1593
-
1594
- * Upload a faux directory `mydir` containing 1 million files, sequentially with sizes ranging from 0 to 2 M - 2 bytes, with the basename of each file being `testfile` to /Upload
1595
-
1596
- ```
1597
- $ <%=cmd%> server upload "faux:///mydir?file=testfile&count=1m&size=0&inc=2&seq=sequential" --to-folder=/Upload
1598
- ```
1599
-
1600
- ## <a name="commands"></a>Sample Commands
1601
-
1602
- A non complete list of commands used in unit tests:
1603
-
1604
- ```
1605
- <%=File.read(ENV["INCL_COMMANDS"])%>
1606
- ...and more
1607
- ```
1608
-
1609
- ## <a name="usage"></a>Usage
1610
-
1611
- ```
1612
- $ <%=cmd%> -h
1613
- <%=File.read(ENV["INCL_USAGE"])%>
1614
-
1615
- ```
1616
-
1617
- Note that actions and parameter values can be written in short form.
1618
-
1619
- # <a name="plugins"></a>Plugins: Application URL and Authentication
1620
-
1621
- <%=tool%> comes with several Aspera application plugins.
1622
-
1623
- REST APIs of Aspera legacy applications (Aspera Node, Faspex, Shares, Console, Orchestrator, Server) use simple username/password authentication: HTTP Basic Authentication.
1624
-
1625
- Those are using options:
1626
-
1627
- * url
1628
- * username
1629
- * password
1630
-
1631
- Those can be provided using command line, parameter set, env var, see section above.
1632
-
1633
- Aspera on Cloud relies on Oauth, refer to the [Aspera on Cloud](#aoc) section.
1634
-
1635
- # <a name="aoc"></a>Plugin: Aspera on Cloud
1636
-
1637
- Aspera on Cloud uses the more advanced Oauth v2 mechanism for authentication (HTTP Basic authentication is not supported).
1638
-
1639
- It is recommended to use the wizard to set it up, but manual configuration is also possible.
1640
-
1641
- ## <a name="aocwizard"></a>Configuration: using Wizard
1642
-
1643
- <%=tool%> provides a configuration wizard. Here is a sample invocation :
1644
-
1645
- ```
1646
- $ <%=cmd%> config wizard
1647
- option: url> https://myorg.ibmaspera.com
1648
- Detected: Aspera on Cloud
1649
- Preparing preset: aoc_myorg
1650
- Please provide path to your private RSA key, or empty to generate one:
1651
- option: pkeypath>
1652
- using existing key:
1653
- /Users/myself/.aspera/<%=cmd%>/aspera_aoc_key
1654
- Using global client_id.
1655
- option: username> john@example.com
1656
- Updating profile with new key
1657
- creating new config preset: aoc_myorg
1658
- Setting config preset as default for aspera
1659
- saving config file
1660
- Done.
1661
- You can test with:
1662
- $ <%=cmd%> aoc user info show
1663
- ```
1664
-
1665
- Optionally, it is possible to create a new organization-specific "integration".
1666
- For this, specify the option: `--use-generic-client=no`.
1667
-
1668
- This will guide you through the steps to create.
1669
-
1670
- ## <a name="aocmanual"></a>Configuration: using manual setup
1671
-
1672
- If you used the wizard (recommended): skip this section.
1673
-
1674
- ### Configuration details
1675
-
1676
- Several types of OAuth authentication are supported:
1677
-
1678
- * JSON Web Token (JWT) : authentication is secured by a private key (recommended for CLI)
1679
- * Web based authentication : authentication is made by user using a browser
1680
- * URL Token : external users authentication with url tokens (public links)
1681
-
1682
- The authentication method is controled by option `auth`.
1683
-
1684
- For a _quick start_, follow the mandatory and sufficient section: [API Client Registration](#clientreg) (auth=web) as well as [<%=prst%> for Aspera on Cloud](#aocpreset).
1685
-
1686
- For a more convenient, browser-less, experience follow the [JWT](#jwt) section (auth=jwt) in addition to Client Registration.
1687
-
1688
- In Oauth, a "Bearer" token are generated to authenticate REST calls. Bearer tokens are valid for a period of time.<%=tool%> saves generated tokens in its configuration folder, tries to re-use them or regenerates them when they have expired.
1689
-
1690
- ### <a name="clientreg"></a>Optional: API Client Registration
1691
-
1692
- If you use the built-in client_id and client_secret, skip this and do not set them in next section.
1693
-
1694
- Else you can use a specific OAuth API client_id, the first step is to declare <%=tool%> in Aspera on Cloud using the admin interface.
1695
-
1696
- (official documentation: <https://ibmaspera.com/help/admin/organization/registering_an_api_client> ).
1697
-
1698
- Let's start by a registration with web based authentication (auth=web):
1699
-
1700
- * Open a web browser, log to your instance: e.g. `https://myorg.ibmaspera.com/`
1701
- * Go to Apps&rarr;Admin&rarr;Organization&rarr;Integrations
1702
- * Click "Create New"
1703
- * Client Name: <%=tool%>
1704
- * Redirect URIs: `http://localhost:12345`
1705
- * Origins: `localhost`
1706
- * uncheck "Prompt users to allow client to access"
1707
- * leave the JWT part for now
1708
- * Save
1709
-
1710
- Note: for web based authentication, <%=tool%> 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 `<%=tool%>, HTTP is required, and 12345 is the default port.
1711
-
1712
- Once the client is registered, a "Client ID" and "Secret" are created, these values will be used in the next step.
1713
-
1714
- ### <a name="aocpreset"></a><%=prst%> for Aspera on Cloud
1715
-
1716
- If you did not use the wizard, you can also manually create a <%=prst%> for <%=tool%> in its configuration file.
1717
-
1718
- Lets create an <%=prst%> called: `my_aoc_org` using `ask` interactive input (client info from previous step):
1719
-
1720
- ```
1721
- $ <%=cmd%> config id my_aoc_org ask url client_id client_secret
1722
- option: url> https://myorg.ibmaspera.com/
1723
- option: client_id> BJLPObQiFw
1724
- option: client_secret> yFS1mu-crbKuQhGFtfhYuoRW...
1725
- updated: my_aoc_org
1726
- ```
1727
-
1728
- (This can also be done in one line using the command `config id my_aoc_org update --url=...`)
1729
-
1730
- Define this <%=prst%> as default configuration for the `aspera` plugin:
1731
-
1732
- ```
1733
- $ <%=cmd%> config id default set aoc my_aoc_org
1734
- ```
1735
-
1736
- Note: Default `auth` method is `web` and default `redirect_uri` is `http://localhost:12345`. Leave those default values.
1737
-
1738
- ### <a name="jwt"></a>Activation of JSON Web Token (JWT) for direct authentication
1739
-
1740
- For a Browser-less, Private Key-based authentication, use the following steps.
1741
-
1742
- #### Key Pair Generation
1743
-
1744
- In order to use JWT for Aspera on Cloud API client authentication,
1745
- a private/public key pair must be generated (without passphrase)
1746
- This can be done using any of the following method:
1747
-
1748
- (TODO: add passphrase protection as option).
1749
-
1750
- * using the CLI:
1751
-
1752
- ```
1753
- $ <%=cmd%> config genkey ~/.aspera/<%=cmd%>/aocapikey
1754
- ```
1755
-
1756
- * `ssh-keygen`:
1757
-
1758
- ```
1759
- $ ssh-keygen -t rsa -f ~/.aspera/<%=cmd%>/aocapikey -N ''
1760
- ```
1761
-
1762
- * `openssl`
1763
-
1764
- (on some openssl implementation (mac) there is option: -nodes (no DES))
1765
-
1766
- ```
1767
- $ APIKEY=~/.aspera/<%=cmd%>/aocapikey
1768
- $ openssl genrsa -passout pass:dummypassword -out ${APIKEY}.protected 2048
1769
- $ openssl rsa -passin pass:dummypassword -in ${APIKEY}.protected -out ${APIKEY}
1770
- $ openssl rsa -pubout -in ${APIKEY} -out ${APIKEY}.pub
1771
- $ rm -f ${APIKEY}.protected
1772
- ```
1773
-
1774
- #### API Client JWT activation
1775
-
1776
- 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:
1777
-
1778
- * Graphically
1779
-
1780
- * Open a web browser, log to your instance: https://myorg.ibmaspera.com/
1781
- * Go to Apps&rarr;Admin&rarr;Organization&rarr;Integrations
1782
- * Click on the previously created application
1783
- * select tab : "JSON Web Token Auth"
1784
- * Modify options if necessary, for instance: activate both options in section "Settings"
1785
- * Click "Save"
1786
-
1787
- * Using command line
1788
-
1789
- ```
1790
- $ <%=cmd%> aoc admin res client list
1791
- :............:.........:
1792
- : id : name :
1793
- :............:.........:
1794
- : BJLPObQiFw : <%=cmd%> :
1795
- :............:.........:
1796
- $ <%=cmd%> aoc admin res client --id=BJLPObQiFw modify @json:'{"jwt_grant_enabled":true,"explicit_authorization_required":false}'
1797
- modified
1798
- ```
1799
-
1800
- ### User key registration
1801
-
1802
- The public key must be assigned to your user. This can be done in two manners:
1803
-
1804
- * Graphically
1805
-
1806
- open the previously generated public key located here: `$HOME/.aspera/<%=cmd%>/aocapikey.pub`
1807
-
1808
- * Open a web browser, log to your instance: https://myorg.ibmaspera.com/
1809
- * Click on the user's icon (top right)
1810
- * Select "Account Settings"
1811
- * Paste the _Public Key_ in the "Public Key" section
1812
- * Click on "Submit"
1813
-
1814
- * Using command line
1815
-
1816
- ```
1817
- $ <%=cmd%> aoc admin res user list
1818
- :........:................:
1819
- : id : name :
1820
- :........:................:
1821
- : 109952 : Tech Support :
1822
- : 109951 : LAURENT MARTIN :
1823
- :........:................:
1824
- $ <%=cmd%> aoc user info modify @ruby:'{"public_key"=>File.read(File.expand_path("~/.aspera/<%=cmd%>/aocapikey.pub"))}'
1825
- modified
1826
- ```
1827
-
1828
- Note: the `aspera user info show` command can be used to verify modifications.
1829
-
1830
- ### <%=prst%> modification for JWT
1831
-
1832
- To activate default use of JWT authentication for <%=tool%> using the <%=prst%>, do the folowing:
1833
-
1834
- * change auth method to JWT
1835
- * provide location of private key
1836
- * provide username to login as (OAuth "subject")
1837
-
1838
- Execute:
1839
-
1840
- ```
1841
- $ <%=cmd%> config id my_aoc_org update --auth=jwt --private-key=@val:@file:~/.aspera/<%=cmd%>/aocapikey --username=laurent.martin.aspera@fr.ibm.com
1842
- ```
1843
-
1844
- 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.
1845
-
1846
- After this last step, commands do not require web login anymore.
1847
-
1848
-
1849
- ### <a name="aocfirst"></a>First Use
1850
-
1851
- Once client has been registered and <%=prst%> created: <%=tool%> can be used:
1852
-
1853
- ```
1854
- $ <%=cmd%> aoc files br /
1855
- Current Workspace: Default Workspace (default)
1856
- empty
1857
- ```
1858
-
1859
-
1860
- ### Administration
1861
-
1862
- The `admin` command allows several administrative tasks (and require admin privilege).
1863
-
1864
- It allows actions (create, update, delete) on "resources": users, group, nodes, workspace, etc... with the `admin resource` command.
1865
-
1866
- 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).
1867
-
1868
- #### Listing resources
1869
-
1870
- The command `aoc admin res <type> list` lists all entities of given type. It uses paging and multiple requests if necessary.
1871
-
1872
- The option `query` can be optionally used. It expects a Hash using [Extended Value Syntax](#extended), generally provided using: `--query=@json:{...}`. Values are directly sent to the API call and used as a filter on server side.
1873
-
1874
- The following parameters are supported:
1875
-
1876
- * `q` : a filter on name of resource (case insensitive, matches if value is contained in name)
1877
- * `sort`: name of fields to sort results, prefix with `-` for reverse order.
1878
- * `max` : maximum number of items to retrieve (stop pages when the maximum is passed)
1879
- * `pmax` : maximum number of pages to request (stop pages when the maximum is passed)
1880
- * `page` : native api parameter, in general do not use (added by
1881
- * `per_page` : native api parameter, number of items par api call, in general do not use
1882
- * Other specific parameters depending on resource type.
1883
-
1884
- Both `max` and `pmax` are processed internally in <%=tool%>, not included in actual API call and limit the number of successive pages requested to API. <%=tool%> will return all values using paging if not provided.
1885
-
1886
- Other parameters are directly sent as parameters to the GET request on API.
1887
-
1888
- `page` and `per_page` are normally added by <%=tool%> to build successive API calls to get all values if there are more than 1000. (AoC allows a maximum page size of 1000).
1889
-
1890
- `q` and `sort` are available on most resrouce types.
1891
-
1892
- Other parameters depend on the type of entity (refer to AoC API).
1893
-
1894
- Examples:
1895
-
1896
- * List users with `laurent` in name:
1897
-
1898
- ```
1899
- <%=cmd%> aoc admin res user list --query=--query=@json:'{"q":"laurent"}'
1900
- ```
1901
-
1902
- * List users who logded-in before a date:
1903
-
1904
- ```
1905
- <%=cmd%> aoc admin res user list --query=@json:'{"q":"last_login_at:<2018-05-28"}'
1906
- ```
1907
-
1908
- * List external users and sort in reverse alphabetical order using name:
1909
-
1910
- ```
1911
- <%=cmd%> aoc admin res user list --query=@json:'{"member_of_any_workspace":false,"sort":"-name"}'
1912
- ```
1913
-
1914
- Refer to the AoC API for full list of query parameters, or use the browser in developer mode with the web UI.
1915
-
1916
- Note the option `select` can also be used to further refine selection, refer to [section earlier](#option_select).
1917
-
1918
- #### Access Key secrets
1919
-
1920
- In order to access some administrative actions on "nodes" (in fact, access keys), the associated
1921
- secret is required, it is usually provided using the `secret` option. For example in a command like:
1922
-
1923
- ```
1924
- $ <%=cmd%> aoc admin res node --id="access_key1" --secret="secret1" v3 info
1925
- ```
1926
-
1927
- 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.
1928
-
1929
- First choose a repository name, for example `my_secrets`, and populate it like this:
1930
-
1931
- ```
1932
- $ <%=cmd%> conf id my_secrets set 'access_key1' 'secret1'
1933
- $ <%=cmd%> conf id my_secrets set 'access_key2' 'secret2'
1934
- $ <%=cmd%> conf id default get config
1935
- "cli_default"
1936
- ```
1937
-
1938
- 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:`):
1939
-
1940
- ```
1941
- $ <%=cmd%> conf id cli_default set secrets @val:@preset:my_secrets
1942
- ```
1943
-
1944
- A secret repository can always be selected at runtime using `--secrets=@preset:xxxx`, or `--secrets=@json:'{"accesskey1":"secret1"}'`
1945
-
1946
- #### Examples
1947
-
1948
- * Bulk creation
1949
-
1950
- ```
1951
- $ <%=cmd%> aoc admin res user create --bulk=yes @json:'[{"email":"dummyuser1@example.com"},{"email":"dummyuser2@example.com"}]'
1952
- :.......:.........:
1953
- : id : status :
1954
- :.......:.........:
1955
- : 98398 : created :
1956
- : 98399 : created :
1957
- :.......:.........:
1958
- ```
1959
-
1960
- * Find with filter and delete
1961
-
1962
- ```
1963
- $ <%=cmd%> aoc admin res user list --query='@json:{"q":"dummyuser"}' --fields=id,email
1964
- :.......:........................:
1965
- : id : email :
1966
- :.......:........................:
1967
- : 98398 : dummyuser1@example.com :
1968
- : 98399 : dummyuser2@example.com :
1969
- :.......:........................:
1970
- $ thelist=$(<%=cmd%> aoc admin res user list --query='@json:{"q":"dummyuser"}' --fields=id --format=json --display=data|jq -cr 'map(.id)')
1971
- $ echo $thelist
1972
- ["113501","354061"]
1973
- $ <%=cmd%> aoc admin res user --bulk=yes --id=@json:"$thelist" delete
1974
- :.......:.........:
1975
- : id : status :
1976
- :.......:.........:
1977
- : 98398 : deleted :
1978
- : 98399 : deleted :
1979
- :.......:.........:
1980
- ```
1981
-
1982
- * <a name="deactuser"></a>Find deactivated users since more than 2 years
1983
-
1984
- ```
1985
- ascli aoc admin res user list --query=@ruby:'{"deactivated"=>true,"q"=>"last_login_at:<#{(DateTime.now.to_time.utc-2*365*86400).iso8601}"}'
1986
- ```
1987
-
1988
- To delete them use the same method as before
1989
-
1990
- * Display current user's workspaces
1991
-
1992
- ```
1993
- $ <%=cmd%> aoc user workspaces
1994
- :......:............................:
1995
- : id : name :
1996
- :......:............................:
1997
- : 16 : Engineering :
1998
- : 17 : Marketing :
1999
- : 18 : Sales :
2000
- :......:............................:
2001
- ```
2002
-
2003
- * Create a sub access key in a "node"
2004
-
2005
- 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)
2006
-
2007
- ```
2008
- $ <%=cmd%> aoc admin resource node --name=_node_name_ --secret=_secret_ v4 access_key create --value=@json:'{"storage":{"path":"/folder1"}}'
2009
- ```
2010
-
2011
- * Display transfer events (ops/transfer)
2012
-
2013
- ```
2014
- $ <%=cmd%> aoc admin res node --secret=_secret_ v3 transfer list --value=@json:'[["q","*"],["count",5]]'
2015
- ```
2016
-
2017
- Examples of query (TODO: cleanup):
2018
-
2019
- ```
2020
- {"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"}
2021
-
2022
- {"tag":"aspera.files.package_id=LA8OU3p8w"}
2023
-
2024
- # filter= 'id', 'short_summary', or 'summary'
2025
- # count=nnn
2026
- # tag=x.y.z%3Dvalue
2027
- # iteration_token=nnn
2028
- # after_time=2016-05-01T23:53:09Z
2029
- # active_only=true|false
2030
- ```
2031
-
2032
- * Display node events (events)
2033
-
2034
- ```
2035
- $ <%=cmd%> aoc admin res node --secret=_secret_ v3 events
2036
- ```
2037
-
2038
- * display members of a workspace
2039
-
2040
- ```
2041
- $ <%=cmd%> aoc admin res workspace_membership list --fields=member_type,manager,member.email --query=@json:'{"embed":"member","inherited":false,"workspace_id":11363,"sort":"name"}'
2042
- :.............:.........:..................................:
2043
- : member_type : manager : member.email :
2044
- :.............:.........:..................................:
2045
- : user : true : john.curtis@email.com :
2046
- : user : false : laurent.martin.aspera@fr.ibm.com :
2047
- : user : false : jean.dupont@me.com :
2048
- : user : false : another.user@example.com :
2049
- : group : false : :
2050
- : user : false : aspera.user@gmail.com :
2051
- :.............:.........:..................................:
2052
- ```
2053
-
2054
- other query parameters:
2055
-
2056
- ```
2057
- {"workspace_membership_through":true,"include_indirect":true}
2058
- ```
2059
-
2060
- * <a name="aoc_sample_member"></a>add all members of a workspace to another workspace
2061
-
2062
- a- Get id of first workspace
2063
-
2064
- ```
2065
- WS1='First Workspace'
2066
- WS1ID=$(<%=cmd%> aoc admin res workspace list --query=@json:'{"q":"'"$WS1"'"}' --select=@json:'{"name":"'"$WS1"'"}' --fields=id --format=csv)
2067
- ```
2068
-
2069
- b- Get id of second workspace
2070
-
2071
- ```
2072
- WS2='Second Workspace'
2073
- WS2ID=$(<%=cmd%> aoc admin res workspace list --query=@json:'{"q":"'"$WS2"'"}' --select=@json:'{"name":"'"$WS2"'"}' --fields=id --format=csv)
2074
- ```
2075
-
2076
- c- Extract membership information
2077
-
2078
- ```
2079
- $ <%=cmd%> aoc admin res workspace_membership list --fields=manager,member_id,member_type,workspace_id --query=@json:'{"workspace_id":'"$WS1ID"'}' --format=jsonpp > ws1_members.json
2080
- ```
2081
-
2082
- d- Convert to creation data for second workspace:
2083
-
2084
- ```
2085
- grep -Eve '(direct|effective_manager|_count|storage|"id")' ws1_members.json|sed '/workspace_id/ s/"'"$WS1ID"'"/"'"$WS2ID"'"/g' > ws2_members.json
2086
- ```
2087
-
2088
- or, using jq:
2089
-
2090
- ```
2091
- jq '[.[] | {member_type,member_id,workspace_id,manager,workspace_id:"'"$WS2ID"'"}]' ws1_members.json > ws2_members.json
2092
- ```
2093
-
2094
- e- Add members to second workspace
2095
-
2096
- ```
2097
- $ <%=cmd%> aoc admin res workspace_membership create --bulk=yes @json:@file:ws2_members.json
2098
- ```
2099
-
2100
- * Get users who did not log since a date
2101
-
2102
- ```
2103
- $ <%=cmd%> aoc admin res user list --fields=email --query=@json:'{"q":"last_login_at:<2018-05-28"}'
2104
- :...............................:
2105
- : email :
2106
- :...............................:
2107
- : John.curtis@acme.com :
2108
- : Jean.Dupont@tropfort.com :
2109
- :...............................:
2110
- ```
2111
-
2112
- * List "Limited" users
2113
-
2114
- ```
2115
- $ <%=cmd%> aoc admin res user list --fields=email --select=@json:'{"member_of_any_workspace":false}'
2116
- ```
2117
-
2118
- * Perform a multi Gbps transfer between two remote shared folders
2119
-
2120
- In this example, a user has access to a workspace where two shared folders are located on differente sites, e.g. different cloud regions.
2121
-
2122
- First, setup the environment (skip if already done)
2123
-
2124
- ```
2125
- $ <%=cmd%> conf wizard --url=https://sedemo.ibmaspera.com --username=laurent.martin.aspera@fr.ibm.com
2126
- Detected: Aspera on Cloud
2127
- Preparing preset: aoc_sedemo
2128
- Using existing key:
2129
- /Users/laurent/.aspera/<%=cmd%>/aspera_aoc_key
2130
- Using global client_id.
2131
- Please Login to your Aspera on Cloud instance.
2132
- Navigate to your "Account Settings"
2133
- Check or update the value of "Public Key" to be:
2134
- -----BEGIN PUBLIC KEY-----
2135
- SOME PUBLIC KEY PEM DATA HERE
2136
- -----END PUBLIC KEY-----
2137
- Once updated or validated, press enter.
2138
-
2139
- creating new config preset: aoc_sedemo
2140
- Setting config preset as default for aspera
2141
- saving config file
2142
- Done.
2143
- You can test with:
2144
- $ <%=cmd%> aoc user info show
2145
- ```
2146
-
2147
- 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.
2148
-
2149
- Then, create two shared folders located in two regions, in your files home, in a workspace.
2150
-
2151
- Then, transfer between those:
2152
-
2153
- ```
2154
- $ <%=cmd%> -Paoc_show aoc 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}'
2155
- ```
2156
-
2157
- * create registration key to register a node
2158
-
2159
- ```
2160
- $ <%=cmd%> aoc admin res admin/client create @json:'{"data":{"name":"laurentnode","client_subject_scopes":["alee","aejd"],"client_subject_enabled":true}}' --fields=token --format=csv
2161
- jfqslfdjlfdjfhdjklqfhdkl
2162
- ```
2163
-
2164
- * delete all registration keys
2165
-
2166
- ```
2167
- $ <%=cmd%> aoc admin res admin/client list --fields=id --format=csv|<%=cmd%> aoc admin res admin/client delete --bulk=yes --id=@lines:@stdin:
2168
- +-----+---------+
2169
- | id | status |
2170
- +-----+---------+
2171
- | 99 | deleted |
2172
- | 100 | deleted |
2173
- | 101 | deleted |
2174
- | 102 | deleted |
2175
- +-----+---------+
2176
- ```
2177
-
2178
- * List packages in a given shared inbox
2179
-
2180
- First retrieve the id of the shared inbox, and then list packages with the appropriate filter.
2181
- (To find out available filters, consult the API definition, or use the web interface in developer mode).
2182
-
2183
- Note that when no query is provided, the query used by default is: `{"archived":false,"exclude_dropbox_packages":true,"has_content":true,"received":true}`. The workspace id is added if not already present in the query.
2184
-
2185
- ```
2186
- shbxid=$(ascli aoc user shared_inboxes --select=@json:'{"dropbox.name":"My Shared Inbox"}' --format=csv --fields=dropbox_id --display=data)
2187
-
2188
- ascli aoc packages list --query=@json:'{"dropbox_id":"'$shbxid'","archived":false,"received":true,"has_content":true,"exclude_dropbox_packages":false,"include_draft":false,"sort":"-received_at"}'
2189
- ```
2190
-
2191
- ## Shared folders
2192
-
2193
- * list shared folders in node
2194
-
2195
- ```
2196
- $ <%=cmd%> aoc admin res node --id=8669 shared_folders
2197
- ```
2198
-
2199
- * list shared folders in workspace
2200
-
2201
- ```
2202
- $ <%=cmd%> aoc admin res workspace --id=10818 shared_folders
2203
- ```
2204
-
2205
- * list members of shared folder
2206
-
2207
- ```
2208
- $ <%=cmd%> aoc admin res node --id=8669 v4 perm 82 show
2209
- ```
2210
-
2211
- ## Send a Package
2212
-
2213
- Send a package:
2214
-
2215
- ```
2216
- $ <%=cmd%> aoc packages send --value=[package extended value] [other parameters such as file list and transfer parameters]
2217
- ```
2218
-
2219
- Notes:
2220
-
2221
- * the `value` parameter can contain any supported package creation parameter. Refer to the AoC package creation API, or display an existing package to find attributes.
2222
- * to provide the list of recipients, use fields: "recipients" and/or "bcc_recipients". <%=cmd%> will resolve the list of email addresses to expected user ids.
2223
- * a recipient can be a shared inbox, in this case just use the name of the shared inbox as recipient.
2224
- * If a recipient is not already registered and the workspace allows external users, then the package is sent to an external user, and
2225
- * 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.
2226
- * if the option `new_user_option` is `@json:{}`, then external users are invited to join the workspace
2227
-
2228
- Examples:
2229
-
2230
- ```
2231
- $ <%=cmd%> aoc package send --value=@json:'{"name":"my title","note":"my note","recipients":["laurent.martin.aspera@fr.ibm.com","other@example.com"]}' --sources=@args my_file.dat
2232
- ```
2233
-
2234
- ```
2235
- $ <%=cmd%> aoc package send --value=@json:'{"name":"my file in shared inbox","recipients":["The Shared Inbox"]}' my_file.dat --ts=@json:'{"target_rate_kbps":100000}'
2236
- ```
2237
-
2238
- ```
2239
- $ <%=cmd%> aoc package send --workspace=eudemo --value=@json:'{"name":"my pack title","recipients":["Shared Inbox Name"],"metadata":[{"input_type":"single-text","name":"Project Id","values":["123"]},{"input_type":"single-dropdown","name":"Type","values":["Opt2"]},{"input_type":"multiple-checkbox","name":"CheckThose","values":["Check1","Check2"]},{"input_type":"date","name":"Optional Date","values":["2021-01-13T15:02:00.000Z"]}]}' ~/Documents/Samples/200KB.1
2240
- ```
2241
-
2242
- ## <a name="aoccargo"></a>Receive new packages only
2243
-
2244
- It is possible to automatically download new packages, like using Aspera Cargo:
2245
-
2246
- ```
2247
- $ <%=cmd%> aoc packages recv --id=ALL --once-only=yes --lock-port=12345
2248
- ```
2249
-
2250
- * `--id=ALL` (case sensitive) will download all packages
2251
- * `--once-only=yes` keeps memory of any downloaded package in persistency files located in the configuration folder.
2252
- * `--lock-port=12345` ensures that only one instance is started at the same time, to avoid collisions
2253
-
2254
- Typically, one would execute this command on a regular basis, using the method of your choice:
2255
-
2256
- * Windows: [Task Scheduler](https://docs.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page)
2257
- * Linux/Unix: [cron](https://www.man7.org/linux/man-pages/man5/crontab.5.html)
2258
- * etc...
2259
-
2260
- ## Download Files
2261
-
2262
- Download of files is straightforward with a specific syntax for the `aoc files download` action: Like other commands the source file list is provided as a list with the `sources` option. Nevertheless, consider this:
2263
-
2264
- * if only one source is provided, it is downloaded
2265
- * 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).
2266
-
2267
- ## Find Files
2268
-
2269
- The command `aoc 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)
2270
-
2271
- The expression can be of 3 formats:
2272
-
2273
- * empty (default) : all files, equivalent to value: `exec:true`
2274
- * not starting with `exec:` : the expression is a regular expression, using [Ruby Regex](https://ruby-doc.org/core/Regexp.html) syntax. equivalent to value: `exec:f['name'].match(/expression/)`
2275
-
2276
- For instance, to find files with a special extension, use `--value='\.myext$'`
2277
-
2278
- * 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 of the expression is true;
2279
-
2280
- Examples of expressions: (using like this: `--value=exec:'<expression>'`)
2281
-
2282
- * Find files more recent than 100 days
2283
-
2284
- ```
2285
- f["type"].eql?("file") and (DateTime.now-DateTime.parse(f["modified_time"]))<100
2286
- ```
2287
-
2288
- * Find files older than 1 year on a given node and store in file list
2289
-
2290
- ```
2291
- $ <%=cmd%> aoc 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
2292
- ```
2293
-
2294
- * Delete the files, one by one
2295
-
2296
- ```
2297
- $ cat my_file_list.txt|while read path;do echo <%=cmd%> aoc admin res node --name='my node name' --secret='my secret' v4 delete "$path" ;done
2298
- ```
2299
-
2300
- * Delete the files in bulk
2301
-
2302
- ```
2303
- cat my_file_list.txt | <%=cmd%> aoc admin res node --name='my node name' --secret='my secret' v3 delete @lines:@stdin:
2304
- ```
2305
-
2306
- ## Activity
2307
-
2308
- The activity app can be queried with:
2309
-
2310
- ```
2311
- $ <%=cmd%> aoc admin analytics transfers
2312
- ```
2313
-
2314
- It can also support filters and send notification using option `notif_to`. a template is defined using option `notif_template` :
2315
-
2316
- `mytemplate.erb`:
2317
-
2318
- ```
2319
- From: <%='<'%>%=from_name%> <<%='<'%>%=from_email%>>
2320
- To: <<%='<'%>%=ev['user_email']%>>
2321
- Subject: <%='<'%>%=ev['files_completed']%> files received
2322
-
2323
- Dear <%='<'%>%=ev[:user_email.to_s]%>,
2324
- We received <%='<'%>%=ev['files_completed']%> files for a total of <%='<'%>%=ev['transferred_bytes']%> bytes, starting with file:
2325
- <%='<'%>%=ev['content']%>
2326
-
2327
- Thank you.
2328
- ```
2329
- The environment provided contains the following additional variable:
2330
-
2331
- * ev : all details on the transfer event
2332
-
2333
- Example:
2334
-
2335
- ```
2336
- $ <%=cmd%> aoc admin analytics transfers --once-only=yes --lock-port=12345 \
2337
- --query=@json:'{"status":"completed","direction":"receive"}' \
2338
- --notif-to=active --notif-template=@file:mytemplate.erb
2339
- ```
2340
-
2341
- Options:
2342
-
2343
- * `once_only` keep track of last date it was called, so next call will get only new events
2344
- * `query` filter (on API call)
2345
- * `notify` send an email as specified by template, this could be places in a file with the `@file` modifier.
2346
-
2347
- 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. The period is [date of previous execution]..[now].
2348
-
2349
- ## Using specific transfer ports
2350
-
2351
- By default transfer nodes are expected to use ports TCP/UDP 33001. The web UI enforces that. The option `default_ports` ([yes]/no) allows <%=cmd%> to retrieve the server ports from an API call (download_setup) which reads the information from `aspera.conf` on the server.
2352
-
2353
-
2354
- # Plugin: Aspera Transfer Service
2355
-
2356
- ATS is usable either :
2357
-
2358
- * from an AoC subscription : <%=cmd%> aoc admin ats : use AoC authentication
2359
-
2360
- * or from an IBM Cloud subscription : <%=cmd%> ats : use IBM Cloud API key authentication
2361
-
2362
- ## IBM Cloud ATS : creation of api key
2363
-
2364
- First get your IBM Cloud APIkey. For instance, it can be created using the IBM Cloud web interface, or using command line:
2365
-
2366
- ```
2367
- $ ibmcloud iam api-key-create mykeyname -d 'my sample key'
2368
- OK
2369
- API key mykeyname was created
2370
-
2371
- Please preserve the API key! It cannot be retrieved after it's created.
2372
-
2373
- Name mykeyname
2374
- Description my sample key
2375
- Created At 2019-09-30T12:17+0000
2376
- API Key my_secret_api_key_here_8f8d9fdakjhfsashjk678
2377
- Locked false
2378
- UUID ApiKey-05b8fadf-e7fe-4bc4-93a9-6fd348c5ab1f
2379
- ```
2380
-
2381
- References:
2382
-
2383
- * [https://console.bluemix.net/docs/iam/userid_keys.html#userapikey](https://console.bluemix.net/docs/iam/userid_keys.html#userapikey)
2384
- * [https://ibm.ibmaspera.com/helpcenter/transfer-service](https://ibm.ibmaspera.com/helpcenter/transfer-service)
2385
-
2386
-
2387
- Then, to register the key by default for the ats plugin, create a preset. Execute:
2388
-
2389
- ```
2390
- $ <%=cmd%> config id my_ibm_ats update --ibm-api-key=my_secret_api_key_here_8f8d9fdakjhfsashjk678
2391
- $ <%=cmd%> config id default set ats my_ibm_ats
2392
- $ <%=cmd%> ats api_key instances
2393
- +--------------------------------------+
2394
- | instance |
2395
- +--------------------------------------+
2396
- | aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee |
2397
- +--------------------------------------+
2398
- $ <%=cmd%> config id my_ibm_ats update --instance=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
2399
- $ <%=cmd%> ats api_key create
2400
- +--------+----------------------------------------------+
2401
- | key | value |
2402
- +--------+----------------------------------------------+
2403
- | id | ats_XXXXXXXXXXXXXXXXXXXXXXXX |
2404
- | secret | YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY |
2405
- +--------+----------------------------------------------+
2406
- $ <%=cmd%> config id my_ibm_ats update --ats-key=ats_XXXXXXXXXXXXXXXXXXXXXXXX --ats-secret=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
2407
- ```
2408
- ## Cross Organization transfers
2409
-
2410
- It is possible to transfer files directly between organizations without having to first download locally and then upload...
2411
-
2412
- Although optional, the creation of <%=prst%> is recommended to avoid placing all parameters in the command line.
2413
-
2414
- Procedure to send a file from org1 to org2:
2415
-
2416
- * Get access to Organization 1 and create a <%=prst%>: e.g. `org1`, for instance, use the [Wizard](#aocwizard)
2417
- * Check that access works and locate the source file e.g. `mysourcefile`, e.g. using command `files browse`
2418
- * Get access to Organization 2 and create a <%=prst%>: e.g. `org2`
2419
- * Check that access works and locate the destination folder `mydestfolder`
2420
- * execute the following:
2421
-
2422
- ```
2423
- $ <%=cmd%> -Porg1 aoc files node_info /mydestfolder --format=json --display=data | <%=cmd%> -Porg2 aoc files upload mysourcefile --transfer=node --transfer-info=@json:@stdin:
2424
- ```
2425
-
2426
- Explanation:
2427
-
2428
- * `-Porg1 aoc` use Aspera on Cloud plugin and load credentials for `org1`
2429
- * `files node_info /mydestfolder` generate transfer information including node api credential and root id, suitable for the next command
2430
- * `--format=json` format the output in JSON (instead of default text table)
2431
- * `--display=data` display only the result, and remove other information, such as workspace name
2432
- * `|` the standard output of the first command is fed into the second one
2433
- * `-Porg2 aoc` use Aspera on Cloud plugin and load credentials for `org2`
2434
- * `files upload mysourcefile` upload the file named `mysourcefile` (located in `org1`)
2435
- * `--transfer=node` use transfer agent type `node` instead of default [`direct`](#direct)
2436
- * `--transfer-info=@json:@stdin:` provide `node` transfer agent information, i.e. node API credentials, those are expected in JSON format and read from standard input
2437
-
2438
- Note that when using a POSIX shell, another possibility to write `cmd1 | cmd2 --transfer-info=@json:stdin:` is `cmd2 --transfer-info=@json:$(cmd1)` instead of ``
2439
- ## Examples
2440
-
2441
- Example: create access key on softlayer:
2442
-
2443
- ```
2444
- $ <%=cmd%> 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_"}'
2445
- ```
2446
-
2447
- Example: create access key on AWS:
2448
-
2449
- ```
2450
- $ <%=cmd%> 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"}}'
2451
-
2452
- ```
2453
-
2454
- Example: create access key on Azure SAS:
2455
-
2456
- ```
2457
- $ <%=cmd%> 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":"/"}}'
2458
-
2459
- ```
2460
-
2461
- (Note that the blob name is mandatory after server address and before parameters. and that parameter sr=c is mandatory.)
2462
-
2463
- Example: create access key on Azure:
2464
-
2465
- ```
2466
- $ <%=cmd%> 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":"/"}}'
2467
-
2468
- ```
2469
-
2470
- delete all my access keys:
2471
-
2472
- ```
2473
- for k in $(<%=cmd%> ats access_key list --field=id --format=csv);do <%=cmd%> ats access_key id $k delete;done
2474
- ```
2475
-
2476
- # Plugin: IBM Aspera High Speed Transfer Server (transfer)
2477
-
2478
- This plugin works at FASP level (SSH/ascp/ascmd) and does not use the node API.
2479
-
2480
- ## Authentication
2481
-
2482
- Both password and SSH keys auth are supported.
2483
-
2484
- If not username is provided, the default transfer user `xfer` is used.
2485
-
2486
- If no ssh password or key is provided, and a token is provided in transfer spec, then standard bypass keys are used.
2487
-
2488
- ```
2489
- $ <%=cmd%> server --url=ssh://... --ts=@json:'{"token":"Basic abc123"}'
2490
- ```
2491
-
2492
- 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).
2493
-
2494
- Examples:
2495
-
2496
- ```
2497
- $ <%=cmd%> server --ssh-keys=~/.ssh/id_rsa
2498
- $ <%=cmd%> server --ssh-keys=@list:,~/.ssh/id_rsa
2499
- $ <%=cmd%> server --ssh-keys=@json:'["~/.ssh/id_rsa"]'
2500
- ```
2501
-
2502
- The underlying ssh library `net::ssh` provides several options that may be used depending on environment. By default the ssh library expect that an ssh-agent is running.
2503
-
2504
- If you get an error message such as:
2505
-
2506
- ```
2507
- [Linux]
2508
- ERROR -- net.ssh.authentication.agent: could not connect to ssh-agent: Agent not configured
2509
- ```
2510
-
2511
- or
2512
-
2513
- ```
2514
- [Windows]
2515
- ERROR -- net.ssh.authentication.agent: could not connect to ssh-agent: pageant process not running
2516
- ```
2517
-
2518
- This means that you dont have such an ssh agent running:
2519
-
2520
- * check env var: `SSH_AGENT_SOCK`
2521
- * check if the key is protected with a passphrase
2522
- * [check the manual](https://net-ssh.github.io/ssh/v1/chapter-2.html#s2)
2523
- * To diable use of `ssh-agent`, use the option `ssh_option` like this (or set in preset):
2524
-
2525
- ```
2526
- $ <%=cmd%> server --ssh-options=@ruby:'{use_agent: false}' ...
2527
- ```
2528
-
2529
- This can also be set as default using a preset.
2530
-
2531
- ## Example
2532
-
2533
- One can test the "server" application using the well known demo server:
2534
-
2535
- ```
2536
- $ <%=cmd%> config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_
2537
- $ <%=cmd%> config id default set server aspera_demo_server
2538
- $ <%=cmd%> server browse /aspera-test-dir-large
2539
- $ <%=cmd%> server download /aspera-test-dir-large/200MB
2540
- ```
2541
-
2542
- This creates a <%=prst%> "aspera_demo_server" and set it as default for application "server"
2543
-
2544
-
2545
- # Plugin: IBM Aspera High Speed Transfer Server (node)
2546
-
2547
- This plugin gives access to capabilities provided by HSTS node API.
2548
-
2549
- ## File Operations
2550
-
2551
- It is possible to:
2552
- * browse
2553
- * transfer (upload / download)
2554
- * ...
2555
-
2556
- For transfers, it is possible to control how transfer is authorized using option: `token_type`:
2557
-
2558
- * `aspera` : api `<upload|download>_setup` is called to create the transfer spec including the Aspera token
2559
- * `basic` : transfer spec is created like this:
2560
-
2561
- ```
2562
- {
2563
- "remote_host": address of node url,
2564
- "remote_user": "xfer",
2565
- "ssh_port": 33001,
2566
- "token": "Basic <base 64 encoded user/pass>",
2567
- "direction": send/recv
2568
- }
2569
- ```
2570
-
2571
- * `hybrid` : same as `aspera`, but token is replaced with basic token like `basic`
2572
-
2573
- ## Central
2574
-
2575
- The central subcommand uses the "reliable query" API (session and file). It allows listing transfer sessions and transfered files.
2576
-
2577
- Filtering can be applied:
2578
-
2579
- ```
2580
- $ <%=cmd%> node central file list
2581
- ```
2582
-
2583
- by providing the `validator` option, offline transfer validation can be done.
2584
-
2585
- ## FASP Stream
2586
-
2587
- It is possible to start a FASPStream session using the node API:
2588
-
2589
- Use the "node stream create" command, then arguments are provided as a [_transfer-spec_](#transferspec).
2590
-
2591
- ```
2592
- $ <%=cmd%> 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
2593
- ```
2594
-
2595
- ## Watchfolder
2596
-
2597
- 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.
2598
-
2599
- <%=tool%> supports remote operations through the node API. Operations are:
2600
-
2601
- * Start watchd and watchfolderd services running as a system user having access to files
2602
- * configure a watchfolder to define automated transfers
2603
-
2604
- ```
2605
- $ <%=cmd%> node service create @json:'{"id":"mywatchd","type":"WATCHD","run_as":{"user":"user1"}}'
2606
- $ <%=cmd%> node service create @json:'{"id":"mywatchfolderd","type":"WATCHFOLDERD","run_as":{"user":"user1"}}'
2607
- $ <%=cmd%> node watch_folder create @json:'{"id":"mywfolder","source_dir":"/watch1","target_dir":"/","transport":{"host":"10.25.0.4","user":"user1","pass":"mypassword"}}'
2608
- ```
2609
-
2610
- ## Out of Transfer File Validation
2611
-
2612
- Follow the Aspera Transfer Server configuration to activate this feature.
2613
-
2614
- ```
2615
- $ <%=cmd%> node central file list --validator=<%=cmd%> --data=@json:'{"file_transfer_filter":{"max_result":1}}'
2616
- :..............:..............:............:......................................:
2617
- : session_uuid : file_id : status : path :
2618
- :..............:..............:............:......................................:
2619
- : 1a74444c-... : 084fb181-... : validating : /home/xfer.../PKG - my title/200KB.1 :
2620
- :..............:..............:............:......................................:
2621
- $ <%=cmd%> node central file update --validator=<%=cmd%> --data=@json:'{"files":[{"session_uuid": "1a74444c-...","file_id": "084fb181-...","status": "completed"}]}'
2622
- updated
2623
- ```
2624
-
2625
- ## Example: SHOD to ATS
2626
-
2627
- Access to a "Shares on Demand" (SHOD) server on AWS is provided by a partner. And we need to
2628
- transfer files from this third party SHOD instance into our Azure BLOB storage.
2629
- Simply create an "Aspera Transfer Service" instance (https://ts.asperasoft.com), which
2630
- provides access to the node API.
2631
- Then create a configuration for the "SHOD" instance in the configuration file: in section
2632
- "shares", a configuration named: awsshod.
2633
- Create another configuration for the Azure ATS instance: in section "node", named azureats.
2634
- Then execute the following command:
2635
-
2636
- ```
2637
- $ <%=cmd%> node download /share/sourcefile --to-folder=/destinationfolder --preset=awsshod --transfer=node --transfer-info=@preset:azureats
2638
- ```
2639
-
2640
- This will get transfer information from the SHOD instance and tell the Azure ATS instance
2641
- to download files.
2642
-
2643
- ## Create access key
2644
-
2645
- ```
2646
- $ <%=cmd%> node access_key create --value=@json:'{"id":"eudemo-sedemo","secret":"mystrongsecret","storage":{"type":"local","path":"/data/asperafiles"}}'
2647
- ```
2648
-
2649
- # Plugin: IBM Aspera Faspex5
2650
-
2651
- 3 authentication methods are supported:
2652
-
2653
- * jwt
2654
- * web
2655
- * boot
2656
-
2657
- For JWT, create an API client in Faspex with jwt support, and use: `--auth=jwt`.
2658
-
2659
- For web method, create an API client in Faspex, and use: --auth=web
2660
-
2661
- For boot method: (will be removed in future)
2662
-
2663
- * open a browser
2664
- * start developer mode
2665
- * login to faspex 5
2666
- * find the first API call with `Authorization` token, and copy it (kind of base64 long string)
2667
-
2668
- Use it as password and use `--auth=boot`.
2669
-
2670
- ```
2671
- $ <%=cmd%> conf id f5boot update --url=https://localhost/aspera/faspex --auth=boot --password=ABC.DEF.GHI...
2672
- ```
2673
-
2674
- Ready to use Faspex5 with CLI.
2675
-
2676
- # Plugin: IBM Aspera Faspex (4.x)
2677
-
2678
- Notes:
2679
-
2680
- * The command "v4" requires the use of APIv4, refer to the Faspex Admin manual on how to activate.
2681
- * For full details on Faspex API, refer to: [Reference on Developer Site](https://developer.ibm.com/apis/catalog/?search=faspex)
2682
-
2683
- ## Listing Packages
2684
-
2685
- Command: `faspex package list`
2686
-
2687
- ### Option `box`
2688
-
2689
- By default it looks in box `inbox`, but the following boxes are also supported: `archive` and `sent`, selected with option `box`.
2690
-
2691
- ### Option `recipient`
2692
-
2693
- A user can receive a package because the recipient is:
2694
-
2695
- * the user himself (default)
2696
- * the user is part of a dropbox or a workgroup (select with option `recipient` with value `*<name of WG or DB>`
2697
-
2698
- ### Option `query`
2699
-
2700
- As inboxes may be large, it is possible to use the following query parameters:
2701
-
2702
- * `count` : (native) number items in one API call (default=0, equivalent to 10)
2703
- * `page` : (native) id of page in call (default=0)
2704
- * `startIndex` : (native) index of item to start, default=0, oldest index=0
2705
- * `max` : maximum number of items
2706
- * `pmax` : maximum number of pages
2707
-
2708
- (SQL query is `LIMIT <startIndex>, <count>`)
2709
-
2710
- The API is listed in [Faspex 4 API Reference](https://developer.ibm.com/apis/catalog/?search=faspex) under "Services (API v.3)".
2711
-
2712
- If no parameter `max` or `pmax` is provided, then all packages will be listed in the inbox, which result in paged API calls (using parameter: `count` and `page`). By default page is `0` (`10`), it can be increased to have less calls.
2713
-
2714
- ### Example
2715
-
2716
- ```
2717
- $ <%=cmd%> faspex package list --box=inbox --recipient='*my_dropbox' --query=@json:'{"max":20,"pmax":2,"count":20}'
2718
- ```
2719
-
2720
- List a maximum of 20 items grouped by pages of 20, with maximum 2 pages in received box (inbox) when received in dropbox `*my_dropbox`.
2721
-
2722
- ## Receiving a Package
2723
-
2724
- The command is `package recv`, possible methods are:
2725
-
2726
- * provide a package id with option `id`
2727
- * provide a public link with option `link`
2728
- * provide a `faspe:` URI with option `link`
2729
-
2730
- ```
2731
- $ <%=cmd%> faspex package recv --id=12345
2732
- $ <%=cmd%> faspex package recv --link=faspe://...
2733
- ```
2734
-
2735
- If the package is in a specific dropbox, add option `recipient` for both the `list` and `recv` commands.
2736
-
2737
- ```
2738
- $ <%=cmd%> faspex package list --recipient='*thedropboxname'
2739
- ```
2740
-
2741
- if `id` is set to `ALL`, then all packages are downloaded, and if option `once_only`is used, then a persistency file is created to keep track of already downloaded packages.
2742
-
2743
- ## Sending a Package
2744
-
2745
- The command is `faspex package send`. Package information (title, note, metadata, options) is provided in option `delivery_info`. (Refer to Faspex API).
2746
-
2747
- Example:
2748
-
2749
- ```
2750
- $ <%=cmd%> faspex package send --delivery-info=@json:'{"title":"my title","recipients":["laurent.martin.aspera@fr.ibm.com"]}' --url=https://faspex.corp.com/aspera/faspex --username=foo --password=bar /tmp/file1 /home/bar/file2
2751
- ```
2752
-
2753
- If the recipient is a dropbox, just provide the name of the dropbox in `recipients`: `"recipients":["My Dropbox Name"]`
2754
-
2755
- Additional optional parameters in `delivery_info`:
2756
-
2757
- * Package Note: : `"note":"note this and that"`
2758
- * Package Metadata: `"metadata":{"Meta1":"Val1","Meta2":"Val2"}`
2759
-
2760
- ## Email notification on transfer
2761
-
2762
- Like for any transfer, a notification can be sent by email using parameters: `notif_to` and `notif_template` .
2763
-
2764
- Example:
2765
-
2766
- ```
2767
- $ <%=cmd%> faspex package send --delivery-info=@json:'{"title":"test pkg 1","recipients":["aspera.user1@gmail.com"]}' ~/Documents/Samples/200KB.1 --notif-to=aspera.user1@gmail.com --notif-template=@ruby:'%Q{From: <%='<'%>%=from_name%> <<%='<'%>%=from_email%>>\nTo: <<%='<'%>%=to%>>\nSubject: Package sent: <%='<'%>%=ts["tags"]["aspera"]["faspex"]["metadata"]["_pkg_name"]%> files received\n\nTo user: <%='<'%>%=ts["tags"]["aspera"]["faspex"]["recipients"].first["email"]%>}'
2768
- ```
2769
-
2770
- In this example the notification template is directly provided on command line. Package information placed in the message are directly taken from the tags in transfer spec. The template can be placed in a file using modifier: `@file:`
2771
-
2772
- ## Operation on dropboxes
2773
-
2774
- Example:
2775
-
2776
- ```
2777
- $ <%=cmd%> faspex v4 dropbox create --value=@json:'{"dropbox":{"e_wg_name":"test1","e_wg_desc":"test1"}}'
2778
- $ <%=cmd%> faspex v4 dropbox list
2779
- $ <%=cmd%> faspex v4 dropbox delete --id=36
2780
- ```
2781
-
2782
- ## Remote sources
2783
-
2784
- Faspex lacks an API to list the contents of a remote source (available in web UI). To workaround this,
2785
- the node API is used, for this it is required to add a section ":storage" that links
2786
- a storage name to a node config and sub path.
2787
-
2788
- Example:
2789
-
2790
- ```yaml
2791
- my_faspex_conf:
2792
- url: https://10.25.0.3/aspera/faspex
2793
- username: admin
2794
- password: MyPassword
2795
- storage:
2796
- testlaurent:
2797
- node: "@preset:my_faspex_node"
2798
- path: /myfiles
2799
- my_faspex_node:
2800
- url: https://10.25.0.3:9092
2801
- username: node_faspex
2802
- password: MyPassword
2803
- ```
2804
-
2805
- In this example, a faspex storage named "testlaurent" exists in Faspex, and is located
2806
- under the docroot in "/myfiles" (this must be the same as configured in Faspex).
2807
- The node configuration name is "my_faspex_node" here.
2808
-
2809
- Note: the v4 API provide an API for nodes and shares.
2810
-
2811
- ## Automated package download (cargo)
2812
-
2813
- It is possible to tell <%=tool%> to download newly received packages, much like the official
2814
- cargo client, or drive. Refer to the [same section](#aoccargo) in the Aspera on Cloud plugin:
2815
-
2816
- ```
2817
- $ <%=cmd%> faspex packages recv --id=ALL --once-only=yes --lock-port=12345
2818
- ```
2819
-
2820
- # Plugin: IBM Aspera Shares
2821
-
2822
- Aspera Shares supports the "node API" for the file transfer part. (Shares 1 and 2)
2823
-
2824
- In Shares2, users, groups listing are paged, to display sequential pages:
2825
-
2826
- ```
2827
- $ for p in 1 2 3;do <%=cmd%> shares2 admin users list --value=@json:'{"page":'$p'}';done
2828
- ```
2829
-
2830
- # Plugin: IBM Cloud Object Storage
2831
-
2832
- The IBM Cloud Object Storage provides the possibility to execute transfers using FASP.
2833
- It uses the same transfer service as Aspera on Cloud, called Aspera Transfer Service (ATS).
2834
- Available ATS regions: [https://status.aspera.io](https://status.aspera.io)
2835
-
2836
- There are two possibilities to provide credentials. If you already have the endpoint, apikey and CRN, use the forst method. If you dont have credentials but have access to the IBM Cloud console, then use the second method.
2837
-
2838
- ## Using endpoint, apikey and Ressource Instance ID (CRN)
2839
-
2840
- If you have those parameters already, then following options shall be provided:
2841
-
2842
- * `bucket` bucket name
2843
- * `endpoint` storage endpoint url, e.g. https://s3.hkg02.cloud-object-storage.appdomain.cloud
2844
- * `apikey` API Key
2845
- * `crn` resource instance id
2846
-
2847
- For example, let us create a default configuration:
2848
-
2849
- ```
2850
- $ <%=cmd%> conf id mycos update --bucket=mybucket --endpoint=https://s3.us-east.cloud-object-storage.appdomain.cloud --apikey=abcdefgh --crn=crn:v1:bluemix:public:iam-identity::a/xxxxxxx
2851
- $ <%=cmd%> conf id default set cos mycos
2852
- ```
2853
-
2854
- Then, jump to the transfer example.
2855
-
2856
- ## Using service credential file
2857
-
2858
- If you are the COS administrator and dont have yet the credential: Service credentials are directly created using the IBM cloud web ui. Navigate to:
2859
-
2860
- 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
2861
-
2862
- Then save the copied value to a file, e.g. : `$HOME/cos_service_creds.json`
2863
-
2864
- or using the IBM Cloud CLI:
2865
-
2866
- ```
2867
- $ ibmcloud resource service-keys
2868
- $ ibmcloud resource service-key aoclaurent --output JSON|jq '.[0].credentials'>$HOME/service_creds.json
2869
- ```
2870
-
2871
- (if you dont have `jq` installed, extract the structure as follows)
2872
-
2873
- It consists in the following structure:
2874
-
2875
- ```
2876
- {
2877
- "apikey": "xxxxxxx.....",
2878
- "cos_hmac_keys": {
2879
- "access_key_id": "xxxxxxx.....",
2880
- "secret_access_key": "xxxxxxx....."
2881
- },
2882
- "endpoints": "https://control.cloud-object-storage.cloud.ibm.com/v2/endpoints",
2883
- "iam_apikey_description": "my description ...",
2884
- "iam_apikey_name": "my key name",
2885
- "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
2886
- "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/xxxxxxx.....",
2887
- "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/xxxxxxx....."
2888
- }
2889
- ```
2890
-
2891
- The field `resource_instance_id` is for option `crn`
2892
-
2893
- The field `apikey` is for option `apikey`
2894
-
2895
- (If needed: endpoints for regions can be found by querying the `endpoints` URL.)
2896
-
2897
- The required options for this method are:
2898
-
2899
- * `bucket` bucket name
2900
- * `region` bucket region, e.g. eu-de
2901
- * `service_credentials` see below
2902
-
2903
- For example, let us create a default configuration:
2904
-
2905
- ```
2906
- $ <%=cmd%> conf id mycos update --bucket=laurent --service-credentials=@val:@json:@file:~/service_creds.json --region=us-south
2907
- $ <%=cmd%> conf id default set cos mycos
2908
- ```
2909
-
2910
- ## Operations, transfers
2911
-
2912
- Let's assume you created a default configuration from once of the two previous steps (else specify the access options on command lines).
2913
-
2914
- A subset of `node` plugin operations are supported, basically node API:
2915
-
2916
- ```
2917
- $ <%=cmd%> cos node info
2918
- $ <%=cmd%> cos node upload 'faux:///sample1G?1g'
2919
- ```
2920
-
2921
- Note: we generate a dummy file `sample1G` of size 2GB using the `faux` PVCL (man ascp and section above), but you can of course send a real file by specifying a real file instead.
2922
-
2923
- # Plugin: IBM Aspera Sync
2924
-
2925
- A basic plugin to start an "async" using <%=tool%>.
2926
- The main advantage is the possibility to start from ma configuration file, using <%=tool%> standard options.
2927
-
2928
- # Plugin: Preview
2929
-
2930
- The `preview` generates "previews" of graphical files, i.e. thumbnails (office, images, video) and video previews on storage for use primarily in the Aspera on Cloud application.
2931
- This is based on the "node API" of Aspera HSTS when using Access Keys only inside it's "storage root".
2932
- Several parameters can be used to tune several aspects:
2933
-
2934
- * methods for detection of new files needing generation
2935
- * methods for generation of video preview
2936
- * parameters for video handling
2937
-
2938
- ## Aspera Server configuration
2939
-
2940
- Specify the previews folder as shown in:
2941
-
2942
- <https://ibmaspera.com/help/admin/organization/installing_the_preview_maker>
2943
-
2944
- 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:
2945
-
2946
- ```
2947
- # /opt/aspera/bin/asconfigurator -x "server;preview_dir,previews"
2948
- # /opt/aspera/bin/asnodeadmin --reload
2949
- ```
2950
-
2951
- Note: the configuration `preview_dir` is *relative* to the storage root, no need leading or trailing `/`. In general just set the value to `previews`
2952
-
2953
- If another folder is configured on the HSTS, then specify it to <%=tool%> using the option `previews_folder`.
2954
-
2955
- The HSTS node API limits any preview file to a parameter: `max_request_file_create_size_kb` (1 KB is 1024 bytes).
2956
- This size is internally capped to `1<<24` Bytes (16777216) , i.e. 16384 KBytes.
2957
-
2958
- To change this parameter in `aspera.conf`, use `asconfigurator`. To display the value, use `asuserdata`:
2959
-
2960
- ```
2961
- # /opt/aspera/bin/asuserdata -a | grep max_request_file_create_size_kb
2962
- max_request_file_create_size_kb: "1024"
2963
- # /opt/aspera/bin/asconfigurator -x "server; max_request_file_create_size_kb,16384"
2964
- ```
2965
-
2966
- If you use a value different than 16777216, then specify it using option `max_size`.
2967
-
2968
- Note: the HSTS parameter (max_request_file_create_size_kb) is in *kiloBytes* while the generator parameter is in *Bytes* (factor of 1024).
2969
-
2970
- ## <a name="prev_ext"></a>External tools: Linux
2971
-
2972
- The tool requires the following external tools available in the `PATH`:
2973
-
2974
- * ImageMagick : `convert` `composite`
2975
- * OptiPNG : `optipng`
2976
- * FFmpeg : `ffmpeg` `ffprobe`
2977
- * Libreoffice : `libreoffice`
2978
- * ruby gem `mimemagic`
2979
-
2980
- Here shown on Redhat/CentOS.
2981
-
2982
- Other OSes should work as well, but are note tested.
2983
-
2984
- To check if all tools are found properly, execute:
2985
-
2986
- ```
2987
- $ <%=cmd%> preview check
2988
- ```
2989
-
2990
- ### mimemagic
2991
-
2992
- To benefit from extra mime type detection install gem mimemagic:
2993
-
2994
- ```
2995
- # gem install mimemagic
2996
- ```
2997
-
2998
- or to install an earlier version if any problem:
2999
-
3000
- ```
3001
- # gem install mimemagic -v '~> 0.3.0'
3002
- ```
3003
-
3004
- To use it, set option `mimemagic` to `yes`: `--mimemagic=yes`
3005
-
3006
- If not used, Mime type used for conversion is the one provided by the node API.
3007
-
3008
- If used, it the `preview` command will first analyse the file content using mimemagic, and if no match, will try by extension.
3009
-
3010
- ### Image: Imagemagick and optipng
3011
-
3012
- ```
3013
- yum install -y ImageMagick optipng
3014
- ```
3015
-
3016
- ### Video: FFmpeg
3017
-
3018
- The easiest method is to download and install the latest released version of ffmpeg with static libraries from [https://johnvansickle.com/ffmpeg/](https://johnvansickle.com/ffmpeg/)
3019
-
3020
- ```
3021
- curl -s https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz|(mkdir -p /opt && cd /opt && rm -f ffmpeg /usr/bin/{ffmpeg,ffprobe} && rm -fr ffmpeg-*-amd64-static && tar xJvf - && ln -s ffmpeg-* ffmpeg && ln -s /opt/ffmpeg/{ffmpeg,ffprobe} /usr/bin)
3022
- ```
3023
-
3024
- ### Office: Unoconv and Libreoffice
3025
-
3026
- 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`
3027
-
3028
- The generation of preview in based on the use of `unoconv` and `libreoffice`
3029
-
3030
- * Centos 8
3031
-
3032
- ```
3033
- # dnf install unoconv
3034
- ```
3035
-
3036
- * Amazon Linux
3037
-
3038
- ```
3039
- # amazon-linux-extras enable libreoffice
3040
- # yum clean metadata
3041
- # yum install libreoffice-core libreoffice-calc libreoffice-opensymbol-fonts libreoffice-ure libreoffice-writer libreoffice-pyuno libreoffice-impress
3042
- # wget https://raw.githubusercontent.com/unoconv/unoconv/master/unoconv
3043
- # mv unoconv /usr/bin
3044
- # chmod a+x /usr/bin/unoconv
3045
- ```
3046
-
3047
- ## Configuration
3048
-
3049
- The preview generator is run as a user, preferably a regular user (not root). When using object storage, any user can be used, but when using local storage it is usually better to use the user `xfer`, as uploaded files are under this identity: this ensures proper access rights. (we will assume this)
3050
-
3051
- Like any <%=tool%> commands, parameters can be passed on command line or using a configuration <%=prst%>. The configuration file must be created with the same user used to run so that it is properly used on runtime.
3052
-
3053
- Note that the `xfer` user has a special protected shell: `aspshell`, so changing identity requires specification of alternate shell:
3054
-
3055
- ```
3056
- # su -s /bin/bash - xfer
3057
- $ <%=cmd%> config id previewconf update --url=https://localhost:9092 --username=my_access_key --password=my_secret --skip-types=office --lock-port=12346
3058
- $ <%=cmd%> config id default set preview previewconf
3059
- ```
3060
-
3061
- Here we assume that Office file generation is disabled, else remove this option.
3062
- `lock_port` prevents concurrent execution of generation when using a scheduler.
3063
-
3064
- One can check if the access key is well configured using:
3065
-
3066
- ```
3067
- $ <%=cmd%> -Ppreviewconf node browse /
3068
- ```
3069
-
3070
- This shall list the contents of the storage root of the access key.
3071
-
3072
- ## Execution
3073
-
3074
- The tool intentionally supports only a "one shot" mode (no infinite loop) in order to avoid having a hanging process or using too many resources (calling REST api too quickly during the scan or event method).
3075
- It needs to be run on a regular basis to create or update preview files. For that use your best
3076
- reliable scheduler. For instance use "CRON" on Linux or Task Scheduler on Windows.
3077
-
3078
- Typically, for "Access key" access, the system/transfer is `xfer`. So, in order to be consistent have generate the appropriate access rights, the generation process should be run as user `xfer`.
3079
-
3080
- Lets do a one shot test, using the configuration previously created:
3081
-
3082
- ```
3083
- # su -s /bin/bash - xfer
3084
- xfer$ <%=cmd%> preview scan --overwrite=always
3085
- ```
3086
-
3087
- When the preview generator is first executed it will create a file: `.aspera_access_key`
3088
- in the previews folder which contains the access key used.
3089
- 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.
3090
-
3091
- ## Configuration for Execution in scheduler
3092
-
3093
- Here is an example of configuration for use with cron on Linux.
3094
- Adapt the scripts to your own preference.
3095
-
3096
- We assume here that a configuration preset was created as shown previously.
3097
-
3098
- Lets first setup a script that will be used in the sceduler and sets up the environment.
3099
-
3100
- Example of startup script `cron_<%=cmd%>`, which sets the Ruby environment and adds some timeout protection:
3101
-
3102
- ```
3103
- #!/bin/bash
3104
- # set a timeout protection, just in case
3105
- case "$*" in *trev*) tmout=10m ;; *) tmout=30m ;; esac
3106
- . /etc/profile.d/rvm.sh
3107
- rvm use 2.6 --quiet
3108
- exec timeout ${tmout} <%=cmd%> "${@}"
3109
- ```
3110
-
3111
- Here the cronjob is created for user `xfer`.
3112
-
3113
- ```
3114
- xfer$ crontab<<EOF
3115
- 0 * * * * /home/xfer/cron_<%=cmd%> preview scan --logger=syslog --display=error
3116
- 2-59 * * * * /home/xfer/cron_<%=cmd%> preview trev --logger=syslog --display=error
3117
- EOF
3118
- ```
3119
-
3120
- Note that the loging options are kept in the cronfile instead of conf file to allow execution on command line with output on command line.
3121
-
3122
- ## Candidate detection for creation or update (or deletion)
3123
-
3124
- The tool generates preview files using those commands:
3125
-
3126
- * `trevents` : only recently uploaded files will be tested (transfer events)
3127
- * `events` : only recently uploaded files will be tested (file events: not working)
3128
- * `scan` : recursively scan all files under the access key&apos;s "storage root"
3129
- * `test` : test using a local file
3130
-
3131
- Once candidate are selected, once candidates are selected,
3132
- a preview is always generated if it does not exist already,
3133
- else if a preview already exist, it will be generated
3134
- using one of three values for the `overwrite` option:
3135
-
3136
- * `always` : preview is always generated, even if it already exists and is newer than original
3137
- * `never` : preview is generated only if it does not exist already
3138
- * `mtime` : preview is generated only if the original file is newer than the existing
3139
-
3140
- Deletion of preview for deleted source files: not implemented yet (TODO).
3141
-
3142
- If the `scan` or `events` detection method is used, then the option : `skip_folders` can be used to skip some folders. It expects a list of path relative to the storage root (docroot) starting with slash, use the `@json:` notation, example:
3143
-
3144
- ```
3145
- $ <%=cmd%> preview scan --skip-folders=@json:'["/not_here"]'
3146
- ```
3147
-
3148
- The option `folder_reset_cache` forces the node service to refresh folder contents using various methods.
3149
-
3150
- When scanning the option `value` has the same behaviour as for the `node find` command.
3151
-
3152
- For instance to filter out files beginning with `._` do:
3153
-
3154
- ```
3155
- ... --value='exec:!f["name"].start_with?("._") or f["name"].eql?(".DS_Store")'
3156
- ```
3157
-
3158
- ## Preview File types
3159
-
3160
- Two types of preview can be generated:
3161
-
3162
- * png: thumbnail
3163
- * mp4: video preview (only for video)
3164
-
3165
- Use option `skip_format` to skip generation of a format.
3166
-
3167
- ## Supported input Files types
3168
-
3169
- The preview generator supports redering of those file categories:
3170
-
3171
- * image
3172
- * pdf
3173
- * plaintext
3174
- * office
3175
- * video
3176
-
3177
- To avoid generation for some categories, specify a list using option `skip_types`.
3178
-
3179
- Each category has a specific rendering method to produce the png thumbnail.
3180
-
3181
- The mp4 video preview file is only for category `video`
3182
-
3183
- File type is primarily based on file extension detected by the node API and translated info a mime type returned by the node API.
3184
-
3185
- The tool can also locally detect the mime type using gem `mimemagic`.
3186
-
3187
- ## Access to original files and preview creation
3188
-
3189
- Standard open source tools are used to create thumnails and video previews.
3190
- Those tools require that original files are accessible in the local file system and also write generated files on the local file system.
3191
- The tool provides 2 ways to read and write files with the option: `file_access`
3192
-
3193
- 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
3194
- are directly written to the storage.
3195
-
3196
- 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`.
3197
-
3198
-
3199
- # SMTP for email notifications
3200
-
3201
- Aspera CLI can send email, for that setup SMTP configuration. This is done with option `smtp`.
3202
-
3203
- The `smtp` option is a hash table (extended value) with the following fields:
3204
- <table>
3205
- <tr><th>field</th><th>default</th><th>example</th><th>description</th></tr>
3206
- <tr><td>`server`</td><td>-</td><td>smtp.gmail.com</td><td>SMTP server address</td></tr>
3207
- <tr><td>`tls`</td><td>true</td><td>false</td><td>use of TLS</td></tr>
3208
- <tr><td>`port`</td><td>587 for tls<br/>25 else</td><td>587</td><td>port for service</td></tr>
3209
- <tr><td>`domain`</td><td>domain of server</td><td>gmail.com</td><td>email domain of user</td></tr>
3210
- <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>
3211
- <tr><td>`password`</td><td>-</td><td>MyP@ssword</td><td>password for above username</td></tr>
3212
- <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>
3213
- <tr><td>`from_name`</td><td>same as email</td><td>John Wayne</td><td>display name of sender</td></tr>
3214
- </table>
3215
-
3216
- ## Example of configuration:
3217
-
3218
- ```
3219
- $ <%=cmd%> config id smtp_google set server smtp.google.com
3220
- $ <%=cmd%> config id smtp_google set username john@gmail.com
3221
- $ <%=cmd%> config id smtp_google set password P@ssw0rd
3222
- ```
3223
-
3224
- or
3225
-
3226
- ```
3227
- $ <%=cmd%> config id smtp_google init @json:'{"server":"smtp.google.com","username":"john@gmail.com","password":"P@ssw0rd"}'
3228
- ```
3229
-
3230
- or
3231
-
3232
- ```
3233
- $ <%=cmd%> config id smtp_google update --server=smtp.google.com --username=john@gmail.com --password=P@ssw0rd
3234
- ```
3235
-
3236
- Set this configation as global default, for instance:
3237
-
3238
- ```
3239
- $ <%=cmd%> config id cli_default set smtp @val:@preset:smtp_google
3240
- $ <%=cmd%> config id default set config cli_default
3241
- ```
3242
-
3243
- ## Email templates
3244
-
3245
- Sent emails are built using a template that uses the [ERB](https://www.tutorialspoint.com/ruby/eruby.htm) syntax.
3246
-
3247
- The template is the full SMTP message, including headers.
3248
-
3249
- The following variables are defined by default:
3250
-
3251
- * from_name
3252
- * from_email
3253
- * to
3254
-
3255
- Other variables are defined depending on context.
3256
-
3257
- ## Test
3258
-
3259
- Check settings with `smtp_settings` command. Send test email with `email_test`.
3260
-
3261
- ```
3262
- $ <%=cmd%> config --smtp=@preset:smtp_google smtp
3263
- $ <%=cmd%> config --smtp=@preset:smtp_google email --notif-to=sample.dest@example.com
3264
- ```
3265
-
3266
- ## Notifications for transfer status
3267
-
3268
- An e-mail notification can be sent upon transfer success and failure (one email per transfer job, one job being possibly multi session, and possibly after retry).
3269
-
3270
- To activate, use option `notif_to`.
3271
-
3272
- A default e-mail template is used, but it can be overriden with option `notif_template`.
3273
-
3274
- The environment provided contains the following additional variables:
3275
-
3276
- * subject
3277
- * body
3278
- * global_transfer_status
3279
- * ts
3280
-
3281
- Example of template:
3282
-
3283
- ```
3284
- From: <%='<'%>%=from_name%> <<%='<'%>%=from_email%>>
3285
- To: <<%='<'%>%=to%>>
3286
- Subject: <%='<'%>%=subject%>
3287
-
3288
- Transfer is: <%='<'%>%=global_transfer_status%>
3289
- ```
3290
-
3291
- # Tool: `asession`
3292
-
3293
- This gem comes with a second executable tool providing a simplified standardized interface
3294
- to start a FASP session: `asession`.
3295
-
3296
- It aims at simplifying the startup of a FASP session from a programmatic stand point as formating a [_transfer-spec_](#transferspec) is:
3297
-
3298
- * common to Aspera Node API (HTTP POST /ops/transfer)
3299
- * common to Aspera Connect API (browser javascript startTransfer)
3300
- * easy to generate by using any third party language specific JSON library
3301
-
3302
- Hopefully, IBM integrates this diectly in `ascp`, and this tool is made redundant.
3303
-
3304
- 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.
3305
-
3306
- The tool expect one single argument: a [_transfer-spec_](#transferspec).
3307
-
3308
- If not argument is provided, it assumes a value of: `@json:@stdin:`, i.e. a JSON formated [_transfer-spec_](#transferspec) on stdin.
3309
-
3310
- Note that if JSON is the format, one has to specify `@json:` to tell the tool to decode the hash using JSON.
3311
-
3312
- During execution, it generates all low level events, one per line, in JSON format on stdout.
3313
-
3314
- Note that there are special "extended" [_transfer-spec_](#transferspec) parameters supported by `asession`:
3315
-
3316
- * `EX_loglevel` to change log level of the tool
3317
- * `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`
3318
-
3319
- Note that in addition, many "EX_" [_transfer-spec_](#transferspec) parameters are supported for the [`direct`](#direct) transfer agent (used by `asession`), refer to section [_transfer-spec_](#transferspec).
3320
-
3321
- ## Comparison of interfaces
3322
-
3323
- <table>
3324
- <tr><th>feature/tool</th><th>asession</th><th>ascp</th><th>FaspManager</th><th>Transfer SDK</th></tr>
3325
- <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>
3326
- <tr><td>additional components to ascp</td><td>Ruby<br/>Aspera</td><td>-</td><td>library<br/>(headers)</td><td>daemon</td></tr>
3327
- <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>
3328
- <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>
3329
- <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>
3330
-
3331
- ## Simple session
3332
-
3333
- ```
3334
- MY_TSPEC='{"remote_host":"demo.asperasoft.com","remote_user":"asperaweb","ssh_port":33001,"remote_password":"_demo_pass_","direction":"receive","destination_root":"./test.dir","paths":[{"source":"/aspera-test-dir-tiny/200KB.1"}],"resume_level":"none"}'
3335
-
3336
- echo "${MY_TSPEC}"|asession
3337
- ```
3338
-
3339
- ## Asynchronous commands and Persistent session
3340
-
3341
- `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`
3342
-
3343
- This is particularly useful for a persistent session ( with the [_transfer-spec_](#transferspec) parameter: `"keepalive":true` )
3344
-
3345
- ```
3346
- $ asession
3347
- {"remote_host":"demo.asperasoft.com","ssh_port":33001,"remote_user":"asperaweb","remote_password":"_demo_pass_","direction":"receive","destination_root":".","keepalive":true,"resume_level":"none"}
3348
- {"type":"START","source":"/aspera-test-dir-tiny/200KB.2"}
3349
- {"type":"DONE"}
3350
- ```
3351
-
3352
- (events from FASP are not shown in above example. They would appear after each command)
3353
-
3354
- ## Example of language wrapper
3355
-
3356
- Nodejs: [https://www.npmjs.com/package/aspera](https://www.npmjs.com/package/aspera)
3357
-
3358
- ## Help
3359
-
3360
- ```
3361
- $ asession -h
3362
- <%=File.read(ENV["INCL_ASESSION"])%>
3363
- ```
3364
-
3365
- # Hot folder
3366
-
3367
- ## Requirements
3368
-
3369
- <%=tool%> maybe used as a simple hot folder engine. A hot folder being defined as a tool that:
3370
-
3371
- * locally (or remotely) detects new files in a top folder
3372
- * send detected files to a remote (respectively, local) repository
3373
- * only sends new files, do not re-send already sent files
3374
- * optionally: sends only files that are not still "growing"
3375
- * optionally: after transfer of files, deletes or moves to an archive
3376
-
3377
- In addition: the detection should be made "continuously" or on specific time/date.
3378
-
3379
- ## Setup procedure
3380
-
3381
- The general idea is to rely on :
3382
-
3383
- * existing `ascp` features for detection and transfer
3384
- * take advantage of <%=tool%> configuration capabilities and server side knowledge
3385
- * the OS scheduler for reliability and continuous operation
3386
-
3387
- ### ascp features
3388
-
3389
- Interesting ascp features are found in its arguments: (see ascp manual):
3390
-
3391
- * `ascp` already takes care of sending only "new" files: option `-k 1,2,3`, or transfer_spec: `resume_policy`
3392
- * `ascp` has some options to remove or move files after transfer: `--remove-after-transfer`, `--move-after-transfer`, `--remove-empty-directories`
3393
- * `ascp` has an option to send only files not modified since the last X seconds: `--exclude-newer-than` (--exclude-older-than)
3394
- * `--src-base` if top level folder name shall not be created on destination
3395
-
3396
- Note that:
3397
-
3398
- * <%=tool%> takes transfer parameters exclusively as a transfer_spec, with `--ts` parameter.
3399
- * most, but not all native ascp arguments are available as standard transfer_spec parameters
3400
- * native ascp arguments can be provided with the [_transfer-spec_](#transferspec) parameter: EX_ascp_args (array), only for the [`direct`](#direct) transfer agent (not connect or node)
3401
-
3402
- ### server side and configuration
3403
-
3404
- 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.
3405
-
3406
- Note: parameters may be saved in a <%=prst%> and used with `-P`.
3407
-
3408
- ### Scheduling
3409
-
3410
- Once <%=tool%> parameters are defined, run the command using the OS native scheduler, e.g. every minutes, or 5 minutes, etc... Refer to section [_Scheduling_](#_scheduling_).
3411
-
3412
- ## Example
3413
-
3414
- ```
3415
- $ <%=cmd%> 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"]}'
3416
-
3417
- ```
3418
-
3419
- The local folder (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).
3420
-
3421
- # Aspera Health check and Nagios
3422
-
3423
- Each plugin provide a `health` command that will check the health status of the application. Example:
3424
-
3425
- ```
3426
- $ <%=cmd%> console health
3427
- +--------+-------------+------------+
3428
- | status | component | message |
3429
- +--------+-------------+------------+
3430
- | ok | console api | accessible |
3431
- +--------+-------------+------------+
3432
- ```
3433
-
3434
- Typically, the health check uses the REST API of the application with the following exception: the `server` plugin allows checking health by:
3435
-
3436
- * issuing a transfer to the server
3437
- * checking web app status with `asctl all:status`
3438
- * checking daemons process status
3439
-
3440
- <%=tool%> can be called by Nagios to check the health status of an Aspera server. The output can be made compatible to Nagios with option `--format=nagios` :
3441
-
3442
- ```
3443
- $ <%=cmd%> server health transfer --to-folder=/Upload --format=nagios --progress=none
3444
- OK - [transfer:ok]
3445
- $ <%=cmd%> server health asctlstatus --cmd_prefix='sudo ' --format=nagios
3446
- OK - [NP:running, MySQL:running, Mongrels:running, Background:running, DS:running, DB:running, Email:running, Apache:running]
3447
- ```
3448
-
3449
- # Module: `Aspera`
3450
-
3451
- Main components:
3452
-
3453
- * `Aspera` generic classes for REST and OAuth
3454
- * `Aspera::Fasp`: starting and monitoring transfers. It can be considered as a FASPManager class for Ruby.
3455
- * `Aspera::Cli`: <%=tool%>.
3456
-
3457
- A working example can be found in the gem, example:
3458
-
3459
- ```
3460
- $ <%=cmd%> config gem_path
3461
- $ cat $(<%=cmd%> config gem_path)/../examples/transfer.rb
3462
- ```
3463
-
3464
- This sample code shows some example of use of the API as well as
3465
- REST API.
3466
- Note: although nice, it's probably a good idea to use RestClient for REST.
3467
-
3468
- Example of use of the API of Aspera on Cloud:
3469
-
3470
- ```
3471
- require 'aspera/aoc'
3472
-
3473
- aoc=Aspera::AoC.new(url: 'https://sedemo.ibmaspera.com',auth: :jwt, scope: 'user:all', private_key: File.read(File.expand_path('~/.aspera/<%=cmd%>/aspera_on_cloud_key')),username: 'laurent.martin.aspera@fr.ibm.com',subpath: 'api/v1')
3474
-
3475
- aoc.read('self')
3476
- ```
3477
-
3478
- # History
3479
-
3480
- 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).
3481
-
3482
- There were a few pitfalls:
3483
-
3484
- * The tool was written in the aging `perl` language while most Aspera application products (but the Transfer Server) are written in `ruby`.
3485
- * The tool was only for transfers, but not able to call other products APIs
3486
-
3487
- So, it evolved into <%=tool%>:
3488
-
3489
- * portable: works on platforms supporting `ruby` (and `ascp`)
3490
- * easy to install with the `gem` utility
3491
- * 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)
3492
- * `ruby` is consistent with other Aspera products
3493
-
3494
- # Changes (Release notes)
3495
-
3496
- * <%=gemspec.version.to_s%>
3497
-
3498
- * new: `aoc packages list` add possibility to add filter with option `query`
3499
- * new: `aoc admin res xxx list` now get all items by default #50
3500
- * new: `preset` option can specify name or hash value
3501
- * new: `node` plugin accepts bearer token and access key as credential
3502
- * new: `node` option `token_type` allows using basic token in addition to aspera type.
3503
- * change: `server`: option `username` not mandatory anymore: xfer user is by default. If transfer spec token is provided, password or keys are optional, and bypass keys are used by default.
3504
- * change: (break) resource `apps_new` of `aoc` replaced with `application` (more clear)
3505
-
3506
- * 4.3.0
3507
-
3508
- * new: parameter `multi_incr_udp` for option `transfer_info`: control if UDP port is incremented when multi-session is used on [`direct`](#direct) transfer agent.
3509
- * new: command `aoc files node_info` to get node information for a given folder in the Files application of AoC. Allows cross-org or cross-workspace transfers.
3510
-
3511
- * 4.2.2
3512
-
3513
- * new: `faspex package list` retrieves the whole list, not just first page
3514
- * new: support web based auth to aoc and faspex 5 using HTTPS, new dependency on gem `webrick`
3515
- * new: the error "Remote host is not who we expected" displays a special remediation message
3516
- * new: `conf ascp spec` displays supported transfer spec
3517
- * new: options `notif_to` and `notif_template` to send email notifications on transfer (and other events)
3518
- * fix: space character in `faspe:` url are precent encoded if needed
3519
- * fix: `preview scan`: if file_id is unknown, ignore and continue scan
3520
- * change: for commands that potentially execute several transfers (`package recv --id=ALL`), if one transfer fails then <%=tool%> exits with code 1 (instead of zero=success)
3521
- * change: (break) option `notify` or `aoc` replaced with `notif_to` and `notif_template`
3522
-
3523
- * 4.2.1
3524
-
3525
- * new: command `faspex package recv` supports link of type: `faspe:`
3526
- * new: command `faspex package recv` supports option `recipient` to specify dropbox with leading `*`
3527
-
3528
- * 4.2.0
3529
-
3530
- * new: command `aoc remind` to receive organization membership by email
3531
- * new: in `preview` option `value` to filter out on file name
3532
- * new: `initdemo` to initialize for demo server
3533
- * new: [`direct`](#direct) transfer agent options: `spawn_timeout_sec` and `spawn_delay_sec`
3534
- * fix: on Windows `conf ascp use` expects ascp.exe
3535
- * fix: (break) multi_session_threshold is Integer, not String
3536
- * fix: `conf ascp install` renames sdk folder if it already exists (leftover shared lib may make fail)
3537
- * fix: removed replace_illegal_chars from default aspera.conf causing "Error creating illegal char conversion table"
3538
- * change: (break) `aoc apiinfo` is removed, use `aoc servers` to provide the list of cloud systems
3539
- * change: (break) parameters for resume in `transfer-info` for [`direct`](#direct) are now in sub-key `"resume"`
3540
-
3541
- * 4.1.0
3542
-
3543
- * fix: remove keys from transfer spec and command line when not needed * fix: default to create_dir:true so that sending single file to a folder does not rename file if folder does not exist
3544
- * new: update documentation with regard to offline and docker installation
3545
- * new: renamed command `nagios_check` to `health`
3546
- * new: agent `http_gw` now supports upload
3547
- * new: added option `sdk_url` to install SDK from local file for offline install
3548
- * new: check new gem version periodically
3549
- * new: the --fields= option, support -_fieldname_ to remove a field from default fields
3550
- * new: Oauth tokens are discarded automatically after 30 minutes (useful for COS delegated refresh tokens)
3551
- * new: mimemagic is now optional, needs manual install for `preview`, compatible with version 0.4.x
3552
- * new: AoC a password can be provided for a public link
3553
- * new: `conf doc` take an optional parameter to go to a section
3554
- * new: initial support for Faspex 5 Beta 1
3555
-
3556
- * 4.0.0
3557
-
3558
- * now available as open source at [<%=gemspec.homepage%>](<%=gemspec.homepage%>) with general cleanup
3559
- * changed default tool name from `mlia` to `ascli`
3560
- * changed `aspera` command to `aoc`
3561
- * changed gem name from `asperalm` to `aspera-cli`
3562
- * changed module name from `Asperalm` to `Aspera`
3563
- * removed command `folder` in `preview`, merged to `scan`
3564
- * persistency files go to sub folder instead of main folder
3565
- * added possibility to install SDK: `config ascp install`
3566
-
3567
- * 0.11.8
3568
-
3569
- * Simplified to use `unoconv` instead of bare `libreoffice` for office conversion, as `unoconv` does not require a X server (previously using Xvfb
3570
-
3571
- * 0.11.7
3572
-
3573
- * rework on rest call error handling
3574
- * use option `display` with value `data` to remove out of extraneous information
3575
- * fixed option `lock_port` not working
3576
- * generate special icon if preview failed
3577
- * possibility to choose transfer progress bar type with option `progress`
3578
- * AoC package creation now output package id
3579
-
3580
- * 0.11.6
3581
-
3582
- * orchestrator : added more choice in auth type
3583
- * preview: cleanup in generator (removed and renamed parameters)
3584
- * preview: better documentation
3585
- * preview: animated thumbnails for video (option: `video_png_conv=animated`)
3586
- * preview: new event trigger: `trevents` (`events` seems broken)
3587
- * preview: unique tmp folder to avoid clash of multiple instances
3588
- * repo: added template for secrets used for testing
3589
-
3590
- * 0.11.5
3591
-
3592
- * added option `default_ports` for AoC (see manual)
3593
- * allow bulk delete in `aspera files` with option `bulk=yes`
3594
- * fix getting connect versions
3595
- * added section for Aix
3596
- * support all ciphers for [`direct`](#direct) agent (including gcm, etc..)
3597
- * added transfer spec param `apply_local_docroot` for [`direct`](#direct)
3598
-
3599
- * 0.11.4
3600
-
3601
- * possibility to give shared inbox name when sending a package (else use id and type)
3602
-
3603
- * 0.11.3
3604
-
3605
- * minor fixes on multi-session: avoid exception on progress bar
3606
-
3607
- * 0.11.2
3608
-
3609
- * fixes on multi-session: progress bat and transfer spec param for "direct"
3610
-
3611
- * 0.11.1
3612
-
3613
- * enhanced short_link creation commands (see examples)
3614
-
3615
- * 0.11
3616
-
3617
- * add option to provide file list directly to ascp like this (only for direct transfer agent):
3618
-
3619
- ```
3620
- ... --sources=@ts --ts=@json:'{"paths":[],"EX_file_list":"filelist"}'
3621
- ```
3622
-
3623
- * 0.10.18
3624
-
3625
- * new option in. `server` : `ssh_options`
3626
-
3627
- * 0.10.17
3628
-
3629
- * fixed problem on `server` for option `ssh_keys`, now accepts both single value and list.
3630
- * new modifier: `@list:<saparator>val1<separator>...`
3631
-
3632
- * 0.10.16
3633
-
3634
- * added list of shared inboxes in workspace (or global), use `--query=@json:'{}'`
3635
-
3636
- * 0.10.15
3637
-
3638
- * in case of command line error, display the error cause first, and non-parsed argument second
3639
- * AoC : Activity / Analytics
3640
-
3641
- * 0.10.14
3642
-
3643
- * added missing bss plugin
3644
-
3645
- * 0.10.13
3646
-
3647
- * added Faspex5 (use option `value` to give API arguments)
3648
-
3649
- * 0.10.12
3650
-
3651
- * added support for AoC node registration keys
3652
- * replaced option : `local_resume` with `transfer_info` for agent [`direct`](#direct)
3653
- * Transfer agent is no more a Singleton instance, but only one is used in CLI
3654
- * `@incps` : new extended value modifier
3655
- * ATS: no more provides access keys secrets: now user must provide it
3656
- * begin work on "aoc" transfer agent
3657
-
3658
- * 0.10.11
3659
-
3660
- * minor refactor and fixes
3661
-
3662
- * 0.10.10
3663
-
3664
- * fix on documentation
3665
-
3666
- * 0.10.9.1
3667
-
3668
- * add total number of items for AoC resource list
3669
- * better gem version dependency (and fixes to support Ruby 2.0.0)
3670
- * removed aoc search_nodes
3671
-
3672
- * 0.10.8
3673
-
3674
- * removed option: `fasp_proxy`, use pseudo transfer spec parameter: `EX_fasp_proxy_url`
3675
- * removed option: `http_proxy`, use pseudo transfer spec parameter: `EX_http_proxy_url`
3676
- * several other changes..
3677
-
3678
- * 0.10.7
3679
-
3680
- * fix: <%=cmd%> fails when username cannot be computed on Linux.
3681
-
3682
- * 0.10.6
3683
-
3684
- * 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.
3685
- * gem version requirements made more open
3686
-
3687
- * 0.10.5
3688
-
3689
- * fix faspex package receive command not working
3690
-
3691
- * 0.10.4
3692
-
3693
- * new options for AoC : `secrets`
3694
- * ACLI-533 temp file list folder to use file lists is set by default, and used by asession
3695
-
3696
- * 0.10.3
3697
-
3698
- * included user name in oauth bearer token cache for AoC when JWT is used.
3699
-
3700
- * 0.10.2
3701
-
3702
- * updated `search_nodes` to be more generic, so it can search not only on access key, but also other queries.
3703
- * added doc for "cargo" like actions
3704
- * added doc for multi-session
3705
-
3706
- * 0.10.1
3707
-
3708
- * AoC and node v4 "browse" works now on non-folder items: file, link
3709
- * initial support for AoC automation (do not use yet)
3710
-
3711
- * 0.10
3712
-
3713
- * support for transfer using IBM Cloud Object Storage
3714
- * improved `find` action using arbitrary expressions
3715
-
3716
- * 0.9.36
3717
-
3718
- * added option to specify file pair lists
3719
-
3720
- * 0.9.35
3721
-
3722
- * updated plugin `preview` , changed parameter names, added documentation
3723
- * fix in `ats` plugin : instance id needed in request header
3724
-
3725
- * 0.9.34
3726
-
3727
- * parser "@preset" can be used again in option "transfer_info"
3728
- * some documentation re-organizing
3729
-
3730
- * 0.9.33
3731
-
3732
- * new command to display basic token of node
3733
- * new command to display bearer token of node in AoC
3734
- * the --fields= option, support +_fieldname_ to add a field to default fields
3735
- * many small changes
3736
-
3737
- * 0.9.32
3738
-
3739
- * all Faspex public links are now supported
3740
- * removed faspex operation recv_publink
3741
- * replaced with option `link` (consistent with AoC)
3742
-
3743
- * 0.9.31
3744
-
3745
- * added more support for public link: receive and send package, to user or dropbox and files view.
3746
- * delete expired file lists
3747
- * changed text table gem from text-table to terminal-table because it supports multiline values
3748
-
3749
- * 0.9.27
3750
-
3751
- * basic email support with SMTP
3752
- * basic proxy auto config support
3753
-
3754
- * 0.9.26
3755
-
3756
- * table display with --fields=ALL now includes all column names from all lines, not only first one
3757
- * unprocessed argument shows error even if there is an error beforehand
3758
-
3759
- * 0.9.25
3760
-
3761
- * the option `value` of command `find`, to filter on name, is not optional
3762
- * `find` now also reports all types (file, folder, link)
3763
- * `find` now is able to report all fields (type, size, etc...)
3764
-
3765
- * 0.9.24
3766
-
3767
- * fix bug where AoC node to node transfer did not work
3768
- * fix bug on error if ED25519 private key is defined in .ssh
3769
-
3770
- * 0.9.23
3771
-
3772
- * defined REST error handlers, more error conditions detected
3773
- * commands to select specific ascp location
3774
-
3775
- * 0.9.21
3776
-
3777
- * supports simplified wizard using global client
3778
- * only ascp binary is required, other SDK (keys) files are now generated
3779
-
3780
- * 0.9.20
3781
-
3782
- * improved wizard (prepare for AoC global client id)
3783
- * preview generator: addedoption : --skip-format=&lt;png,mp4&gt;
3784
- * removed outdated pictures from this doc
3785
-
3786
- * 0.9.19
3787
-
3788
- * added command aspera bearer --scope=xx
3789
-
3790
- * 0.9.18
3791
-
3792
- * enhanced aspera admin events to support query
3793
-
3794
- * 0.9.16
3795
-
3796
- * AoC transfers are now reported in activity app
3797
- * new interface for Rest class authentication (keep backward compatibility)
3798
-
3799
- * 0.9.15
3800
-
3801
- * new feature: "find" command in aspera files
3802
- * sample code for transfer API
3803
-
3804
- * 0.9.12
3805
-
3806
- * add nagios commands
3807
- * support of ATS for IBM Cloud, removed old version based on aspera id
3808
-
3809
- * 0.9.11
3810
-
3811
- * Breaking change: @stdin is now @stdin:
3812
- * support of ATS for IBM Cloud, removed old version based on aspera id
3813
-
3814
-
3815
- * 0.9.10
3816
-
3817
- * Breaking change: parameter transfer-node becomes more generic: transfer-info
3818
- * Display SaaS storage usage with command: aspera admin res node --id=nn info
3819
- * cleaner way of specifying source file list for transfers
3820
- * Breaking change: replaced download_mode option with http_download action
3821
-
3822
- * 0.9.9
3823
-
3824
- * Breaking change: "aspera package send" parameter deprecated, use the --value option instead with "recipients" value. See example.
3825
- * Now supports "cargo" for Aspera on Cloud (automatic package download)
3826
-
3827
- * 0.9.8
3828
-
3829
- * Faspex: use option once_only set to yes to enable cargo like function. id=NEW deprecated.
3830
- * AoC: share to share transfer with command "transfer"
3831
-
3832
- * 0.9.7
3833
-
3834
- * homogeneous [_transfer-spec_](#transferspec) for `node` and [`direct`](#direct) transfer agents
3835
- * preview persistency goes to unique file by default
3836
- * catch mxf extension in preview as video
3837
- * Faspex: possibility to download all paclages by specifying id=ALL
3838
- * Faspex: to come: cargo-like function to download only new packages with id=NEW
3839
-
3840
- * 0.9.6
3841
-
3842
- * Breaking change: `@param:`is now `@preset:` and is generic
3843
- * AoC: added command to display current workspace information
3844
-
3845
- * 0.9.5
3846
-
3847
- * new parameter: new_user_option used to choose between public_link and invite of external users.
3848
- * fixed bug in wizard, and wizard uses now product detection
3849
-
3850
- * 0.9.4
3851
-
3852
- * 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).
3853
- * AoC Package send supports external users
3854
- * new command to export AoC config to Aspera CLI config
3855
-
3856
- * 0.9.3
3857
-
3858
- * REST error message show host and code
3859
- * option for quiet display
3860
- * modified transfer interface and allow token re-generation on error
3861
- * async add admin command
3862
- * async add db parameters
3863
- * Breaking change: new option "sources" to specify files to transfer
3864
-
3865
- * 0.9.2
3866
-
3867
- * Breaking change: changed AoC package creation to match API, see AoC section
3868
-
3869
- * 0.9.1
3870
-
3871
- * Breaking change: changed faspex package creation to match API, see Faspex section
3872
-
3873
- * 0.9
3874
-
3875
- * Renamed the CLI from aslmcli to <%=tool%>
3876
- * Automatic rename and conversion of former config folder from aslmcli to <%=tool%>
3877
-
3878
- * 0.7.6
3879
-
3880
- * add "sync" plugin
3881
-
3882
- * 0.7
3883
-
3884
- * Breaking change: AoC package recv take option if for package instead of argument.
3885
- * Breaking change: Rest class and Oauth class changed init parameters
3886
- * AoC: receive package from public link
3887
- * select by col value on output
3888
- * added rename (AoC, node)
3889
-
3890
- * 0.6.19
3891
-
3892
- Breaking change:
3893
-
3894
- * ats server list provisioned &rarr; ats cluster list
3895
- * ats server list clouds &rarr; ats cluster clouds
3896
- * ats server list instance --cloud=x --region=y &rarr; ats cluster show --cloud=x --region=y
3897
- * ats server id xxx &rarr; ats cluster show --id=xxx
3898
- * ats subscriptions &rarr; ats credential subscriptions
3899
- * ats api_key repository list &rarr; ats credential cache list
3900
- * ats api_key list &rarr; ats credential list
3901
- * ats access_key id xxx &rarr; ats access_key --id=xxx
3902
-
3903
- * 0.6.18
3904
-
3905
- * some commands take now --id option instead of id command.
3906
-
3907
- * 0.6.15
3908
-
3909
- * 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 <%=prst%> "default".
3910
-
3911
- # BUGS, FEATURES, CONTRIBUTION
3912
-
3913
- For issues or feature requests use the Github repository and issues.
3914
-
3915
- You can also contribute to this open source project.
3916
-
3917
- One can also create one's own command nplugin.
3918
-
3919
- ## Only one value for any option
3920
-
3921
- Some commands and sub commands may ask for the same option name.
3922
- Currently, since option definition is position independant (last one wins), it is not possible
3923
- to give an option to a command and the same option with different value to a sub command.
3924
-
3925
- 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.
3926
- As a workaround use another option, if available, to identify the entity.
3927
-
3928
- This happens typically for the `node` sub command, e.g. identify the node by name instead of id.
3929
-
3930
-
3931
- ## ED255519 key not supported
3932
-
3933
- ED25519 keys are deactivated since version 0.9.24 so this type of key will just be ignored.
3934
-
3935
- Without this deactivation, if such key was present the following error was generated:
3936
-
3937
- ```
3938
- OpenSSH keys only supported if ED25519 is available
3939
- ```
3940
-
3941
- Which meant that you do not have ruby support for ED25519 SSH keys.
3942
- You may either install the suggested Gems, or remove your ed25519 key from your `.ssh` folder to solve the issue.
3943
-
3944
- ## Error "Remote host is not who we expected"
3945
-
3946
- Cause: `ascp` >= 4.x checks fingerprint of highest server host key, including ECDSA. `ascp` < 4.0 (3.9.6 and earlier) support only to RSA level (and ignore ECDSA presented by server). `aspera.conf` supports a single fingerprint.
3947
-
3948
- Workaround on client side: To ignore the certificate (SSH fingerprint) add option on client side (this option can also be added permanently to the config file):
3949
-
3950
- ```
3951
- --ts=@json:'{"sshfp":null}'
3952
- ```
3953
-
3954
- Workaround on server side: Either remove the fingerprint from `aspera.conf`, or keep only RSA host keys in `sshd_config`.
3955
-
3956
- References: ES-1944 in release notes of 4.1 and to [HSTS admin manual section "Configuring Transfer Server Authentication With a Host-Key Fingerprint"](https://www.ibm.com/docs/en/ahts/4.2?topic=upgrades-configuring-ssh-server).
3957
-
3958
- ## Miscelaneous
3959
-
3960
- * remove rest and oauth classes and use ruby standard gems:
3961
-
3962
- * oauth
3963
- * https://github.com/rest-client/rest-client
3964
-
3965
- * use Thor or any standard Ruby CLI manager
3966
-
3967
- * provide metadata in packages
3968
-
3969
- * deliveries to dropboxes
3970
-
3971
- * Going through proxy: use env var http_proxy and https_proxy, no_proxy
3972
-
3973
- * easier use with https://github.com/pmq20/ruby-packer