asperalm 0.9.33 → 0.9.34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dd4154b6b494fa9d9075376b9ee124b51beaf5f4eb0074607ae27594711b904
4
- data.tar.gz: e12bbd75709ca9a003e2429bd850d187975849c8a5095fc7551515021080d9c5
3
+ metadata.gz: 9360f7e594d8e141d486f28f6799992effd0ee0b03aafebfeecf3eba481fa2ff
4
+ data.tar.gz: 2be12f080706bb1b818195b6b4b039686e9b9f32af7362b11552950b77ffc0b3
5
5
  SHA512:
6
- metadata.gz: 1158643f20e4bbdd109380fa61895c4753530a2ecb23b237bf5e8492f1b427dff4da0494afae912028500b1ac429e5b33447fe9b11b048a173434908bf57e163
7
- data.tar.gz: 77a068cc24ba6a2131f0e784a5a66ab214740b2750bfcf73f197326bce68cc92044425054b25745f5ee620c2c1d147f59c901f9206d7225315589d5932ecf095
6
+ metadata.gz: 40baa01511d8a5612c426bfd6e180d59d3823291151b24f9bbae65f55e1a8026dae41d2ecc1951d0e426104794bf2b26ee1156b9873f7aa5aa73e92d424c0228
7
+ data.tar.gz: 82d68063233e1bcd99c17878c6185cbbd42024ac21159d06fad8e0c20099b0739b691e52b8fb1613eaa3e39fa240a15c3d220223c03eb59fdd746342dc30fc3a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Asperalm - A Ruby library for Aspera transfers and "Amelia", the _Multi Layer IBM Aspera_ Command Line Tool
2
2
 
3
- Version : 0.9.33
3
+ Version : 0.9.34
4
4
 
5
5
 
6
6
  _Laurent/2016-2018_
@@ -39,7 +39,7 @@ Once the gem is installed, `mlia` shall be accessible:
39
39
 
40
40
  ```bash
41
41
  $ mlia --version
42
- 0.9.33
42
+ 0.9.34
43
43
  ```
44
44
 
45
45
  ## First use
@@ -670,6 +670,97 @@ $ mlia config proxy_check --fpac=file:///./proxy.pac http://www.example.com
670
670
  PROXY proxy.example.com:8080
671
671
  ```
672
672
 
673
+ ## <a name="client"></a>FASP configuration
674
+
675
+ The `config` plugin also allows specification for the use of a local FASP client. It provides the following commands for `ascp` subcommand:
676
+
677
+ * `show` : shows the path of ascp used
678
+ * `use` : list,download connect client versions available on internet
679
+ * `products` : list Aspera transfer products available locally
680
+ * `connect` : list,download connect client versions available on internet
681
+
682
+ ### Show path of currently used `ascp`
683
+
684
+ ```
685
+ $ mlia config ascp show
686
+ /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
687
+ ```
688
+
689
+ ### Selection of local `ascp`
690
+
691
+ To temporarily use an alternate ascp path use option `ascp_path` (`--ascp-path=`)
692
+
693
+ To permanently use another ascp:
694
+
695
+ ```
696
+ $ mlia config ascp use '/Users/laurent/Applications/Aspera CLI/bin/ascp'
697
+ saved to default global preset /Users/laurent/Applications/Aspera CLI/bin/ascp
698
+ ```
699
+
700
+ This sets up a global default.
701
+
702
+ ### List locally installed Aspera Transfer products
703
+
704
+ Locally installed Aspera products can be listed with:
705
+
706
+ ```bash
707
+ $ mlia config ascp products list
708
+ :.........................................:................................................:
709
+ : name : app_root :
710
+ :.........................................:................................................:
711
+ : Aspera Connect : /Users/laurent/Applications/Aspera Connect.app :
712
+ : IBM Aspera CLI : /Users/laurent/Applications/Aspera CLI :
713
+ : IBM Aspera High-Speed Transfer Endpoint : /Library/Aspera :
714
+ : Aspera Drive : /Applications/Aspera Drive.app :
715
+ :.........................................:................................................:
716
+ ```
717
+
718
+ ### Selection of local client
719
+
720
+ If no ascp is selected, this is equivalent to using option: `--use-product=FIRST`.
721
+
722
+ Using the option use_product finds the ascp binary of the selected product.
723
+
724
+ To permanently use the ascp of a product:
725
+
726
+ ```bash
727
+ $ mlia config ascp products use 'Aspera Connect'
728
+ saved to default global preset /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
729
+ ```
730
+
731
+ ### Installation of Connect Client on command line
732
+
733
+ ```bash
734
+ $ mlia config ascp connect list
735
+ :...............................................:......................................:..............:
736
+ : id : title : version :
737
+ :...............................................:......................................:..............:
738
+ : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows : 3.7.0.138427 :
739
+ : urn:uuid:A3820D20-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows 64-bit : 3.7.0.138427 :
740
+ : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows XP : 3.7.0.138427 :
741
+ : urn:uuid:55425020-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows XP 64-bit : 3.7.0.138427 :
742
+ : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel 10.6 : 3.6.1.111259 :
743
+ : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel : 3.7.0.138427 :
744
+ : urn:uuid:213C9370-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 32 : 3.6.2.117442 :
745
+ : urn:uuid:97F94DF0-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 64 : 3.7.2.141527 :
746
+ :...............................................:......................................:..............:
747
+ $ mlia config ascp connect id 'Aspera Connect for Mac Intel 10.6' links list
748
+ :.............................................:..........................:.......................................................................:..........:...............:
749
+ : title : type : href : hreflang : rel :
750
+ :.............................................:..........................:.......................................................................:..........:...............:
751
+ : Mac Intel Installer : application/octet-stream : bin/AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg : en : enclosure :
752
+ : Aspera Connect for Mac HTML Documentation : text/html : : en : documentation :
753
+ : 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 :
754
+ : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/en/pdf/Connect_User_3.7.0_OSX.pdf : en : documentation :
755
+ : 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 :
756
+ : 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 :
757
+ : 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 :
758
+ : Aspera Connect for Mac Release Notes : text/html : http://www.asperasoft.com/en/release_notes/default_1/release_notes_54 : en : release-notes :
759
+ :.............................................:..........................:.......................................................................:..........:...............:
760
+ $ mlia config ascp connect id 'Aspera Connect for Mac Intel 10.6' links id 'Mac Intel Installer' download --to-folder=.
761
+ downloaded: AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg
762
+ ```
763
+
673
764
  ## <a name="agents"></a>Transfer Agents
674
765
 
675
766
  Some of the actions on Aspera Applications lead to file transfers (upload and download) using the FASP protocol (`ascp`).
@@ -964,6 +1055,7 @@ mlia --version)
964
1055
  mlia --version` TOOLNAME=EXENAME erb README.erb.md > README.md
