Sha256: 80d841c53dee67b7189ad95c23abcc68e91ae570c2032b48e6e3c94a0d198884

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents




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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prometheus-splash-0.9.1 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.9.0 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.8.6 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.8.5 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.8.4 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.8.3 lib/splash/webadmin/api/routes/sequences.rb
prometheus-splash-0.8.2 lib/splash/webadmin/api/routes/sequences.rb