Sha256: d00f8665d8375d314a52a836a0c8e4a19dda418ef34adf95f438e8a08ee8e79a

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents




WebAdminApp.get '/api/commands/list.?:format?' do
  log = get_logger
  format = (params[:format])? format_by_extensions(params[:format]) : format_by_extensions('json')
  log.call "api : commands, verb : GET, route : list, format : #{format}"
  obj =  splash_return case: :quiet_exit, :more => "Commands list"
  obj[:data] = get_config.commands
  content_type format
  format_response(obj, (params[:format])? format_by_extensions(params[:format]): request.accept.first)
  end

WebAdminApp.get '/api/commands/show/:name.?:format?' do
  log = get_logger
  format = (params[:format])? format_by_extensions(params[:format]) : format_by_extensions('json')
  log.call "api : commands, verb : GET, route : show, item : #{params[:name]} , format : #{format}"
  commands_recordset = get_config.commands[params[:name].to_sym]
  unless commands_recordset.nil? then
    obj = splash_return case: :quiet_exit
    obj[:data] = commands_recordset
  else
    obj = splash_return case: :not_found, :more => "Command not configured"
  end
  content_type format
  format_response(obj, (params[:format])? format_by_extensions(params[:format]): request.accept.first)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
prometheus-splash-0.8.1 lib/splash/webadmin/api/routes/commands.rb
prometheus-splash-0.8.0 lib/splash/webadmin/api/routes/commands.rb
prometheus-splash-0.7.0 lib/splash/webadmin/api/routes/commands.rb
prometheus-splash-0.6.1 lib/splash/webadmin/api/routes/commands.rb
prometheus-splash-0.6.0 lib/splash/webadmin/api/routes/commands.rb