965
1056
  mlia -N --url=my_url_here --username=my_username_here --password=my_password_here node acc create --value=@json:'{"id":"aoc_1","secret":"'NODE_PASS'","storage":{"type":"local","path":"/"}}'
966
1057
  mlia -N --url=my_url_here --username=my_username_here --password=my_password_here node acc delete --id=aoc_1
1058
+ mlia -N aspera files browse / --link=AOC_PUBLINK_FOLDER
967
1059
  mlia -N aspera files upload --to-folder=/ CLIENT_DEMOFILE_PATH --link=AOC_PUBLINK_FOLDER
968
1060
  mlia -N aspera org --link=AOC_PUBLINK_RECV_PACKAGE
969
1061
  mlia -N aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'"}' CLIENT_DEMOFILE_PATH --link=AOC_PUBLINK_SEND_DROPBOX
@@ -1113,9 +1205,9 @@ mlia server mv SERVER_FOLDER_UPLOAD/200KB.2 SERVER_FOLDER_UPLOAD/to.delete
1113
1205
  mlia server upload --to-folder=SERVER_FOLDER_UPLOAD/target_hot --lock-port=12345 --ts=@json:'{"EX_ascp_args":["--remove-after-transfer","--remove-empty-directories","--exclude-newer-than=-8","--src-base","source_hot"]}' source_hot
1114
1206
  mlia server upload CLIENT_DEMOFILE_PATH --to-folder=NEW_SERVER_FOLDER
1115
1207
  mlia shares repository browse /
1116
- mlia shares repository delete /TEST_SHARE/SAMPLE_FILENAME
1117
- mlia shares repository download --to-folder=LOCAL_FOLDER /TEST_SHARE/SAMPLE_FILENAME
1118
- mlia shares repository upload --to-folder=/TEST_SHARE CLIENT_DEMOFILE_PATH
1208
+ mlia shares repository delete /SHARES_UPLOAD/SAMPLE_FILENAME
1209
+ mlia shares repository download --to-folder=LOCAL_FOLDER /SHARES_UPLOAD/SAMPLE_FILENAME
1210
+ mlia shares repository upload --to-folder=/SHARES_UPLOAD CLIENT_DEMOFILE_PATH
1119
1211
  mlia shares2 appinfo
1120
1212
  mlia shares2 organization list
1121
1213
  mlia shares2 project list --organization=Sport
