asperalm 0.10.14 → 0.10.15

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: 7c47ef56f70fd2ecb385b62750dd2c3585908bd4a84b5550dfe1a169ee21f170
4
- data.tar.gz: a4c5a5beca9b6fe4ddaba704b53ab4ef9c4c3a7bb1cc45fcb3b2a1b940b012b0
3
+ metadata.gz: 2ac2a0d3d0af2ff661338e68d7d1497b3a3f5626ad0fd1937b356576e3e6af02
4
+ data.tar.gz: 0df3bb6447b3877fc1cb84c65d8a6d5b3d1e4db4c99e063e2200274889e54d38
5
5
  SHA512:
6
- metadata.gz: 261bd25c91c49d67d74a31407fbd87e5991737973cafc72a6d7fa99ae5a8e498629e8b68d4effac5fe86963b28df1c0beffeba35c8259274aabcf434e9795f57
7
- data.tar.gz: 223fd8555e7f825c62785e710c1eccee5e1cd84a8310829379d38ad7213285025659fa95949520abc039e78585f1f46ecf90ea73e5c2b4ff265595346fed242b
6
+ metadata.gz: 0665bc76d054fcf346a991606eb5ec73359ff3b153520bbc8db2c33cdc215e5e4bc72aad5a1325005456dd63064145d5eca31365cd592e191b55af9d9b3a54c4
7
+ data.tar.gz: 19acd9437da7cf66fb4b34980c971c0219a90388c9ed094353a76d2c16e2e57392d94b972193d072241a7c14ea3c5f52e84cc62f2293e9660cbac354cd58eddc
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.10.14
3
+ Version : 0.10.15
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.10.14
42
+ 0.10.15
43
43
  ```
44
44
 
45
45
  ## First use
@@ -1165,33 +1165,33 @@ A non complete list of commands used in unit tests:
1165
1165
  ```bash
1166
1166
  mlia
1167
1167
  mlia --no-default node --url=my_url_here --username=my_username_here --password=my_password_here --insecure=yes delete /500M.dat
1168
- mlia --no-default node --url=my_url_here --username=my_username_here --password=my_password_here --insecure=yes upload --to-folder=SERVER_FOLDER_UPLOAD --sources=@ts --ts=@json:'{"paths":[{"source":"/aspera-test-dir-small/10MB.1"}],"remote_password":"demoaspera","precalculate_job_size":true}' --transfer=node --transfer-info=@json:'{"url":"my_url_here","username":"my_username_here","password":"my_password_here"}'
1168
+ mlia --no-default node --url=my_url_here --username=my_username_here --password=my_password_here --insecure=yes upload --to-folder=CF_HSTS_FOLDER_UPLOAD --sources=@ts --ts=@json:'{"paths":[{"source":"/aspera-test-dir-small/10MB.1"}],"remote_password":"CF_HSTS_SSH_PASS","precalculate_job_size":true}' --transfer=node --transfer-info=@json:'{"url":"my_url_here","username":"my_username_here","password":"my_password_here"}'
1169
1169
  mlia --version)
