Class: Aspera::Transfer::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/aspera/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
TRANSPORT_FIELDS =

fields for transport

%w[remote_host remote_user ssh_port fasp_port wss_enabled wss_port].freeze
TAG_RESERVED =

reserved tag for Aspera

'aspera'
DESCRIPTION =
CommandLineBuilder.normalize_description(YAML.load_file("#{__FILE__[0..-3]}yaml"))

Class Method Summary collapse

Class Method Details

.direction_to_transfer_type(direction) ⇒ Object

translate send/receive to upload/download



35
36
37
38
39
40
41
# File 'lib/aspera/transfer/spec.rb', line 35

def direction_to_transfer_type(direction)
  case direction
  when DIRECTION_SEND then :upload
  when DIRECTION_RECEIVE then :download
  else Aspera.error_unexpected_value(direction)
  end
end

.transfer_type_to_direction(transfer_type) ⇒ Object

translate upload/download to send/receive



26
27
28
29
30
31
32
# File 'lib/aspera/transfer/spec.rb', line 26

def transfer_type_to_direction(transfer_type)
  case transfer_type.to_sym
  when :upload then DIRECTION_SEND
  when :download then DIRECTION_RECEIVE
  else Aspera.error_unexpected_value(transfer_type.to_sym)
  end
end