umts-microservices-engine 0.1.0 → 0.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9409c0b1a98e54dadf7bd0800deeb7aa39d72a9b
|
|
4
|
+
data.tar.gz: 0a53090a5e55d798486c6ddfa618dda0503d4c63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a67493586dc5607dc0782678bfd93350e5ab434e333b884a4ce2577c38356602b652fa956c64694a20576ab11adad4485ec3417e328749db0267aab8d64a1cf
|
|
7
|
+
data.tar.gz: a1af368d87eff8874420679b4ca72e2d0caf4f315335fc9278393f617716cc4a81de46f536874dee63077bcb0ca0248583997ae9815cc383494c7b23a208a908
|
|
@@ -2,29 +2,33 @@
|
|
|
2
2
|
require 'net/http'
|
|
3
3
|
CONFIG_FILE = 'config/mse_router_info.yml'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
raise ArgumentError, "Missing key #{key} in #{CONFIG_FILE}"
|
|
7
|
-
end
|
|
5
|
+
unless ENV['DISABLE_ROUTER_CHECKIN']
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
end
|
|
7
|
+
report_missing_config_key = lambda do |key|
|
|
8
|
+
raise ArgumentError, "Missing key #{key} in #{CONFIG_FILE}"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
unless File.file?(CONFIG_FILE)
|
|
12
|
+
raise IOError, 'No router configuration YAML file found'
|
|
13
|
+
end
|
|
12
14
|
|
|
13
|
-
config_data = YAML.load_file(CONFIG_FILE)
|
|
15
|
+
config_data = YAML.load_file(CONFIG_FILE)
|
|
14
16
|
|
|
15
|
-
service_name = config_data.fetch 'name', &report_missing_config_key
|
|
16
|
-
service_url = config_data.fetch 'uri', &report_missing_config_key
|
|
17
|
-
router_url = config_data.fetch 'router_uri', &report_missing_config_key
|
|
18
|
-
security_token = config_data.fetch 'security_token', &report_missing_config_key
|
|
17
|
+
service_name = config_data.fetch 'name', &report_missing_config_key
|
|
18
|
+
service_url = config_data.fetch 'uri', &report_missing_config_key
|
|
19
|
+
router_url = config_data.fetch 'router_uri', &report_missing_config_key
|
|
20
|
+
security_token = config_data.fetch 'security_token', &report_missing_config_key
|
|
19
21
|
|
|
20
|
-
router_url = router_url + '/services/register'
|
|
22
|
+
router_url = router_url + '/services/register'
|
|
21
23
|
|
|
22
|
-
res = Net::HTTP.post_form(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
24
|
+
res = Net::HTTP.post_form(
|
|
25
|
+
URI.parse(router_url),
|
|
26
|
+
name: service_name,
|
|
27
|
+
url: service_url,
|
|
28
|
+
models: config_data['accessible_models'],
|
|
29
|
+
security_token: security_token
|
|
30
|
+
)
|
|
29
31
|
|
|
30
|
-
raise 'The router API response was invalid' if res.code != '200'
|
|
32
|
+
raise 'The router API response was invalid' if res.code != '200'
|
|
33
|
+
|
|
34
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: umts-microservices-engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- UMass Transportation Services
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-01-
|
|
11
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|