kapacitor-ruby 1.0.7 → 1.0.8

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
  SHA256:
3
- metadata.gz: 4855f87f3ec102488bb9c853b8f7a9d1d9e161d759ec62617859a784b8b521ac
4
- data.tar.gz: a7875fdb26ce45b801297caec2ebc17946a6b8e1932f07c11e73fced251e03cd
3
+ metadata.gz: b992f75fe340aaeb410f88845f8b0cf22f404a68f2407920450aeb8f81a749cc
4
+ data.tar.gz: 0f86926ff9b4354aa26f34cb82dbdcc48678dd9cf89f7b3a7b4161573d0b1265
5
5
  SHA512:
6
- metadata.gz: 6a7c13869776805389686060b8e3a47abda670b81d1adf2c8ff2690774af85d61dda6cf83c3ad35fb21f286b37f01d62c668253403e7c45d405dc76148f196c8
7
- data.tar.gz: 321f5d4263ae5ec53fde9bb28ea158a4881967643e0071edaee2778ac37485cdf5db72de58503c6659fe06da362786a6f5d1cc667726e21bcac6708053502780
6
+ metadata.gz: 5766810cf37cf0f73c05085e5dc0e2698f2439a48b065a8c78b0dd1516ea08d5597cfd5ddc8b266f56ee175f0627ac7667f3fa9ac2b515406efb7343862cbc6d
7
+ data.tar.gz: e2e22bb48e84baf6803fa099364991221fb5f0c1d4746a38811d9fc88e208c98b6ba312eb226f27b5a4f4011580da787bb9885ddca86f43202affd92f77de6b5
@@ -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'] = opts[:status] if opts[: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
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
 
5
5
  module Kapacitor
6
- VERSION = "1.0.7"
6
+ VERSION = "1.0.8"
7
7
 
8
8
  def self.version
9
9
  VERSION
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.7
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-27 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient