Class: Wakame::Cli::Subcommand::ShutdownVm

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



647
648
649
650
651
652
653
654
655
656
657
# File 'lib/wakame/runner/administrator_command.rb', line 647

def parse(args)
  @params = {}
  cmd = create_parser(args) {|opts|
    opts.banner = "Usage: shutdown_vm [options] \"Agent ID\""
    opts.separator ""
    opts.separator "options:"
    opts.on("-f", "--force"){|str| @params[:force] = "yes"}
  }
  agent_id = args.shift || abort("[ERROR]: Agent ID was not given")
  @params[:agent_id] = agent_id
end

#run(requester) ⇒ Object



659
660
661
# File 'lib/wakame/runner/administrator_command.rb', line 659

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