@@ -1131,7 +1223,7 @@ mlia sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"re
1131
1223
  ```bash
1132
1224
  $ mlia -h
1133
1225
  NAME
1134
- mlia -- a command line tool for Aspera Applications (v0.9.33)
1226
+ mlia -- a command line tool for Aspera Applications (v0.9.34)
1135
1227
 
1136
1228
  SYNOPSIS
1137
1229
  mlia COMMANDS [OPTIONS] [ARGS]
@@ -1165,7 +1257,7 @@ OPTIONS: global
1165
1257
  -w, --warnings check for language warnings
1166
1258
  --display=ENUM output only some information: info, data, error
1167
1259
  --ui=ENUM method to start browser: text, graphical
1168
- --log-level=ENUM Log level: info, error, fatal, unknown, debug, warn
1260
+ --log-level=ENUM Log level: debug, info, warn, error, fatal, unknown
1169
1261
  --logger=ENUM log method: stderr, stdout, syslog
1170
1262
  --format=ENUM output format: table, ruby, json, jsonpp, yaml, csv, nagios
1171
1263
  --fields=VALUE comma separated list of fields, or ALL, or DEF
@@ -1178,11 +1270,6 @@ OPTIONS: global
1178
1270
  --flat-hash=ENUM display hash values as additional keys: yes, no
1179
1271
  --once-only=ENUM process only new items (some commands): yes, no
1180
1272
  -h, --help Show this message.
1181
- --ts=VALUE override transfer spec values (Hash, use @json: prefix), current={}
1182
- --to-folder=VALUE destination folder for downloaded files
1183
- --sources=VALUE list of source files (see doc)
1184
- --transfer=ENUM type of transfer: direct, connect, node, aoc
1185
- --transfer-info=VALUE additional information for transfer client
1186
1273
 
1187
1274
  COMMAND: config
1188
1275
  SUBCOMMANDS: gem_path genkey plugins flush_tokens list overview open echo id documentation wizard export_to_cli detect coffee ascp email_test smtp_settings proxy_check
@@ -1200,6 +1287,11 @@ OPTIONS:
1200
1287
  --smtp=VALUE smtp configuration (extended value: hash)
1201
1288
  --fpac=VALUE proxy auto configuration URL
1202
1289
  -P, --presetVALUE load the named option preset from current config file
1290
+ --ts=VALUE override transfer spec values (Hash, use @json: prefix), current={}
1291
+ --to-folder=VALUE destination folder for downloaded files
1292
+ --sources=VALUE list of source files (see doc)
1293
+ --transfer=ENUM type of transfer: direct, connect, node, aoc
1294
+ --transfer-info=VALUE additional information for transfer client
1203
1295
 
1204
1296
 
1205
1297
  COMMAND: shares
@@ -1233,7 +1325,7 @@ OPTIONS:
1233
1325
 
1234
1326
 
1235
1327
  COMMAND: aspera
1236
- SUBCOMMANDS: apiinfo bearer_token organization user workspace packages files faspexgw admin
1328
+ SUBCOMMANDS: apiinfo bearer_token organization tier_restrictions user workspace packages files faspexgw admin
1237
1329
  OPTIONS:
1238
1330
  --url=VALUE URL of application, e.g. https://org.asperafiles.com
1239
1331
  --username=VALUE username to log in
@@ -1793,7 +1885,27 @@ filename matches the regex.
1793
1885
 
1794
1886
  For instance, to find files with a special extension, use `--value='\.myext$'`
1795
1887
 
1796
- ## Aspera Node (Transfer Server)
1888
+ ## IBM Aspera High Speed Transfer Server (transfer)
1889
+
1890
+ This plugin works at FASP level (SSH/ascp/ascmd) and does not use the node API.
1891
+
1892
+ ### Example
1893
+
1894
+ One can test the "server" application using the well known demo server:
1895
+
1896
+ ```bash
1897
+ $ mlia config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
1898
+ $ mlia config id default set server aspera_demo_server
1899
+ $ mlia server browse /aspera-test-dir-large
1900
+ $ mlia server download /aspera-test-dir-large/200MB
1901
+ ```
1902
+
1903
+ This creates a [option preset](#lprt) "aspera_demo_server" and set it as default for application "server"
1904
+
1905
+
1906
+ ## IBM Aspera High Speed Transfer Server (node)
1907
+
1908
+ This plugin gives access to capabilities provided by HSTS node API.
1797
1909
 
1798
1910
  ### Simple Operations
1799
1911
 
@@ -1878,115 +1990,6 @@ to download files.
1878
1990
  $ mlia node access_key create --value=@json:'{"id":"eudemo-sedemo","secret":"mystrongsecret","storage":{"type":"local","path":"/data/asperafiles"}}'
1879
1991
  ```
1880
1992
 
