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 +5 -5
- data/Gemfile.lock +1 -1
- data/bin/aggwrap +44 -0
- data/lib/aggkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 37fe2901158e5309db8e3eb0e3376e7b606c0c3c2c88c69d9985788f1168b5de
|
4
|
+
data.tar.gz: 771afcf919ab0c727dc0ce928894d6ac2f2df54eb583a7e0aef815f18f726b9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 438119fb45e3ac6f8b0581b6440157966e29e3a28fcae73079c426cc97bd138fd4962fe85c4cca5f579323a377a5b69e59e9ab57220e9edb3c6a60202c9178b8
|
7
|
+
data.tar.gz: fbf311f0ff57bb254f563ea6ef89dfde4ef8a6aa7bc12e1a7ebe9f46f06683f48fab3d9679b00cdd9acf6e39562c615486047142fdea82eac9517eb351857c3b
|
data/Gemfile.lock
CHANGED
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
|
|
data/lib/aggkit/version.rb
CHANGED
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
|
+
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.
|
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
|