diplomat 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/diplomat/health.rb +9 -1
- data/lib/diplomat/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25c0b2769edc31ef7e21ce9a27bb80640ad924e8c7e5d3941ad85a7cf94605da
|
4
|
+
data.tar.gz: b42997b367d7a4f17358823e773c5ade86789677c273d02f02ca799baba8c79f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd6483e59dd18715f52bb783d4cdfaaa4ba3f0b16e5f045c3a7bfea6cfea5f002bda8f3ca85fe33854be9e69e1ae523ba3277699204bcf07c07a8476c84af980
|
7
|
+
data.tar.gz: 0c92e00358566383f63105d6c656db1b641199fefe03aefdabed592dd4efdf6eceeaa5e7e1a5a1c8ad8538bdf6ed5fdbc48ecd4400a9b556d40a5ab42b1bbeaf
|
data/lib/diplomat/health.rb
CHANGED
@@ -33,17 +33,25 @@ module Diplomat
|
|
33
33
|
# Get service health
|
34
34
|
# @param s [String] the service
|
35
35
|
# @param options [Hash] options parameter hash
|
36
|
+
# @param meta [Hash] output structure containing header information about the request (index)
|
36
37
|
# @return [OpenStruct] all data associated with the node
|
37
38
|
# rubocop:disable Metrics/PerceivedComplexity
|
38
|
-
def service(s, options = {})
|
39
|
+
def service(s, options = {}, meta = nil)
|
39
40
|
custom_params = []
|
40
41
|
custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]
|
41
42
|
custom_params << ['passing'] if options[:passing]
|
42
43
|
custom_params += [*options[:tag]].map { |value| use_named_parameter('tag', value) } if options[:tag]
|
43
44
|
custom_params << use_named_parameter('near', options[:near]) if options[:near]
|
44
45
|
custom_params << use_named_parameter('node-meta', options[:node_meta]) if options[:node_meta]
|
46
|
+
custom_params << use_named_parameter('index', options[:index]) if options[:index]
|
45
47
|
|
46
48
|
ret = send_get_request(@conn, ["/v1/health/service/#{s}"], options, custom_params)
|
49
|
+
if meta && ret.headers
|
50
|
+
meta[:index] = ret.headers['x-consul-index'] if ret.headers['x-consul-index']
|
51
|
+
meta[:knownleader] = ret.headers['x-consul-knownleader'] if ret.headers['x-consul-knownleader']
|
52
|
+
meta[:lastcontact] = ret.headers['x-consul-lastcontact'] if ret.headers['x-consul-lastcontact']
|
53
|
+
end
|
54
|
+
|
47
55
|
JSON.parse(ret.body).map { |service| OpenStruct.new service }
|
48
56
|
end
|
49
57
|
|
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.
|
4
|
+
version: 2.6.0
|
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: 2021-
|
13
|
+
date: 2021-09-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
- !ruby/object:Gem::Version
|
253
253
|
version: '0'
|
254
254
|
requirements: []
|
255
|
-
rubygems_version: 3.1.
|
255
|
+
rubygems_version: 3.1.6
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: Diplomat is a simple wrapper for Consul
|