1170
1170
  mlia --version` TOOLNAME=EXENAME erb README.erb.md > README.md
1171
1171
  mlia --warnings --config-file=MLIA_CONFIG_FILE
1172
- 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":"/"}}'
1172
+ mlia -N --url=my_url_here --username=my_username_here --password=my_password_here node acc create --value=@json:'{"id":"aoc_1","secret":"'CF_COMMON_PASS'","storage":{"type":"local","path":"/"}}'
1173
1173
  mlia -N --url=my_url_here --username=my_username_here --password=my_password_here node acc delete --id=aoc_1
1174
- mlia -N aspera files browse / --link=AOC_PUBLINK_FOLDER
1175
- mlia -N aspera files upload --to-folder=/ CLIENT_DEMOFILE_PATH --link=AOC_PUBLINK_FOLDER
1176
- mlia -N aspera org --link=AOC_PUBLINK_RECV_PACKAGE
1177
- mlia -N aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'"}' CLIENT_DEMOFILE_PATH --link=AOC_PUBLINK_SEND_DROPBOX
1178
- mlia -N aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'"}' CLIENT_DEMOFILE_PATH --link=AOC_PUBLINK_SEND_USER
1179
- mlia -N server --url=my_url_here --username=my_username_here --password=my_password_here --format=nagios nagios transfer --to-folder=SERVER_FOLDER_UPLOAD
1174
+ mlia -N aspera files browse / --link=CF_AOC_PUBLINK_FOLDER
1175
+ mlia -N aspera files upload --to-folder=/ CF_SAMPLE_FILEPATH --link=CF_AOC_PUBLINK_FOLDER
1176
+ mlia -N aspera org --link=CF_AOC_PUBLINK_RECV_PACKAGE
1177
+ mlia -N aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'"}' CF_SAMPLE_FILEPATH --link=CF_AOC_PUBLINK_SEND_DROPBOX
1178
+ mlia -N aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'"}' CF_SAMPLE_FILEPATH --link=CF_AOC_PUBLINK_SEND_USER
1179
+ mlia -N server --url=my_url_here --username=my_username_here --password=my_password_here --format=nagios nagios transfer --to-folder=CF_HSTS_FOLDER_UPLOAD
1180
1180
  mlia -N server --url=my_url_here --username=my_username_here --ssh-keys=~/.ssh/id_rsa --format=nagios nagios app_services
1181
1181
  mlia -N server --url=my_url_here --username=my_username_here --ssh-keys=~/.ssh/id_rsa ctl all:status
1182
1182
  mlia -N server --url=my_url_here --username=my_username_here --ssh-keys=~/.ssh/id_rsa nodeadmin -- -l
1183
1183
  mlia -h
1184
+ mlia aspera admin analytics transfers --query=@json:'{"status":"completed","direction":"receive"}'
1184
1185
  mlia aspera admin ats access_key --id=akibmcloud --secret=my_secret_here node browse /
1185
1186
  mlia aspera admin ats access_key --id=akibmcloud delete
1186
- mlia aspera admin ats access_key create --cloud=aws --region=AWS_REGION --params=@json:'{"id":"ak_aws","name":"laurent key AWS","storage":{"type":"aws_s3","bucket":"'AWS_BUCKET'","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1187
- mlia aspera admin ats access_key create --cloud=softlayer --region=ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"laurent key","storage":{"type":"ibm-s3","bucket":"ICOS_BUCKET","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1187
+ mlia aspera admin ats access_key create --cloud=aws --region=CF_AWS_REGION --params=@json:'{"id":"ak_aws","name":"laurent key AWS","storage":{"type":"aws_s3","bucket":"'CF_AWS_BUCKET'","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1188
+ mlia aspera admin ats access_key create --cloud=softlayer --region=CF_ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"laurent key","storage":{"type":"ibm-s3","bucket":"CF_ICOS_BUCKET","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1188
1189
  mlia aspera admin ats access_key list --fields=name,id
1189
1190
  mlia aspera admin ats cluster clouds
1190
1191
  mlia aspera admin ats cluster list
1191
- mlia aspera admin ats cluster show --cloud=aws --region=AWS_REGION
1192
+ mlia aspera admin ats cluster show --cloud=aws --region=CF_AWS_REGION
1192
1193
  mlia aspera admin ats cluster show --id=1f412ae7-869a-445c-9c05-02ad16813be2
1193
- mlia aspera admin eve --query=@json:'{"page":1,"per_page":2,"q":"*","sort":"-date"}'
1194
- mlia aspera admin res client --id=MY_CLIENT_ID set_pub_key @file:MY_PRIVATE_KEY_FILE
1194
+ mlia aspera admin res client --id=CF_AOC1_CLIENT_ID set_pub_key @file:CF_PRIVATE_KEY_FILE
1195
1195
  mlia aspera admin res node v3 events --secret=my_secret_here
1196
1196
  mlia aspera admin resource node --name=eudemo-sedemo --secret=my_secret_here v3 access_key create --value=@json:'{"id":"testsub1","storage":{"path":"/folder1"}}'
1197
1197
  mlia aspera admin resource node --name=eudemo-sedemo --secret=my_secret_here v3 access_key delete --id=testsub1
@@ -1220,14 +1220,14 @@ mlia aspera files http_node_download --to-folder=LOCAL_FOLDER /200KB.1
1220
1220
  mlia aspera files mkdir /testfolder
1221
1221
  mlia aspera files rename /testfolder newname
1222
1222
  mlia aspera files transfer --workspace=eudemo --from-folder='/Demo Files/aspera-test-dir-tiny' --to-folder=unit_test 200KB.1
1223
- mlia aspera files upload --to-folder=/ CLIENT_DEMOFILE_PATH
1223
+ mlia aspera files upload --to-folder=/ CF_SAMPLE_FILEPATH
1224
1224
  mlia aspera files v3 info
1225
1225
  mlia aspera organization
1226
1226
  mlia aspera packages list
1227
1227
  mlia aspera packages list --format=csv --fields=id|head -n 1)
1228
1228
  mlia aspera packages recv --id=ALL --once-only=yes --lock-port=12345
1229
- mlia aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'","recipients":["laurent.martin.aspera@fr.ibm.com"],"note":"my note"}' CLIENT_DEMOFILE_PATH
1230
- mlia aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'","recipients":["laurent.martin.l+external@gmail.com"]}' --new-user-option=@json:'{"package_contact":true}' CLIENT_DEMOFILE_PATH
1229
+ mlia aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'","recipients":["laurent.martin.aspera@fr.ibm.com"],"note":"my note"}' CF_SAMPLE_FILEPATH
1230
+ mlia aspera packages send --value=@json:'{"name":"'"CURRENT_DATE"'","recipients":["laurent.martin.l+external@gmail.com"]}' --new-user-option=@json:'{"package_contact":true}' CF_SAMPLE_FILEPATH
1231
1231
  mlia aspera user info modify @json:'{"name":"dummy change"}'
1232
1232
  mlia aspera user info show
1233
1233
  mlia aspera workspace
@@ -1235,15 +1235,15 @@ mlia ats access_key --id=ak_aws delete
1235
1235
  mlia ats access_key --id=akibmcloud --secret=my_secret_here cluster
1236
1236
  mlia ats access_key --id=akibmcloud --secret=my_secret_here node browse /
1237
1237
  mlia ats access_key --id=akibmcloud delete
1238
- mlia ats access_key create --cloud=aws --region=AWS_REGION --params=@json:'{"id":"ak_aws","name":"laurent key AWS","storage":{"type":"aws_s3","bucket":"'AWS_BUCKET'","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1239
- mlia ats access_key create --cloud=softlayer --region=ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"laurent key","storage":{"type":"ibm-s3","bucket":"ICOS_BUCKET","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1238
+ mlia ats access_key create --cloud=aws --region=CF_AWS_REGION --params=@json:'{"id":"ak_aws","name":"laurent key AWS","storage":{"type":"aws_s3","bucket":"'CF_AWS_BUCKET'","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1239
+ mlia ats access_key create --cloud=softlayer --region=CF_ICOS_REGION --params=@json:'{"id":"akibmcloud","secret":"somesecret","name":"laurent key","storage":{"type":"ibm-s3","bucket":"CF_ICOS_BUCKET","credentials":{"access_key_id":"my_access_key_id_here","secret_access_key":"my_secret_access_key_here"},"path":"/"}}'
1240
1240
  mlia ats access_key list --fields=name,id
1241
1241
  mlia ats api_key create
1242
1242
  mlia ats api_key instances
1243
1243
  mlia ats api_key list
1244
1244
  mlia ats cluster clouds
1245
1245
  mlia ats cluster list
1246
- mlia ats cluster show --cloud=aws --region=AWS_REGION
1246
+ mlia ats cluster show --cloud=aws --region=CF_AWS_REGION
1247
1247
  mlia ats cluster show --id=1f412ae7-869a-445c-9c05-02ad16813be2
1248
1248
  mlia conf flush
1249
1249
  mlia conf wiz --url=my_url_here --config-file=SAMPLE_CONFIG_FILE --client-id=HIDE_CLIENT_ID --client-secret=HIDE_CLIENT_SECRET --pkeypath='' --use-generic-client=no --username=my_username_here
@@ -1271,24 +1271,24 @@ mlia config proxy_check --fpac=file:///./examples/proxy.pac https://eudemo.asper
1271
1271
  mlia console transfer current list
1272
1272
  mlia console transfer smart list
1273
1273
  mlia console transfer smart sub 112 @json:'{"source":{"paths":["10MB.1"]},"source_type":"user_selected"}'
1274
- mlia cos node --service-credentials=@json:@file:SERVICE_CREDS_FILE --region=COS_REGION --bucket=COS_BUCKET access_key --id=self show
1275
- mlia cos node --service-credentials=@json:@file:SERVICE_CREDS_FILE --region=COS_REGION --bucket=COS_BUCKET download SAMPLE_FILENAME
1276
- mlia cos node --service-credentials=@json:@file:SERVICE_CREDS_FILE --region=COS_REGION --bucket=COS_BUCKET info
1277
- mlia cos node --service-credentials=@json:@file:SERVICE_CREDS_FILE --region=COS_REGION --bucket=COS_BUCKET upload CLIENT_DEMOFILE_PATH
1274
+ mlia cos node --service-credentials=@json:@file:CF_ICOS_CREDS_FILE --region=CF_ICOS_REGION --bucket=CF_ICOS_BUCKET access_key --id=self show
1275
+ mlia cos node --service-credentials=@json:@file:CF_ICOS_CREDS_FILE --region=CF_ICOS_REGION --bucket=CF_ICOS_BUCKET download CF_SAMPLE_FILENAME
1276
+ mlia cos node --service-credentials=@json:@file:CF_ICOS_CREDS_FILE --region=CF_ICOS_REGION --bucket=CF_ICOS_BUCKET info
1277
+ mlia cos node --service-credentials=@json:@file:CF_ICOS_CREDS_FILE --region=CF_ICOS_REGION --bucket=CF_ICOS_BUCKET upload CF_SAMPLE_FILEPATH
1278
1278
  mlia faspex nagios_check
1279
1279
  mlia faspex package list
1280
1280
  mlia faspex package list --fields=package_id --format=csv --box=sent|tail -n 1)
1281
1281
  mlia faspex package list --fields=package_id --format=csv|tail -n 1)
1282
- mlia faspex package recv --link='FASPEX_PUBLINK_RECV_PACKAGE'
1282
+ mlia faspex package recv --link='CF_FASPEX_PUBLINK_RECV_PACKAGE'
1283
1283
  mlia faspex package recv --to-folder=LOCAL_FOLDER --id=ALL --once-only=yes
1284
- mlia faspex package send --delivery-info=@json:'{"title":"'"CURRENT_DATE"'","recipients":["laurent.martin.aspera@fr.ibm.com"]}' CLIENT_DEMOFILE_PATH
1285
- mlia faspex package send --link='FASPEX_PUBLINK_SEND_DROPBOX' --delivery-info=@json:'{"title":"'"CURRENT_DATE"'"}' CLIENT_DEMOFILE_PATH
1286
- mlia faspex package send --link='FASPEX_PUBLINK_SEND_TO_USER' --delivery-info=@json:'{"title":"'"CURRENT_DATE"'"}' CLIENT_DEMOFILE_PATH
1284
+ mlia faspex package send --delivery-info=@json:'{"title":"'"CURRENT_DATE"'","recipients":["laurent.martin.aspera@fr.ibm.com"]}' CF_SAMPLE_FILEPATH
1285
+ mlia faspex package send --link='CF_FASPEX_PUBLINK_SEND_DROPBOX' --delivery-info=@json:'{"title":"'"CURRENT_DATE"'"}' CF_SAMPLE_FILEPATH
1286
+ mlia faspex package send --link='CF_FASPEX_PUBLINK_SEND_TO_USER' --delivery-info=@json:'{"title":"'"CURRENT_DATE"'"}' CF_SAMPLE_FILEPATH
1287
1287
  mlia faspex source name "Server Files" node br /
1288
1288
  mlia faspex5 node list --value=@json:'{"type":"received","subtype":"mypackages"}'
1289
1289
  mlia faspex5 package list --value=@json:'{"state":["released"]}'
1290
1290
  mlia faspex5 package receive --id=$$LAST_PACK
1291
- mlia faspex5 package send --value=@json:'{"title":"test title","recipients":["laurent"]}' CLIENT_DEMOFILE_PATH
1291
+ mlia faspex5 package send --value=@json:'{"title":"test title","recipients":["laurent"]}' CF_SAMPLE_FILEPATH
1292
1292
  mlia node async --id=1 bandwidth
1293
1293
  mlia node async --id=1 counters
1294
1294
  mlia node async --id=1 files
@@ -1297,8 +1297,8 @@ mlia node async show --id=1
1297
1297
  mlia node async show --id=ALL
1298
1298
  mlia node basic_token
1299
1299
  mlia node browse / -r
1300
- mlia node delete SERVER_FOLDER_UPLOAD/SAMPLE_FILENAME
1301
- mlia node download --to-folder=LOCAL_FOLDER SERVER_FOLDER_UPLOAD/SAMPLE_FILENAME
1300
+ mlia node delete CF_HSTS_FOLDER_UPLOAD/CF_SAMPLE_FILENAME
1301
+ mlia node download --to-folder=LOCAL_FOLDER CF_HSTS_FOLDER_UPLOAD/CF_SAMPLE_FILENAME
1302
1302
  mlia node info
1303
1303
  mlia node nagios_check
1304
1304
  mlia node search / --value=@json:'{"sort":"mtime"}'
@@ -1306,14 +1306,14 @@ mlia node service --id=service1 delete
1306
1306
  mlia node service create @json:'{"id":"service1","type":"WATCHD","run_as":{"user":"user1"}}'
1307
1307
  mlia node service list
1308
1308
  mlia node transfer list --value=@json:'{"active_only":true}'
1309
- mlia node upload --to-folder=SERVER_FOLDER_UPLOAD --ts=@json:'{"target_rate_cap_kbps":10000}' CLIENT_DEMOFILE_PATH
1309
+ mlia node upload --to-folder=CF_HSTS_FOLDER_UPLOAD --ts=@json:'{"target_rate_cap_kbps":10000}' CF_SAMPLE_FILEPATH
1310
1310
  mlia orchestrator info
1311
1311
  mlia orchestrator plugins
1312
1312
  mlia orchestrator processes
1313
- mlia orchestrator workflow --id=TEST_WORKFLOW_ID inputs
1314
- mlia orchestrator workflow --id=TEST_WORKFLOW_ID start --params=@json:'{"Param":"laurent"}'
1315
- mlia orchestrator workflow --id=TEST_WORKFLOW_ID start --params=@json:'{"Param":"laurent"}' --result=ResultStep:Complete_status_message
1316
- mlia orchestrator workflow --id=TEST_WORKFLOW_ID status
1313
+ mlia orchestrator workflow --id=CF_WORKFLOW_ID inputs
1314
+ mlia orchestrator workflow --id=CF_WORKFLOW_ID start --params=@json:'{"Param":"laurent"}'
1315
+ mlia orchestrator workflow --id=CF_WORKFLOW_ID start --params=@json:'{"Param":"laurent"}' --result=ResultStep:Complete_status_message
1316
+ mlia orchestrator workflow --id=CF_WORKFLOW_ID status
1317
1317
  mlia orchestrator workflow list
1318
1318
  mlia orchestrator workflow status
1319
1319
  mlia preview events --once-only=yes --skip-types=office
@@ -1324,35 +1324,35 @@ mlia preview test ~/'Documents/Samples/mxf_video.mxf' --log-level=debug mp4 --vi
1324
1324
  mlia preview test ~/'Documents/Samples/mxf_video.mxf' --log-level=debug mp4 --video-conversion=reencode
1325
1325
  mlia preview test ~/Documents/Samples/anatomic-2k/TG18-CH/TG18-CH-2k-01.dcm --log-level=debug png
1326
1326
  mlia server browse /
1327
- mlia server browse SERVER_FOLDER_UPLOAD/target_hot
1328
- mlia server cp NEW_SERVER_FOLDER/SAMPLE_FILENAME SERVER_FOLDER_UPLOAD/200KB.2
1327
+ mlia server browse CF_HSTS_FOLDER_UPLOAD/target_hot
1328
+ mlia server cp NEW_SERVER_FOLDER/CF_SAMPLE_FILENAME CF_HSTS_FOLDER_UPLOAD/200KB.2
1329
+ mlia server delete CF_HSTS_FOLDER_UPLOAD/target_hot
1330
+ mlia server delete CF_HSTS_FOLDER_UPLOAD/to.delete
1329
1331
  mlia server delete NEW_SERVER_FOLDER
1330
- mlia server delete SERVER_FOLDER_UPLOAD/target_hot
1331
- mlia server delete SERVER_FOLDER_UPLOAD/to.delete
1332
1332
  mlia server df
1333
- mlia server download NEW_SERVER_FOLDER/SAMPLE_FILENAME --to-folder=LOCAL_FOLDER
1334
- mlia server download NEW_SERVER_FOLDER/SAMPLE_FILENAME --to-folder=SERVER_FOLDER_UPLOAD --transfer=node
1333
+ mlia server download NEW_SERVER_FOLDER/CF_SAMPLE_FILENAME --to-folder=CF_HSTS_FOLDER_UPLOAD --transfer=node
1334
+ mlia server download NEW_SERVER_FOLDER/CF_SAMPLE_FILENAME --to-folder=LOCAL_FOLDER
1335
1335
  mlia server du /
1336
1336
  mlia server info
1337
- mlia server md5sum NEW_SERVER_FOLDER/SAMPLE_FILENAME
1337
+ mlia server md5sum NEW_SERVER_FOLDER/CF_SAMPLE_FILENAME
1338
+ mlia server mkdir CF_HSTS_FOLDER_UPLOAD/target_hot
1338
1339
  mlia server mkdir NEW_SERVER_FOLDER --logger=stdout
1339
- mlia server mkdir SERVER_FOLDER_UPLOAD/target_hot
1340
- mlia server mv SERVER_FOLDER_UPLOAD/200KB.2 SERVER_FOLDER_UPLOAD/to.delete
1341
- mlia server upload --sources=@ts --ts=@json:'{"paths":[{"source":"CLIENT_DEMOFILE_PATH","destination":"NEW_SERVER_FOLDER/othername"}]}'
1342
- mlia server upload --src-type=pair --sources=@json:'["CLIENT_DEMOFILE_PATH","NEW_SERVER_FOLDER/othername"]'
1343
- mlia server upload --src-type=pair CLIENT_DEMOFILE_PATH NEW_SERVER_FOLDER/othername
1344
- 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
1345
- mlia server upload CLIENT_DEMOFILE_PATH --to-folder=NEW_SERVER_FOLDER
1340
+ mlia server mv CF_HSTS_FOLDER_UPLOAD/200KB.2 CF_HSTS_FOLDER_UPLOAD/to.delete
1341
+ mlia server upload --sources=@ts --ts=@json:'{"paths":[{"source":"CF_SAMPLE_FILEPATH","destination":"NEW_SERVER_FOLDER/othername"}]}'
1342
+ mlia server upload --src-type=pair --sources=@json:'["CF_SAMPLE_FILEPATH","NEW_SERVER_FOLDER/othername"]'
1343
+ mlia server upload --src-type=pair CF_SAMPLE_FILEPATH NEW_SERVER_FOLDER/othername
1344
+ mlia server upload --to-folder=CF_HSTS_FOLDER_UPLOAD/target_hot --lock-port=12345 --ts=@json:'{"EX_ascp_args":["--remove-after-transfer","--remove-empty-directories","--exclude-newer-than=-8","--src-base","source_hot"]}' source_hot
1345
+ mlia server upload CF_SAMPLE_FILEPATH --to-folder=NEW_SERVER_FOLDER
1346
1346
  mlia shares repository browse /
1347
- mlia shares repository delete /SHARES_UPLOAD/SAMPLE_FILENAME
1348
- mlia shares repository download --to-folder=LOCAL_FOLDER /SHARES_UPLOAD/SAMPLE_FILENAME
1349
- mlia shares repository upload --to-folder=/SHARES_UPLOAD CLIENT_DEMOFILE_PATH
1347
+ mlia shares repository delete /CF_SHARES_UPLOAD/CF_SAMPLE_FILENAME
1348
+ mlia shares repository download --to-folder=LOCAL_FOLDER /CF_SHARES_UPLOAD/CF_SAMPLE_FILENAME
1349
+ mlia shares repository upload --to-folder=/CF_SHARES_UPLOAD CF_SAMPLE_FILEPATH
1350
1350
  mlia shares2 appinfo
1351
1351
  mlia shares2 organization list
1352
1352
  mlia shares2 project list --organization=Sport
1353
1353
  mlia shares2 repository browse /
1354
1354
  mlia shares2 userinfo
1355
- mlia sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"remote_dir":"/sync_test","local_dir":"contents","host":"HSTS_ADDR","user":"user1","private_key_path":"/Users/laurent/.ssh/id_rsa"}]}'
1355
+ mlia sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"remote_dir":"/sync_test","local_dir":"contents","host":"CF_HSTS1_ADDR","user":"user1","private_key_path":"/Users/laurent/.ssh/id_rsa"}]}'
1356
1356
 
1357
1357
  ...and more
1358
1358
  ```
