Class: Aspera::Agent::Httpgw
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#start_transfer(transfer_spec, token_regenerator: nil) ⇒ Object
start FASP transfer based on transfer spec (hash table) note that it is asynchronous HTTP download only supports file list.
-
#wait_for_transfers_completion ⇒ Object
wait for completion of all jobs started.
Methods inherited from Base
agent_list, factory_create, to_move_options, #wait_for_completion
Instance Method Details
#start_transfer(transfer_spec, token_regenerator: nil) ⇒ Object
start FASP transfer based on transfer spec (hash table) note that it is asynchronous HTTP download only supports file list
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/aspera/agent/httpgw.rb', line 15 def start_transfer(transfer_spec, token_regenerator: nil) raise 'GW URL must be set' if @gw_api.nil? Aspera.assert_type(transfer_spec['paths'], Array){'paths'} Aspera.assert_type(transfer_spec['token'], String){'only token based transfer is supported in GW'} Log.log.debug{Log.dump(:user_spec, transfer_spec)} transfer_spec['authentication'] ||= 'token' case transfer_spec['direction'] when Transfer::Spec::DIRECTION_SEND @gw_api.upload(transfer_spec) when Transfer::Spec::DIRECTION_RECEIVE @gw_api.download(transfer_spec) else raise "unexpected direction: [#{transfer_spec['direction']}]" end end |
#wait_for_transfers_completion ⇒ Object
wait for completion of all jobs started
33 34 35 36 |
# File 'lib/aspera/agent/httpgw.rb', line 33 def wait_for_transfers_completion # well ... transfer was done in "start" return [:success] end |