fluent-plugin-lambda 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 952e6510f51593e371e8a325ff06aa0816b283b1
4
- data.tar.gz: 4c0ea87380ce8c827492c4c70fd3923d7c928bd0
3
+ metadata.gz: a79d46bba15a5ee2e5eeed7aeb214e3d3040eb89
4
+ data.tar.gz: 19f67bc95dda317f6a4ece5ebc8df62beb0cb974
5
5
  SHA512:
6
- metadata.gz: eb2be51136d48e86c88e03e5971a9e400e4982ef5c7c7d1472bdf0613b7f4e1da8868ffa02ef5609cbfa828650c13768685b721bc97ac3e1e573bd33b52c4500
7
- data.tar.gz: dc6d903d4c4287a4ae6398b1018a5bfe033996c4fad12fe30785b937b3801fe44309f51ec16aba57aeaf62396f176bb86a9564e16dc66611e6bb81f9e9650ebe
6
+ metadata.gz: ee1e82399f2004d29a3298acdb528d703d8f8b0413132de671dd0a19925a01b474a30430a34a7819c444bc3f7d0eca902ed5dcdcd5f07751e58d7d925463b948
7
+ data.tar.gz: 61aee9a29dcae8e315b639f540df7b4d7679842895a4742b744d6c7d566b8714187b9fe6793d855a4d67ab6b2f557d6b6eb07dead83a8931300f6186fb6e7ed8
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ fluent.cnf
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = 'fluent-plugin-lambda'
4
- spec.version = '0.1.0'
4
+ spec.version = '0.2.0'
5
5
  spec.authors = ['Genki Sugawara']
6
6
  spec.email = ['sugawara@cookpad.com']
7
7
  spec.description = %q{Output plugin for AWS Lambda.}
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.require_paths = ['lib']
15
15
 
16
16
  spec.add_dependency 'fluentd'
17
- spec.add_dependency 'aws-sdk-core', '~> 2.0.9'
17
+ spec.add_dependency 'aws-sdk-core', '~> 2.1'
18
18
  spec.add_development_dependency 'bundler'
19
19
  spec.add_development_dependency 'rake'
20
20
  spec.add_development_dependency 'rspec', '>= 3.0.0'
data/fluent.conf ADDED
@@ -0,0 +1,10 @@
1
+ <source>
2
+ @type forward
3
+ @id forward_input
4
+ </source>
5
+
6
+ <match lambda.**>
7
+ type lambda
8
+
9
+ function_name test
10
+ </match>
@@ -68,9 +68,10 @@ class Fluent::LambdaOutput < Fluent::BufferedOutput
68
68
  }.each {|tag, time, record|
69
69
  func_name = @function_name || record['function_name']
70
70
 
71
- @client.invoke_async(
71
+ @client.invoke(
72
72
  :function_name => func_name,
73
- :invoke_args => JSON.dump(record),
73
+ :payload => JSON.dump(record),
74
+ :invocation_type => 'Event',
74
75
  )
75
76
  }
76
77
  end
@@ -4,16 +4,18 @@ describe Fluent::LambdaOutput do
4
4
  }
5
5
 
6
6
  context 'when events is sent' do
7
- it 'should be call invoke_async' do
7
+ it 'should be call invoke' do
8
8
  run_driver(function_name: 'my_func') do |d, client|
9
- expect(client).to receive(:invoke_async).with(
9
+ expect(client).to receive(:invoke).with(
10
10
  function_name: 'my_func',
11
- invoke_args: JSON.dump('key1' => 'foo' , 'key2' => 100),
11
+ payload: JSON.dump('key1' => 'foo', 'key2' => 100),
12
+ invocation_type: 'Event',
12
13
  )
13
14
 
14
- expect(client).to receive(:invoke_async).with(
15
+ expect(client).to receive(:invoke).with(
15
16
  function_name: 'my_func',
16
- invoke_args: JSON.dump('key1' => 'bar' , 'key2' => 200),
17
+ payload: JSON.dump('key1' => 'bar', 'key2' => 200),
18
+ invocation_type: 'Event',
17
19
  )
18
20
 
19
21
  d.emit({'key1' => 'foo', 'key2' => 100}, time)
@@ -23,16 +25,18 @@ describe Fluent::LambdaOutput do
23
25
  end
24
26
 
25
27
  context 'when events is sent with function_name' do
26
- it 'should be call invoke_async' do
28
+ it 'should be call invoke' do
27
29
  run_driver do |d, client|
28
- expect(client).to receive(:invoke_async).with(
30
+ expect(client).to receive(:invoke).with(
29
31
  function_name: 'my_func1',
30
- invoke_args: JSON.dump('function_name' => 'my_func1', 'key1' => 'foo' , 'key2' => 100),
32
+ payload: JSON.dump('function_name' => 'my_func1', 'key1' => 'foo' , 'key2' => 100),
33
+ invocation_type: 'Event',
31
34
  )
32
35
 
33
- expect(client).to receive(:invoke_async).with(
36
+ expect(client).to receive(:invoke).with(
34
37
  function_name: 'my_func2',
35
- invoke_args: JSON.dump('function_name' => 'my_func2', 'key1' => 'bar' , 'key2' => 200),
38
+ payload: JSON.dump('function_name' => 'my_func2', 'key1' => 'bar' , 'key2' => 200),
39
+ invocation_type: 'Event',
36
40
  )
37
41
 
38
42
  d.emit({'function_name' => 'my_func1', 'key1' => 'foo', 'key2' => 100}, time)
@@ -44,7 +48,7 @@ describe Fluent::LambdaOutput do
44
48
  context 'when events is sent without function_name' do
45
49
  it 'should be warned' do
46
50
  run_driver do |d, client|
47
- expect(client).to_not receive(:invoke_async)
51
+ expect(client).to_not receive(:invoke)
48
52
 
49
53
  d.emit({'key1' => 'foo', 'key2' => 100}, time)
50
54
  d.emit({'key1' => 'bar', 'key2' => 200}, time)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-lambda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-24 00:00:00.000000000 Z
11
+ date: 2015-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.9
33
+ version: '2.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.9
40
+ version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +95,7 @@ files:
95
95
  - README.md
96
96
  - Rakefile
97
97
  - fluent-plugin-lambda.gemspec
98
+ - fluent.conf
98
99
  - lib/fluent/plugin/out_lambda.rb
99
100
  - spec/out_lambda_spec.rb
100
101
  - spec/spec_helper.rb