Sha256: e3669b9825076a5aea18e38d8d7bdf95eb90a7cfcbfca908c4b731e9e6cb39d8

Contents?: true

Size: 866 Bytes

Versions: 7

Compression:

Stored size: 866 Bytes

Contents

class Fluentd::Settings::OutS3Controller < ApplicationController
  before_action :login_required
  before_action :find_fluentd

  def show
    @setting = Fluentd::Setting::OutS3.new({
      s3_endpoint: "s3-us-west-1.amazonaws.com",
      output_tag: true,
      output_time: true,
      use_ssl: true,
    })
  end

  def finish
    @setting = Fluentd::Setting::OutS3.new(setting_params)
    unless @setting.valid?
      return render "show"
    end

    @fluentd.agent.config_append @setting.to_config
    if @fluentd.agent.running?
      unless @fluentd.agent.restart
        @setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
        return render "show"
      end
    end
    redirect_to daemon_setting_path(@fluentd)
  end

  private

  def setting_params
    params.require(:fluentd_setting_out_s3).permit(*Fluentd::Setting::OutS3::KEYS)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fluentd-ui-0.3.0 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.2.0 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.1.4 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.1.3 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.1.2 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.1.1 app/controllers/fluentd/settings/out_s3_controller.rb
fluentd-ui-0.1.0 app/controllers/fluentd/settings/out_s3_controller.rb