kapacitor-ruby 1.0.7 → 1.0.8
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 +9 -3
- data/lib/kapacitor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b992f75fe340aaeb410f88845f8b0cf22f404a68f2407920450aeb8f81a749cc
|
4
|
+
data.tar.gz: 0f86926ff9b4354aa26f34cb82dbdcc48678dd9cf89f7b3a7b4161573d0b1265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5766810cf37cf0f73c05085e5dc0e2698f2439a48b065a8c78b0dd1516ea08d5597cfd5ddc8b266f56ee175f0627ac7667f3fa9ac2b515406efb7343862cbc6d
|
7
|
+
data.tar.gz: e2e22bb48e84baf6803fa099364991221fb5f0c1d4746a38811d9fc88e208c98b6ba312eb226f27b5a4f4011580da787bb9885ddca86f43202affd92f77de6b5
|
data/lib/kapacitor/client.rb
CHANGED
@@ -139,7 +139,7 @@ module Kapacitor
|
|
139
139
|
req['type'] = opts[:type] if opts[:type]
|
140
140
|
req['dbrps'] = opts[:dbrps] if opts[:dbrps]
|
141
141
|
req['script'] = opts[:script] if opts[:script]
|
142
|
-
req['status'] =
|
142
|
+
req['status'] = 'disabled'
|
143
143
|
req['vars'] = opts[:vars] if opts[:vars]
|
144
144
|
|
145
145
|
if opts[:type]
|
@@ -151,6 +151,12 @@ module Kapacitor
|
|
151
151
|
end
|
152
152
|
|
153
153
|
api_patch(endpoint: "tasks/#{id}", data: req) unless req.empty?
|
154
|
+
|
155
|
+
if opts[:status] == 'enabled'
|
156
|
+
req['status'] = opts[:status] if opts[:status]
|
157
|
+
api_patch(endpoint: "tasks/#{id}", data: req) unless req.empty?
|
158
|
+
end
|
159
|
+
|
154
160
|
end
|
155
161
|
|
156
162
|
# Delete a Kapacitor task
|
@@ -210,13 +216,13 @@ module Kapacitor
|
|
210
216
|
# @param match [String] Lambda expression
|
211
217
|
# @param options [Hash] Handler options
|
212
218
|
#
|
213
|
-
def update_topic_handler(id:, topic:, kind:, match: nil, options:
|
219
|
+
def update_topic_handler(id:, topic:, kind:, match: nil, options: nil)
|
214
220
|
req = {
|
215
221
|
'id': id,
|
216
222
|
'kind': kind
|
217
223
|
}
|
218
224
|
req['match'] = match unless match.nil?
|
219
|
-
req['options'] = options
|
225
|
+
req['options'] = options unless options.nil?
|
220
226
|
api_put(endpoint: "alerts/topics/#{topic}/handlers/#{id}", data: req) unless req.empty?
|
221
227
|
end
|
222
228
|
|
data/lib/kapacitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapacitor-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matteo Cerutti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|