kapacitor-ruby 1.0.5 → 1.0.6
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 +4 -4
- data/lib/kapacitor/client.rb +6 -6
- data/lib/kapacitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 821ace263cd605e3233f42c76b01ff93c8d9a2bd08764634d843183296eef674
|
4
|
+
data.tar.gz: ce299b58d8e2d5eb1efc792c36a6a101fb3504773e4b610fc8ea91457369936b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab76b9f3b5dd49d919f7b38422c68f5d2ae286694584dbaa53dd1e2b7e72fc088022a78b996c8106846f9047985f23776bf18f3d4c7b53456bf3d7f606b58181
|
7
|
+
data.tar.gz: 509abc65bc1104000e58cc8871e36d8557055db8b937a09c90d19f35f3c6cdb67ce6ae469d1847bf35aba2dee371b7c36f4d2c09372ed24cbf7dfd81de585979
|
data/lib/kapacitor/client.rb
CHANGED
@@ -66,7 +66,7 @@ module Kapacitor
|
|
66
66
|
# @return [List[String]] List of topics
|
67
67
|
#
|
68
68
|
def topics()
|
69
|
-
res = api_get(endpoint: "alerts/topics")
|
69
|
+
res = api_get(endpoint: "alerts/topics")
|
70
70
|
return res['topics'].map { |v| v['id'] }
|
71
71
|
end
|
72
72
|
|
@@ -250,7 +250,7 @@ private
|
|
250
250
|
begin
|
251
251
|
resp = self.http.get([self.url, endpoint].join('/'), query, {'Content-type' => 'application/json', 'Accept' => 'application/json'})
|
252
252
|
begin
|
253
|
-
data = JSON.parse(resp.body) unless resp.body.
|
253
|
+
data = JSON.parse(resp.body) unless resp.body.empty?
|
254
254
|
rescue JSON::ParserError
|
255
255
|
raise Exception, "Failed to decode response message"
|
256
256
|
end
|
@@ -274,7 +274,7 @@ private
|
|
274
274
|
begin
|
275
275
|
resp = self.http.post([self.url, endpoint].join('/'), data.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})
|
276
276
|
begin
|
277
|
-
data = JSON.parse(resp.body) unless resp.body.
|
277
|
+
data = JSON.parse(resp.body) unless resp.body.empty?
|
278
278
|
rescue JSON::ParserError
|
279
279
|
raise Exception, "Failed to decode response message"
|
280
280
|
end
|
@@ -297,7 +297,7 @@ private
|
|
297
297
|
begin
|
298
298
|
resp = self.http.delete([self.url, endpoint].join('/'), {'Content-type' => 'application/json', 'Accept' => 'application/json'})
|
299
299
|
begin
|
300
|
-
data = JSON.parse(resp.body) unless resp.body.
|
300
|
+
data = JSON.parse(resp.body) unless resp.body.empty?
|
301
301
|
rescue JSON::ParserError
|
302
302
|
raise Exception, "Failed to decode response message"
|
303
303
|
end
|
@@ -321,7 +321,7 @@ private
|
|
321
321
|
begin
|
322
322
|
resp = self.http.patch([self.url, endpoint].join('/'), data.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})
|
323
323
|
begin
|
324
|
-
data = JSON.parse(resp.body) unless resp.body.
|
324
|
+
data = JSON.parse(resp.body) unless resp.body.empty?
|
325
325
|
rescue JSON::ParserError
|
326
326
|
raise Exception, "Failed to decode response message"
|
327
327
|
end
|
@@ -345,7 +345,7 @@ private
|
|
345
345
|
begin
|
346
346
|
resp = self.http.put([self.url, endpoint].join('/'), data.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})
|
347
347
|
begin
|
348
|
-
data = JSON.parse(resp.body) unless resp.body.
|
348
|
+
data = JSON.parse(resp.body) unless resp.body.empty?
|
349
349
|
rescue JSON::ParserError
|
350
350
|
raise Exception, "Failed to decode response message"
|
351
351
|
end
|
data/lib/kapacitor/version.rb
CHANGED