@@ -1362,7 +1362,7 @@ mlia sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"re
1362
1362
  ```bash
1363
1363
  $ mlia -h
1364
1364
  NAME
1365
- mlia -- a command line tool for Aspera Applications (v0.10.14)
1365
+ mlia -- a command line tool for Aspera Applications (v0.10.15)
1366
1366
 
1367
1367
  SYNOPSIS
1368
1368
  mlia COMMANDS [OPTIONS] [ARGS]
@@ -1401,7 +1401,7 @@ OPTIONS: global
1401
1401
  -v, --version display version
1402
1402
  -w, --warnings check for language warnings
1403
1403
  --ui=ENUM method to start browser: text, graphical
1404
- --log-level=ENUM Log level: info, error, debug, fatal, unknown, warn
1404
+ --log-level=ENUM Log level: warn, debug, info, error, fatal, unknown
1405
1405
  --logger=ENUM log method: stderr, stdout, syslog
1406
1406
  --lock-port=VALUE prevent dual execution of a command, e.g. in cron
1407
1407
  --query=VALUE additional filter for API calls (extended value) (some commands)
@@ -1506,6 +1506,7 @@ OPTIONS:
1506
1506
  --new-user-option=VALUE new user creation option
1507
1507
  --from-folder=VALUE share to share source folder
1508
1508
  --scope=VALUE scope for AoC API calls
1509
+ --notify=VALUE notify users that file was received
1509
1510
  --bulk=ENUM bulk operation: yes, no
1510
1511
 
1511
1512
 
@@ -2255,6 +2256,28 @@ $ cat my_file_list.txt|while read path;do echo mlia aspera admin res node --name
2255
2256
  cat my_file_list.txt | mlia aspera admin res node --name='my node name' --secret='my secret' v3 delete @lines:@stdin:
2256
2257
  ```
