mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 10:56:11 +02:00
Remove Fluentd::Api
This commit is contained in:
parent
be84f285cc
commit
8f0086abb5
@ -73,14 +73,6 @@ class Fluentd
|
||||
end
|
||||
end
|
||||
|
||||
def api
|
||||
Api::Http.new(api_endpoint)
|
||||
end
|
||||
|
||||
def api_endpoint
|
||||
# TODO: autodetect from parsed configuration, but unused for now
|
||||
end
|
||||
|
||||
def label
|
||||
"fluentd" # NOTE: for multiple fluentd management, but only single fluentd manage now
|
||||
end
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
require "fluentd/api/http"
|
||||
|
||||
class Fluentd
|
||||
class Api
|
||||
end
|
||||
end
|
||||
@ -1,26 +0,0 @@
|
||||
require "httpclient"
|
||||
require "addressable/uri"
|
||||
|
||||
class Fluentd
|
||||
class Api
|
||||
class Http
|
||||
def initialize(endpoint)
|
||||
@endpoint = Addressable::URI.parse(endpoint)
|
||||
end
|
||||
|
||||
def config
|
||||
request("/api/config.json")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request(path)
|
||||
uri = @endpoint.dup
|
||||
uri.path = path
|
||||
res = HTTPClient.get(uri)
|
||||
JSON.parse res.body
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user