Class: Fluent::BacklogOutput
- Inherits:
-
BufferedOutput
- Object
- BufferedOutput
- Fluent::BacklogOutput
- Defined in:
- lib/fluent/plugin/out_backlog_create.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #format(tag, time, record) ⇒ Object
-
#initialize ⇒ BacklogOutput
constructor
A new instance of BacklogOutput.
- #shutdown ⇒ Object
- #start ⇒ Object
- #write(chunk) ⇒ Object
Constructor Details
#initialize ⇒ BacklogOutput
Returns a new instance of BacklogOutput.
16 17 18 19 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 16 def initialize super require 'xmlrpc/client' end |
Instance Method Details
#configure(conf) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 21 def configure(conf) super @server = XMLRPC::Client.new2("https://#{@user}:#{@password}@#{@space}.backlog.jp/XML-RPC") @summary_keys = @summary_keys.split(',') if @description_keys @description_keys = @description_keys.split(',') end end |
#format(tag, time, record) ⇒ Object
38 39 40 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 38 def format(tag, time, record) [tag, time, record].to_msgpack end |
#shutdown ⇒ Object
34 35 36 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 34 def shutdown super end |
#start ⇒ Object
30 31 32 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 30 def start super end |
#write(chunk) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fluent/plugin/out_backlog_create.rb', line 42 def write(chunk) chunk.msgpack_each do |tag, time, record| summary = @summary_template % @summary_keys.map { |key| record[key] } args = { projectId: @project_id, summary: summary } if @description_template description = @description_template % @description_keys.map { |key| record[key] } args[:description] = description end args[:component] = @component if @component @server.call('backlog.createIssue', args) end end |