2257
2258
 
2259
+ ### Activity
2260
+
2261
+ The activity app can be queried with:
2262
+
2263
+ ```
2264
+ $ mlia aspera admin analytics transfers
2265
+ ```
2266
+
2267
+ It can also support filters and send notification email with a template:
2268
+
2269
+ ```
2270
+ $ mlia aspera admin analytics transfers --once-only=yes --lock-port=123455 \
2271
+ --query=@json:'{"status":"completed","direction":"receive"}' \
2272
+ --notify=@json:'{"to":"<''%=transfer[:user_email.to_s]%>","subject":"<''%=transfer[:files_completed.to_s]%> files received","body":"Dear <''%=transfer[:user_email.to_s]%>\nWe received <''%=transfer[:files_completed.to_s]%> files for a total of <''%=transfer[:transferred_bytes.to_s]%> bytes, starting with file:\n<''%=transfer[:content.to_s]%>\n\nThank you."}'
2273
+ ```
2274
+
2275
+ * `once_only` keep track of last date it was called, so next call will get only new events
2276
+ * `query` filter (on API call)
2277
+ * `notify` send an email as specified by template, this could be places in a file with the `@file` modifier.
2278
+
2279
+ Note this must not be executed in less than 5 minutes because the analytics interface accepts only a period of time between 5 minutes and 6 months. here the period is [date of previous execution]..[now].
2280
+
2258
2281
  ## IBM Aspera High Speed Transfer Server (transfer)
