diplomat 2.6.2 → 2.6.3
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/README.md +1 -1
- data/lib/diplomat/health.rb +5 -2
- data/lib/diplomat/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: 5d140133bd3a6e625d15be77e1c851348e71c3a2ebf573d64d7542f1b68e8745
|
|
4
|
+
data.tar.gz: cb73d392f2a10f9999b43000c52a2064a892c83ba1ed802fc07597ab102bc496
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f223217f2580e3264164c61e9cfe42284714d853a5d111b330b46891cc3ea3348ccf455dd84446e87b67c92043ae0aef9733803be6a9e1446d8412fea4f41eef
|
|
7
|
+
data.tar.gz: 0d4e0f56a7bc839d1b284a76af995f1a698d092549672ec40c56fd37983d711652c9f4ca671c7d12772d1906147848f272e29cac02cd7c317b4a473c741a2046
|
data/README.md
CHANGED
|
@@ -362,7 +362,7 @@ You also have some convenience method (`any`, `passing`, `warning`, `critical`)
|
|
|
362
362
|
That can be filtered
|
|
363
363
|
|
|
364
364
|
```ruby
|
|
365
|
-
Diplomat::Health.critical({:dc => 'abc', :filter => '
|
|
365
|
+
Diplomat::Health.critical({:dc => 'abc', :filter => 'ServiceName==foo'})
|
|
366
366
|
```
|
|
367
367
|
|
|
368
368
|
### Maintenance mode
|
data/lib/diplomat/health.rb
CHANGED
|
@@ -8,11 +8,12 @@ module Diplomat
|
|
|
8
8
|
|
|
9
9
|
# Get node health
|
|
10
10
|
# @param n [String] the node
|
|
11
|
-
# @param options [Hash] :dc string for
|
|
11
|
+
# @param options [Hash] :dc, :filter string for specific query
|
|
12
12
|
# @return [OpenStruct] all data associated with the node
|
|
13
13
|
def node(n, options = {})
|
|
14
14
|
custom_params = []
|
|
15
15
|
custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]
|
|
16
|
+
custom_params << use_named_parameter('filter', options[:filter]) if options[:filter]
|
|
16
17
|
|
|
17
18
|
ret = send_get_request(@conn, ["/v1/health/node/#{n}"], options, custom_params)
|
|
18
19
|
JSON.parse(ret.body).map { |node| OpenStruct.new node }
|
|
@@ -20,11 +21,12 @@ module Diplomat
|
|
|
20
21
|
|
|
21
22
|
# Get service checks
|
|
22
23
|
# @param s [String] the service
|
|
23
|
-
# @param options [Hash] :dc string for
|
|
24
|
+
# @param options [Hash] :dc, :filter string for specific query
|
|
24
25
|
# @return [OpenStruct] all data associated with the node
|
|
25
26
|
def checks(s, options = {})
|
|
26
27
|
custom_params = []
|
|
27
28
|
custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]
|
|
29
|
+
custom_params << use_named_parameter('filter', options[:filter]) if options[:filter]
|
|
28
30
|
|
|
29
31
|
ret = send_get_request(@conn, ["/v1/health/checks/#{s}"], options, custom_params)
|
|
30
32
|
JSON.parse(ret.body).map { |check| OpenStruct.new check }
|
|
@@ -44,6 +46,7 @@ module Diplomat
|
|
|
44
46
|
custom_params << use_named_parameter('near', options[:near]) if options[:near]
|
|
45
47
|
custom_params << use_named_parameter('node-meta', options[:node_meta]) if options[:node_meta]
|
|
46
48
|
custom_params << use_named_parameter('index', options[:index]) if options[:index]
|
|
49
|
+
custom_params << use_named_parameter('filter', options[:filter]) if options[:filter]
|
|
47
50
|
|
|
48
51
|
ret = send_get_request(@conn, ["/v1/health/service/#{s}"], options, custom_params)
|
|
49
52
|
if meta && ret.headers
|
data/lib/diplomat/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diplomat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.6.
|
|
4
|
+
version: 2.6.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Hamelink
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2022-
|
|
13
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: bundler
|