idlc-sdk-core 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/idlc-sdk-core.rb +42 -14
- data/lib/idlc-sdk-core/restclient.rb +5 -2
- data/lib/idlc-sdk-core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6309169da0626fb1db2eae918d549a82231c13ee4ce31183643e7458053d724a
|
4
|
+
data.tar.gz: deb5f054055d3e8cfe880ad974cb9adf96e666950518b551448edbe31acea34d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf573881a9a9260fec6c27909a3644f06974e58aa80d2488540d62ef5f0ac0862928ae58f78c9742ddb2a8e2d7b2134ad03cfde42c5379a0e607c49fa229056e
|
7
|
+
data.tar.gz: 8e42fd8a4f007353dee8a1a05e640ab6dd61feaf1a9663247ffa4289905234903a1749b085195cdddfd90d4eaa327edf28ad3e7056b070e1457506fee6377fcc
|
data/lib/idlc-sdk-core.rb
CHANGED
@@ -11,21 +11,49 @@ require 'idlc-sdk-core/restclient'
|
|
11
11
|
module Idlc
|
12
12
|
# Service Definitions
|
13
13
|
SERVICES = {
|
14
|
-
'
|
15
|
-
'
|
16
|
-
|
14
|
+
'us-east-1' => {
|
15
|
+
'build' => {
|
16
|
+
'endpoint' => 'build.orchestrate.imageapi.com',
|
17
|
+
'stage' => 'prod'
|
18
|
+
},
|
19
|
+
'config' => {
|
20
|
+
'endpoint' => 'config.orchestrate.imageapi.com',
|
21
|
+
'stage' => 'prod'
|
22
|
+
},
|
23
|
+
'deploy' => {
|
24
|
+
'endpoint' => 'deploy.orchestrate.imageapi.com',
|
25
|
+
'stage' => 'prod'
|
26
|
+
},
|
27
|
+
'status' => {
|
28
|
+
'endpoint' => 'status.orchestrate.imageapi.com',
|
29
|
+
'stage' => 'prod'
|
30
|
+
},
|
31
|
+
'auth' => {
|
32
|
+
'endpoint' => 'auth.orchestrate.imageapi.com',
|
33
|
+
'stage' => 'prod'
|
34
|
+
}
|
17
35
|
},
|
18
|
-
'
|
19
|
-
'
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
'
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
'
|
28
|
-
|
36
|
+
'us-gov-west-1' => {
|
37
|
+
'build' => {
|
38
|
+
'endpoint' => 'build.orchestrate-us-gov.imageapi.com',
|
39
|
+
'stage' => 'govcloud'
|
40
|
+
},
|
41
|
+
'config' => {
|
42
|
+
'endpoint' => 'config.orchestrate-us-gov.imageapi.com',
|
43
|
+
'stage' => 'govcloud'
|
44
|
+
},
|
45
|
+
'deploy' => {
|
46
|
+
'endpoint' => 'deploy.orchestrate-us-gov.imageapi.com',
|
47
|
+
'stage' => 'govcloud'
|
48
|
+
},
|
49
|
+
'status' => {
|
50
|
+
'endpoint' => 'status.orchestrate-us-gov.imageapi.com',
|
51
|
+
'stage' => 'govcloud'
|
52
|
+
},
|
53
|
+
'auth' => {
|
54
|
+
'endpoint' => 'auth.orchestrate-us-gov.imageapi.com',
|
55
|
+
'stage' => 'govcloud'
|
56
|
+
}
|
29
57
|
}
|
30
58
|
}.freeze
|
31
59
|
end
|
@@ -11,8 +11,10 @@ module Idlc
|
|
11
11
|
|
12
12
|
def fetch(request)
|
13
13
|
client = Aws::Lambda::Client.new()
|
14
|
+
region = ENV['AWS_REGION']
|
15
|
+
backend_services = Idlc::SERVICES[region]
|
14
16
|
|
15
|
-
request[:function] = "#{request[:service]}-" +
|
17
|
+
request[:function] = "#{request[:service]}-" + backend_services[request[:service]]['stage'] + "-#{request[:lambda]}"
|
16
18
|
request[:httpMethod] = request[:method]
|
17
19
|
|
18
20
|
retries = 0
|
@@ -60,12 +62,13 @@ module Idlc
|
|
60
62
|
@service_name = 'execute-api'
|
61
63
|
@credentials = credentials
|
62
64
|
@region = region
|
65
|
+
@backend_services = Idlc::SERVICES[region]
|
63
66
|
end
|
64
67
|
|
65
68
|
def fetch(request)
|
66
69
|
request = JSON.parse(request)
|
67
70
|
|
68
|
-
endpoint = 'https://' +
|
71
|
+
endpoint = 'https://' + @backend_services[request['service']]['endpoint'] + '/' + @backend_services[request['service']]['stage']
|
69
72
|
|
70
73
|
body = ''
|
71
74
|
body = request['body'].to_json if request['body']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idlc-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Cazell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|