2259
2282
 
2260
2283
  This plugin works at FASP level (SSH/ascp/ascmd) and does not use the node API.
@@ -3051,6 +3074,12 @@ So, it evolved into `mlia`:
3051
3074
 
3052
3075
 
3053
3076
  # Release Notes
3077
+
3078
+ * 0.10.15
3079
+
3080
+ * in case of command line error, display the error cause first, and non-parsed argument second
3081
+ * AoC : Activity / Analytics
3082
+
3054
3083
  * 0.10.14
3055
3084
 
3056
3085
  * added missing bss plugin
@@ -1 +1 @@
1
- 0.10.14
1
+ 0.10.15
@@ -279,13 +279,17 @@ module Asperalm
279
279
  end
280
280
  # cleanup file list files
281
281
  TempFileManager.instance.cleanup
282
+ # 1- processing of error condition
283
+ unless exception_info.nil?
284
+ @plugin_env[:formater].display_message(:error,"ERROR:".bg_red.gray.blink+" "+exception_info[1]+": "+exception_info[0].message)
285
+ @plugin_env[:formater].display_message(:error,"Use '-h' option to get help.") if exception_info[2].eql?(:usage)
286
+ end
287
+ # 2- processing of command not processed (due to exception or bad command line)
282
288
  @opt_mgr.final_errors.each do |msg|
283
289
  @plugin_env[:formater].display_message(:error,"ERROR:".bg_red.gray.blink+" Argument: "+msg)
284
290
  end
285
- # processing of error condition
291
+ # 3- in case of error, fail the process status
286
292
  unless exception_info.nil?
287
- @plugin_env[:formater].display_message(:error,"ERROR:".bg_red.gray.blink+" "+exception_info[1]+": "+exception_info[0].message)
288
- @plugin_env[:formater].display_message(:error,"Use '-h' option to get help.") if exception_info[2].eql?(:usage)
289
293
  if Log.instance.level.eql?(:debug)