1881
- ## <a name="client"></a>FASP configuration
1882
-
1883
- The `config` plugin also allows specification for the use of a local FASP client. It provides the following commands for `ascp` subcommand:
1884
-
1885
- * `show` : shows the path of ascp used
1886
- * `use` : list,download connect client versions available on internet
1887
- * `products` : list Aspera transfer products available locally
1888
- * `connect` : list,download connect client versions available on internet
1889
-
1890
- ### Show path of currently used `ascp`
1891
-
1892
- ```
1893
- $ mlia config ascp show
1894
- /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
1895
- ```
1896
-
1897
- ### Selection of local `ascp`
1898
-
1899
- To temporarily use an alternate ascp path use option `ascp_path` (`--ascp-path=`)
1900
-
1901
- To permanently use another ascp:
1902
-
1903
- ```
1904
- $ mlia config ascp use '/Users/laurent/Applications/Aspera CLI/bin/ascp'
1905
- saved to default global preset /Users/laurent/Applications/Aspera CLI/bin/ascp
1906
- ```
1907
-
1908
- This sets up a global default.
1909
-
1910
- ### List locally installed Aspera Transfer products
1911
-
1912
- Locally installed Aspera products can be listed with:
1913
-
1914
- ```bash
1915
- $ mlia config ascp products list
1916
- :.........................................:................................................:
1917
- : name : app_root :
1918
- :.........................................:................................................:
1919
- : Aspera Connect : /Users/laurent/Applications/Aspera Connect.app :
1920
- : IBM Aspera CLI : /Users/laurent/Applications/Aspera CLI :
1921
- : IBM Aspera High-Speed Transfer Endpoint : /Library/Aspera :
1922
- : Aspera Drive : /Applications/Aspera Drive.app :
1923
- :.........................................:................................................:
1924
- ```
1925
-
1926
- ### Selection of local client
1927
-
1928
- If no ascp is selected, this is equivalent to using option: `--use-product=FIRST`.
1929
-
1930
- Using the option use_product finds the ascp binary of the selected product.
1931
-
1932
- To permanently use the ascp of a product:
1933
-
1934
- ```bash
1935
- $ mlia config ascp products use 'Aspera Connect'
1936
- saved to default global preset /Users/laurent/Applications/Aspera Connect.app/Contents/Resources/ascp
1937
- ```
1938
-
1939
- ### Installation of Connect Client on command line
1940
-
1941
- ```bash
1942
- $ mlia config ascp connect list
1943
- :...............................................:......................................:..............:
1944
- : id : title : version :
1945
- :...............................................:......................................:..............:
1946
- : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows : 3.7.0.138427 :
1947
- : urn:uuid:A3820D20-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows 64-bit : 3.7.0.138427 :
1948
- : urn:uuid:589F9EE5-0489-4F73-9982-A612FAC70C4E : Aspera Connect for Windows XP : 3.7.0.138427 :
1949
- : urn:uuid:55425020-083E-11E2-892E-0800200C9A66 : Aspera Connect for Windows XP 64-bit : 3.7.0.138427 :
1950
- : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel 10.6 : 3.6.1.111259 :
1951
- : urn:uuid:D8629AD2-6898-4811-A46F-2AF386531BFF : Aspera Connect for Mac Intel : 3.7.0.138427 :
1952
- : urn:uuid:213C9370-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 32 : 3.6.2.117442 :
1953
- : urn:uuid:97F94DF0-22B1-11E2-81C1-0800200C9A66 : Aspera Connect for Linux 64 : 3.7.2.141527 :
1954
- :...............................................:......................................:..............:
1955
- $ mlia config ascp connect id 'Aspera Connect for Mac Intel 10.6' links list
1956
- :.............................................:..........................:.......................................................................:..........:...............:
1957
- : title : type : href : hreflang : rel :
1958
- :.............................................:..........................:.......................................................................:..........:...............:
1959
- : Mac Intel Installer : application/octet-stream : bin/AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg : en : enclosure :
1960
- : Aspera Connect for Mac HTML Documentation : text/html : : en : documentation :
1961
- : 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 :
1962
- : Aspera Connect PDF Documentation for Mac OS : application/pdf : docs/user/osx/en/pdf/Connect_User_3.7.0_OSX.pdf : en : documentation :
1963
- : 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 :
1964
- : 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 :
1965
- : 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 :
1966
- : Aspera Connect for Mac Release Notes : text/html : http://www.asperasoft.com/en/release_notes/default_1/release_notes_54 : en : release-notes :
1967
- :.............................................:..........................:.......................................................................:..........:...............:
1968
- $ mlia config ascp connect id 'Aspera Connect for Mac Intel 10.6' links id 'Mac Intel Installer' download --to-folder=.
1969
- downloaded: AsperaConnect-3.6.1.111259-mac-intel-10.6.dmg
1970
- ```
1971
-
1972
- ## IBM Aspera High Speed Transfer Server
1973
-
1974
- Works at FASP level (SSH/ascp/ascmd). (different from node api)
1975
-
1976
- ### Example
1977
-
1978
- One can test the "server" application using the well known demo server:
1979
-
1980
- ```bash
1981
- $ mlia config id aspera_demo_server update --url=ssh://demo.asperasoft.com:33001 --username=asperaweb --password=demoaspera
1982
- $ mlia config id default set server aspera_demo_server
1983
- $ mlia server browse /aspera-test-dir-large
1984
- $ mlia server download /aspera-test-dir-large/200MB
1985
- ```
1986
-
1987
- This creates a [option preset](#lprt) "aspera_demo_server" and set it as default for application "server"
1988
-
1989
-
1990
1993
  ## IBM Aspera Faspex
1991
1994
 
1992
1995
  Note that the command "v4" requires the use of APIv4, refer to the Faspex Admin manual on how to activate.
@@ -2062,17 +2065,36 @@ ATS is usable either :
2062
2065
 
2063
2066
  * from an AoC subscription : mlia aspera admin ats
2064
2067
 
2065
- * or from an IBM Cloud (bluemix) subscription : mlia ats
2068
+ * or from an IBM Cloud subscription : mlia ats
2066
2069
 
2067
2070
  ### IBM Cloud ATS : creation of api key
2068
2071
 
2069
2072
  First get your IBM Cloud APIkey, as described here:
2070
- [https://console.bluemix.net/docs/iam/userid_keys.html#userapikey](https://console.bluemix.net/docs/iam/userid_keys.html#userapikey)
2071
2073
 
2072
- Execute:
2074
+ * [https://console.bluemix.net/docs/iam/userid_keys.html#userapikey](https://console.bluemix.net/docs/iam/userid_keys.html#userapikey)
2075
+ * [https://ibm.ibmaspera.com/helpcenter/transfer-service](https://ibm.ibmaspera.com/helpcenter/transfer-service)
2076
+
2077
+ For instance the IBM cloud API key can be created using the web interface, or using command line:
2078
+
2079
+ ```bash
2080
+ $ ibmcloud iam api-key-create mykeyname -d 'my sample key'
2081
+ OK
2082
+ API key mykeyname was created
2073
2083
 
2084
+ Please preserve the API key! It cannot be retrieved after it's created.
2085
+
2086
+ Name mykeyname
2087
+ Description my sample key
2088
+ Created At 2019-09-30T12:17+0000
2089
+ API Key my_secret_api_key_here_8f8d9fdakjhfsashjk678
2090
+ Locked false
2091
+ UUID ApiKey-05b8fadf-e7fe-4bc4-93a9-6fd348c5ab1f
2074
2092
  ```
2075
- $ mlia config id my_ibm_ats update --ibm-api-key=XXXX
2093
+
2094
+ Then, to register the key by default for the ats plugin: execute:
2095
+
2096
+ ```
2097
+ $ mlia config id my_ibm_ats update --ibm-api-key=my_secret_api_key_here_8f8d9fdakjhfsashjk678
2076
2098
  $ mlia config id default set ats my_ibm_ats
2077
2099
  $ mlia ats api_key instances
2078
2100
  :......................................:
@@ -2097,10 +2119,6 @@ $ mlia ats api_key create
2097
2119
  $ mlia config id my_ibm_ats update --ats-key=ats_XXXXXXXXXXXXXXXXXXXXXXXX --ats-secret=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
2098
2120
  ```
2099
2121
 
2100
- Note: access key API is described here: [https://ibm.ibmaspera.com/helpcenter/transfer-service](https://ibm.ibmaspera.com/helpcenter/transfer-service)
2101
-
2102
- and here: [https://developer.asperasoft.com/web/node/access-keys](https://developer.asperasoft.com/web/node/access-keys)
2103
-
2104
2122
  ### Examples
2105
2123
 
2106
2124
  Example: create access key on softlayer:
@@ -2580,6 +2598,11 @@ Gems, or remove your ed25519 key from your `.ssh` folder to solve the issue. Not
2580
2598
 
2581
2599
  # Release Notes
2582
2600
 
2601
+ * version 0.9.34
2602
+
2603
+ * parser "@preset" can be used again in option "transfer_info"
2604
+ * some documentation re-organizing
2605
+
2583
2606
  * version 0.9.33
2584
2607
 
2585
2608
  * new command to display basic token of node
@@ -50,10 +50,12 @@ fasp_manager.add_listener(MyListener.new)
50
50
 
51
51
  # manually build teansfer spec
52
52
  transfer_spec={
53
- 'remote_host' =>'demo.asperasoft.com',
53
+ #'remote_host' =>'demo.asperasoft.com',
54
+ 'remote_host' =>'eudemo.asperademo.com',
54
55
  'remote_user' =>'asperaweb',
55
56
  'remote_password' =>'demoaspera',
56
57
  'direction' =>'receive',
58
+ 'ssh_port' =>33001,
57
59
  'destination_root'=>'.',
58
60
  'paths' =>[{'source'=>'aspera-test-dir-tiny/200KB.1'}]
59
61
  }
@@ -81,7 +83,7 @@ node_api=Asperalm::Rest.new({
81
83
  :base_url => 'https://eudemo.asperademo.com:9092',
82
84
  :auth => {
83
85
  :type => :basic,
84
- :username => 'node_aspera',
86
+ :username => 'node_asperaweb',
85
87
  :password => 'demoaspera'
86
88
  }})
87
89
  # define sample file(s) and destination folder
@@ -1 +1 @@
1
- 0.9.33
1
+ 0.9.34
@@ -4,6 +4,8 @@ require 'asperalm/rest'
4
4
  module Asperalm
5
5
  # detect Aspera product by calling API
6
6
  class ApiDetector
7
+ # @return a hash: {:product=>:node,:version=>'unknown'}
8
+ # if not found: {:product=>:unknown,:version=>'unknown'}
7
9
  def self.discover_product(url)
8
10
  #uri=URI.parse(url)
9
11
  api=Rest.new({:base_url=>url})
@@ -40,6 +40,7 @@ module Asperalm
40
40
  'path' =>{:type=>:reader ,:func=>lambda{|v|File.expand_path(v)}},
41
41
  'env' =>{:type=>:reader ,:func=>lambda{|v|ENV[v]}},
42
42
  'stdin' =>{:type=>:reader ,:func=>lambda{|v|raise "no value allowed for stdin" unless v.empty?;STDIN.gets}},
43
+ # other handlers can be set using set_handler, e.g. preset is reader in config plugin
43
44
  }
44
45
  end
45
46
  public
@@ -51,8 +52,8 @@ module Asperalm
51
52
  @handlers[name]={:type=>type,:func=>method}
52
53
  end
53
54
 
54
- # parse an option value, special behavior for file:, env:, val:
55
- # parse only string, other values are returned as is
55
+ # parse an option value if it is a String using supported extended vaklue modifiers
56
+ # other value types are returned as is
56
57
  def parse(name_or_descr,value)
57
58
  return value if !value.is_a?(String)
58
59
  decoder_list=@handlers.keys.select{|k|@handlers[k][:type].eql?(:decoder)}
@@ -81,8 +81,10 @@ module Asperalm
81
81
  # must override help methods before parser called (in other constructors)
82
82
  init_global_options()
83
83
  @opt_mgr.add_opt_switch(:help,"-h","Show this message.") { @option_help=true }
84
- @plugin_env[:transfer]=TransferAgent.new(@plugin_env)
84
+ # the Config plugin adds the @preset parser
85
85
  @plugin_env[:config]=Plugins::Config.new(@plugin_env,self.program_name,@help_url,self.class.gem_version)
86
+ # the TransferAgent plugin may use the @preset parser
87
+ @plugin_env[:transfer]=TransferAgent.new(@plugin_env)
86
88
  Log.log.debug('created plugin env'.red)
87
89
  # give command line arguments to option manager (no parsing)
88
90
  # set application folder for modules
@@ -63,8 +63,14 @@ module Asperalm
63
63
  return self.transfer.start(*@api_aoc.tr_spec(app,direction,node_file,@workspace_id,@workspace_name,ts_add))
64
64
  end
65
65
 
66
- def execute_node_gen4_action(top_node_file)
67
- command_repo=self.options.get_next_command([ :browse, :find, :mkdir, :rename, :delete, :upload, :download, :transfer, :http_node_download, :v3, :file, :bearer_token_node ])
66
+ NODE4_COMMANDS=[ :browse, :find, :mkdir, :rename, :delete, :upload, :download, :transfer, :http_node_download, :v3, :file, :bearer_token_node ]
67
+
68
+ def node_gen4_execute_action(top_node_file)
69
+ command_repo=self.options.get_next_command(NODE4_COMMANDS)
70
+ return execute_node_gen4_command(command_repo,top_node_file)
71
+ end
72
+
73
+ def execute_node_gen4_command(command_repo,top_node_file)
68
74
  case command_repo
69
75
  when :bearer_token_node
70
76
  thepath=self.options.get_next_argument('path')
@@ -179,7 +185,8 @@ module Asperalm
179
185
  items=node_api.read("files/#{fileid}")[:data]
180
186
  return {:type=>:single_object,:data=>items}
181
187
  end # command_repo
182
- end # execute_node_gen4_action
188
+ throw "ERR"
189
+ end # node_gen4_execute_action
183
190
 
184
191
  # check option "link"
185
192
  # if present try to get token value (resolve redirection if short links used)
@@ -395,7 +402,7 @@ module Asperalm
395
402
  end
396
403
  end
397
404
 
398
- ACTIONS=[ :apiinfo, :bearer_token, :organization, :user, :workspace, :packages, :files, :faspexgw, :admin]
405
+ ACTIONS=[ :apiinfo, :bearer_token, :organization, :tier_restrictions, :user, :workspace, :packages, :files, :faspexgw, :admin]
399
406
 
400
407
  def execute_action
401
408
  command=self.options.get_next_command(ACTIONS)
@@ -409,6 +416,8 @@ module Asperalm
409
416
  return {:type=>:text,:data=>@api_aoc.oauth_token}
410
417
  when :organization
411
418
  return { :type=>:single_object, :data =>@api_aoc.read('organization')[:data] }
419
+ when :tier_restrictions
420
+ return { :type=>:single_object, :data =>@api_aoc.read('tier_restrictions')[:data] }
412
421
  when :user
413
422
  command=self.options.get_next_command([ :workspaces,:info ])
414
423
  case command
@@ -523,10 +532,18 @@ module Asperalm
523
532
  end
524
533
  end
525
534
  when :files
535
+ # get workspace related information
526
536
  set_workspace_info
527
537
  set_home_node_file
538
+ # set node secret in case it was provided
528
539
  @api_aoc.secrets[@home_node_file[:node_info]['id']]=@option_ak_secret
529
- return execute_node_gen4_action(@home_node_file)
540
+ command_repo=self.options.get_next_command(NODE4_COMMANDS.clone.concat([:short_link]))
541
+ case command_repo
542
+ when *NODE4_COMMANDS; return execute_node_gen4_command(command_repo,@home_node_file)
543
+ when :short_link
544
+ return self.entity_action(@api_aoc,'short_links',nil,:id,'self')
545
+ end
546
+ throw "Error"
530
547
  when :faspexgw
531
548
  set_workspace_info
532
549
  require 'asperalm/faspex_gw'
@@ -627,7 +644,7 @@ module Asperalm
627
644
  api_node=@api_aoc.get_files_node_api(res_data)
628
645
  return Node.new(@agents.merge(skip_basic_auth_options: true, node_api: api_node)).execute_action if command.eql?(:v3)
629
646
  ak_data=api_node.call({:operation=>'GET',:subpath=>"access_keys/#{res_data['access_key']}",:headers=>{'Accept'=>'application/json'}})[:data]
630
- return execute_node_gen4_action({node_info: res_data, file_id: ak_data['root_file_id']})
647
+ return node_gen4_execute_action({node_info: res_data, file_id: ak_data['root_file_id']})
631
648
  when :info
632
649
  object=@api_aoc.read(resource_instance_path)[:data]
633
650
  access_key=object['access_key']
@@ -144,6 +144,7 @@ module Asperalm
144
144
  :auth => {
145
145
  :type => :oauth2,
146
146
  :base_url => 'https://iam.bluemix.net/identity',
147
+ # :base_url => 'https://iam.cloud.ibm.com/identity',
147
148
  :grant => :ibm_apikey,
148
149
  :api_key => self.options.get_option(:ibm_api_key,:mandatory)
149
150
  }
@@ -161,7 +162,9 @@ module Asperalm
161
162
  instance=self.options.get_option(:instance,:optional)
162
163
  #Log.log.error("1>>#{instance}".red)
163
164
  if instance.nil?
165
+ # Take the first Aspera on Cloud transfer service instance ID if not provided by user
164
166
  instance=ats_api_v2_auth_ibm.read('instances')[:data]['data'].first
167
+ self.format.display_status("using first instance: #{instance}")
165
168
  end
166
169
  #Log.log.error("2>>#{instance}".red)
167
170
  rest_add_header={'X-ATS-Service-Instance-Id'=>instance}
@@ -72,7 +72,7 @@ module Asperalm
72
72
  node_config=@env[:config].preset_by_name(param_set_name)
73
73
  end
74
74
  Log.log.debug("node=#{node_config}")
75
- raise CliBadArgument,"the node configuration shall be a hash, use either @json:<json> or @preset:<parameter set name>" if !node_config.is_a?(Hash)
75
+ raise CliBadArgument,"the node configuration shall be Hash, not #{node_config.class} (#{node_config}), use either @json:<json> or @preset:<parameter set name>" if !node_config.is_a?(Hash)
76
76
  # now check there are required parameters
77
77
  sym_config=[:url,:username,:password].inject({}) do |h,param|
78
78
  raise CliBadArgument,"missing parameter [#{param}] in node specification: #{node_config}" if !node_config.has_key?(param.to_s)
@@ -184,6 +184,7 @@ module Asperalm
184
184
  transfer_spec.merge!(@transfer_spec_cmdline)
185
185
  # add bypass keys if there is a token, also prevents connect plugin to ask password
186
186
  transfer_spec['authentication']='token' if transfer_spec.has_key?('token')
187
+ # create transfer agent
187
188
  self.set_agent_by_options
188
189
  Log.log.debug("mgr is a #{@agent.class}")
189
190
  @agent.start_transfer(transfer_spec,options)
@@ -20,7 +20,7 @@ module Asperalm
20
20
  module Fasp
21
21
  # default transfer username for access key based transfers
22
22
  ACCESS_KEY_TRANSFER_USER='xfer'
23
- # executes a local "ascp", equivalent of "Fasp Manager"
23
+ # executes a local "ascp", connects mgt port, equivalent of "Fasp Manager"
24
24
  class Local < Manager
25
25
  include Singleton
26
26
  # set to false to keep ascp progress bar display (basically: removes ascp's option -q)
@@ -98,7 +98,7 @@ module Asperalm
98
98
  this_session[:env_args]=this_session[:env_args].clone()
99
99
  this_session[:env_args][:args]=this_session[:env_args][:args].clone()
100
100
  this_session[:env_args][:args].unshift("-C#{i}:#{multi_session}")
101
- # check if this is necessary ? should be handled by server, this is in man page
101
+ # necessary only if server is not linux, i.e. server does not support port re-use
102
102
  this_session[:env_args][:args].unshift("-O","#{multi_session_udp_port_base+i-1}")
103
103
  this_session[:thread] = Thread.new(this_session) {|s|transfer_thread_entry(s)}
104
104
  xfer_job[:sessions].push(this_session)
@@ -191,8 +191,11 @@ module Asperalm
191
191
  end
192
192
  end
193
193
 
194
+ # TODO: give change to decode content type of JSON even in case of error code
195
+ # (in that case do not parse in rest_call_error.rb)
194
196
  Log.log.debug("result: code=#{result[:http].code}")
195
197
  RestCallError.raiseOnError(req,result[:http])
198
+ # TODO: check paged on Content-Type rather than Accept
196
199
  if call_data.has_key?(:headers) and
197
200
  call_data[:headers].has_key?('Accept') then
198
201
  Log.log.debug("result: body=#{result[:http].body}")
@@ -80,11 +80,21 @@ module Asperalm
80
80
  d_t_s.each do |res|
81
81
  r_err=res['transfer_spec']['error']
82
82
  if r_err.is_a?(Hash)
83
- add_error("Type 8","#{r_err['code']}: #{r_err['reason']}: #{r_err['user_message']}",msg_stack,json_response,req,resp)
83
+ add_error("T8:node: *_setup","#{r_err['code']}: #{r_err['reason']}: #{r_err['user_message']}",msg_stack,json_response,req,resp)
84
84
  end
85
85
  end
86
86
  end
87
87
  end
88
+ # call to IBM cloud IAM
89
+ add_handler do |msg_stack,json_response,req,resp|
90
+ d_error=json_response['errorMessage']
91
+ add_error("T9:IBM cloud",d_error,msg_stack,json_response,req,resp) if d_error.is_a?(String)
92
+ end
93
+ # faspex v4
94
+ add_handler do |msg_stack,json_response,req,resp|
95
+ d_error=json_response['user_message']
96
+ add_error("T10:faspex v4",d_error,msg_stack,json_response,req,resp) if d_error.is_a?(String)
97
+ end
88
98
 
89
99
  # called by the Rest object on any result
90
100
  def self.raiseOnError(req,resp)
@@ -102,7 +112,7 @@ module Asperalm
102
112
  end
103
113
  end
104
114
  unless resp.code.start_with?('2') and msg_stack.empty?
105
- add_error("Type 9",resp.message,msg_stack,json_response,req,resp) if msg_stack.empty?
115
+ add_error("Type Generic",resp.message,msg_stack,json_response,req,resp) if msg_stack.empty?
106
116
  raise RestCallError.new(req,resp,msg_stack.join("\n"))
107
117
  end
108
118
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asperalm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.33
4
+ version: 0.9.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple