aspera-cli 4.1.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/docs/README.erb.md CHANGED
@@ -106,9 +106,10 @@ Once installation is completed, you can proceed to the first use with a demo ser
106
106
 
107
107
  If you want to test with Aspera on Cloud, jump to section: [Wizard](#aocwizard)
108
108
 
109
- If you want to test with Aspera demo transfer server, a default configuration is created on first use:
109
+ To test with Aspera demo transfer server, setup the environment and then test:
110
110
 
111
111
  ```
112
+ $ <%=cmd%> config initdemo
112
113
  $ <%=cmd%> server browse /
113
114
  :............:...........:......:........:...........................:.......................:
114
115
  : zmode : zuid : zgid : size : mtime : name :
@@ -128,7 +129,7 @@ If you want to use <%=tool%> with another server, and in order to make further c
128
129
  * download a file
129
130
 
130
131
  ```
131
- $ <%=cmd%> config id myserver update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
132
+ $ <%=cmd%> config id myserver update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_
132
133
  updated: myserver
133
134
  $ <%=cmd%> config id default set server myserver
134
135
  updated: default&rarr;server to myserver
@@ -162,18 +163,22 @@ Then, follow the section relative to the product you want to interact with ( Asp
162
163
 
163
164
  # <a name="installation"></a>Installation
164
165
 
165
- It is possible to install *either* as a docker container or step by step on the native host:
166
+ It is possible to install *either* directly on the host operating system (Linux, Windows, Macos) or as a docker container.
167
+
168
+ The direct installation is recommended and consists in installing:
166
169
 
167
170
  * [Ruby](#ruby) version >= <%= gemspec.required_ruby_version %>
168
171
  * [<%= gemspec.name %>](#the_gem)
169
172
  * [Aspera SDK (ascp)](#fasp_prot)
170
173
 
171
- The following sections provide information on the installation.
174
+ The following sections provide information on the various installation methods.
172
175
 
173
176
  An internet connection is required for the installation. If you dont have internet for the installation, refer to section [Installation without internet access](#offline_install).
174
177
 
175
178
  ## Docker container
176
179
 
180
+ Use this method only if you know what you do, else use the standard recommended method as described here above.
181
+
177
182
  This method installs a docker image that contains: Ruby, ascli and the FASP sdk.
178
183
 
179
184
  Ensure that you have Docker installed.
@@ -197,11 +202,12 @@ $ ./<%=cmd%> install
197
202
 
198
203
  Start using it !
199
204
 
200
- Note that the tool is run in the container.
205
+ Note that the tool is run in the container, so transfers are also executed in the container, not calling host.
201
206
 
202
- The wrapping script maps the container folder `/usr/src/app/config` to configuration folder `$HOME/.aspera/<%=cmd%>`.
207
+ The wrapping script maps the container folder `/usr/src/app/config` to configuration folder `$HOME/.aspera/<%=cmd%>` on host.
203
208
 
204
209
  To transfer to/from the native host, you will need to map a volume in docker or use the config folder (already mapped).
210
+ To add local storage as a volume edit the script: ascli and add a `--volume` stanza.
205
211
 
206
212
  ## <a name="ruby"></a>Ruby
207
213
 
@@ -211,7 +217,7 @@ A ruby interpreter is required to run the tool or to use the gem and tool.
211
217
 
212
218
  Ruby minimum version: <%= gemspec.required_ruby_version %>. Ruby version 3 is also supported.
213
219
 
214
- *Any type of Ruby installation can be used* : rpm, yum, dnf, rvm, brew, windows installer, ... .
220
+ *Ruby can be installed using any method* : rpm, yum, dnf, rvm, brew, windows installer, ... .
215
221
 
216
222
  Refer to the following sections for a proposed method for specific operating systems.
217
223
 
@@ -789,7 +795,7 @@ $ <%=cmd%> config id <<%=opprst%>> set|delete|show|initialize|update
789
795
  The command `update` allows the easy creation of <%=prst%> by simply providing the options in their command line format, e.g. :
790
796
 
791
797
  ```
792
- $ <%=cmd%> config id demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera --ts=@json:'{"precalculate_job_size":true}'
798
+ $ <%=cmd%> config id demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_ --ts=@json:'{"precalculate_job_size":true}'
793
799
  ```
794
800
 
795
801
  * This creates a <%=prst%> `demo_server` with all provided options.
@@ -797,13 +803,13 @@ $ <%=cmd%> config id demo_server update --url=ssh://demo.asperasoft.com:33001 --
797
803
  The command `set` allows setting individual options in a <%=prst%>.
798
804
 
799
805
  ```
800
- $ <%=cmd%> config id demo_server set password demoaspera
806
+ $ <%=cmd%> config id demo_server set password _demo_pass_
801
807
  ```
802
808
 
803
809
  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)_.
804
810
 
805
811
  ```
806
- $ <%=cmd%> config id demo_server initialize @json:'{"url":"ssh://demo.asperasoft.com:33001","username":"asperaweb","password":"demoaspera","ts":{"precalculate_job_size":true}}'
812
+ $ <%=cmd%> config id demo_server initialize @json:'{"url":"ssh://demo.asperasoft.com:33001","username":"asperaweb","password":"_demo_pass_","ts":{"precalculate_job_size":true}}'
807
813
  ```
808
814
 
809
815
  A good practice is to not manually edit the configuration file and use modification commands instead.
@@ -840,11 +846,19 @@ Note that special plugin name: `config` can be associated with a preset that is
840
846
  Operations on this preset are done using regular `config` operations:
841
847
 
842
848
  ```
843
- $ <%=cmd%> config id default set _plugin_name_ _defauklt_preset_for_plugin_
849
+ $ <%=cmd%> config id default set _plugin_name_ _default_preset_for_plugin_
844
850
  $ <%=cmd%> config id default get _plugin_name_
845
- "_defauklt_preset_for_plugin_"
851
+ "_default_preset_for_plugin_"
846
852
  ```
847
853
 
854
+ ### <a name="lprtdef"></a>Special Plugin: config
855
+
856
+ Plugin `config` (not to be confused with <%=prstt%> config) is used to configure <%=tool%> but it also contains global options.
857
+
858
+ When <%=tool%> starts, it lookjs for the `default` <%=prstt%> and if there is a value for `config`, if so, it loads the option values for any plugin used.
859
+
860
+ 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`)
861
+
848
862
  ### Format of file
849
863
 
850
864
  The configuration file is a hash in a YAML file. Example:
@@ -860,7 +874,7 @@ cli_default:
860
874
  demo_server:
861
875
  url: ssh://demo.asperasoft.com:33001
862
876
  username: asperaweb
863
- password: demoaspera
877
+ password: _demo_pass_
864
878
  ```
865
879
 
866
880
  We can see here:
@@ -929,7 +943,6 @@ A <%=prst%> value can be removed with `unset`:
929
943
  $ <%=cmd%> config id cli_default unset interactive
930
944
  ```
931
945
 
932
-
933
946
  ### Examples
934
947
 
935
948
  For Faspex, Shares, Node (including ATS, Aspera Transfer Service), Console,
@@ -1049,21 +1062,42 @@ The `config` plugin also allows specification for the use of a local FASP client
1049
1062
 
1050
1063
  ```
1051
1064
  $ <%=cmd%> config ascp show
1052
- /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
1065
+ /Users/laurent/.aspera/ascli/sdk/ascp
1066
+ $ <%=cmd%> config ascp info
1067
+ +--------------------+-----------------------------------------------------------+
1068
+ | key | value |
1069
+ +--------------------+-----------------------------------------------------------+
1070
+ | ascp | /Users/laurent/.aspera/ascli/sdk/ascp |
1071
+ ...
1053
1072
  ```
1054
1073
 
1055
1074
  ### Selection of local `ascp`
1056
1075
 
1076
+ By default, <%=tool%> uses any found local product with ascp, including SDK.
1077
+
1057
1078
  To temporarily use an alternate ascp path use option `ascp_path` (`--ascp-path=`)
1058
1079
 
1059
- To permanently use another ascp:
1080
+ For a permanent change, the command `config ascp use` sets the same parameter for the global default.
1081
+
1082
+ Using a POSIX shell:
1060
1083
 
1061
1084
  ```
1062
1085
  $ <%=cmd%> config ascp use '/Users/laurent/Applications/Aspera CLI/bin/ascp'
1063
- saved to default global preset /Users/laurent/Applications/Aspera CLI/bin/ascp
1086
+ ascp version: 4.0.0.182279
1087
+ Updated: global_common_defaults: ascp_path <- /Users/laurent/Applications/Aspera CLI/bin/ascp
1088
+ Saved to default global preset global_common_defaults
1064
1089
  ```
1065
1090
 
1066
- This sets up a global default.
1091
+ Windows:
1092
+
1093
+ ```
1094
+ $ <%=cmd%> config ascp use C:\Users\admin\.aspera\ascli\sdk\ascp.exe
1095
+ ascp version: 4.0.0.182279
1096
+ Updated: global_common_defaults: ascp_path <- C:\Users\admin\.aspera\ascli\sdk\ascp.exe
1097
+ Saved to default global preset global_common_defaults
1098
+ ```
1099
+
1100
+ If the path has spaces, read section: [Shell and Command line parsing](#parsing).
1067
1101
 
1068
1102
  ### List locally installed Aspera Transfer products
1069
1103
 
@@ -1150,7 +1184,7 @@ will effectively push files to the related server from the agent node.
1150
1184
 
1151
1185
  ### <a name="direct"></a>Direct (local ascp using FASPManager API)
1152
1186
 
1153
- By default the CLI will use a local FASP protocol, equivalent to specifying `--transfer=direct`.
1187
+ By default <%=tool%> uses a local ascp, equivalent to specifying `--transfer=direct`.
1154
1188
  <%=tool%> will detect locally installed Aspera products.
1155
1189
  Refer to section [FASP](#client).
1156
1190
 
@@ -1160,17 +1194,33 @@ To specify a FASP proxy (only supported with the `direct` agent), set the approp
1160
1194
  * `EX_http_proxy_url` (proxy for legacy http fallback)
1161
1195
  * `EX_ascp_args`
1162
1196
 
1163
- The `transfer-info` optionally provides the following auto resume parameters:
1197
+ The `transfer-info` accepts the following optional parameters:
1198
+
1199
+ <table>
1200
+ <tr><th>Name</th><th>Type</th><th>Default</th><th>Feature</th><th>Description</th></tr>
1201
+ <tr><td>spawn_timeout_sec</td><td>Float</td><td>3</td><td>Multi session</td><td>Verification time that ascp is running</td></tr>
1202
+ <tr><td>spawn_delay_sec</td><td>Float</td><td>2</td><td>Multi session</td><td>Delay between startup of sessions</td></tr>
1203
+ <tr><td>wss</td><td>Bool</td><td>false</td><td>Web Socket Session</td><td>Enable use of web socket session in case it is available</td></tr>
1204
+ <tr><td>resume</td><td>Hash</td><td>nil</td><td>Resumer parameters</td><td>See below</td></tr>
1205
+ </table>
1206
+
1207
+ Resume parameters:
1164
1208
 
1165
1209
  <table>
1166
- <tr><th>Name</th><th>Default</th><th>Feature</th><th>Description</th></tr>
1167
- <tr><td>iter_max</td>. <td>7</td><td>Resume</td><td>Max number of retry on error</td></tr>
1168
- <tr><td>sleep_initial</td><td>2</td><td>Resume</td><td>First Sleep before retry</td></tr>
1169
- <tr><td>sleep_factor</td> <td>2</td><td>Resume</td><td>Multiplier of Sleep</td></tr>
1170
- <tr><td>sleep_max</td>. <td>60</td><td>Resume</td><td>Maximum sleep</td></tr>
1171
- <tr><td>wss</td> <td>false</td><td>Web Socket Session</td><td>Enable use of web socket session in case it is available</td></tr>
1210
+ <tr><th>Name</th><th>Type</th><th>Default</th><th>Feature</th><th>Description</th></tr>
1211
+ <tr><td>iter_max</td><td>int</td><td>7</td><td>Resume</td><td>Max number of retry on error</td></tr>
1212
+ <tr><td>sleep_initial</td><td>int</td><td>2</td><td>Resume</td><td>First Sleep before retry</td></tr>
1213
+ <tr><td>sleep_factor</td><td>int</td><td>2</td><td>Resume</td><td>Multiplier of Sleep</td></tr>
1214
+ <tr><td>sleep_max</td><td>int</td><td>60</td><td>Resume</td><td>Maximum sleep</td></tr>
1172
1215
  </table>
1173
1216
 
1217
+ Examples:
1218
+
1219
+ ```
1220
+ $ <%=cmd%> ... --transfer-info=@json:'{"wss":true,"resume":{"iter_max":10}}'
1221
+ $ <%=cmd%> ... --transfer-info=@json:'{"spawn_delay_sec":2.5}'
1222
+ ```
1223
+
1174
1224
  ### IBM Aspera Connect Client GUI
1175
1225
 
1176
1226
  By specifying option: `--transfer=connect`, <%=tool%> will start transfers
@@ -1220,7 +1270,7 @@ is described in a _transfer-spec_ (Transfer Specification), such as:
1220
1270
 
1221
1271
  <%=tool%> builds a default _transfer-spec_ internally, so it is not necessary to provide additional parameters on the command line for this transfer.
1222
1272
 
1223
- 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.
1273
+ If needed, it is possible to modify or add any of the supported _transfer-spec_ parameter using the `ts` option. The `ts` option accepts a [Structured Value](#native) containing one or several _transfer-spec_ parameters. Multiple `ts` options on command line are cummulative.
1224
1274
 
1225
1275
  It is possible to specify ascp options when the `transfer` option is set to `direct` using the special [_transfer-spec_](#transferspec) parameter: `EX_ascp_args`. Example: `--ts=@json:'{"EX_ascp_args":["-l","100m"]}'`. This is espacially useful for ascp command line parameters not supported yet in the transfer spec.
1226
1276
 
@@ -1966,10 +2016,10 @@ $ <%=cmd%> aoc packages recv --id=ALL --once-only=yes --lock-port=12345
1966
2016
  * `--once-only=yes` keeps memory of any downloaded package in persistency files located in the configuration folder.
1967
2017
  * `--lock-port=12345` ensures that only one instance is started at the same time, to avoid collisions
1968
2018
 
1969
- Typically, one would regularly execute this command on a regular basis, using the method oif your choice:
2019
+ Typically, one would regularly execute this command on a regular basis, using the method of your choice:
1970
2020
 
1971
- * Windows scheduler
1972
- * cron
2021
+ * Windows: [Task Scheduler](https://docs.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page)
2022
+ * Linux/Unix: [cron](https://www.man7.org/linux/man-pages/man5/crontab.5.html)
1973
2023
  * etc...
1974
2024
 
1975
2025
  ## Download Files
@@ -2189,7 +2239,7 @@ This can also be set as default using a preset
2189
2239
  One can test the "server" application using the well known demo server:
2190
2240
 
2191
2241
  ```
2192
- $ <%=cmd%> config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
2242
+ $ <%=cmd%> config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=_demo_pass_
2193
2243
  $ <%=cmd%> config id default set server aspera_demo_server
2194
2244
  $ <%=cmd%> server browse /aspera-test-dir-large
2195
2245
  $ <%=cmd%> server download /aspera-test-dir-large/200MB
@@ -2493,7 +2543,7 @@ to start from ma configuration file, using <%=tool%> standard options.
2493
2543
 
2494
2544
  # Plugin: Preview
2495
2545
 
2496
- The `preview` generates "previews" of graphical files, i.e. thumbnails (office, images, video) and video previews on an Aspera HSTS for use primarily in the Aspera on Cloud application.
2546
+ 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.
2497
2547
  This is based on the "node API" of Aspera HSTS when using Access Keys only inside it's "storage root".
2498
2548
  Several parameters can be used to tune several aspects:
2499
2549
 
@@ -2622,9 +2672,10 @@ $ <%=cmd%> config id previewconf update --url=https://localhost:9092 --username=
2622
2672
  $ <%=cmd%> config id default set preview previewconf
2623
2673
  ```
2624
2674
 
2625
- Here we assume that Office file generation is disabled, else remove the option. `lock_port` prevents concurrent execution of generation when using a scheduler.
2675
+ Here we assume that Office file generation is disabled, else remove this option.
2676
+ `lock_port` prevents concurrent execution of generation when using a scheduler.
2626
2677
 
2627
- Once can check if the access key is well configured using:
2678
+ One can check if the access key is well configured using:
2628
2679
 
2629
2680
  ```
2630
2681
  $ <%=cmd%> -Ppreviewconf node browse /
@@ -2710,6 +2761,14 @@ $ <%=cmd%> preview scan --skip-folders=@json:'["/not_here"]'
2710
2761
 
2711
2762
  The option `folder_reset_cache` forces the node service to refresh folder contents using various methods.
2712
2763
 
2764
+ When scanning the option `value` has the same behaviour as for the `node find` command.
2765
+
2766
+ For instance to filter out files beginning with `._` do:
2767
+
2768
+ ```
2769
+ ... --value='exec:!f["name"].start_with?("._") or f["name"].eql?(".DS_Store")'
2770
+ ```
2771
+
2713
2772
  ## Preview File types
2714
2773
 
2715
2774
  Two types of preview can be generated:
@@ -2847,7 +2906,7 @@ Note that in addition, many "EX_" [_transfer-spec_](#transferspec) parameters ar
2847
2906
  ## Simple session
2848
2907
 
2849
2908
  ```
2850
- MY_TSPEC='{"remote_host":"demo.asperasoft.com","remote_user":"asperaweb","ssh_port":33001,"remote_password":"demoaspera","direction":"receive","destination_root":"./test.dir","paths":[{"source":"/aspera-test-dir-tiny/200KB.1"}],"resume_level":"none"}'
2909
+ 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"}'
2851
2910
 
2852
2911
  echo "${MY_TSPEC}"|asession
2853
2912
  ```
@@ -2860,7 +2919,7 @@ This is particularly useful for a persistent session ( with the [_transfer-spec_
2860
2919
 
2861
2920
  ```
2862
2921
  $ asession
2863
- {"remote_host":"demo.asperasoft.com","ssh_port":33001,"remote_user":"asperaweb","remote_password":"demoaspera","direction":"receive","destination_root":".","keepalive":true,"resume_level":"none"}
2922
+ {"remote_host":"demo.asperasoft.com","ssh_port":33001,"remote_user":"asperaweb","remote_password":"_demo_pass_","direction":"receive","destination_root":".","keepalive":true,"resume_level":"none"}
2864
2923
  {"type":"START","source":"/aspera-test-dir-tiny/200KB.2"}
2865
2924
  {"type":"DONE"}
2866
2925
  ```
@@ -3009,7 +3068,20 @@ So, it evolved into <%=tool%>:
3009
3068
 
3010
3069
  # Changes (Release notes)
3011
3070
 
3012
- * 4.x
3071
+ * <%= gemspec.version.to_s %>
3072
+
3073
+ * new: command `aoc remind` to receive organization membership by email
3074
+ * new: in `preview` option `value` to filter out on file name
3075
+ * new: `initdemo` to initialize for demo server
3076
+ * new: `direct` transfer agent options: `spawn_timeout_sec` and `spawn_delay_sec`
3077
+ * fix: on Windows `conf ascp use` expects ascp.exe
3078
+ * fix: (break) multi_session_threshold is Integer, not String
3079
+ * fix: `conf ascp install` renames sdk folder if it already exists (leftover shared lib may make fail)
3080
+ * fix: removed replace_illegal_chars from default aspera.conf causing "Error creating illegal char conversion table"
3081
+ * change: (break) `aoc apiinfo` is removed, use `aoc servers` to provide the list of cloud systems
3082
+ * change: (break) parameters for resume in `transfer-info` for `direct` are now in sub-key `"resume"`
3083
+
3084
+ * 4.1.0
3013
3085
 
3014
3086
  * fix: remove keys from transfer spec and command line when not needed
3015
3087
  * fix: default to create_dir:true so that sending single file to a folder does not rename file if folder does not exist
@@ -3380,11 +3452,15 @@ Breaking change:
3380
3452
 
3381
3453
  * 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".
3382
3454
 
3383
- # BUGS
3455
+ # BUGS, FEATURES, CONTRIBUTION
3456
+
3457
+ For issues or feature requests use the Github repository and issues.
3458
+
3459
+ You can also contribute to this open source project.
3384
3460
 
3385
- * This is best effort code without official support, dont expect full capabilities. This code is not supported by IBM/Aspera. You can contact the author for bugs or features.
3461
+ One can also create one's own command nplugin.
3386
3462
 
3387
- ## only one value for any option
3463
+ ## Only one value for any option
3388
3464
 
3389
3465
  Some commands and sub commands may ask for the same option name.
3390
3466
  Currently, since option definition is position independant (last one wins), it is not possible
@@ -3398,7 +3474,8 @@ This happens typically for the `node` sub command, e.g. identify the node by nam
3398
3474
 
3399
3475
  ## ED255519 key not supported
3400
3476
 
3401
- ED255519 keys are deactivated since version 0.9.24 so this type of key will just be ignored.
3477
+ ED25519 keys are deactivated since version 0.9.24 so this type of key will just be ignored.
3478
+
3402
3479
  Without this deactivation, if such key was present the following error was generated:
3403
3480
 
3404
3481
  ```
@@ -3408,7 +3485,17 @@ OpenSSH keys only supported if ED25519 is available
3408
3485
  Which meant that you do not have ruby support for ED25519 SSH keys.
3409
3486
  You may either install the suggested Gems, or remove your ed25519 key from your `.ssh` folder to solve the issue.
3410
3487
 
3411
- # TODO
3488
+ ## Error "Remote host is not who we expected"
3489
+
3490
+ `ascp` version 4.x changed the algorithm used to check the SSH server certificate. To ignore the certificate (SSH fingerprint) add option on client side:
3491
+
3492
+ ```
3493
+ --ts=@json:'{"sshfp":null}'
3494
+ ```
3495
+
3496
+ Refer to 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): if you have access to server side, basically disable other SSH host keys than RSA.
3497
+
3498
+ ## Miscelaneous
3412
3499
 
3413
3500
  * remove rest and oauth classes and use ruby standard gems:
3414
3501
 
@@ -3424,9 +3511,3 @@ You may either install the suggested Gems, or remove your ed25519 key from your
3424
3511
  * Going through proxy: use env var http_proxy and https_proxy, no_proxy
3425
3512
 
3426
3513
  * easier use with https://github.com/pmq20/ruby-packer
3427
-
3428
- # Contribution
3429
-
3430
- Send comments !
3431
-
3432
- Create your own plugin !
data/docs/test_env.conf CHANGED
@@ -5,8 +5,8 @@ default:
5
5
  config: cli_default
6
6
  aoc: tst_aoc1
7
7
  faspex: tst_faspex
8
- faspex5: tst_faspex5
9
- shares: tst_shares
8
+ faspex5: tst_faspex5_boot
9
+ shares: tst_shares_1
10
10
  shares2: tst_shares2
11
11
  node: tst_node
12
12
  server: tst_server
@@ -47,11 +47,18 @@ tst_node_faspex:
47
47
  url: your value here
48
48
  username: your value here
49
49
  password: your value here
50
- tst_faspex5:
50
+ tst_faspex5_boot:
51
51
  url: your value here
52
52
  auth: your value here
53
53
  username: your value here
54
54
  password: your value here
55
+ tst_faspex5:
56
+ url: your value here
57
+ auth: your value here
58
+ client_id: your value here
59
+ client_secret: your value here
60
+ private_key: your value here
61
+ username: your value here
55
62
  tst_shares:
56
63
  url: your value here
57
64
  username: your value here
@@ -111,6 +118,8 @@ misc:
111
118
  faspex_publink_send_to_fxuser: your value here
112
119
  faspex_publink_send_to_dropbox: your value here
113
120
  shares_upload: your value here
121
+ console_smart_id: your value here
122
+ console_smart_file: your value here
114
123
  orch_workflow_id: your value here
115
124
  file_dcm: your value here
116
125
  file_pdf: your value here
@@ -139,5 +148,5 @@ misc:
139
148
  email_internal: your value here
140
149
  email_external: your value here
141
150
  aoc_org: your value here
142
- aoc_user: your value here
151
+ aoc_user_email: your value here
143
152
  http_gw_fqdn_port: your value here
data/lib/aspera/aoc.rb CHANGED
@@ -9,6 +9,8 @@ module Aspera
9
9
  private
10
10
  @@use_standard_ports = true
11
11
 
12
+ API_V1='api/v1'
13
+
12
14
  PRODUCT_NAME='Aspera on Cloud'
13
15
  # Production domain of AoC
14
16
  PROD_DOMAIN='ibmaspera.com'
@@ -42,11 +44,6 @@ module Aspera
42
44
  FILES_APP='files'
43
45
  PACKAGES_APP='packages'
44
46
 
45
- CLIENT_RANDOM={
46
- 'aspera.global-cli-client' => 'frpmsRsG4mjZ0PlxCgdJlvONqBg4Vlpz_IX7gXmBMAfsgMLy2FO6CXLodKfKAuhqnCqSptLbe_wdmnm9JRuEPO-PpFqpq_Kb',
47
- 'aspera.drive' => 'UegzQ3LcbLht5dLYAXaR-7ZMnJ6-kwPEXWEXaqLSOMGmtzNA9r6kPFLElqBfq66BfgMabdO96k5sPXV-H8M3vsx9LbGlewF1'
48
- }
49
-
50
47
  def self.get_client_info(client_name=CLIENT_APPS.first)
51
48
  client_index=CLIENT_APPS.index(client_name)
52
49
  raise "no such pre-defined client: #{client_name}" if client_index.nil?
@@ -68,9 +65,14 @@ module Aspera
68
65
  return organization,instance_domain
69
66
  end
70
67
 
68
+ # base API url depends on domain, which could be "qa.xxx"
69
+ def self.api_base_url(api_domain=PROD_DOMAIN)
70
+ return "https://api.#{api_domain}"
71
+ end
72
+
71
73
  def self.metering_api(entitlement_id,customer_id,api_domain=PROD_DOMAIN)
72
74
  return Rest.new({
73
- :base_url => "https://api.#{api_domain}/metering/v1",
75
+ :base_url => "#{api_base_url(api_domain)}/metering/v1",
74
76
  :headers => {'X-Aspera-Entitlement-Authorization' => Rest.basic_creds(entitlement_id,customer_id)}
75
77
  })
76
78
  end
@@ -126,7 +128,7 @@ module Aspera
126
128
  # access key secrets are provided out of band to get node api access
127
129
  # key: access key
128
130
  # value: associated secret
129
- @secrets={}
131
+ @key_chain=nil
130
132
 
131
133
  # init rest params
132
134
  aoc_rest_p={:auth=>{:type =>:oauth2}}
@@ -147,12 +149,12 @@ module Aspera
147
149
 
148
150
  # get org name and domain from url
149
151
  organization,instance_domain=self.class.parse_url(opt[:url])
150
- # this is the base API url (depends on domain, which could be "qa.xxx")
151
- api_base_url="https://api.#{instance_domain}"
152
- # base API URL
153
- aoc_rest_p[:base_url]="#{api_base_url}/#{opt[:subpath]}"
152
+ # this is the base API url
153
+ api_url_base=self.class.api_base_url(instance_domain)
154
+ # API URL, including subpath (version ...)
155
+ aoc_rest_p[:base_url]="#{api_url_base}/#{opt[:subpath]}"
154
156
  # base auth URL
155
- aoc_auth_p[:base_url] = "#{api_base_url}/#{OAUTH_API_SUBPATH}/#{organization}"
157
+ aoc_auth_p[:base_url] = "#{api_url_base}/#{OAUTH_API_SUBPATH}/#{organization}"
156
158
  aoc_auth_p[:client_id]=opt[:client_id]
157
159
  aoc_auth_p[:client_secret] = opt[:client_secret]
158
160
 
@@ -192,17 +194,12 @@ module Aspera
192
194
  super(aoc_rest_p)
193
195
  end
194
196
 
195
- def add_secrets(secrets)
196
- @secrets.merge!(secrets)
197
- Log.log.debug("now secrets:#{secrets}")
197
+ def key_chain=(keychain)
198
+ raise "keychain already set" unless @key_chain.nil?
199
+ @key_chain=keychain
198
200
  nil
199
201
  end
200
202
 
201
- def has_secret(ak)
202
- Log.log.debug("has key:#{ak} -> #{@secrets.has_key?(ak)}")
203
- return @secrets.has_key?(ak)
204
- end
205
-
206
203
  # additional transfer spec (tags) for package information
207
204
  def self.package_tags(package_info,operation)
208
205
  return {'tags'=>{'aspera'=>{'files'=>{
@@ -299,9 +296,9 @@ module Aspera
299
296
  :base_url => node_info['url'],
300
297
  :headers => {'X-Aspera-AccessKey'=>node_info['access_key']},
301
298
  }
302
- ak_secret=@secrets[node_info['access_key']]
299
+ ak_secret=@key_chain.get_secret(node_info['access_key'],false)
303
300
  if ak_secret.nil? and node_scope.nil?
304
- raise 'There must be at least one of: secret, node scope'
301
+ raise "There must be at least one of: 'secret' or 'scope' for access key #{node_info['access_key']}"
305
302
  end
306
303
  # if secret provided on command line or if there is no scope
307
304
  if !ak_secret.nil? or node_scope.nil?