Class: Wakame::Cli::Subcommand::PropagateResource

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



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/wakame/runner/administrator_command.rb', line 578

def parse(args)
  @params = {}
  create_parser(args) {|opts|
    opts.banner = 'Usage: propagate_resource [options] "Resource Name" "Cloud Host ID"'
    opts.separator("  Resource Name: ....")
    opts.separator("  Cloud Host ID: ....")
    opts.separator("  ")
    opts.separator("  Options:")
    opts.on("-n NUMBER", "--number NUMBER", Integer, "Number (>0) to propagate the specified resource."){|i| @params["number"] = i}
  }
  raise "Unknown Resource Name: #{args}" unless args.size > 0
  @params["resource"] = args.shift

  raise "Unknown Cloud Host ID: #{args}" unless args.size > 0
  @params["cloud_host_id"] = args.shift
end

#run(requester) ⇒ Object



595
596
597
# File 'lib/wakame/runner/administrator_command.rb', line 595

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