Class: Wakame::Cli::Subcommand::PropagateService

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



460
461
462
463
464
465
466
467
468
469
470
# File 'lib/wakame/runner/administrator_command.rb', line 460

def parse(args)
  @params = {}
  create_parser(args) {|opts|
    opts.banner = 'Usage: propagate_service [options] "Service ID"'
    opts.separator('Options:')
    opts.on('-h CLOUD_HOST_ID', '--host CLOUD_HOST_ID', String, "Cloud Host ID to be used as template."){ |i| @params["cloud_host_id"] = i }
    opts.on('-n NUMBER', '--number NUMBER', Integer, "Number (>0) to propagate the specified service."){ |i| @params["number"] = i.to_i }
  }
  raise "Unknown Service ID: #{args}" unless args.size > 0
  @params[:service_id] = args.shift
end

#run(requester) ⇒ Object



472
473
474
# File 'lib/wakame/runner/administrator_command.rb', line 472

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