290
294
  # will force to show stack trace
291
295
  raise exception_info[0]
@@ -39,6 +39,7 @@ module Asperalm
39
39
  self.options.add_opt_simple(:new_user_option,"new user creation option")
40
40
  self.options.add_opt_simple(:from_folder,"share to share source folder")
41
41
  self.options.add_opt_simple(:scope,"scope for AoC API calls")
42
+ self.options.add_opt_simple(:notify,"notify users that file was received")
42
43
  self.options.add_opt_boolean(:bulk,"bulk operation")
43
44
  self.options.set_option(:bulk,:no)
44
45
  self.options.set_option(:new_user_option,{'package_contact'=>true})
@@ -398,7 +399,7 @@ module Asperalm
398
399
  def execute_admin_action
399
400
  self.options.set_option(:scope,OnCloud::SCOPE_FILES_ADMIN)
400
401
  update_aoc_api
401
- command_admin=self.options.get_next_command([ :ats, :resource, :usage_reports, :events, :subscription, :auth_providers ])
402
+ command_admin=self.options.get_next_command([ :ats, :resource, :usage_reports, :analytics, :subscription, :auth_providers ])
402
403
  case command_admin
403
404
  when :auth_providers
404
405
  command_auth_prov=self.options.get_next_command([ :list, :update ])
@@ -480,20 +481,60 @@ module Asperalm
480
481
  # item
481
482
  # end
482
483
  # return {:type=>:object_list,:data=>nodes,:fields=>['host_name','node_status.cluster_id','node_status.node_id']}
