Sha256: d7eeccd861675f0db435918860ca0d5562434064350469875c371f012f99c367
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
Contents
require "logstash/api/app_helpers" require "logstash/api/command_factory" module LogStash module Api module Modules class Base < ::Sinatra::Base helpers AppHelpers # These options never change # Sinatra isn't good at letting you change internal settings at runtime # which is a requirement. We always propagate errors up and catch them # in a custom rack handler in the RackApp class set :environment, :production set :raise_errors, true set :show_exceptions, false attr_reader :factory include LogStash::Util::Loggable helpers AppHelpers def initialize(app=nil, agent) super(app) @factory = ::LogStash::Api::CommandFactory.new(LogStash::Api::Service.new(agent)) end not_found do status 404 as = params.has_key?("human") ? :string : :json text = as == :string ? "" : {} respond_with(text, :as => as) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
logstash-core-5.0.0.alpha4.snapshot3-java | lib/logstash/api/modules/base.rb |
logstash-core-5.0.0.alpha4.snapshot2-java | lib/logstash/api/modules/base.rb |