aspera-cli 4.13.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +81 -7
- data/CONTRIBUTING.md +22 -6
- data/README.md +2038 -1080
- data/bin/ascli +18 -9
- data/bin/asession +12 -14
- data/examples/dascli +1 -1
- data/examples/proxy.pac +1 -1
- data/examples/rubyc +24 -0
- data/lib/aspera/aoc.rb +219 -159
- data/lib/aspera/ascmd.rb +25 -14
- data/lib/aspera/cli/basic_auth_plugin.rb +12 -9
- data/lib/aspera/cli/error.rb +17 -0
- data/lib/aspera/cli/extended_value.rb +47 -12
- data/lib/aspera/cli/formatter.rb +260 -179
- data/lib/aspera/cli/hints.rb +80 -0
- data/lib/aspera/cli/main.rb +104 -156
- data/lib/aspera/cli/manager.rb +259 -209
- data/lib/aspera/cli/plugin.rb +123 -63
- data/lib/aspera/cli/plugins/alee.rb +2 -3
- data/lib/aspera/cli/plugins/aoc.rb +341 -261
- data/lib/aspera/cli/plugins/ats.rb +22 -21
- data/lib/aspera/cli/plugins/bss.rb +5 -5
- data/lib/aspera/cli/plugins/config.rb +578 -627
- data/lib/aspera/cli/plugins/console.rb +44 -6
- data/lib/aspera/cli/plugins/cos.rb +15 -17
- data/lib/aspera/cli/plugins/faspex.rb +114 -100
- data/lib/aspera/cli/plugins/faspex5.rb +411 -264
- data/lib/aspera/cli/plugins/node.rb +354 -259
- data/lib/aspera/cli/plugins/orchestrator.rb +61 -29
- data/lib/aspera/cli/plugins/preview.rb +82 -90
- data/lib/aspera/cli/plugins/server.rb +79 -32
- data/lib/aspera/cli/plugins/shares.rb +55 -42
- data/lib/aspera/cli/sync_actions.rb +68 -0
- data/lib/aspera/cli/transfer_agent.rb +66 -73
- data/lib/aspera/cli/transfer_progress.rb +74 -0
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/colors.rb +12 -8
- data/lib/aspera/command_line_builder.rb +14 -11
- data/lib/aspera/cos_node.rb +3 -2
- data/lib/aspera/data/6 +0 -0
- data/lib/aspera/environment.rb +24 -9
- data/lib/aspera/fasp/agent_aspera.rb +126 -0
- data/lib/aspera/fasp/agent_base.rb +31 -77
- data/lib/aspera/fasp/agent_connect.rb +25 -21
- data/lib/aspera/fasp/agent_direct.rb +89 -103
- data/lib/aspera/fasp/agent_httpgw.rb +231 -149
- data/lib/aspera/fasp/agent_node.rb +41 -34
- data/lib/aspera/fasp/agent_trsdk.rb +75 -32
- data/lib/aspera/fasp/error_info.rb +4 -2
- data/lib/aspera/fasp/faux_file.rb +52 -0
- data/lib/aspera/fasp/installation.rb +53 -195
- data/lib/aspera/fasp/management.rb +244 -0
- data/lib/aspera/fasp/parameters.rb +71 -37
- data/lib/aspera/fasp/parameters.yaml +76 -8
- data/lib/aspera/fasp/products.rb +162 -0
- data/lib/aspera/fasp/resume_policy.rb +3 -3
- data/lib/aspera/fasp/transfer_spec.rb +7 -6
- data/lib/aspera/fasp/uri.rb +26 -24
- data/lib/aspera/faspex_gw.rb +2 -2
- data/lib/aspera/faspex_postproc.rb +2 -2
- data/lib/aspera/hash_ext.rb +14 -4
- data/lib/aspera/json_rpc.rb +49 -0
- data/lib/aspera/keychain/macos_security.rb +13 -13
- data/lib/aspera/line_logger.rb +23 -0
- data/lib/aspera/log.rb +58 -16
- data/lib/aspera/node.rb +157 -92
- data/lib/aspera/oauth.rb +37 -19
- data/lib/aspera/open_application.rb +4 -4
- data/lib/aspera/persistency_action_once.rb +1 -1
- data/lib/aspera/persistency_folder.rb +2 -2
- data/lib/aspera/preview/file_types.rb +4 -2
- data/lib/aspera/preview/generator.rb +22 -35
- data/lib/aspera/preview/options.rb +2 -0
- data/lib/aspera/preview/terminal.rb +73 -16
- data/lib/aspera/preview/utils.rb +21 -28
- data/lib/aspera/proxy_auto_config.js +2 -2
- data/lib/aspera/rest.rb +136 -68
- data/lib/aspera/rest_call_error.rb +1 -1
- data/lib/aspera/rest_error_analyzer.rb +15 -14
- data/lib/aspera/rest_errors_aspera.rb +37 -34
- data/lib/aspera/secret_hider.rb +18 -15
- data/lib/aspera/ssh.rb +5 -2
- data/lib/aspera/sync.rb +127 -119
- data/lib/aspera/temp_file_manager.rb +10 -3
- data/lib/aspera/web_auth.rb +10 -7
- data/lib/aspera/web_server_simple.rb +9 -4
- data.tar.gz.sig +0 -0
- metadata +34 -17
- metadata.gz.sig +0 -0
- data/docs/test_env.conf +0 -186
- data/lib/aspera/cli/listener/line_dump.rb +0 -19
- data/lib/aspera/cli/listener/logger.rb +0 -22
- data/lib/aspera/cli/listener/progress.rb +0 -50
- data/lib/aspera/cli/listener/progress_multi.rb +0 -84
- data/lib/aspera/cli/plugins/sync.rb +0 -44
- data/lib/aspera/data/7 +0 -0
- data/lib/aspera/fasp/listener.rb +0 -13
data/docs/test_env.conf
DELETED
@@ -1,186 +0,0 @@
|
|
1
|
-
---
|
2
|
-
config:
|
3
|
-
version: 4.0.0
|
4
|
-
default:
|
5
|
-
config: cli_default
|
6
|
-
aoc: tst_aoc_jwt
|
7
|
-
faspex: tst_faspex4
|
8
|
-
faspex5: tst_faspex5_jwt
|
9
|
-
shares: tst_shares
|
10
|
-
node: tst_node_simple
|
11
|
-
server: tst_server
|
12
|
-
orchestrator: tst_orch
|
13
|
-
console: tst_console
|
14
|
-
preview: tst_ak_preview
|
15
|
-
ats: tst_ats
|
16
|
-
bss: tst_bss
|
17
|
-
cos: tst_cos
|
18
|
-
cli_default:
|
19
|
-
interactive: your value here
|
20
|
-
smtp: your value here
|
21
|
-
local_user:
|
22
|
-
ssh_keys: your value here
|
23
|
-
smtp_config:
|
24
|
-
server: your value here
|
25
|
-
port: your value here
|
26
|
-
domain: your value here
|
27
|
-
tls: your value here
|
28
|
-
from_email: your value here
|
29
|
-
from_name: your value here
|
30
|
-
username: your value here
|
31
|
-
password: your value here
|
32
|
-
tst_aoc_jwt:
|
33
|
-
url: your value here
|
34
|
-
username: your value here
|
35
|
-
auth: your value here
|
36
|
-
private_key: your value here
|
37
|
-
tst_aoc_web:
|
38
|
-
url: your value here
|
39
|
-
auth: your value here
|
40
|
-
redirect_uri: your value here
|
41
|
-
client_id: your value here
|
42
|
-
client_secret: your value here
|
43
|
-
tst_faspex4:
|
44
|
-
url: your value here
|
45
|
-
username: your value here
|
46
|
-
password: your value here
|
47
|
-
tst_faspex4_admin:
|
48
|
-
username: your value here
|
49
|
-
password: your value here
|
50
|
-
faspex4_publink:
|
51
|
-
link_recv_from_user: your value here
|
52
|
-
link_send_to_user: your value here
|
53
|
-
link_send_to_dropbox: your value here
|
54
|
-
tst_faspex4_storage:
|
55
|
-
storage: your value here
|
56
|
-
tst_hstsfaspex_ssh:
|
57
|
-
url: your value here
|
58
|
-
username: your value here
|
59
|
-
tst_faspex5_boot:
|
60
|
-
url: your value here
|
61
|
-
auth: your value here
|
62
|
-
username: your value here
|
63
|
-
password: your value here
|
64
|
-
tst_faspex5_web:
|
65
|
-
url: your value here
|
66
|
-
auth: your value here
|
67
|
-
redirect_uri: your value here
|
68
|
-
client_id: your value here
|
69
|
-
tst_faspex5_jwt:
|
70
|
-
url: your value here
|
71
|
-
auth: your value here
|
72
|
-
client_id: your value here
|
73
|
-
client_secret: your value here
|
74
|
-
private_key: your value here
|
75
|
-
username: your value here
|
76
|
-
f5_admin:
|
77
|
-
username: your value here
|
78
|
-
tst_shares:
|
79
|
-
url: your value here
|
80
|
-
username: your value here
|
81
|
-
password: your value here
|
82
|
-
tst_shares_1:
|
83
|
-
url: your value here
|
84
|
-
username: your value here
|
85
|
-
password: your value here
|
86
|
-
tst_node_simple:
|
87
|
-
url: your value here
|
88
|
-
username: your value here
|
89
|
-
password: your value here
|
90
|
-
tst_node_ak:
|
91
|
-
url: your value here
|
92
|
-
username: your value here
|
93
|
-
password: your value here
|
94
|
-
tst_node_faspex:
|
95
|
-
url: your value here
|
96
|
-
username: your value here
|
97
|
-
password: your value here
|
98
|
-
tst_node_admak:
|
99
|
-
url: your value here
|
100
|
-
username: your value here
|
101
|
-
password: your value here
|
102
|
-
tst_node_preview:
|
103
|
-
url: your value here
|
104
|
-
username: your value here
|
105
|
-
password: your value here
|
106
|
-
tst_console:
|
107
|
-
url: your value here
|
108
|
-
username: your value here
|
109
|
-
password: your value here
|
110
|
-
tst_server:
|
111
|
-
url: your value here
|
112
|
-
username: your value here
|
113
|
-
password: your value here
|
114
|
-
tst_server_bykey:
|
115
|
-
url: your value here
|
116
|
-
username: your value here
|
117
|
-
tst_orch:
|
118
|
-
url: your value here
|
119
|
-
username: your value here
|
120
|
-
password: your value here
|
121
|
-
tst_ats:
|
122
|
-
ibm_api_key: your value here
|
123
|
-
ats_key: your value here
|
124
|
-
ats_secret: your value here
|
125
|
-
instance: your value here
|
126
|
-
tst_bss:
|
127
|
-
password: your value here
|
128
|
-
tst_ak_preview:
|
129
|
-
url: your value here
|
130
|
-
username: your value here
|
131
|
-
password: your value here
|
132
|
-
mimemagic: your value here
|
133
|
-
tst_cos:
|
134
|
-
apikey: your value here
|
135
|
-
crn: your value here
|
136
|
-
bucket: your value here
|
137
|
-
endpoint: your value here
|
138
|
-
sync:
|
139
|
-
local_path: your value here
|
140
|
-
remote_path: your value here
|
141
|
-
nowss:
|
142
|
-
ts: your value here
|
143
|
-
misc:
|
144
|
-
upload_folder: your value here
|
145
|
-
syncuser: your value here
|
146
|
-
faspex_dbx: your value here
|
147
|
-
faspex_wkg: your value here
|
148
|
-
faspex_src: your value here
|
149
|
-
faspex5_shinbox: your value here
|
150
|
-
faspex5_meta: your value here
|
151
|
-
shares_upload: your value here
|
152
|
-
console_smart_id: your value here
|
153
|
-
console_smart_file: your value here
|
154
|
-
orch_workflow_id: your value here
|
155
|
-
file_dcm: your value here
|
156
|
-
file_pdf: your value here
|
157
|
-
file_docx: your value here
|
158
|
-
file_mxf: your value here
|
159
|
-
aws_bucket_key: your value here
|
160
|
-
aws_bucket_secret: your value here
|
161
|
-
aws_bucket_name: your value here
|
162
|
-
aws_bucket_region: your value here
|
163
|
-
aoc_publink_recv_from_aocuser: your value here
|
164
|
-
aoc_publink_send_shd_inbox: your value here
|
165
|
-
aoc_publink_send_aoc_user: your value here
|
166
|
-
aoc_publink_send_use_pass: your value here
|
167
|
-
aoc_publink_folder: your value here
|
168
|
-
aoc_shbx_ws: your value here
|
169
|
-
aoc_shbx_name: your value here
|
170
|
-
aoc_shbx_meta: your value here
|
171
|
-
aoc_ak_name: your value here
|
172
|
-
aoc_ak_secret: your value here
|
173
|
-
aoc_test_folder: your value here
|
174
|
-
icos_bucket_key: your value here
|
175
|
-
icos_bucket_secret: your value here
|
176
|
-
icos_bucket_name: your value here
|
177
|
-
icos_bucket_region: your value here
|
178
|
-
icos_bucket_endpoint: your value here
|
179
|
-
icos_bucket_apikey: your value here
|
180
|
-
icos_resource_instance_id: your value here
|
181
|
-
email_internal: your value here
|
182
|
-
email_external: your value here
|
183
|
-
aoc_org: your value here
|
184
|
-
aoc_user_email: your value here
|
185
|
-
aoc_workspace2: your value here
|
186
|
-
http_gw_fqdn_port: your value here
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aspera/fasp/listener'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
module Aspera
|
7
|
-
module Cli
|
8
|
-
module Listener
|
9
|
-
# listener for FASP transfers (debug)
|
10
|
-
# FASP event listener display management events as JSON
|
11
|
-
class LineDump < Aspera::Fasp::Listener
|
12
|
-
def event_enhanced(data)
|
13
|
-
$stdout.puts(JSON.generate(data))
|
14
|
-
$stdout.flush
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aspera/fasp/listener'
|
4
|
-
require 'aspera/log'
|
5
|
-
|
6
|
-
module Aspera
|
7
|
-
module Cli
|
8
|
-
module Listener
|
9
|
-
# listener for FASP transfers (debug)
|
10
|
-
class Logger < Aspera::Fasp::Listener
|
11
|
-
def event_struct(data)
|
12
|
-
Log.log.debug(data.to_s)
|
13
|
-
Log.log.error((data['Description']).to_s) if data['Type'].eql?('FILEERROR')
|
14
|
-
end
|
15
|
-
|
16
|
-
def event_enhanced(data)
|
17
|
-
Log.log.debug(JSON.generate(data))
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aspera/fasp/listener'
|
4
|
-
require 'aspera/environment'
|
5
|
-
require 'ruby-progressbar'
|
6
|
-
|
7
|
-
module Aspera
|
8
|
-
module Cli
|
9
|
-
module Listener
|
10
|
-
# a listener to FASP event that displays a progress bar
|
11
|
-
class Progress < Aspera::Fasp::Listener
|
12
|
-
def initialize
|
13
|
-
super
|
14
|
-
@progress = nil
|
15
|
-
@cumulative = 0
|
16
|
-
end
|
17
|
-
|
18
|
-
def event_struct(data)
|
19
|
-
case data['Type']
|
20
|
-
when 'NOTIFICATION'
|
21
|
-
if data.key?('PreTransferBytes')
|
22
|
-
@progress = ProgressBar.create(
|
23
|
-
format: '%a %B %p%% %r Mbps %e',
|
24
|
-
rate_scale: lambda{|rate|rate / Environment::BYTES_PER_MEBIBIT},
|
25
|
-
title: 'progress',
|
26
|
-
total: data['PreTransferBytes'].to_i)
|
27
|
-
end
|
28
|
-
when 'STOP'
|
29
|
-
# stop event when one file is completed
|
30
|
-
@cumulative += data['Size'].to_i
|
31
|
-
when 'STATS'
|
32
|
-
if @progress.nil?
|
33
|
-
puts '.'
|
34
|
-
else
|
35
|
-
@progress.progress = data.key?('Bytescont') ? @cumulative + data['Bytescont'].to_i : data['TransferBytes'].to_i
|
36
|
-
end
|
37
|
-
when 'DONE'
|
38
|
-
if @progress.nil?
|
39
|
-
# terminate progress by going to next line
|
40
|
-
puts "\n"
|
41
|
-
else
|
42
|
-
@progress.progress = @progress.total
|
43
|
-
@progress = nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'aspera/fasp/listener'
|
4
|
-
require 'aspera/fasp/agent_base'
|
5
|
-
require 'aspera/environment'
|
6
|
-
require 'ruby-progressbar'
|
7
|
-
|
8
|
-
module Aspera
|
9
|
-
module Cli
|
10
|
-
module Listener
|
11
|
-
# a listener to FASP event that displays a progress bar
|
12
|
-
class ProgressMulti < Aspera::Fasp::Listener
|
13
|
-
def initialize
|
14
|
-
super
|
15
|
-
@progress_bar = nil
|
16
|
-
@sessions = {}
|
17
|
-
end
|
18
|
-
|
19
|
-
def reset
|
20
|
-
@progress_bar = nil
|
21
|
-
@sessions = {}
|
22
|
-
end
|
23
|
-
|
24
|
-
def update_total
|
25
|
-
@progress_bar.total = @sessions.values.inject(0){|m, s|m + s[:job_size].to_i}
|
26
|
-
rescue StandardError
|
27
|
-
nil
|
28
|
-
end
|
29
|
-
|
30
|
-
def update_progress
|
31
|
-
@progress_bar.progress = @sessions.values.inject(0){|m, s|m + s[:current].to_i}
|
32
|
-
rescue StandardError
|
33
|
-
nil
|
34
|
-
end
|
35
|
-
|
36
|
-
def event_enhanced(data)
|
37
|
-
if @progress_bar.nil?
|
38
|
-
@progress_bar = ProgressBar.create(
|
39
|
-
format: '%t %a %B %p%% %r Mbps %e',
|
40
|
-
rate_scale: lambda{|rate|rate / Environment::BYTES_PER_MEBIBIT},
|
41
|
-
title: '',
|
42
|
-
total: nil)
|
43
|
-
end
|
44
|
-
if !data.key?(Fasp::AgentBase::LISTENER_SESSION_ID_S)
|
45
|
-
Log.log.error{"Internal error: no #{Fasp::AgentBase::LISTENER_SESSION_ID_S} in event: #{data}"}
|
46
|
-
return
|
47
|
-
end
|
48
|
-
new_title = @sessions.length < 2 ? '' : "multi=#{@sessions.length}"
|
49
|
-
@progress_bar.title = new_title unless @progress_bar.title.eql?(new_title)
|
50
|
-
session = @sessions[data[Fasp::AgentBase::LISTENER_SESSION_ID_S]] ||= {
|
51
|
-
cumulative: 0,
|
52
|
-
job_size: 0,
|
53
|
-
current: 0
|
54
|
-
}
|
55
|
-
case data['type']
|
56
|
-
when 'INIT' # connection to ascp (get id)
|
57
|
-
when 'SESSION' # session information
|
58
|
-
when 'NOTIFICATION' # sent from remote
|
59
|
-
if data.key?('pre_transfer_bytes')
|
60
|
-
session[:job_size] = data['pre_transfer_bytes']
|
61
|
-
update_total
|
62
|
-
end
|
63
|
-
when 'STATS' # during transfer
|
64
|
-
if @progress_bar.total.nil?
|
65
|
-
@progress_bar.increment
|
66
|
-
else
|
67
|
-
session[:current] = data.key?('bytescont') ? session[:cumulative] + data['bytescont'].to_i : data['transfer_bytes'].to_i
|
68
|
-
update_progress
|
69
|
-
end
|
70
|
-
when 'STOP'
|
71
|
-
# stop event when one file is completed
|
72
|
-
session[:cumulative] = session[:cumulative] + data['size'].to_i
|
73
|
-
when 'DONE' # end of session
|
74
|
-
@sessions.delete(data[Fasp::AgentBase::LISTENER_SESSION_ID_S])
|
75
|
-
update_progress
|
76
|
-
update_total
|
77
|
-
else
|
78
|
-
Log.log.debug{"ignore: #{data['type']}"}
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'English'
|
4
|
-
require 'aspera/cli/plugin'
|
5
|
-
require 'aspera/sync'
|
6
|
-
require 'aspera/log'
|
7
|
-
require 'open3'
|
8
|
-
|
9
|
-
module Aspera
|
10
|
-
module Cli
|
11
|
-
module Plugins
|
12
|
-
# Execute Aspera Sync
|
13
|
-
class Sync < Aspera::Cli::Plugin
|
14
|
-
def initialize(env, sync_spec: nil)
|
15
|
-
super(env)
|
16
|
-
options.add_opt_simple(:sync_info, 'Information for sync instance and sessions (Hash)')
|
17
|
-
options.add_opt_simple(:sync_session, 'Name of session to use for admin commands. default: first in parameters')
|
18
|
-
options.parse_options!
|
19
|
-
return if env[:man_only]
|
20
|
-
@params = options.get_option(:sync_info, is_type: :mandatory)
|
21
|
-
@sync_spec = sync_spec
|
22
|
-
end
|
23
|
-
|
24
|
-
ACTIONS = %i[start admin].freeze
|
25
|
-
|
26
|
-
def execute_action
|
27
|
-
command = options.get_next_command(ACTIONS)
|
28
|
-
case command
|
29
|
-
when :start
|
30
|
-
Aspera::Sync.new(@params, @sync_spec).start
|
31
|
-
return Main.result_success
|
32
|
-
when :admin
|
33
|
-
sync_admin = Aspera::SyncAdmin.new(@params, options.get_option(:sync_session))
|
34
|
-
command2 = options.get_next_command([:status])
|
35
|
-
case command2
|
36
|
-
when :status
|
37
|
-
return {type: :single_object, data: sync_admin.status}
|
38
|
-
end # command2
|
39
|
-
end # command
|
40
|
-
end # execute_action
|
41
|
-
end # Sync
|
42
|
-
end # Plugins
|
43
|
-
end # Cli
|
44
|
-
end # Aspera
|
data/lib/aspera/data/7
DELETED
Binary file
|
data/lib/aspera/fasp/listener.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Aspera
|
4
|
-
module Fasp
|
5
|
-
# implement this class to get transfer events
|
6
|
-
class Listener # rubocop:disable Lint/EmptyClass
|
7
|
-
# define one of the following methods:
|
8
|
-
# event_text(text_data)
|
9
|
-
# event_struct(legacy_names)
|
10
|
-
# event_enhanced(snake_names)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|