fluke/devops-client/lib/devops-client/handler/bootstrap_templates.rb
2015-04-14 16:29:02 +04:00

30 lines
622 B
Ruby

require "devops-client/handler/handler"
require "devops-client/options/bootstrap_templates_options"
require "json"
require "devops-client/output/bootstrap_templates"
class BootstrapTemplates < Handler
output_with Output::BootstrapTemplates
def initialize(host, def_options={})
@host, @options = host, def_options
@options_parser = BootstrapTemplatesOptions.new(ARGV, def_options)
end
def handle
case ARGV[1]
when "list"
@options, @args = @options_parser.parse_options_for!(:list)
list_handler
output
end
end
def list_handler
@list = get("/templates")
end
end