instructure_registrar 0.1.14 → 0.1.15
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 +6 -3
- data/instructure_registrar.gemspec +1 -1
- data/lib/instructure_registrar/client.rb +5 -4
- data/lib/instructure_registrar/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b2003ff7c8762ebc1fc1e9fc7a924d58bb4c31e
|
|
4
|
+
data.tar.gz: 809e99d6a39fc38c223b069465b4a2ffe29a3181
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84c0aa62ef69c33590108ca9563de0c26543bec423fe3a582464044cd909e6db571f24026dfbbde76ca9b462a36b0cabfd5c9febd01c5b8e32ea6928ffed5ee9
|
|
7
|
+
data.tar.gz: 694d18c3e3395929305e5b7894d920f16f521a63dc7f504fdfd4184cbf93533d96f0177bc0d5d5e6d613a3e53e89b4183dacbb0fb119c01b897b34e61345e4df
|
data/README.md
CHANGED
|
@@ -36,9 +36,10 @@ In your service's project folder, create a configuration file with the following
|
|
|
36
36
|
config.registry_host = ENV['REGISTRY_HOST']# || "http://instructure-etcd.docker"
|
|
37
37
|
config.registry_port = ENV['REGISTRY_PORT']# || 12379
|
|
38
38
|
config.service_name = "sample_service_3"
|
|
39
|
-
config.
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
config.service_config = {
|
|
40
|
+
host: "http://someservice.docker",
|
|
41
|
+
token: 'foo',
|
|
42
|
+
option: 'bar'}
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
if ENV['RAILS_ENV'] == "development"
|
|
@@ -66,3 +67,5 @@ Then, to fetch connection information for a given service:
|
|
|
66
67
|
require 'instructure_registrar'
|
|
67
68
|
@some_service_url = InstructureRegistrar.get_service('some_service_name')
|
|
68
69
|
|
|
70
|
+
This will return all keys and values associated with the service.
|
|
71
|
+
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Client for registering an Instructure service via etcd.}
|
|
13
13
|
spec.description = %q{Client for registering an Instructure service via etcd.}
|
|
14
|
-
spec.homepage = "https://github.com/
|
|
14
|
+
spec.homepage = "https://github.com/Instructure/instructure_registrar"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
17
17
|
spec.bindir = "exe"
|
|
@@ -18,17 +18,18 @@ module InstructureRegistrar
|
|
|
18
18
|
|
|
19
19
|
def lookup(service_name)
|
|
20
20
|
begin
|
|
21
|
-
client.get("/#{service_name}").
|
|
21
|
+
client.get("/#{service_name}").children.inject({}) do |h, child|
|
|
22
|
+
h["#{child.key.split('/').last}"] = child.value; h
|
|
23
|
+
end
|
|
22
24
|
rescue Etcd::KeyNotFound
|
|
23
|
-
"unknown"
|
|
25
|
+
{status: "unknown"}
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
def register
|
|
28
30
|
return unless server_available
|
|
29
31
|
InstructureRegistrar.config.service_config.keys.each do |key|
|
|
30
|
-
|
|
31
|
-
p client.set(
|
|
32
|
+
client.set(
|
|
32
33
|
"/#{InstructureRegistrar.config.service_name}/#{key}",
|
|
33
34
|
value: InstructureRegistrar.config.service_config[key]
|
|
34
35
|
)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: instructure_registrar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- CoralineAda
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-
|
|
12
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: etcd
|
|
@@ -87,7 +87,7 @@ files:
|
|
|
87
87
|
- lib/instructure_registrar.rb
|
|
88
88
|
- lib/instructure_registrar/client.rb
|
|
89
89
|
- lib/instructure_registrar/version.rb
|
|
90
|
-
homepage: https://github.com/
|
|
90
|
+
homepage: https://github.com/Instructure/instructure_registrar
|
|
91
91
|
licenses: []
|
|
92
92
|
metadata: {}
|
|
93
93
|
post_install_message:
|