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

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

Constant Summary collapse

ACTIONS =
%i[entitlement].freeze

Constants inherited from Aspera::Cli::Plugin

Aspera::Cli::Plugin::ALL_OPS, Aspera::Cli::Plugin::GLOBAL_OPS, Aspera::Cli::Plugin::INIT_PARAMS, Aspera::Cli::Plugin::INSTANCE_OPS, Aspera::Cli::Plugin::MAX_ITEMS, Aspera::Cli::Plugin::MAX_PAGES, Aspera::Cli::Plugin::REGEX_LOOKUP_ID_BY_FIELD

Instance Method Summary collapse

Methods inherited from BasicAuthPlugin

#basic_auth_api, #basic_auth_params, declare_options, #initialize

Methods inherited from Aspera::Cli::Plugin

declare_generic_options, #do_bulk_operation, #entity_action, #entity_command, #init_params, #initialize, #instance_identifier, #old_query_read_delete, #query_option, #query_read_delete, #value_create_modify

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 = options.get_next_command(ACTIONS)
  case command
  when :entitlement
    entitlement_id = options.get_option(:username, mandatory: true)
    customer_id = options.get_option(:password, mandatory: true)
    api_metering = Api::AoC.metering_api(entitlement_id, customer_id)
    return {type: :single_object, data: api_metering.read('entitlement')[:data]}
  end
end