summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Multanen <eric.w.multanen@intel.com>2020-03-01 20:58:29 -0800
committerEric Multanen <eric.w.multanen@intel.com>2020-03-01 20:58:29 -0800
commitaea45499e7f905538ec97e6075b97ae171565905 (patch)
treed5231058b896d96803a01bbb52cb7ae0169c76a9
parentab9eb6aba42457ed9adb21d7239c7729bb26bd15 (diff)
Add ability to build https endpoint to multicloud
Add parameter to allow https endpoint to be used for endpoint to multicloud (via msb). Change-Id: Ia3a296cab8e8676e7b39c0f56c03e18e18a0a777 Issue-ID: SO-1450 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java8
-rw-r--r--adapters/mso-adapter-utils/src/test/resources/application-test.yaml1
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/application-test.yaml1
3 files changed, 9 insertions, 1 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
index ca0180ae4b..b26b49ec70 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoMulticloudUtils.java
@@ -81,7 +81,9 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
private static final Integer DEFAULT_MSB_PORT = 80;
private static final String DEFAULT_MSB_IP = "127.0.0.1";
+ private static final String DEFAULT_MSB_SCHEME = "http";
private static final String ONAP_IP = "ONAP_IP";
+ private static final String MSB_SCHEME = "MSB_SCHEME";
private final HttpClientFactory httpClientFactory = new HttpClientFactory();
@Autowired
@@ -795,10 +797,14 @@ public class MsoMulticloudUtils extends MsoHeatUtils implements VduPlugin {
msbIp = environment.getProperty("mso.msb-ip", DEFAULT_MSB_IP);
}
Integer msbPort = environment.getProperty("mso.msb-port", Integer.class, DEFAULT_MSB_PORT);
+ String msbScheme = System.getenv().get(MSB_SCHEME);
+ if (null == msbScheme || msbScheme.isEmpty()) {
+ msbScheme = environment.getProperty("mso.msb-scheme", DEFAULT_MSB_SCHEME);
+ }
String path = "/api/multicloud/v1/" + cloudOwner + "/" + cloudSiteId + "/infra_workload";
- String endpoint = UriBuilder.fromPath(path).host(msbIp).port(msbPort).scheme("http").build().toString();
+ String endpoint = UriBuilder.fromPath(path).host(msbIp).port(msbPort).scheme(msbScheme).build().toString();
if (workloadId != null) {
String middlepart = null;
if (isName) {
diff --git a/adapters/mso-adapter-utils/src/test/resources/application-test.yaml b/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
index 32a4db6b80..117d616cd4 100644
--- a/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
+++ b/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
@@ -53,6 +53,7 @@ mso:
logPath: logs
msb-ip: localhost
msb-port: ${wiremock.server.port}
+ msb-scheme: http
catalog:
db:
spring:
diff --git a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
index 20fd812ab9..6171e7a624 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
+++ b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
@@ -66,6 +66,7 @@ mso:
logPath: logs
msb-ip: localhost
msb-port: ${wiremock.server.port}
+ msb-scheme: http
catalog:
db:
spring: