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