fluent-plugin-gcloud-pubsub-custom 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc9dc8d4003d063cc4e918c37dbda0ff9d5386be
|
4
|
+
data.tar.gz: b2fe919a6ef18270fb4641302318c9a7c60a6b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f788632c81919ef4345813cffbab25299440047e8c4c0b47a1804d3c511fdd1f92b61b8e6f6caaef3d4a69bbfafd2da23e50ff640db94abb2dd1157cf641331d
|
7
|
+
data.tar.gz: 64494f35d1b8521982a12accc8ff95b52c5f5ed3718db0fe81a5e783751a72f6393d1d7ef328fa95c800812734d5f211ceab9bc28c93a6546ab9c99edd5a976d
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.license = "MIT"
|
8
8
|
gem.homepage = "https://github.com/mia-0032/fluent-plugin-gcloud-pubsub-custom"
|
9
9
|
gem.summary = gem.description
|
10
|
-
gem.version = "0.4.
|
10
|
+
gem.version = "0.4.3"
|
11
11
|
gem.authors = ["Yoshihiro MIYAI"]
|
12
12
|
gem.email = "msparrow17@gmail.com"
|
13
13
|
gem.has_rdoc = false
|
@@ -92,15 +92,18 @@ module Fluent
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def process(req, res)
|
95
|
+
ret = {'ok' => true}
|
95
96
|
case req.path_info
|
96
97
|
when '/stop'
|
97
98
|
@plugin.stop_pull
|
98
99
|
when '/start'
|
99
100
|
@plugin.start_pull
|
101
|
+
when '/status'
|
102
|
+
ret['status'] = @plugin.status_of_pull
|
100
103
|
else
|
101
104
|
raise Error.new "Invalid path_info: #{req.path_info}"
|
102
105
|
end
|
103
|
-
render_json(200,
|
106
|
+
render_json(200, ret)
|
104
107
|
end
|
105
108
|
end
|
106
109
|
|
@@ -159,6 +162,10 @@ module Fluent
|
|
159
162
|
log.info "start pull from subscription:#{@subscription}"
|
160
163
|
end
|
161
164
|
|
165
|
+
def status_of_pull
|
166
|
+
@stop_pull ? 'stopped' : 'started'
|
167
|
+
end
|
168
|
+
|
162
169
|
private
|
163
170
|
|
164
171
|
def static_tag(record)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'json'
|
2
3
|
|
3
4
|
require_relative "../test_helper"
|
4
5
|
|
@@ -355,5 +356,26 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
|
|
355
356
|
assert_equal({"foo" => "bar"}, record)
|
356
357
|
end
|
357
358
|
end
|
359
|
+
|
360
|
+
test 'get status by http rpc when started' do
|
361
|
+
d = create_driver("#{CONFIG}\npull_interval 1.0\nenable_rpc true")
|
362
|
+
assert_equal(false, d.instance.instance_variable_get(:@stop_pull))
|
363
|
+
|
364
|
+
d.run {
|
365
|
+
res = http_get('/api/in_gcloud_pubsub/pull/status')
|
366
|
+
assert_equal({"ok" => true, "status" => "started"}, JSON.parse(res.body))
|
367
|
+
}
|
368
|
+
end
|
369
|
+
|
370
|
+
test 'get status by http rpc when stopped' do
|
371
|
+
d = create_driver("#{CONFIG}\npull_interval 1.0\nenable_rpc true")
|
372
|
+
d.instance.stop_pull
|
373
|
+
assert_equal(true, d.instance.instance_variable_get(:@stop_pull))
|
374
|
+
|
375
|
+
d.run {
|
376
|
+
res = http_get('/api/in_gcloud_pubsub/pull/status')
|
377
|
+
assert_equal({"ok" => true, "status" => "stopped"}, JSON.parse(res.body))
|
378
|
+
}
|
379
|
+
end
|
358
380
|
end
|
359
381
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-gcloud-pubsub-custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshihiro MIYAI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|