kapacitor-ruby 1.0.6 → 1.0.7
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 +20 -21
- 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: 4855f87f3ec102488bb9c853b8f7a9d1d9e161d759ec62617859a784b8b521ac
|
4
|
+
data.tar.gz: a7875fdb26ce45b801297caec2ebc17946a6b8e1932f07c11e73fced251e03cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a7c13869776805389686060b8e3a47abda670b81d1adf2c8ff2690774af85d61dda6cf83c3ad35fb21f286b37f01d62c668253403e7c45d405dc76148f196c8
|
7
|
+
data.tar.gz: 321f5d4263ae5ec53fde9bb28ea158a4881967643e0071edaee2778ac37485cdf5db72de58503c6659fe06da362786a6f5d1cc667726e21bcac6708053502780
|
data/lib/kapacitor/client.rb
CHANGED
@@ -188,20 +188,17 @@ module Kapacitor
|
|
188
188
|
#
|
189
189
|
# @param id [String] Handler ID
|
190
190
|
# @param topic [String] Topic name
|
191
|
-
# @param
|
191
|
+
# @param kind [String] Kind of handler
|
192
|
+
# @param match [String] Lambda expression
|
193
|
+
# @param options [Hash] Handler options
|
192
194
|
#
|
193
|
-
def define_topic_handler(id:, topic:,
|
194
|
-
req = {
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
actions.each do |action|
|
201
|
-
raise ArgumentError, "Missing required kind attribute for action #{action}"
|
202
|
-
end
|
203
|
-
|
204
|
-
req['actions'] = actions
|
195
|
+
def define_topic_handler(id:, topic:, kind:, match: nil, options: {})
|
196
|
+
req = {
|
197
|
+
'id': id,
|
198
|
+
'kind': kind
|
199
|
+
}
|
200
|
+
req['match'] = match unless match.nil?
|
201
|
+
req['options'] = options
|
205
202
|
api_post(endpoint: "alerts/topics/#{topic}/handlers", data: req)
|
206
203
|
end
|
207
204
|
|
@@ -209,15 +206,17 @@ module Kapacitor
|
|
209
206
|
#
|
210
207
|
# @param id [String] Handler ID
|
211
208
|
# @param topic [String] Topic name
|
212
|
-
# @param
|
209
|
+
# @param kind [String] Kind of handler
|
210
|
+
# @param match [String] Lambda expression
|
211
|
+
# @param options [Hash] Handler options
|
213
212
|
#
|
214
|
-
def update_topic_handler(id:, topic:,
|
215
|
-
req = {
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
req['
|
213
|
+
def update_topic_handler(id:, topic:, kind:, match: nil, options: {})
|
214
|
+
req = {
|
215
|
+
'id': id,
|
216
|
+
'kind': kind
|
217
|
+
}
|
218
|
+
req['match'] = match unless match.nil?
|
219
|
+
req['options'] = options
|
221
220
|
api_put(endpoint: "alerts/topics/#{topic}/handlers/#{id}", data: req) unless req.empty?
|
222
221
|
end
|
223
222
|
|
data/lib/kapacitor/version.rb
CHANGED