aspera-cli 4.15.0 → 4.16.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 +29 -3
- data/CHANGELOG.md +292 -228
- data/CONTRIBUTING.md +69 -18
- data/README.md +1102 -952
- data/bin/ascli +13 -31
- data/bin/asession +3 -1
- data/examples/dascli +2 -2
- data/lib/aspera/aoc.rb +28 -33
- data/lib/aspera/ascmd.rb +3 -6
- data/lib/aspera/assert.rb +45 -0
- data/lib/aspera/cli/extended_value.rb +5 -5
- data/lib/aspera/cli/formatter.rb +26 -13
- data/lib/aspera/cli/hints.rb +4 -3
- data/lib/aspera/cli/main.rb +16 -3
- data/lib/aspera/cli/manager.rb +45 -36
- data/lib/aspera/cli/plugin.rb +20 -13
- data/lib/aspera/cli/plugins/aoc.rb +103 -73
- data/lib/aspera/cli/plugins/ats.rb +4 -3
- data/lib/aspera/cli/plugins/config.rb +114 -119
- data/lib/aspera/cli/plugins/cos.rb +2 -2
- data/lib/aspera/cli/plugins/faspex.rb +23 -19
- data/lib/aspera/cli/plugins/faspex5.rb +75 -43
- data/lib/aspera/cli/plugins/node.rb +28 -15
- data/lib/aspera/cli/plugins/orchestrator.rb +4 -2
- data/lib/aspera/cli/plugins/preview.rb +9 -7
- data/lib/aspera/cli/plugins/server.rb +6 -3
- data/lib/aspera/cli/plugins/shares.rb +30 -26
- data/lib/aspera/cli/sync_actions.rb +9 -9
- data/lib/aspera/cli/transfer_agent.rb +21 -14
- data/lib/aspera/cli/transfer_progress.rb +2 -3
- data/lib/aspera/cli/version.rb +1 -1
- data/lib/aspera/command_line_builder.rb +13 -11
- data/lib/aspera/cos_node.rb +3 -2
- data/lib/aspera/coverage.rb +22 -0
- data/lib/aspera/data_repository.rb +33 -2
- data/lib/aspera/environment.rb +4 -2
- data/lib/aspera/fasp/{agent_aspera.rb → agent_alpha.rb} +29 -39
- data/lib/aspera/fasp/agent_base.rb +17 -7
- data/lib/aspera/fasp/agent_direct.rb +88 -84
- data/lib/aspera/fasp/agent_httpgw.rb +4 -3
- data/lib/aspera/fasp/agent_node.rb +3 -2
- data/lib/aspera/fasp/agent_trsdk.rb +79 -37
- data/lib/aspera/fasp/installation.rb +51 -12
- data/lib/aspera/fasp/management.rb +11 -6
- data/lib/aspera/fasp/parameters.rb +53 -47
- data/lib/aspera/fasp/resume_policy.rb +7 -5
- data/lib/aspera/fasp/sync.rb +273 -0
- data/lib/aspera/fasp/transfer_spec.rb +10 -8
- data/lib/aspera/fasp/uri.rb +2 -2
- data/lib/aspera/faspex_gw.rb +11 -8
- data/lib/aspera/faspex_postproc.rb +6 -5
- data/lib/aspera/id_generator.rb +3 -1
- data/lib/aspera/json_rpc.rb +10 -8
- data/lib/aspera/keychain/encrypted_hash.rb +46 -11
- data/lib/aspera/keychain/macos_security.rb +15 -13
- data/lib/aspera/log.rb +4 -3
- data/lib/aspera/nagios.rb +7 -2
- data/lib/aspera/node.rb +17 -16
- data/lib/aspera/node_simulator.rb +214 -0
- data/lib/aspera/oauth.rb +22 -19
- data/lib/aspera/persistency_action_once.rb +13 -14
- data/lib/aspera/persistency_folder.rb +3 -2
- data/lib/aspera/preview/file_types.rb +53 -267
- data/lib/aspera/preview/generator.rb +7 -5
- data/lib/aspera/preview/terminal.rb +14 -5
- data/lib/aspera/preview/utils.rb +8 -7
- data/lib/aspera/proxy_auto_config.rb +6 -3
- data/lib/aspera/rest.rb +29 -13
- data/lib/aspera/rest_error_analyzer.rb +1 -0
- data/lib/aspera/rest_errors_aspera.rb +2 -0
- data/lib/aspera/secret_hider.rb +5 -2
- data/lib/aspera/ssh.rb +10 -8
- data/lib/aspera/temp_file_manager.rb +1 -1
- data/lib/aspera/web_server_simple.rb +2 -1
- data.tar.gz.sig +0 -0
- metadata +96 -45
- metadata.gz.sig +0 -0
- data/lib/aspera/sync.rb +0 -219
@@ -10,6 +10,7 @@ require 'aspera/aoc'
|
|
10
10
|
require 'aspera/node'
|
11
11
|
require 'aspera/persistency_action_once'
|
12
12
|
require 'aspera/id_generator'
|
13
|
+
require 'aspera/assert'
|
13
14
|
require 'securerandom'
|
14
15
|
require 'date'
|
15
16
|
|
@@ -118,7 +119,7 @@ module Aspera
|
|
118
119
|
end
|
119
120
|
myself = object.aoc_api.read('self')[:data]
|
120
121
|
if auto_set_pub_key
|
121
|
-
|
122
|
+
assert(myself['public_key'].empty?, exception_class: Cli::Error){'Public key is already set in profile (use --override=yes)'} unless option_override
|
122
123
|
formatter.display_status('Updating profile with the public key.')
|
123
124
|
aoc_api.update("users/#{myself['id']}", {'public_key' => pub_key_pem})
|
124
125
|
end
|
@@ -165,7 +166,11 @@ module Aspera
|
|
165
166
|
client_registration_token
|
166
167
|
client_access_key
|
167
168
|
kms_profile].freeze
|
168
|
-
|
169
|
+
PACKAGE_RECEIVED_BASE_QUERY = {
|
170
|
+
'archived' => false,
|
171
|
+
'has_content' => true,
|
172
|
+
'received' => true,
|
173
|
+
'completed' => true}.freeze
|
169
174
|
|
170
175
|
def initialize(env)
|
171
176
|
super(env)
|
@@ -209,7 +214,7 @@ module Aspera
|
|
209
214
|
# @return identifier
|
210
215
|
def get_resource_id_from_args(resource_class_path)
|
211
216
|
return instance_identifier do |field, value|
|
212
|
-
|
217
|
+
assert(field.eql?('name'), exception_class: Cli::BadArgument){'only selection by name is supported'}
|
213
218
|
aoc_api.lookup_by_name(resource_class_path, value)['id']
|
214
219
|
end
|
215
220
|
end
|
@@ -218,11 +223,11 @@ module Aspera
|
|
218
223
|
return "#{resource_class_path}/#{get_resource_id_from_args(resource_class_path)}"
|
219
224
|
end
|
220
225
|
|
221
|
-
# Call
|
222
|
-
#
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
+
# Call block with same query using paging and response information
|
227
|
+
# @return [Hash] {data: , total: }
|
228
|
+
def api_call_paging(base_query={})
|
229
|
+
assert_type(base_query, Hash){'query'}
|
230
|
+
assert(block_given?)
|
226
231
|
# set default large page if user does not specify own parameters. AoC Caps to 1000 anyway
|
227
232
|
base_query['per_page'] = 1000 unless base_query.key?('per_page')
|
228
233
|
max_items = base_query.delete(MAX_ITEMS)
|
@@ -235,7 +240,7 @@ module Aspera
|
|
235
240
|
loop do
|
236
241
|
query = base_query.clone
|
237
242
|
query['page'] = current_page
|
238
|
-
result =
|
243
|
+
result = yield(query)
|
239
244
|
total_count = result[:http]['X-Total-Count']
|
240
245
|
page_count += 1
|
241
246
|
current_page += 1
|
@@ -247,7 +252,36 @@ module Aspera
|
|
247
252
|
break if !max_pages.nil? && page_count >= max_pages
|
248
253
|
end
|
249
254
|
item_list = item_list[0..max_items - 1] if !max_items.nil? && item_list.count > max_items
|
250
|
-
return {
|
255
|
+
return {data: item_list, total: total_count}
|
256
|
+
end
|
257
|
+
|
258
|
+
# read using the query and paging
|
259
|
+
# @return [Hash] {data: , total: }
|
260
|
+
def api_read_all(resource_class_path, base_query={})
|
261
|
+
return api_call_paging(base_query) do |query|
|
262
|
+
aoc_api.read(resource_class_path, query)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
# list all entities, given additional, default and user's queries
|
267
|
+
def result_list(resource_class_path, fields: nil, base_query: {}, default_query: {})
|
268
|
+
assert_type(base_query, Hash)
|
269
|
+
assert_type(default_query, Hash)
|
270
|
+
user_query = query_read_delete(default: default_query)
|
271
|
+
# caller may add specific modifications or checks
|
272
|
+
yield(user_query) if block_given?
|
273
|
+
return {type: :object_list, fields: fields}.merge(api_read_all(resource_class_path, base_query.merge(user_query)))
|
274
|
+
end
|
275
|
+
|
276
|
+
def resolve_dropbox_name_default_ws_id(query)
|
277
|
+
if query.key?('dropbox_name')
|
278
|
+
# convenience: specify name instead of id
|
279
|
+
raise 'not both dropbox_name and dropbox_id' if query.key?('dropbox_id')
|
280
|
+
query['dropbox_id'] = aoc_api.lookup_by_name('dropboxes', query['dropbox_name'])['id']
|
281
|
+
query.delete('dropbox_name')
|
282
|
+
end
|
283
|
+
query['workspace_id'] ||= aoc_api.context[:workspace_id] unless aoc_api.context[:workspace_id].eql?(:undefined)
|
284
|
+
query['exclude_dropbox_packages'] = true unless query.key?('dropbox_id')
|
251
285
|
end
|
252
286
|
|
253
287
|
NODE4_EXT_COMMANDS = %i[transfer].concat(Node::COMMANDS_GEN4).freeze
|
@@ -282,7 +316,7 @@ module Aspera
|
|
282
316
|
client_direction = Fasp::TransferSpec::DIRECTION_RECEIVE
|
283
317
|
client_folder = transfer.destination_folder(client_direction)
|
284
318
|
server_folder = source_folder
|
285
|
-
else
|
319
|
+
else error_unreachable_line
|
286
320
|
end
|
287
321
|
client_apfid = top_node_api.resolve_api_fid(file_id, client_folder)
|
288
322
|
server_apfid = top_node_api.resolve_api_fid(file_id, server_folder)
|
@@ -303,9 +337,9 @@ module Aspera
|
|
303
337
|
server_apfid[:file_id],
|
304
338
|
client_direction,
|
305
339
|
add_ts)))
|
306
|
-
else
|
340
|
+
else error_unreachable_line
|
307
341
|
end # command_repo
|
308
|
-
|
342
|
+
error_unreachable_line
|
309
343
|
end # execute_nodegen4_command
|
310
344
|
|
311
345
|
def execute_admin_action
|
@@ -317,8 +351,7 @@ module Aspera
|
|
317
351
|
command_auth_prov = options.get_next_command(%i[list update])
|
318
352
|
case command_auth_prov
|
319
353
|
when :list
|
320
|
-
|
321
|
-
return {type: :object_list, data: providers}
|
354
|
+
return result_list('admin/auth_providers')
|
322
355
|
when :update
|
323
356
|
raise 'not implemented'
|
324
357
|
end
|
@@ -402,7 +435,7 @@ module Aspera
|
|
402
435
|
when :organizations then aoc_api.current_user_info['organization_id']
|
403
436
|
when :users then aoc_api.current_user_info['id']
|
404
437
|
when :nodes then aoc_api.current_user_info['id'] # TODO: consistent ? # rubocop:disable Lint/DuplicateBranch
|
405
|
-
else
|
438
|
+
else error_unreachable_line
|
406
439
|
end
|
407
440
|
filter = options.get_option(:query) || {}
|
408
441
|
filter['limit'] ||= 100
|
@@ -411,9 +444,13 @@ module Aspera
|
|
411
444
|
start_date_persistency = PersistencyActionOnce.new(
|
412
445
|
manager: @agents[:persistency],
|
413
446
|
data: saved_date,
|
414
|
-
|
447
|
+
id: IdGenerator.from_list([
|
448
|
+
'aoc_ana_date',
|
449
|
+
options.get_option(:url, mandatory: true),
|
450
|
+
aoc_api.context(:files)[:workspace_name],
|
415
451
|
filter_resource.to_s,
|
416
|
-
filter_id
|
452
|
+
filter_id
|
453
|
+
]))
|
417
454
|
start_date_time = saved_date.first
|
418
455
|
stop_date_time = Time.now.utc.strftime('%FT%T.%LZ')
|
419
456
|
# Log.log().error("start: #{start_date_time}")
|
@@ -484,9 +521,7 @@ module Aspera
|
|
484
521
|
when :group_membership then default_fields.push(*%w[group_id member_type member_id])
|
485
522
|
when :workspace_membership then default_fields.push(*%w[workspace_id member_type member_id])
|
486
523
|
end
|
487
|
-
|
488
|
-
formatter.display_item_count(items[:list].length, items[:total])
|
489
|
-
return {type: :object_list, data: items[:list], fields: default_fields}
|
524
|
+
return result_list(resource_class_path, fields: default_fields, default_query: default_query)
|
490
525
|
when :show
|
491
526
|
object = aoc_api.read(resource_instance_path)[:data]
|
492
527
|
# default: show all, but certificate
|
@@ -511,12 +546,13 @@ module Aspera
|
|
511
546
|
return Main.result_success
|
512
547
|
when :do
|
513
548
|
command_repo = options.get_next_command(NODE4_EXT_COMMANDS)
|
514
|
-
|
549
|
+
# init context
|
550
|
+
aoc_api.context(:files)
|
515
551
|
return execute_nodegen4_command(command_repo, res_id)
|
516
|
-
else
|
552
|
+
else error_unexpected_value(command)
|
517
553
|
end
|
518
554
|
when :usage_reports
|
519
|
-
return
|
555
|
+
return result_list('usage_reports', base_query: {workspace_id: aoc_api.context(:files)[:workspace_id]})
|
520
556
|
end
|
521
557
|
end
|
522
558
|
|
@@ -549,15 +585,15 @@ module Aspera
|
|
549
585
|
when :tier_restrictions
|
550
586
|
return { type: :single_object, data: aoc_api.read('tier_restrictions')[:data] }
|
551
587
|
when :user
|
552
|
-
case options.get_next_command(%i[workspaces profile])
|
588
|
+
case options.get_next_command(%i[workspaces profile preferences])
|
553
589
|
# when :settings
|
554
590
|
# return {type: :object_list,data: aoc_api.read('client_settings/')[:data]}
|
555
591
|
when :workspaces
|
556
592
|
case options.get_next_command(%i[list current])
|
557
593
|
when :list
|
558
|
-
return
|
594
|
+
return result_list('workspaces', fields: %w[id name])
|
559
595
|
when :current
|
560
|
-
return { type: :single_object, data: aoc_api.read("workspaces/#{aoc_api.context(:
|
596
|
+
return { type: :single_object, data: aoc_api.read("workspaces/#{aoc_api.context(:files)[:workspace_id]}")[:data] }
|
561
597
|
end
|
562
598
|
when :profile
|
563
599
|
case options.get_next_command(%i[show modify])
|
@@ -567,19 +603,25 @@ module Aspera
|
|
567
603
|
aoc_api.update("users/#{aoc_api.current_user_info(exception: true)['id']}", options.get_next_argument('properties', type: Hash))
|
568
604
|
return Main.result_status('modified')
|
569
605
|
end
|
606
|
+
when :preferences
|
607
|
+
user_preferences_res = "users/#{aoc_api.current_user_info(exception: true)['id']}/user_interaction_preferences"
|
608
|
+
case options.get_next_command(%i[show modify])
|
609
|
+
when :show
|
610
|
+
return { type: :single_object, data: aoc_api.read(user_preferences_res)[:data] }
|
611
|
+
when :modify
|
612
|
+
aoc_api.update(user_preferences_res, options.get_next_argument('properties', type: Hash))
|
613
|
+
return Main.result_status('modified')
|
614
|
+
end
|
570
615
|
end
|
571
616
|
when :packages
|
572
|
-
package_command = options.get_next_command(%i[shared_inboxes send
|
617
|
+
package_command = options.get_next_command(%i[shared_inboxes send receive list show delete].concat(Node::NODE4_READ_ACTIONS), aliases: {recv: :receive})
|
573
618
|
case package_command
|
574
619
|
when :shared_inboxes
|
575
620
|
case options.get_next_command(%i[list show])
|
576
621
|
when :list
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
query['workspace_id'] = aoc_api.context[:workspace_id] unless aoc_api.context[:workspace_id].eql?(:undefined)
|
581
|
-
end
|
582
|
-
return {type: :object_list, data: aoc_api.read('dropbox_memberships', query)[:data], fields: ['dropbox_id', 'dropbox.name']}
|
622
|
+
default_query = {'embed[]' => 'dropbox', 'aggregate_permissions_by_dropbox' => true, 'sort' => 'dropbox_name'}
|
623
|
+
default_query['workspace_id'] = aoc_api.context[:workspace_id] unless aoc_api.context[:workspace_id].eql?(:undefined)
|
624
|
+
return result_list('dropbox_memberships', fields: %w[dropbox_id dropbox.name], default_query: default_query)
|
583
625
|
when :show
|
584
626
|
return {type: :single_object, data: aoc_api.read(get_resource_path_from_args('dropboxes'), query)[:data]}
|
585
627
|
end
|
@@ -603,7 +645,7 @@ module Aspera
|
|
603
645
|
Main.result_transfer(transfer.start(created_package[:spec], rest_token: created_package[:node]))
|
604
646
|
# return all info on package (especially package id)
|
605
647
|
return { type: :single_object, data: created_package[:info]}
|
606
|
-
when :
|
648
|
+
when :receive
|
607
649
|
ids_to_download = nil
|
608
650
|
if !aoc_api.public_link.nil?
|
609
651
|
aoc_api.assert_public_link_types(['view_received_package'])
|
@@ -615,6 +657,7 @@ module Aspera
|
|
615
657
|
skip_ids_data = []
|
616
658
|
skip_ids_persistency = nil
|
617
659
|
if options.get_option(:once_only, mandatory: true)
|
660
|
+
# TODO: add query info to id
|
618
661
|
skip_ids_persistency = PersistencyActionOnce.new(
|
619
662
|
manager: @agents[:persistency],
|
620
663
|
data: skip_ids_data,
|
@@ -624,25 +667,25 @@ module Aspera
|
|
624
667
|
aoc_api.context[:workspace_id]
|
625
668
|
].concat(aoc_api.additional_persistence_ids)))
|
626
669
|
end
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
raise 'not both dropbox_name and dropbox_id' if query.key?('dropbox_id')
|
633
|
-
query['dropbox_id'] = aoc_api.lookup_by_name('dropboxes', query['dropbox_name'])['id']
|
634
|
-
query.delete('dropbox_name')
|
635
|
-
end
|
636
|
-
query['workspace_id'] ||= aoc_api.context[:workspace_id] unless aoc_api.context[:workspace_id].eql?(:undefined)
|
637
|
-
# get list of packages in inbox
|
638
|
-
package_info = aoc_api.read('packages', query)[:data]
|
670
|
+
case ids_to_download
|
671
|
+
when ExtendedValue::ALL, ExtendedValue::INIT
|
672
|
+
query = query_read_delete(default: PACKAGE_RECEIVED_BASE_QUERY)
|
673
|
+
assert_type(query, Hash){'query'}
|
674
|
+
resolve_dropbox_name_default_ws_id(query)
|
639
675
|
# remove from list the ones already downloaded
|
640
|
-
|
676
|
+
all_ids = api_read_all('packages', query)[:data].map{|e|e['id']}
|
677
|
+
if ids_to_download.eql?(ExtendedValue::INIT)
|
678
|
+
assert(skip_ids_persistency){'Only with option once_only'}
|
679
|
+
skip_ids_persistency.data.clear.concat(all_ids)
|
680
|
+
skip_ids_persistency.save
|
681
|
+
return Main.result_status("Initialized skip for #{skip_ids_persistency.data.count} package(s)")
|
682
|
+
end
|
641
683
|
# array here
|
642
|
-
ids_to_download.reject
|
684
|
+
ids_to_download = all_ids.reject{|id|skip_ids_data.include?(id)}
|
685
|
+
else
|
686
|
+
ids_to_download = [ids_to_download] unless ids_to_download.is_a?(Array)
|
643
687
|
end # ExtendedValue::ALL
|
644
688
|
# list here
|
645
|
-
ids_to_download = [ids_to_download] unless ids_to_download.is_a?(Array)
|
646
689
|
result_transfer = []
|
647
690
|
formatter.display_status("found #{ids_to_download.length} package(s).")
|
648
691
|
ids_to_download.each do |package_id|
|
@@ -673,24 +716,13 @@ module Aspera
|
|
673
716
|
return { type: :single_object, data: package_info }
|
674
717
|
when :list
|
675
718
|
display_fields = %w[id name bytes_transferred]
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
raise 'not both dropbox_name and dropbox_id' if query.key?('dropbox_id')
|
681
|
-
query['dropbox_id'] = aoc_api.lookup_by_name('dropboxes', query['dropbox_name'])['id']
|
682
|
-
query.delete('dropbox_name')
|
683
|
-
end
|
684
|
-
if aoc_api.context[:workspace_id].eql?(:undefined)
|
685
|
-
display_fields.push('workspace_id')
|
686
|
-
else
|
687
|
-
query['workspace_id'] ||= aoc_api.context[:workspace_id]
|
688
|
-
end
|
689
|
-
packages = aoc_api.read('packages', query)[:data]
|
690
|
-
return {type: :object_list, data: packages, fields: display_fields}
|
719
|
+
display_fields.push('workspace_id') if aoc_api.context[:workspace_id].eql?(:undefined)
|
720
|
+
return result_list('packages', fields: display_fields, base_query: PACKAGE_RECEIVED_BASE_QUERY) do |query|
|
721
|
+
resolve_dropbox_name_default_ws_id(query)
|
722
|
+
end
|
691
723
|
when :delete
|
692
724
|
return do_bulk_operation(command: package_command, descr: 'identifier', values: identifier) do |id|
|
693
|
-
|
725
|
+
assert_values(id.class, [String, Integer]){'identifier'}
|
694
726
|
aoc_api.delete("packages/#{id}")[:data]
|
695
727
|
end
|
696
728
|
when *Node::NODE4_READ_ACTIONS
|
@@ -720,7 +752,7 @@ module Aspera
|
|
720
752
|
purpose = case link_type
|
721
753
|
when :public then 'token_auth_redirection'
|
722
754
|
when :private then 'shared_folder_auth_link'
|
723
|
-
else
|
755
|
+
else error_unreachable_line
|
724
756
|
end
|
725
757
|
case short_link_command
|
726
758
|
when :delete
|
@@ -754,8 +786,7 @@ module Aspera
|
|
754
786
|
# embed: 'updated_by_user',
|
755
787
|
sort: '-created_at'
|
756
788
|
}
|
757
|
-
|
758
|
-
return {type: :object_list, data: result, fields: Formatter.all_but('data')}
|
789
|
+
return result_list('short_links', fields: Formatter.all_but('data'), base_query: list_params)
|
759
790
|
when :create
|
760
791
|
creation_params = {
|
761
792
|
purpose: purpose,
|
@@ -846,17 +877,16 @@ module Aspera
|
|
846
877
|
url = value_create_modify(command: command, type: String)
|
847
878
|
uri = URI.parse(url)
|
848
879
|
server = WebServerSimple.new(uri)
|
849
|
-
server.mount(uri.path, Faspex4GWServlet, aoc_api, aoc_api.context(:
|
880
|
+
server.mount(uri.path, Faspex4GWServlet, aoc_api, aoc_api.context(:files)[:workspace_id])
|
850
881
|
trap('INT') { server.shutdown }
|
851
882
|
formatter.display_status("Faspex 4 gateway listening on #{url}")
|
852
883
|
Log.log.info("Listening on #{url}")
|
853
884
|
# this is blocking until server exits
|
854
885
|
server.start
|
855
886
|
return Main.result_status('Gateway terminated')
|
856
|
-
else
|
857
|
-
raise "internal error: #{command}"
|
887
|
+
else error_unreachable_line
|
858
888
|
end # action
|
859
|
-
|
889
|
+
error_unreachable_line
|
860
890
|
end
|
861
891
|
|
862
892
|
private :execute_admin_action
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
require 'aspera/cli/plugins/node'
|
6
6
|
require 'aspera/ats_api'
|
7
|
+
require 'aspera/assert'
|
7
8
|
|
8
9
|
module Aspera
|
9
10
|
module Cli
|
@@ -128,7 +129,7 @@ module Aspera
|
|
128
129
|
}}
|
129
130
|
api_ak_auth = Rest.new(rest_params)
|
130
131
|
return {type: :single_object, data: api_ak_auth.read('servers')[:data]}
|
131
|
-
else
|
132
|
+
else error_unreachable_line
|
132
133
|
end
|
133
134
|
end
|
134
135
|
|
@@ -200,7 +201,7 @@ module Aspera
|
|
200
201
|
when :delete
|
201
202
|
ats_ibm_api.delete("api_keys/#{concerned_id}")
|
202
203
|
return Main.result_status("deleted #{concerned_id}")
|
203
|
-
else
|
204
|
+
else error_unreachable_line
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -224,7 +225,7 @@ module Aspera
|
|
224
225
|
when :aws_trust_policy
|
225
226
|
res = ats_api_pub_v1.read('aws/trustpolicy', {region: options.get_option(:region, mandatory: true)})[:data]
|
226
227
|
return {type: :single_object, data: res}
|
227
|
-
else
|
228
|
+
else error_unexpected_value(command)
|
228
229
|
end
|
229
230
|
end
|
230
231
|
|