Revise and publish configuration property keys 38/338/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Thu, 13 Jun 2019 15:22:39 +0000 (11:22 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 13 Jun 2019 15:57:05 +0000 (11:57 -0400)
Add deployment configuration in README

Change-Id: I880b76636ddbf04b09571d5af1fac2028da64826
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
README.md
docs/release-notes.rst
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/A1MediatorConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerConfiguration.java
webapp-backend/src/main/resources/application.properties

index 3e26e99..3cec2d6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,13 +2,30 @@
 
 This webapp is built with Angular 7 and Spring-Boot 2.
 
-## Getting started
+## Deployment configuration
+
+The application expects an application.properties file to be provided,
+probably mounted as a file from a Kubernetes configuration map, with
+the following content:
+
+    # A1 Mediator
+    a1med.url = http://A1-URL
+    # ANR xApp
+    anrxapp.url = http://ANR-URL
+    # E2 Manager
+    e2mgr.url = http://E2-URL
+    # Xapp Manager
+    xappmgr.url = http://MGR-URL
+
+## Development guide
+
+This section gives a quickstart guide for developers.
 
 ### Check prerequisites
 
 1. Java development kit (JDK), version 1.8 or later
 2. Maven dependency-management tool, version 3.4 or later
-  
+
 ### Build and launch the web app
 
     mvn -Ddocker.skip=true clean install
@@ -17,7 +34,7 @@ This webapp is built with Angular 7 and Spring-Boot 2.
 
 Then open a browser on http://localhost:8080
 
-In addition to the above, you can run the Angular server 
+In addition to the above, you can run the Angular server
 for debugging the frontend and backend separately:
 
     cd webapp-frontend
index cddc051..d3533e7 100644 (file)
@@ -30,6 +30,7 @@ Version 1.0.4, 13 June 2019
 * Update ANR xApp client to spec version 0.0.8
 * Update E2 manager client to spec version 20190611
 * Adjust CSS and HTML for main container positioning
+* Revise config property keys to use URL (not basepath)
 
 Version 1.0.3, 28 May 2019
 --------------------------
index 5ea4b05..2ed6b9a 100644 (file)
@@ -20,6 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.oransc.ric.a1med.client.api.A1MediatorApi;
 import org.oransc.ric.a1med.client.invoker.ApiClient;
@@ -30,7 +32,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Profile;
-import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -44,18 +45,18 @@ public class A1MediatorConfiguration {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        // Populated by the autowired constructor
-       private final String a1medBasepath;
+       private final String a1medUrl;
 
        @Autowired
-       public A1MediatorConfiguration(@Value("${a1med.basepath}") final String a1medBasepath) {
-               Assert.notNull(a1medBasepath, "base path must not be null");
-               logger.info("Configuring A1 Mediator at base path {}", a1medBasepath);
-               this.a1medBasepath = a1medBasepath;
+       public A1MediatorConfiguration(@Value("${a1med.url}") final String url) throws MalformedURLException {
+               logger.info("Configuring A1 Mediator at URL {}", url);
+               new URL(url);
+               this.a1medUrl = url;
        }
 
        private ApiClient apiClient() {
                ApiClient apiClient = new ApiClient(new RestTemplate());
-               apiClient.setBasePath(a1medBasepath);
+               apiClient.setBasePath(a1medUrl);
                return apiClient;
        }
 
index 3a2e810..5f2ae9b 100644 (file)
@@ -20,6 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.oransc.ric.anrxapp.client.api.HealthApi;
 import org.oransc.ric.anrxapp.client.api.NcrtApi;
@@ -31,7 +33,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Profile;
-import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -44,18 +45,18 @@ public class AnrXappConfiguration {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        // Populated by the autowired constructor
-       private final String anrXappBasepath;
+       private final String anrXappUrl;
 
        @Autowired
-       public AnrXappConfiguration(@Value("${anrxapp.basepath}") final String anrXappBasepath) {
-               Assert.notNull(anrXappBasepath, "base path must not be null");
-               logger.info("Configuring ANR client at base path {}", anrXappBasepath);
-               this.anrXappBasepath = anrXappBasepath;
+       public AnrXappConfiguration(@Value("${anrxapp.url}") final String url) throws MalformedURLException {
+               logger.info("Configuring ANR client at URL {}", url);
+               new URL(url);
+               this.anrXappUrl = url;
        }
 
        private ApiClient apiClient() {
                ApiClient apiClient = new ApiClient(new RestTemplate());
-               apiClient.setBasePath(anrXappBasepath);
+               apiClient.setBasePath(anrXappUrl);
                return apiClient;
        }
 
index 1983623..92bef31 100644 (file)
@@ -20,6 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
 import org.oransc.ric.e2mgr.client.api.NodebApi;
@@ -31,7 +33,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Profile;
-import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -44,18 +45,18 @@ public class E2ManagerConfiguration {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        // Populated by the autowired constructor
-       private final String e2mgrBasepath;
+       private final String e2mgrUrl;
 
        @Autowired
-       public E2ManagerConfiguration(@Value("${e2mgr.basepath}") final String e2mgrBasepath) {
-               Assert.notNull(e2mgrBasepath, "base path must not be null");
-               logger.info("Configuring E2 Manager at base path {}", e2mgrBasepath);
-               this.e2mgrBasepath = e2mgrBasepath;
+       public E2ManagerConfiguration(@Value("${e2mgr.url}") final String url) throws MalformedURLException {
+               logger.info("Configuring E2 Manager at base path {}", url);
+               new URL(url);
+               this.e2mgrUrl = url;
        }
 
        private ApiClient apiClient() {
                ApiClient apiClient = new ApiClient(new RestTemplate());
-               apiClient.setBasePath(e2mgrBasepath);
+               apiClient.setBasePath(e2mgrUrl);
                return apiClient;
        }
 
index b05d817..04bb8fc 100644 (file)
@@ -49,7 +49,7 @@ public class E2ManagerMockConfiguration {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        private final GetNodebResponse nodebResponse;
-       
+
        public E2ManagerMockConfiguration() {
                logger.info("Configuring mock E2 Manager");
                nodebResponse = new GetNodebResponse().ip("1.2.3.4").port(123).ranName("myRan");
index 00cd939..7ecd95c 100644 (file)
@@ -20,6 +20,8 @@
 package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.oransc.ric.xappmgr.client.api.HealthApi;
 import org.oransc.ric.xappmgr.client.api.XappApi;
@@ -31,7 +33,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Profile;
-import org.springframework.util.Assert;
 import org.springframework.web.client.RestTemplate;
 
 /**
@@ -45,18 +46,18 @@ public class XappManagerConfiguration {
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
        // Populated by the autowired constructor
-       private final String xappMgrBasepath;
+       private final String xappMgrUrl;
 
        @Autowired
-       public XappManagerConfiguration(@Value("${xappmgr.basepath}") final String xappMgrBasepath) {
-               Assert.notNull(xappMgrBasepath, "base path must not be null");
-               logger.info("Configuring xApp Manager at base path {}", xappMgrBasepath);
-               this.xappMgrBasepath = xappMgrBasepath;
+       public XappManagerConfiguration(@Value("${xappmgr.url}") final String url) throws MalformedURLException {
+               logger.info("Configuring xApp Manager at base path {}", url);
+               new URL(url);
+               this.xappMgrUrl = url;
        }
 
        private ApiClient apiClient() {
                ApiClient apiClient = new ApiClient(new RestTemplate());
-               apiClient.setBasePath(xappMgrBasepath);
+               apiClient.setBasePath(xappMgrUrl);
                return apiClient;
        }
 
index 8c48e96..6015f51 100644 (file)
 # ========================LICENSE_END===================================
 ###
 
-# Default properties for the RIC Dashboard backend REST services
+# Defines property keys for the RIC Dashboard, and some defaults
 
-# This lacks any spring prefix
-# The server port number is chosen RANDOMLY when running a test
+# Confusingly, this key has no "spring" prefix
+# The port number is chosen RANDOMLY when running a test
 server.port = 8080
 
 # A1 Mediator
-a1med.basepath = http://localhost:12345
-a1med.delaypath   = /a1ric/delay
-a1med.loadpath    = /a1ric/load
-a1med.metricspath = /a1ric/metrics
+a1med.url = http://A1-URL
 
 # ANR xApp
-anrxapp.basepath = http://localhost:23456
+anrxapp.url = http://ANR-URL
 
 # E2 Manager
-e2mgr.basepath = http://localhost:30098
+e2mgr.url = http://E2-URL
 
 # Xapp Manager
-xappmgr.basepath = http://localhost:30099
+xappmgr.url = http://MGR-URL