aggkit 0.3.4.8975 → 0.3.5

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
- SHA1:
3
- metadata.gz: 0f49193054abc11007abc2714baa2d3fa9e751ab
4
- data.tar.gz: 98cef5e0721351973d8b88ee481f46f073c80b6b
2
+ SHA256:
3
+ metadata.gz: 37fe2901158e5309db8e3eb0e3376e7b606c0c3c2c88c69d9985788f1168b5de
4
+ data.tar.gz: 771afcf919ab0c727dc0ce928894d6ac2f2df54eb583a7e0aef815f18f726b9e
5
5
  SHA512:
6
- metadata.gz: cd3cc30ace6c724a5109a2e82a28b9d34b005a408ea994cbc13d4480605e8aba00c859164aafda1709ee14831054ec77e27efe7f0027aa4092a35a9d75d3d929
7
- data.tar.gz: b4a65bf93f57cd8b099c9e0929abb0356c9a2a8fa88c77de2abc13f3eb9c7870c2def4c030d0049ef1beee1500f94bf0cfa84d28dbf64b51d8e9ec823195fcb1
6
+ metadata.gz: 438119fb45e3ac6f8b0581b6440157966e29e3a28fcae73079c426cc97bd138fd4962fe85c4cca5f579323a377a5b69e59e9ab57220e9edb3c6a60202c9178b8
7
+ data.tar.gz: fbf311f0ff57bb254f563ea6ef89dfde4ef8a6aa7bc12e1a7ebe9f46f06683f48fab3d9679b00cdd9acf6e39562c615486047142fdea82eac9517eb351857c3b
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- aggkit (0.3.4.8975)
12
+ aggkit (0.3.5)
13
13
  diplomat
14
14
  dotenv
15
15
  json
data/bin/aggwrap CHANGED
@@ -5,6 +5,50 @@ require 'securerandom'
5
5
  require 'aggkit'
6
6
  require 'net/http'
7
7
 
8
+ module Diplomat
9
+ # Methods for interacting with the Consul check API endpoint
10
+ class Check < Diplomat::RestClient
11
+ # Update a TTL check
12
+ # @param check_id [String] the unique id of the check
13
+ # @param status [String] status of the check. Valid values are "passing", "warning", and "critical"
14
+ # @param output [String] human-readable message will be passed through to the check's Output field
15
+ # @return [Integer] Status code
16
+ def update_ttl(check_id, status, output = nil)
17
+ ret = @conn.put do |req|
18
+ req.url "/v1/agent/check/update/#{check_id}"
19
+ req.body = JSON.generate('Status' => status, 'Output' => output)
20
+ end
21
+ ret.status == 200
22
+ end
23
+
24
+ # Pass a check
25
+ # @param check_id [String] the unique id of the check
26
+ # @param output [String] human-readable message will be passed through to the check's Output field
27
+ # @return [Integer] Status code
28
+ def pass(check_id, output = nil)
29
+ update_ttl(check_id, 'passing', output)
30
+ end
31
+
32
+ # Warn a check
33
+ # @param check_id [String] the unique id of the check
34
+ # @param output [String] human-readable message will be passed through to the check's Output field
35
+ # @return [Integer] Status code
36
+ def warn(check_id, output = nil)
37
+ update_ttl(check_id, 'warning', output)
38
+ end
39
+
40
+ # Fail a check
41
+ # @param check_id [String] the unique id of the check
42
+ # @param output [String] human-readable message will be passed through to the check's Output field
43
+ # @return [Integer] Status code
44
+ def fail(check_id, output = nil)
45
+ update_ttl(check_id, 'critical', output)
46
+ end
47
+ end
48
+ end
49
+
50
+
51
+
8
52
  STDERR.sync
9
53
  STDOUT.sync
10
54
 
@@ -1,6 +1,6 @@
1
1
  module Aggkit
2
2
 
3
- VERSION = '0.3.4'.freeze
3
+ VERSION = '0.3.5'.freeze
4
4
 
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4.8975
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.6.3
194
+ rubygems_version: 2.7.3
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: Helper scripts for work with docker and consul in Aggredator