Class: Aspera::Fasp::TransferSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/aspera/fasp/transfer_spec.rb

Overview

parameters for Transfer Spec

Constant Summary collapse

ACCESS_KEY_TRANSFER_USER =

default transfer username for access key based transfers

'xfer'
SSH_PORT =
33_001
UDP_PORT =
33_001
AK_TSPEC_BASE =
{
  'remote_user' => ACCESS_KEY_TRANSFER_USER,
  'ssh_port'    => SSH_PORT,
  'fasp_port'   => UDP_PORT
}.freeze
TAG_RESERVED =

reserved tag for Aspera

'aspera'

Class Method Summary collapse

Class Method Details

.action(tspec) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/aspera/fasp/transfer_spec.rb', line 39

def action(tspec)
  raise 'transfer spec must be a Hash' unless tspec.is_a?(Hash)
  return case tspec['direction']
         when DIRECTION_SEND then :upload
         when DIRECTION_RECEIVE then :download
         else raise 'Error: upload or download only'
         end
end

.action_to_direction(tspec, command) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/aspera/fasp/transfer_spec.rb', line 29

def action_to_direction(tspec, command)
  raise 'transfer spec must be a Hash' unless tspec.is_a?(Hash)
  tspec['direction'] = case command.to_sym
  when :upload then DIRECTION_SEND
  when :download then DIRECTION_RECEIVE
  else raise 'Error: upload or download only'
  end
  return tspec
end