consul-ruby-client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/consul/client/agent.rb +7 -7
- data/lib/consul/client/catalog.rb +1 -1
- data/lib/consul/client/session.rb +5 -5
- data/lib/consul/client/version.rb +1 -1
- data/lib/consul/extensions/uid.rb +11 -0
- metadata +25 -24
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjE3ZGI1NTUzZmMwMmM3YWE1Njk4M2QyZDliYWNjMjk3NDViNTExYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Mzk4ODMxNjhmZGU1YTk0OWY3ZTkyMTEyZDY5MGMwZjQ3YTIyNWM5Mg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDFjMTU0Y2IwYzM0MzJkNjc3YWFmMWI2MjhmMGI4MjM0MGUzZWE2ZTdiYjA5
|
10
|
+
MTQyYTM3YjVhOGQwYmIxNmJkMDg3Y2E1YjhlYmQwMGJjOWE5YjhkMWE3MWQy
|
11
|
+
OWI0MGJmMmU0NjgzNWFhYzkyNjJjYWFkMGFiY2VkMjkwMjg1NGQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzdkZGQ1NGZjNmZjODFlZTVkOGFlOWM1NzUwYmM5ZjMzZDkwOThkODZjOTFl
|
14
|
+
MzM0YTJmNWMxOTViYzA5OTMxODFiNjkzMTM4MjljMTEzNGZhNTYyZTRjNmEx
|
15
|
+
ODAwZDc0NDg4N2RmY2Y4Nzg3MjY4MThkZTYzODA5ZWMwMTYyOGU=
|
data/lib/consul/client/agent.rb
CHANGED
@@ -201,8 +201,8 @@ module Consul
|
|
201
201
|
validate_arg name
|
202
202
|
validate_arg ttl
|
203
203
|
c = Consul::Model::HealthCheck.new(name: name, ttl: ttl)
|
204
|
-
c
|
205
|
-
c
|
204
|
+
c.id = id unless id.nil?
|
205
|
+
c.notes = notes unless notes.nil?
|
206
206
|
c
|
207
207
|
end
|
208
208
|
|
@@ -220,8 +220,8 @@ module Consul
|
|
220
220
|
validate_arg script
|
221
221
|
validate_arg interval
|
222
222
|
c = Consul::Model::HealthCheck.new(name: name, script: script, interval: interval)
|
223
|
-
c
|
224
|
-
c
|
223
|
+
c.id = id unless id.nil?
|
224
|
+
c.notes = notes unless notes.nil?
|
225
225
|
c
|
226
226
|
end
|
227
227
|
|
@@ -238,9 +238,9 @@ module Consul
|
|
238
238
|
validate_arg name
|
239
239
|
validate_arg http
|
240
240
|
validate_arg interval
|
241
|
-
c = Consul::Model::HealthCheck.new(name: name,
|
242
|
-
c
|
243
|
-
c
|
241
|
+
c = Consul::Model::HealthCheck.new(name: name, http: http, interval: interval)
|
242
|
+
c.id = id unless id.nil?
|
243
|
+
c.notes = notes unless notes.nil?
|
244
244
|
c
|
245
245
|
end
|
246
246
|
|
@@ -53,7 +53,7 @@ module Consul
|
|
53
53
|
def service(id, dc = nil, tag = nil)
|
54
54
|
params = {}
|
55
55
|
params[:dc] = dc unless dc.nil?
|
56
|
-
params
|
56
|
+
params[:tag] = tag unless tag.nil?
|
57
57
|
JSON.parse(_get build_url("service/#{id}"), params).map {|n| Consul::Model::Node.new.extend(Consul::Model::Node::Representer).from_hash(n)}
|
58
58
|
end
|
59
59
|
|
@@ -26,14 +26,14 @@ module Consul
|
|
26
26
|
ttl = nil)
|
27
27
|
raise ArgumentError.new "Illegal Name: #{name}" if name.nil?
|
28
28
|
session = Consul::Model::Session.new(name: name)
|
29
|
-
session
|
30
|
-
session
|
29
|
+
session.lock_delay = lock_delay unless lock_delay.nil?
|
30
|
+
session.node = node unless node.nil?
|
31
31
|
checks = [] if checks.nil?
|
32
32
|
checks += 'serfHealth' unless checks.include? 'serfHealth'
|
33
|
-
session
|
33
|
+
session.checks = checks
|
34
34
|
behaviour = 'release' if behaviour.nil? or behaviour != 'release' or behaviour != 'destroy'
|
35
|
-
session
|
36
|
-
session
|
35
|
+
session.behaviour = behaviour
|
36
|
+
session.ttl = ttl unless ttl.nil?
|
37
37
|
session
|
38
38
|
end
|
39
39
|
|
@@ -16,6 +16,17 @@ module Consul
|
|
16
16
|
|
17
17
|
# Public: Constructor for this extension. Ensures a global unique ID for this client for a given namespace.
|
18
18
|
#
|
19
|
+
# Under the covers UID generator associates the Consul agent to the determine its individuality away from other clients.
|
20
|
+
# the opts[:client_id] parameter is used to expose an external parameter to allow clients to determin uniqueness.
|
21
|
+
#
|
22
|
+
# For Example:
|
23
|
+
# catOpts = {:name => 'animal', :client_id => 'cat'}
|
24
|
+
# otherCatOpts = {:name => 'animal', :client_id => 'cat'}
|
25
|
+
# dogOpts = {:name => 'animal', :client_id => 'dog'}
|
26
|
+
#
|
27
|
+
# UID.new(catOpts).get will return the same UID as UID.new(otherCatOpts).get
|
28
|
+
# UID.new(catOpts).get will return different UIDs from UID.new(dogOpts).get
|
29
|
+
#
|
19
30
|
# options - (Required) Hash of Consul Client and extension options.
|
20
31
|
# options[:name] - (Required) The name or name space of the GUID to generate. This extension will
|
21
32
|
# generate a GUID with respect to other clients is this name space.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consul-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hotan
|
@@ -14,117 +14,118 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.9'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.21'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.21'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rest-client
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.6'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: representable
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '2.1'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2.1'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: json
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '1.8'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.8'
|
125
|
-
description:
|
126
|
-
|
127
|
-
|
125
|
+
description: ! 'Consul Thin Client. Exposes Consul defined interfaces through a very
|
126
|
+
thin abstraction
|
127
|
+
|
128
|
+
layer.'
|
128
129
|
email:
|
129
130
|
- michael.hotan@socrata.com
|
130
131
|
executables:
|
@@ -132,7 +133,7 @@ executables:
|
|
132
133
|
extensions: []
|
133
134
|
extra_rdoc_files: []
|
134
135
|
files:
|
135
|
-
-
|
136
|
+
- .gitignore
|
136
137
|
- Gemfile
|
137
138
|
- LICENSE
|
138
139
|
- LICENSE.txt
|
@@ -183,17 +184,17 @@ require_paths:
|
|
183
184
|
- lib
|
184
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
185
186
|
requirements:
|
186
|
-
- -
|
187
|
+
- - ! '>='
|
187
188
|
- !ruby/object:Gem::Version
|
188
189
|
version: '0'
|
189
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
191
|
requirements:
|
191
|
-
- -
|
192
|
+
- - ! '>='
|
192
193
|
- !ruby/object:Gem::Version
|
193
194
|
version: '0'
|
194
195
|
requirements: []
|
195
196
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.4.
|
197
|
+
rubygems_version: 2.4.6
|
197
198
|
signing_key:
|
198
199
|
specification_version: 4
|
199
200
|
summary: Ruby Client library for communicating with Consul Agents.
|