Skip to content

Commit dbea951

Browse files
cachedoutycombinator
authored andcommitted
Add options to pipelines/
Fixes #10561
1 parent 592591b commit dbea951

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

logstash-core/lib/logstash/api/commands/node.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def all(selected_fields=[])
1717
payload
1818
end
1919

20-
def pipelines
20+
def pipelines(options={})
2121
pipeline_ids = service.get_shallow(:stats, :pipelines).keys
2222
pipeline_ids.each_with_object({}) do |pipeline_id, result|
23-
result[pipeline_id] = pipeline(pipeline_id)
23+
result[pipeline_id] = pipeline(pipeline_id, options)
2424
end
2525
end
2626

logstash-core/lib/logstash/api/modules/node.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ def node
3434
respond_with(:pipelines => { pipeline_id => payload } )
3535
end
3636

37+
get "/pipelines" do
38+
opts = {:graph => as_boolean(params.fetch("graph", false))}
39+
payload = node.pipelines(opts)
40+
halt(404) if payload.empty?
41+
respond_with(:pipelines => payload )
42+
end
43+
3744
get "/?:filter?" do
3845
selected_fields = extract_fields(params["filter"].to_s.strip)
3946
values = node.all(selected_fields)

0 commit comments

Comments
 (0)