aspera-cli 4.9.0 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/BUGS.md +20 -0
- data/CHANGELOG.md +509 -0
- data/CONTRIBUTING.md +118 -0
- data/README.md +1241 -916
- data/bin/ascli +4 -4
- data/bin/asession +11 -11
- data/docs/test_env.conf +32 -21
- data/examples/aoc.rb +4 -4
- data/examples/dascli +16 -9
- data/examples/faspex4.rb +8 -8
- data/examples/node.rb +12 -12
- data/examples/server.rb +10 -10
- data/lib/aspera/aoc.rb +273 -266
- data/lib/aspera/ascmd.rb +56 -54
- data/lib/aspera/ats_api.rb +4 -4
- data/lib/aspera/cli/basic_auth_plugin.rb +15 -12
- data/lib/aspera/cli/extended_value.rb +5 -5
- data/lib/aspera/cli/formater.rb +64 -64
- data/lib/aspera/cli/info.rb +2 -2
- data/lib/aspera/cli/listener/line_dump.rb +1 -1
- data/lib/aspera/cli/listener/logger.rb +1 -1
- data/lib/aspera/cli/listener/progress.rb +5 -6
- data/lib/aspera/cli/listener/progress_multi.rb +14 -19
- data/lib/aspera/cli/main.rb +66 -67
- data/lib/aspera/cli/manager.rb +112 -110
- data/lib/aspera/cli/plugin.rb +57 -36
- data/lib/aspera/cli/plugins/alee.rb +4 -4
- data/lib/aspera/cli/plugins/aoc.rb +309 -670
- data/lib/aspera/cli/plugins/ats.rb +44 -46
- data/lib/aspera/cli/plugins/bss.rb +10 -10
- data/lib/aspera/cli/plugins/config.rb +497 -378
- data/lib/aspera/cli/plugins/console.rb +12 -12
- data/lib/aspera/cli/plugins/cos.rb +18 -20
- data/lib/aspera/cli/plugins/faspex.rb +112 -114
- data/lib/aspera/cli/plugins/faspex5.rb +71 -46
- data/lib/aspera/cli/plugins/node.rb +379 -283
- data/lib/aspera/cli/plugins/orchestrator.rb +46 -46
- data/lib/aspera/cli/plugins/preview.rb +122 -114
- data/lib/aspera/cli/plugins/server.rb +137 -83
- data/lib/aspera/cli/plugins/shares.rb +30 -29
- data/lib/aspera/cli/plugins/sync.rb +13 -33
- data/lib/aspera/cli/transfer_agent.rb +60 -59
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/colors.rb +3 -3
- data/lib/aspera/command_line_builder.rb +27 -27
- data/lib/aspera/cos_node.rb +22 -20
- data/lib/aspera/data_repository.rb +1 -1
- data/lib/aspera/environment.rb +35 -15
- data/lib/aspera/fasp/agent_base.rb +15 -15
- data/lib/aspera/fasp/agent_connect.rb +23 -21
- data/lib/aspera/fasp/agent_direct.rb +66 -64
- data/lib/aspera/fasp/agent_httpgw.rb +141 -78
- data/lib/aspera/fasp/agent_node.rb +23 -21
- data/lib/aspera/fasp/agent_trsdk.rb +20 -20
- data/lib/aspera/fasp/error.rb +3 -2
- data/lib/aspera/fasp/error_info.rb +11 -8
- data/lib/aspera/fasp/installation.rb +79 -79
- data/lib/aspera/fasp/listener.rb +1 -1
- data/lib/aspera/fasp/parameters.rb +86 -71
- data/lib/aspera/fasp/parameters.yaml +7 -4
- data/lib/aspera/fasp/resume_policy.rb +8 -8
- data/lib/aspera/fasp/transfer_spec.rb +35 -2
- data/lib/aspera/fasp/uri.rb +7 -7
- data/lib/aspera/faspex_gw.rb +7 -5
- data/lib/aspera/hash_ext.rb +3 -3
- data/lib/aspera/id_generator.rb +5 -5
- data/lib/aspera/keychain/encrypted_hash.rb +38 -105
- data/lib/aspera/keychain/macos_security.rb +128 -57
- data/lib/aspera/log.rb +7 -7
- data/lib/aspera/nagios.rb +19 -18
- data/lib/aspera/node.rb +209 -35
- data/lib/aspera/oauth.rb +37 -36
- data/lib/aspera/open_application.rb +19 -11
- data/lib/aspera/persistency_action_once.rb +4 -4
- data/lib/aspera/persistency_folder.rb +16 -15
- data/lib/aspera/preview/file_types.rb +8 -8
- data/lib/aspera/preview/generator.rb +67 -67
- data/lib/aspera/preview/utils.rb +27 -27
- data/lib/aspera/proxy_auto_config.js +41 -41
- data/lib/aspera/proxy_auto_config.rb +21 -14
- data/lib/aspera/rest.rb +72 -67
- data/lib/aspera/rest_call_error.rb +2 -1
- data/lib/aspera/rest_error_analyzer.rb +18 -17
- data/lib/aspera/rest_errors_aspera.rb +16 -16
- data/lib/aspera/secret_hider.rb +15 -13
- data/lib/aspera/ssh.rb +11 -10
- data/lib/aspera/sync.rb +158 -44
- data/lib/aspera/temp_file_manager.rb +2 -2
- data/lib/aspera/uri_reader.rb +4 -4
- data/lib/aspera/web_auth.rb +14 -13
- data.tar.gz.sig +0 -0
- metadata +11 -36
- metadata.gz.sig +0 -0
@@ -6,16 +6,16 @@ require 'aspera/nagios'
|
|
6
6
|
module Aspera
|
7
7
|
module Cli
|
8
8
|
module Plugins
|
9
|
-
class Console < BasicAuthPlugin
|
9
|
+
class Console < Aspera::Cli::BasicAuthPlugin
|
10
10
|
DEFAULT_FILTER_AGE_SECONDS = 3 * 3600
|
11
11
|
private_constant :DEFAULT_FILTER_AGE_SECONDS
|
12
12
|
def initialize(env)
|
13
13
|
super(env)
|
14
|
-
options.add_opt_date(:filter_from,'only after date')
|
15
|
-
options.add_opt_date(:filter_to,'only before date')
|
14
|
+
options.add_opt_date(:filter_from, 'only after date')
|
15
|
+
options.add_opt_date(:filter_to, 'only before date')
|
16
16
|
time_now = Time.now
|
17
|
-
options.set_option(:filter_from,Manager.time_to_string(time_now - DEFAULT_FILTER_AGE_SECONDS))
|
18
|
-
options.set_option(:filter_to,Manager.time_to_string(time_now))
|
17
|
+
options.set_option(:filter_from, Manager.time_to_string(time_now - DEFAULT_FILTER_AGE_SECONDS))
|
18
|
+
options.set_option(:filter_to, Manager.time_to_string(time_now))
|
19
19
|
options.parse_options!
|
20
20
|
end
|
21
21
|
|
@@ -29,9 +29,9 @@ module Aspera
|
|
29
29
|
nagios = Nagios.new
|
30
30
|
begin
|
31
31
|
api_console.read('ssh_keys')
|
32
|
-
nagios.add_ok('console api','accessible')
|
32
|
+
nagios.add_ok('console api', 'accessible')
|
33
33
|
rescue StandardError => e
|
34
|
-
nagios.add_critical('console api',e.to_s)
|
34
|
+
nagios.add_critical('console api', e.to_s)
|
35
35
|
end
|
36
36
|
return nagios.result
|
37
37
|
when :transfer
|
@@ -41,11 +41,11 @@ module Aspera
|
|
41
41
|
command = options.get_next_command(%i[list submit])
|
42
42
|
case command
|
43
43
|
when :list
|
44
|
-
return {type: :object_list,data: api_console.read('smart_transfers')[:data]}
|
44
|
+
return {type: :object_list, data: api_console.read('smart_transfers')[:data]}
|
45
45
|
when :submit
|
46
46
|
smart_id = options.get_next_argument('smart_id')
|
47
47
|
params = options.get_next_argument('transfer parameters')
|
48
|
-
return {type: :object_list,data: api_console.create('smart_transfers/' + smart_id,params)[:data]}
|
48
|
+
return {type: :object_list, data: api_console.create('smart_transfers/' + smart_id, params)[:data]}
|
49
49
|
end
|
50
50
|
when :current
|
51
51
|
command = options.get_next_command([:list])
|
@@ -53,9 +53,9 @@ module Aspera
|
|
53
53
|
when :list
|
54
54
|
return {
|
55
55
|
type: :object_list,
|
56
|
-
data: api_console.read('transfers',{
|
57
|
-
'from' => options.get_option(:filter_from,is_type: :mandatory),
|
58
|
-
'to' => options.get_option(:filter_to,is_type: :mandatory)
|
56
|
+
data: api_console.read('transfers', {
|
57
|
+
'from' => options.get_option(:filter_from, is_type: :mandatory),
|
58
|
+
'to' => options.get_option(:filter_to, is_type: :mandatory)
|
59
59
|
})[:data],
|
60
60
|
fields: %w[id contact name status]}
|
61
61
|
end
|
@@ -7,18 +7,18 @@ require 'aspera/cos_node'
|
|
7
7
|
module Aspera
|
8
8
|
module Cli
|
9
9
|
module Plugins
|
10
|
-
class Cos < Plugin
|
10
|
+
class Cos < Aspera::Cli::Plugin
|
11
11
|
def initialize(env)
|
12
12
|
super(env)
|
13
13
|
@service_creds = nil
|
14
|
-
options.add_opt_simple(:bucket,'Bucket name')
|
15
|
-
options.add_opt_simple(:endpoint,'Storage endpoint url')
|
16
|
-
options.add_opt_simple(:apikey,'Storage API key')
|
17
|
-
options.add_opt_simple(:crn,'Ressource instance id')
|
18
|
-
options.add_opt_simple(:service_credentials,'IBM Cloud service credentials (Hash)')
|
19
|
-
options.add_opt_simple(:region,'Storage region')
|
20
|
-
options.add_opt_simple(:identity,"Authentication url (#{CosNode::IBM_CLOUD_TOKEN_URL})")
|
21
|
-
options.set_option(:identity,CosNode::IBM_CLOUD_TOKEN_URL)
|
14
|
+
options.add_opt_simple(:bucket, 'Bucket name')
|
15
|
+
options.add_opt_simple(:endpoint, 'Storage endpoint url')
|
16
|
+
options.add_opt_simple(:apikey, 'Storage API key')
|
17
|
+
options.add_opt_simple(:crn, 'Ressource instance id')
|
18
|
+
options.add_opt_simple(:service_credentials, 'IBM Cloud service credentials (Hash)')
|
19
|
+
options.add_opt_simple(:region, 'Storage region')
|
20
|
+
options.add_opt_simple(:identity, "Authentication url (#{CosNode::IBM_CLOUD_TOKEN_URL})")
|
21
|
+
options.set_option(:identity, CosNode::IBM_CLOUD_TOKEN_URL)
|
22
22
|
options.parse_options!
|
23
23
|
end
|
24
24
|
|
@@ -28,26 +28,24 @@ module Aspera
|
|
28
28
|
command = options.get_next_command(ACTIONS)
|
29
29
|
case command
|
30
30
|
when :node
|
31
|
-
bucket_name = options.get_option(:bucket,is_type: :mandatory)
|
31
|
+
bucket_name = options.get_option(:bucket, is_type: :mandatory)
|
32
32
|
# get service credentials, Hash, e.g. @json:@file:...
|
33
33
|
service_credentials = options.get_option(:service_credentials)
|
34
34
|
storage_endpoint = options.get_option(:endpoint)
|
35
|
-
raise CliBadArgument,'one of: endpoint or service_credentials is required' if service_credentials.nil? && storage_endpoint.nil?
|
36
|
-
raise CliBadArgument,'endpoint and service_credentials are mutually exclusive' unless service_credentials.nil? || storage_endpoint.nil?
|
35
|
+
raise CliBadArgument, 'one of: endpoint or service_credentials is required' if service_credentials.nil? && storage_endpoint.nil?
|
36
|
+
raise CliBadArgument, 'endpoint and service_credentials are mutually exclusive' unless service_credentials.nil? || storage_endpoint.nil?
|
37
37
|
if service_credentials.nil?
|
38
|
-
service_api_key = options.get_option(:apikey,is_type: :mandatory)
|
39
|
-
instance_id = options.get_option(:crn,is_type: :mandatory)
|
38
|
+
service_api_key = options.get_option(:apikey, is_type: :mandatory)
|
39
|
+
instance_id = options.get_option(:crn, is_type: :mandatory)
|
40
40
|
else
|
41
|
-
params=CosNode.parameters_from_svc_creds(service_credentials,options.get_option(:region,is_type: :mandatory))
|
41
|
+
params = CosNode.parameters_from_svc_creds(service_credentials, options.get_option(:region, is_type: :mandatory))
|
42
42
|
storage_endpoint = params[:storage_endpoint]
|
43
43
|
service_api_key = params[:service_api_key]
|
44
44
|
instance_id = params[:instance_id]
|
45
45
|
end
|
46
|
-
api_node = CosNode.new(bucket_name,storage_endpoint,instance_id,service_api_key,options.get_option(:identity,is_type: :mandatory))
|
47
|
-
|
48
|
-
|
49
|
-
command = options.get_next_command(%i[upload download info access_key api_details transfer])
|
50
|
-
node_plugin = Node.new(@agents.merge(skip_basic_auth_options: true, node_api: api_node, add_request_param: api_node.add_ts))
|
46
|
+
api_node = CosNode.new(bucket_name, storage_endpoint, instance_id, service_api_key, options.get_option(:identity, is_type: :mandatory))
|
47
|
+
node_plugin = Node.new(@agents.merge(skip_basic_auth_options: true, node_api: api_node))
|
48
|
+
command = options.get_next_command(Node::COMMANDS_COS)
|
51
49
|
return node_plugin.execute_action(command)
|
52
50
|
end
|
53
51
|
end
|