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
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
* 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
--------------------------
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;
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;
/**
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;
}
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;
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;
/**
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;
}
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;
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;
/**
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;
}
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");
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;
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;
/**
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;
}
# ========================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