-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from fluent/support-fluentd-v1-revive
Support Fluentd v1 * Rewrite models * Depend on fluent-plugins to fetch plugins config definitions * Construct owned plugins(parser, formatter, buffer, storage) form dynamicaly * Use custom FormBuilder to construct form for plugin configuration * Add models for parser, formatter, buffer, storage plugins * Rewrite in_tail configuration wizard
- Loading branch information
Showing
114 changed files
with
2,998 additions
and
1,363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
class Api::ConfigDefinitionsController < ApplicationController | ||
before_action :login_required | ||
|
||
def index | ||
name = params[:name] | ||
type = params[:type] | ||
prefix = case type | ||
when "input" | ||
"in" | ||
when "output" | ||
"out" | ||
when "filter" | ||
"filter" | ||
when "parse" | ||
"parser" | ||
when "format" | ||
"formatter" | ||
when "parser", "formatter", "buffer", "storage" | ||
type | ||
end | ||
|
||
target_class = Fluentd::Setting.const_get("#{prefix}_#{name}".classify) | ||
target = target_class.new | ||
|
||
common_options = target.common_options.map do |key| | ||
h = { | ||
name: key, | ||
type: target.column_type(key), | ||
desc: target.desc(key), | ||
default: target.default(key) | ||
} | ||
h[:list] = target.list_of(key) if target.column_type(key) == :enum | ||
h | ||
end | ||
|
||
advanced_options = target.advanced_options.map do |key| | ||
h = { | ||
name: key, | ||
type: target.column_type(key), | ||
desc: target.desc(key), | ||
default: target.default(key) | ||
} | ||
h[:list] = target.list_of(key) if target.column_type(key) == :enum | ||
h | ||
end | ||
|
||
options = { | ||
type: type, | ||
name: name, | ||
commonOptions: common_options, | ||
advancedOptions: advanced_options | ||
} | ||
render json: options | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Fluentd::Settings::OutTdlogController < ApplicationController | ||
include SettingConcern | ||
|
||
private | ||
|
||
def target_class | ||
Fluentd::Setting::OutTdlog | ||
end | ||
end |
Oops, something went wrong.