Class: Wakame::Cli::Subcommand::ControlService

Inherits:
Object
  • Object
show all
Includes:
Wakame::Cli::Subcommand
Defined in:
lib/wakame/runner/administrator_command.rb

Instance Method Summary collapse

Methods included from Wakame::Cli::Subcommand

#create_parser, included, #print_result

Instance Method Details

#parse(args) ⇒ Object



867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
# File 'lib/wakame/runner/administrator_command.rb', line 867

def parse(args)
  @params = {}
  create_parser(args) {|opts|
    opts.banner = 'Usage: control_service [options] "Resource Name" "Service ID" "Number"'
    opts.separator('Options:')
  }

  raise "Unknown Resource Name: #{args}" unless args.size > 0
  @params["resource"] = args.shift

  raise "Unknown Service ID: #{args}" unless args.size > 0
  @params[:service_id] = args.shift

  raise "Unknown Number: #{args}" unless args.size > 0
  @params[:number] = args.shift.to_i
end

#run(requester) ⇒ Object



884
885
886
# File 'lib/wakame/runner/administrator_command.rb', line 884

def run(requester)
  requester.request(@params)
end