483
- when :events
484
- # begin: old
485
- #events=@api_aoc.read("admin/events",url_query({q: '*'}))[:data]
486
- #events.map!{|i|i['_source']['_score']=i['_score'];i['_source']}
487
- #return {:type=>:object_list,:data=>events,:fields=>['user.name','type','data.files_transfer_action','data.workspace_name','date']}
488
- # end: old
489
- events_api = Rest.new(@api_aoc.params.deep_merge({
490
- :base_url => @api_aoc.params[:base_url].gsub('/api/v1','')+'/analytics/v2/organizations/'+user_info['organization_id'],
484
+ when :analytics
485
+ analytics_api = Rest.new(@api_aoc.params.deep_merge({
486
+ :base_url => @api_aoc.params[:base_url].gsub('/api/v1','')+'/analytics/v2',
491
487
  :auth => {:scope => OnCloud::SCOPE_FILES_ADMIN_USER}
492
488
  }))
493
- events=events_api.read("application_events")[:data]['application_events']
494
- return {:type=>:object_list,:data=>events}
489
+ command_analytics=self.options.get_next_command([ :application_events, :transfers ])
490
+ case command_analytics
491
+ when :application_events
492
+ event_type=command_analytics.to_s
493
+ events=analytics_api.read("organizations/#{user_info['organization_id']}/#{event_type}")[:data][event_type]
494
+ return {:type=>:object_list,:data=>events}
495
+ when :transfers
496
+ event_type=command_analytics.to_s
497
+ filter_resource=self.options.get_option(:name,:optional) || 'organizations'
498
+ filter_id=self.options.get_option(:id,:optional) || case filter_resource
499
+ when 'organizations'; user_info['organization_id']
500
+ when 'users'; user_info['id']
501
+ when 'nodes'; user_info['id']
502
+ else raise "organizations or users for option --name"
503
+ end
504
+ #
505
+ filter=self.options.get_option(:query,:optional) || {}
506
+ filter['limit']||=100
507
+ if self.options.get_option(:once_only,:mandatory)
508
+ saved_date=[]
509
+ startdate_persistency=PersistencyFile.new(
510
+ data: saved_date,
511
+ ids: ['aoc_ana_date',self.options.get_option(:url,:mandatory),@workspace_name].push(filter_resource,filter_id))
512
+ start_datetime=saved_date.first
513
+ stop_datetime=Time.now.utc.strftime('%FT%T.%LZ')
514
+ #Log.log().error("start: #{start_datetime}")
515
+ #Log.log().error("end: #{stop_datetime}")
516
+ saved_date[0]=stop_datetime
517
+ filter['start_time'] = start_datetime unless start_datetime.nil?
518
+ filter['stop_time'] = stop_datetime
519
+ end
520
+ notification=self.options.get_option(:notify,:optional)
521
+ events=analytics_api.read("#{filter_resource}/#{filter_id}/#{event_type}",url_query(filter))[:data][event_type]
522
+ startdate_persistency.save unless startdate_persistency.nil?
523
+ if !notification.nil?
524
+ require 'erb'
525
+ events.each do |transfer|
526
+ email_to_send={}
527
+ notification.each do |k,v|
528
+ email_to_send[k.to_sym]=ERB.new(v).result(binding)
529
+ end
530
+ Log.log().error("send email: #{email_to_send}")
531
+ self.config.send_email(email_to_send)
532
+ end
533
+ end
534
+ return {:type=>:object_list,:data=>events}
535
+ end
495
536
  when :resource
496
- resource_type=self.options.get_next_argument('resource',[:self,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership,'admin/apps_new'.to_sym,'admin/client_registration_token'.to_sym])
537
+ resource_type=self.options.get_next_argument('resource',[:self,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership,'admin/apps_new'.to_sym,'admin/client_registration_token'.to_sym,'integrations/kms_profile'.to_sym])
497
538
  resource_class_path=resource_type.to_s+case resource_type;when :dropbox;'es';when :self,'admin/apps_new'.to_sym;'';else; 's';end
498
539
  singleton_object=[:self].include?(resource_type)
499
540
  global_operations=[:create,:list]
@@ -310,13 +310,11 @@ module Asperalm
310
310
  my_info=api_v3.call({:operation=>'GET',:subpath=>'me',:headers=>{'Accept'=>'application/json'}})[:data]
311
311
  return {:data=>my_info, :type=>:single_object}
312
312
  when :dropbox
313
- command_pkg=self.options.get_next_command([ :list, :create ])
313
+ command_pkg=self.options.get_next_command([ :list ])
314
314
  case command_pkg
315
315
  when :list
316
316
  dropbox_list=api_v3.call({:operation=>'GET',:subpath=>'dropboxes',:headers=>{'Accept'=>'application/json'}})[:data]
317
317
  return {:type=>:object_list, :data=>dropbox_list['items'], :fields=>['name','id','description','can_read','can_write']}
318
- # when :create
319
- #
320
318
  end
321
319
  when :v4
322
320
  command=self.options.get_next_command([:dropbox, :dmembership, :workgroup,:wmembership,:user,:metadata_profile])
@@ -63,7 +63,7 @@ module Asperalm
63
63
  if pack_id.eql?(VAL_ALL)
64
64
  # todo: if packages have same name, they will overwrite
65
65
  parameters=self.options.get_option(:value,:optional)
66
- parameters||={"type":"received","subtype":"mypackages","limit":1000}
66
+ parameters||={"type"=>"received","subtype"=>"mypackages","limit"=>1000}
67
67
  raise CliBadArgument,'value filter must be hash (API GET)' unless parameters.is_a?(Hash)
68
68
  package_ids=api_v5.read('packages',parameters)[:data]['packages'].map{|p|p['id']}
69
69
  package_ids.select!{|i|!skip_ids_data.include?(i)}
@@ -52,8 +52,14 @@ module Asperalm
52
52
  # reduce the path from a result on given named column
53
53
  def c_result_remove_prefix_path(result,column,path_prefix)
54
54
  if !path_prefix.nil?
55
- result[:data].each do |r|
56
- r[column].replace(r[column][path_prefix.length..-1]) if r[column].start_with?(path_prefix)
55
+ case result[:type]
56
+ when :object_list
57
+ result[:data].each do |item|
58
+ item[column].replace(item[column][path_prefix.length..-1]) if item[column].start_with?(path_prefix)
59
+ end
60
+ when :single_object
61
+ item=result[:data]
62
+ item[column].replace(item[column][path_prefix.length..-1]) if item[column].start_with?(path_prefix)
57
63
  end
58
64
  end
59
65
  return result
@@ -171,11 +177,18 @@ module Asperalm
171
177
  query={ :path => thepath}
172
178
  additional_query=self.options.get_option(:query,:optional)
173
179
  query.merge!(additional_query) unless additional_query.nil?
174
- send_result=@api_node.create('files/browse', query)
175
- #send_result={:data=>{'items'=>[{'file'=>"filename1","permissions"=>[{'name'=>'read'},{'name'=>'write'}]}]}}
176
- return Main.result_empty if !send_result[:data].has_key?('items')
177
- result={ :data => send_result[:data]['items'] , :type => :object_list, :textify => lambda { |table_data| c_textify_browse(table_data) } }
178
- self.format.display_status("Items: #{send_result[:data]['item_count']}/#{send_result[:data]['total_count']}")
180
+ send_result=@api_node.create('files/browse', query)[:data]
181
+ #example: send_result={'items'=>[{'file'=>"filename1","permissions"=>[{'name'=>'read'},{'name'=>'write'}]}]}
182
+ # if there is no items
183
+ case send_result['self']['type']
184
+ when 'directory'
185
+ result={ :data => send_result['items'] , :type => :object_list, :textify => lambda { |table_data| c_textify_browse(table_data) } }
186
+ self.format.display_status("Items: #{send_result['item_count']}/#{send_result['total_count']}")
187
+ else # 'file','symbolic_link'
188
+ result={ :data => send_result['self'] , :type => :single_object}
189
+ #result={ :data => [send_result['self']] , :type => :object_list, :textify => lambda { |table_data| c_textify_browse(table_data) } }
190
+ #raise "unknown type: #{send_result['self']['type']}"
191
+ end
179
192
  return c_result_remove_prefix_path(result,'path',prefix_path)
180
193
  when :upload
181
194
  # we send only a list of one transfer request
@@ -3,6 +3,7 @@ require 'asperalm/fasp/manager'
3
3
  require 'asperalm/log'
4
4
  require 'asperalm/rest'
5
5
 
6
+ # ref: https://api.ibm.com/explorer/catalog/aspera/product/ibm-aspera/api/http-gateway-api/doc/guides-toc
6
7
  module Asperalm
7
8
  module Fasp
8
9
  # executes a local "ascp", connects mgt port, equivalent of "Fasp Manager"
@@ -13,19 +14,37 @@ module Asperalm
13
14
  def start_transfer(transfer_spec,options={})
14
15
  raise "GW URL must be set" unless !@gw_api.nil?
15
16
  raise "option: must be hash (or nil)" unless options.is_a?(Hash)
16
- raise "only one source allowed in http mode" unless transfer_spec['paths'].is_a?(Array) and transfer_spec['paths'].length.eql?(1)
17
+ raise "paths: must be Array" unless transfer_spec['paths'].is_a?(Array)
17
18
  case transfer_spec['direction']
18
19
  when 'send'
19
- raise "error"
20
+ # this is a websocket
21
+ raise "error, not implemented"
20
22
  when 'receive'
21
- transfer_spec['zip_required']=false
22
- transfer_spec['authentication']='token'
23
- transfer_spec['download_name']='my_download' # TODO
24
- transfer_spec['source_root']=transfer_spec['paths'].first['source']
25
- transfer_spec['paths'].first['source']='200KB.1' #TODO: how to get list of files ?
26
- creation=@gw_api.create('download',{'transfer_spec'=>transfer_spec})
27
- transfer_uuid=creation[:data]['url'].split('/').last
28
- file_dest=File.join(transfer_spec['destination_root'],'toto.bin')
23
+ transfer_spec['zip_required']||=false
24
+ transfer_spec['authentication']||='token'
25
+ transfer_spec['source_root']||='/'
26
+ # is normally provided by application, like package name
27
+ if !transfer_spec.has_key?('download_name')
28
+ # by default it is the name of first file
29
+ dname=File.basename(transfer_spec['paths'].first['source'])
30
+ # we remove extension
31
+ dname=dname.gsub(/\.@gw_api.*$/,'')
32
+ # ands add indication of number of files if there is more than one
33
+ if transfer_spec['paths'].length > 1
34
+ dname=dname+" #{transfer_spec['paths'].length} Files"
35
+ end
36
+ transfer_spec['download_name']=dname
37
+ end
38
+ creation=@gw_api.create('download',{'transfer_spec'=>transfer_spec})[:data]
39
+ transfer_uuid=creation['url'].split('/').last
40
+ if transfer_spec['zip_required'] or transfer_spec['paths'].length > 1
41
+ # it is a zip file if zip is required or there is more than 1 file
42
+ file_dest=transfer_spec['download_name']+'.zip'
43
+ else
44
+ # it is a plain file if we don't require zip and there is only one file
45
+ file_dest=File.basename(transfer_spec['paths'].first['source'])
46
+ end
47
+ file_dest=File.join(transfer_spec['destination_root'],file_dest)
29
48
  @gw_api.call({:operation=>'GET',:subpath=>"download/#{transfer_uuid}",:save_to_file=>file_dest})
30
49
  else
31
50
  raise "error"
@@ -51,7 +70,7 @@ module Asperalm
51
70
  raise "params must be Hash" unless params.is_a?(Hash)
52
71
  params=params.symbolize_keys
53
72
  raise "must have only one param: url" unless params.keys.eql?([:url])
54
- super
73
+ super()
55
74
  @gw_api=Rest.new({:base_url => params[:url]})
56
75
  api_info = @gw_api.read('info')[:data]
57
76
  Log.log.info("#{api_info}")
@@ -31,14 +31,16 @@ module Asperalm
31
31
  'EX_license_text' => { :type => :envvar, :variable=>'ASPERA_SCP_LICENSE'},
32
32
  # bool params
33
33
  'create_dir' => { :type => :opt_without_arg, :option_switch=>'-d'},
34
- 'precalculate_job_size' => { :type => :opt_without_arg, :option_switch=>'--precalculate-job-size'},
35
- 'keepalive' => { :type => :opt_without_arg, :option_switch=>'--keepalive'},
36
- 'delete_before_transfer' => { :type => :opt_without_arg, :option_switch=>'--delete-before-transfer'}, #TODO: doc
34
+ 'precalculate_job_size' => { :type => :opt_without_arg},
35
+ 'keepalive' => { :type => :opt_without_arg},
36
+ 'delete_before_transfer' => { :type => :opt_without_arg}, #TODO: doc readme
37
37
  'preserve_access_time' => { :type => :opt_without_arg}, #TODO: doc
38
38
  'preserve_creation_time' => { :type => :opt_without_arg}, #TODO: doc
39
39
  'preserve_times' => { :type => :opt_without_arg}, #TODO: doc
40
40
  'preserve_modification_time'=> { :type => :opt_without_arg}, #TODO: doc
41
41
  'remove_empty_directories'=> { :type => :opt_without_arg}, #TODO: doc
42
+ 'remove_after_transfer' => { :type => :opt_without_arg}, #TODO: doc
43
+ 'remove_empty_source_directory'=> { :type => :opt_without_arg}, #TODO: doc
42
44
 
43
45
  # value params
44
46
  'cipher' => { :type => :opt_with_arg, :option_switch=>'-c',:accepted_types=>String,:translate_values=>{'aes128'=>'aes128','aes-128'=>'aes128','aes192'=>'aes192','aes-192'=>'aes192','aes256'=>'aes256','aes-256'=>'aes256','none'=>'none'}},
@@ -61,6 +63,7 @@ module Asperalm
61
63
  'exclude_newer_than' => { :type => :opt_with_arg, :accepted_types=>Integer}, #todo: doc
62
64
  'exclude_older_than' => { :type => :opt_with_arg, :accepted_types=>Integer}, #todo: doc
63
65
  'preserve_acls' => { :type => :opt_with_arg, :accepted_types=>String}, #todo: doc
66
+ 'move_after_transfer' => { :type => :opt_with_arg, :accepted_types=>String}, #todo: doc
64
67
  # non standard parameters
65
68
  'EX_fasp_proxy_url' => { :type => :opt_with_arg, :option_switch=>'--proxy',:accepted_types=>String},
66
69
  'EX_http_proxy_url' => { :type => :opt_with_arg, :option_switch=>'-x',:accepted_types=>String},
@@ -37,6 +37,9 @@ module Asperalm
37
37
  Log.log.debug("insecure=#{@@insecure}")
38
38
  @http_session.verify_mode = OpenSSL::SSL::VERIFY_NONE if @@insecure
39
39
  @http_session.set_debug_output($stdout) if @@debug
40
+ if @params.has_key?(:session_cb)
41
+ @params[:session_cb].call(@http_session)
42
+ end
40
43
  # manually start session for keep alive (if supported by server, else, session is closed every time)
41
44
  @http_session.start
42
45
  end
@@ -67,6 +70,7 @@ module Asperalm
67
70
  # :username [:basic]
68
71
  # :password [:basic]
69
72
  # :url_creds [:url]
73
+ # :session_cb a lambda which takes @http_session as arg, use this to change parameters
70
74
  # :* [:oauth2] see Oauth class
71
75
  def initialize(a_rest_params)
72
76
  raise "ERROR: expecting Hash" unless a_rest_params.is_a?(Hash)
@@ -214,6 +218,7 @@ module Asperalm
214
218
  if !response['Content-Disposition'].nil? and m=response['Content-Disposition'].match(/filename="([^"]+)"/)
215
219
  target_file=m[1]
216
220
  end
221
+ Log.log.debug("saving to: #{target_file}")
217
222
  File.open(target_file, "wb") do |file|
218
223
  result[:http].read_body do |fragment|
219
224
  file.write(fragment)
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.10.14
4
+ version: 0.10.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Martin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -260,7 +260,7 @@ licenses:
260
260
  - Apache-2.0
261
261
  metadata:
262
262
  allowed_push_host: https://rubygems.org
263
- post_install_message:
263
+ post_install_message:
264
264
  rdoc_options: []
265
265
  require_paths:
266
266
  - lib
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  requirements:
278
278
  - IBM Aspera ascp installed for the user
279
279
  rubygems_version: 3.1.2
280
- signing_key:
280
+ signing_key:
281
281
  specification_version: 4
282
282
  summary: 'gem and command line tool for Aspera Server products: Aspera on Cloud, Faspex,
283
283
  Shares, Node, Console, Orchestrator, Transfer Server'