Class: Aspera::Cli::Plugins::Alee

Inherits:
BasicAuthPlugin show all
Defined in:
lib/aspera/cli/plugins/alee.rb

Constant Summary collapse

ACTIONS =
[ :entitlement ]

Constants inherited from Aspera::Cli::Plugin

Aspera::Cli::Plugin::ALL_OPS, Aspera::Cli::Plugin::GLOBAL_OPS, Aspera::Cli::Plugin::INSTANCE_OPS

Instance Method Summary collapse

Methods inherited from BasicAuthPlugin

#basic_auth_api, #initialize

Methods inherited from Aspera::Cli::Plugin

#config, #entity_action, #entity_command, #format, #initialize, #options, #transfer

Constructor Details

This class inherits a constructor from Aspera::Cli::BasicAuthPlugin

Instance Method Details

#execute_actionObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/aspera/cli/plugins/alee.rb', line 11

def execute_action
  command=self.options.get_next_command(ACTIONS)
  case command
  when :entitlement
    entitlement_id = self.options.get_option(:username,:mandatory),
    customer_id = self.options.get_option(:password,:mandatory)
    api_metering=AoC.metering_api(entitlement_id,customer_id)
    return {:type=>:single_object, :data=>api_metering.read('entitlement')[:data]}
  end
end