mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
parent
4c38288d31
commit
6268e063e3
2 changed files with 33 additions and 1 deletions
|
@ -104,7 +104,7 @@ module LogStash
|
||||||
"/_node" => LogStash::Api::Modules::Node,
|
"/_node" => LogStash::Api::Modules::Node,
|
||||||
"/_stats" => LogStash::Api::Modules::Stats,
|
"/_stats" => LogStash::Api::Modules::Stats,
|
||||||
"/_node/stats" => LogStash::Api::Modules::NodeStats,
|
"/_node/stats" => LogStash::Api::Modules::NodeStats,
|
||||||
"/_plugins" => LogStash::Api::Modules::Plugins
|
"/_node/plugins" => LogStash::Api::Modules::Plugins
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
32
logstash-core/spec/api/lib/api/node_plugins_spec.rb
Normal file
32
logstash-core/spec/api/lib/api/node_plugins_spec.rb
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
require_relative "../../spec_helper"
|
||||||
|
require "sinatra"
|
||||||
|
require "logstash/api/modules/plugins"
|
||||||
|
require "logstash/json"
|
||||||
|
|
||||||
|
describe LogStash::Api::Modules::Plugins do
|
||||||
|
include_context "api setup"
|
||||||
|
|
||||||
|
extend ResourceDSLMethods
|
||||||
|
|
||||||
|
before(:all) do
|
||||||
|
do_request { get "/" }
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:payload) { LogStash::Json.load(last_response.body) }
|
||||||
|
|
||||||
|
describe "retrieving plugins" do
|
||||||
|
it "should return OK" do
|
||||||
|
expect(last_response).to be_ok
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should return a list of plugins" do
|
||||||
|
expect(payload["plugins"]).to be_a(Array)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should return the total number of plugins" do
|
||||||
|
expect(payload["total"]).to be_a(Numeric)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue