diplomat 2.6.3 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/diplomat/service.rb +1 -0
- data/lib/diplomat/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a511e72072393dd5a7ae290168917f50e27f13bfa46384ca480840277bd33f22
|
4
|
+
data.tar.gz: be98732d7e185789f5d62011d208dbff64088e2634a863d2da3ea9d35f029058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ab4b6033d60b9a9930da3736e105980da473cf186e289db808d0eb5d8bc964d2712fec70711c3d918a84968696ea1ea1a51926e0c41aa663971d4e3825988eb
|
7
|
+
data.tar.gz: 6df7409db9894e31b74d764354c305a70997eef07053d9369756d1572be004239c3268f8d79842116e5d6e8a962e3c21ef97b6c43bcefdaf9898a38735605ce0
|
data/README.md
CHANGED
@@ -196,6 +196,13 @@ foo_service = Diplomat::Service.get('foo', :all, { :dc => 'My_Datacenter'})
|
|
196
196
|
# => [#<OpenStruct Node="hotel", Address="1.2.3.4", ServiceID="hotel_foo", ServiceName="foo", ServiceTags=["foo"], ServicePort=5432>,#<OpenStruct Node="indigo", Address="1.2.3.5", ServiceID="indigo_foo", ServiceName="foo", ServiceTags=["foo"], ServicePort=5432>]
|
197
197
|
```
|
198
198
|
|
199
|
+
Or if you want to filter services
|
200
|
+
|
201
|
+
```ruby
|
202
|
+
foo_service = Diplomat::Service.get('foo', :all, { :filter => 'ServiceID == "indigo_foo"'})
|
203
|
+
# => [#<OpenStruct Node="indigo", Address="1.2.3.5", ServiceID="indigo_foo", ServiceName="foo", ServiceTags=["foo"], ServicePort=5432>]
|
204
|
+
```
|
205
|
+
|
199
206
|
If you wish to list all the services on consul:
|
200
207
|
|
201
208
|
```ruby
|
data/lib/diplomat/service.rb
CHANGED
@@ -17,6 +17,7 @@ module Diplomat
|
|
17
17
|
custom_params << use_named_parameter('wait', options[:wait]) if options[:wait]
|
18
18
|
custom_params << use_named_parameter('index', options[:index]) if options[:index]
|
19
19
|
custom_params << use_named_parameter('dc', options[:dc]) if options[:dc]
|
20
|
+
custom_params << use_named_parameter('filter', options[:filter]) if options[:filter]
|
20
21
|
custom_params += [*options[:tag]].map { |value| use_named_parameter('tag', value) } if options[:tag]
|
21
22
|
|
22
23
|
ret = send_get_request(@conn, ["/v1/catalog/service/#{key}"], options, custom_params)
|
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.4
|
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-08-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -187,9 +187,12 @@ dependencies:
|
|
187
187
|
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0.9'
|
190
|
+
- - "!="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 2.0.0
|
190
193
|
- - "<"
|
191
194
|
- !ruby/object:Gem::Version
|
192
|
-
version: '
|
195
|
+
version: '3.0'
|
193
196
|
type: :runtime
|
194
197
|
prerelease: false
|
195
198
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -197,9 +200,12 @@ dependencies:
|
|
197
200
|
- - ">="
|
198
201
|
- !ruby/object:Gem::Version
|
199
202
|
version: '0.9'
|
203
|
+
- - "!="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 2.0.0
|
200
206
|
- - "<"
|
201
207
|
- !ruby/object:Gem::Version
|
202
|
-
version: '
|
208
|
+
version: '3.0'
|
203
209
|
description: Diplomat is a simple wrapper for Consul
|
204
210
|
email:
|
205
211
|
- john@johnhamelink.com
|