From: Lott, Christopher (cl778h) Date: Fri, 29 Nov 2019 19:12:02 +0000 (-0500) Subject: Add RIC instance list and controller method X-Git-Tag: 2.0.0~16 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=a16f2d04fa1af4fe1ea993133a1d106e7fa1da3d;p=portal%2Fric-dashboard.git Add RIC instance list and controller method In the "B" release the Dashboard is expected to support multiple RIC instances. Switch config file format to YAML for ease of maintaining a list, add a mock list of instances, and a new admin controller method that publishes the list. Bump the POM versions to 2.0. Change-Id: Iaa2558b4e1670482d5e7b32f454f9d24de9cef04 Signed-off-by: Lott, Christopher (cl778h) --- diff --git a/a1-med-client/pom.xml b/a1-med-client/pom.xml index f4c88c3f..ca0a871c 100644 --- a/a1-med-client/pom.xml +++ b/a1-med-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT org.o-ran-sc.ric.plt.a1med.client diff --git a/app-mgr-client/pom.xml b/app-mgr-client/pom.xml index 4b41b8e5..4d65e49e 100644 --- a/app-mgr-client/pom.xml +++ b/app-mgr-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT org.o-ran-sc.ric.plt.appmgr.client diff --git a/docs/config-deploy.rst b/docs/config-deploy.rst index 11144eda..f02cbbd5 100644 --- a/docs/config-deploy.rst +++ b/docs/config-deploy.rst @@ -14,7 +14,7 @@ Configuration The application requires the following configuration files:: - application.properties + application.yaml key.properties portal.properties @@ -24,16 +24,16 @@ a configuration map. Application Properties ^^^^^^^^^^^^^^^^^^^^^^ -The file ``application.properties`` must be provided when the -application is launched, either in the current working directory or in -a ``config`` subdirectory (latter is preferred). The Helm chart that -deploys the application should mount this file appropriately. +The file ``application.yaml`` must be provided when the application +is launched, either in the current working directory or in a ``config`` +subdirectory (latter is preferred). The Helm chart that deploys the +application should mount this file appropriately. Many properties have default values cached within the application, in -file ``src/main/resources/application.properties``. Properties with -default values do NOT need to be repeated in a deployment-specific -configuration. Properties without default values MUST be specified in -a deployment-specific configuration. +file ``src/main/resources/application.yaml``. Properties with default +values do NOT need to be repeated in a deployment-specific configuration. +Properties without default values MUST be specified in a +deployment-specific configuration. The properties are listed below in alphabetical order. @@ -200,7 +200,7 @@ Deployment A production server requires the configuration files listed above. All files should be placed in a ``config`` directory. That name is important; Spring automatically searches that directory for the -``application.properties`` file. Further, that directory can easily be +``application.yaml`` file. Further, that directory can easily be placed on the Java classpath so the additional files can be found at runtime. @@ -243,11 +243,3 @@ include the ``config`` directory on the Java classpath:: java -cp config:target/ric-dash-be-1.2.0-SNAPSHOT.jar \ -Dloader.main=org.oransc.ric.portal.dashboard.DashboardApplication \ org.springframework.boot.loader.PropertiesLauncher - -Alternately, to use the configuration in the "application-abc.properties" file, -modify the command to have "spring.config.name=name" like this:: - - java -cp config:target/ric-dash-be-1.2.0-SNAPSHOT.jar \ - -Dspring.config.name=application-abc \ - -Dloader.main=org.oransc.ric.portal.dashboard.DashboardApplication \ - org.springframework.boot.loader.PropertiesLauncher diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 35f6aab0..697f46e1 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,6 +5,12 @@ RIC Dashboard Release Notes =========================== +Version 2.0.0, 2 Dec 2019 +------------------------- +* Change application properties file to YAML format +* Add mock list of RIC instances to application properties +* Add admin controller method to fetch list of RIC instances + Version 1.3.0, 26 Nov 2019 -------------------------- * This is the Amber release version diff --git a/e2-mgr-client/pom.xml b/e2-mgr-client/pom.xml index c50b0d54..ec60d530 100644 --- a/e2-mgr-client/pom.xml +++ b/e2-mgr-client/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT org.o-ran-sc.ric.plt.e2mgr.client diff --git a/pom.xml b/pom.xml index 8b9657b5..8bee35b8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ limitations under the License. ric-dash-parent RIC Dashboard project pom - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT 11 diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index 892ca6fb..7e3f1b56 100644 --- a/webapp-backend/pom.xml +++ b/webapp-backend/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT ric-dash-be RIC Dashboard Webapp backend diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardApplication.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardApplication.java index ed5cf176..8cb774f8 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardApplication.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardApplication.java @@ -22,8 +22,12 @@ package org.oransc.ric.portal.dashboard; import java.lang.invoke.MethodHandles; +import org.oransc.ric.portal.dashboard.config.RICInstanceConfiguration; +import org.oransc.ric.portal.dashboard.model.InstanceTransport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @@ -31,15 +35,23 @@ import org.springframework.context.annotation.ComponentScan; @SpringBootApplication // Limit scan to dashboard classes; exclude generated API classes @ComponentScan("org.oransc.ric.portal.dashboard") -public class DashboardApplication { +public class DashboardApplication implements CommandLineRunner { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Autowired + private RICInstanceConfiguration instanceConfig; + public static void main(String[] args) { SpringApplication.run(DashboardApplication.class, args); - // Ensure this appears on the console by using level WARN - logger.warn("main: version '{}' successful start", - getImplementationVersion(MethodHandles.lookup().lookupClass())); + } + + @Override + public void run(String... args) throws Exception { + // Ensure output appears on the console by using level WARN + logger.warn("run: version '{}'", getImplementationVersion(MethodHandles.lookup().lookupClass())); + for (InstanceTransport it : instanceConfig.getInstances()) + logger.warn("run: RIC instance {}", it); } /** diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/RICInstanceConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/RICInstanceConfiguration.java new file mode 100644 index 00000000..f39f2001 --- /dev/null +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/RICInstanceConfiguration.java @@ -0,0 +1,58 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ + +package org.oransc.ric.portal.dashboard.config; + +import java.util.ArrayList; +import java.util.List; + +import org.oransc.ric.portal.dashboard.model.InstanceTransport; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * Holds the list of RIC instances read from configuration data. This asserts no + * Spring profile such as ("!test"). No mock version of this class is required. + * Populated from a YAML list in the application properties like this: + * + *
+ * ric-instance-list:
+    instances:
+        -
+          key: key1
+          name: Friendly Name One
+        -
+          key: key2
+          name: Friendly Name Two
+ * 
+ */ +@Configuration +@ConfigurationProperties(prefix = "ric-instance-list") +public class RICInstanceConfiguration { + private List instances = new ArrayList<>(); + + public List getInstances() { + return instances; + } + + public void setInstances(List instances) { + this.instances = instances; + } +} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AdminController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AdminController.java index bb3700ed..39488bd1 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AdminController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AdminController.java @@ -28,8 +28,10 @@ import org.onap.portalsdk.core.restful.domain.EcompUser; import org.oransc.ric.portal.dashboard.DashboardApplication; import org.oransc.ric.portal.dashboard.DashboardConstants; import org.oransc.ric.portal.dashboard.DashboardUserManager; +import org.oransc.ric.portal.dashboard.config.RICInstanceConfiguration; import org.oransc.ric.portal.dashboard.model.ErrorTransport; import org.oransc.ric.portal.dashboard.model.IDashboardResponse; +import org.oransc.ric.portal.dashboard.model.InstanceTransport; import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,8 +57,9 @@ public class AdminController { // Publish paths in constants so tests are easy to write public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/admin"; - public static final String USER_METHOD = "user"; public static final String HEALTH_METHOD = "health"; + public static final String INSTANCE_METHOD = "instance"; + public static final String USER_METHOD = "user"; public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD; public static final String XAPPMETRICS_METHOD = "metrics"; @@ -69,6 +72,9 @@ public class AdminController { @Autowired private DashboardUserManager dashboardUserManager; + @Autowired + private RICInstanceConfiguration instanceConfig; + @ApiOperation(value = "Gets the Dashboard MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class) @GetMapping(VERSION_METHOD) // No role required @@ -96,9 +102,17 @@ public class AdminController { return dashboardUserManager.getUsers(); } + @ApiOperation(value = "Gets the list of RIC instances.", response = InstanceTransport.class, responseContainer = "List") + @GetMapping(INSTANCE_METHOD) + @Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD }) + public List getInstances() { + logger.debug("getInstances"); + return instanceConfig.getInstances(); + } + @ApiOperation(value = "Gets the kibana metrics URL for the specified app.", response = SuccessTransport.class) @GetMapping(XAPPMETRICS_METHOD) - // No role required + @Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD }) public IDashboardResponse getAppMetricsUrl(@RequestParam String app, HttpServletResponse response) { String metricsUrl = null; if (DashboardConstants.APP_NAME_AC.equals(app)) diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AppManagerController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AppManagerController.java index 04157462..cf267da0 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AppManagerController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AppManagerController.java @@ -158,7 +158,7 @@ public class AppManagerController { @ApiOperation(value = "Returns a list of deployable xapps.", response = DashboardDeployableXapps.class) @GetMapping(XAPPS_LIST_METHOD) @Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD }) - public Object getAvailableXapps() { + public DashboardDeployableXapps getAvailableXapps() { logger.debug("getAvailableXapps"); AllDeployableXapps appNames = xappApi.listAllDeployableXapps(); // Answer a collection of structure instead of string diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppTransport.java index fbc7bbcb..ea04067f 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppTransport.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/AppTransport.java @@ -21,9 +21,8 @@ package org.oransc.ric.portal.dashboard.model; /** - * Trivial model to transport available application from the App manager. I - * expect that system will soon add additional attributes. This allows coding to - * a structure rather than a scalar. + * Trivial model to transport available application details from the App + * manager. */ public class AppTransport implements IDashboardResponse { @@ -63,4 +62,9 @@ public class AppTransport implements IDashboardResponse { this.version = version; } + @Override + public String toString() { + return this.getClass().getName() + "[name=" + getName() + ", version=" + getVersion() + "]"; + } + } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java index 25a00737..c81a66bc 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/EcompUserDetails.java @@ -83,4 +83,11 @@ public class EcompUserDetails implements UserDetails { return ecompUser.isActive(); } + @Override + public String toString() { + return this.getClass().getName() + "[ecompUser=" + ecompUser + ", isAccountNonExpired=" + isAccountNonExpired() + + ", isAccountNonLocked=" + isAccountNonLocked() + ", isCredentialsNonExpired=" + + isCredentialsNonExpired() + "]"; + } + } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java index 516e3c8e..df5c3e40 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/ErrorTransport.java @@ -130,4 +130,10 @@ public class ErrorTransport implements IDashboardResponse { this.path = path; } + @Override + public String toString() { + return this.getClass().getName() + "[timestamp=" + getTimestamp() + ", error=" + getError() + ", path=" + + getPath() + "]"; + } + } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/InstanceTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/InstanceTransport.java new file mode 100644 index 00000000..9f0ad2b8 --- /dev/null +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/InstanceTransport.java @@ -0,0 +1,52 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ + +package org.oransc.ric.portal.dashboard.model; + +/** + * Trivial model to transport key-name pairs that represent RIC instances. + */ +public class InstanceTransport implements IDashboardResponse { + + private String key; + private String name; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getName() { + return name; + } + + public void setName(String s) { + this.name = s; + } + + @Override + public String toString() { + return this.getClass().getName() + "[key=" + getKey() + ", name=" + getName() + "]"; + } + +} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java index 237ebb06..130a1c56 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java @@ -22,7 +22,7 @@ package org.oransc.ric.portal.dashboard.model; import org.oransc.ric.e2mgr.client.model.GetNodebResponse; import org.oransc.ric.e2mgr.client.model.NodebIdentity; -public class RanDetailsTransport { +public class RanDetailsTransport implements IDashboardResponse { private NodebIdentity nodebIdentity; private GetNodebResponse nodebStatus; @@ -61,4 +61,10 @@ public class RanDetailsTransport { return this; } + @Override + public String toString() { + return this.getClass().getName() + "[nodebIdentity=" + getNodebIdentity() + ", nodebStatus=" + getNodebStatus() + + "]"; + } + } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/SuccessTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/SuccessTransport.java index 9e137890..c0c9a246 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/SuccessTransport.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/SuccessTransport.java @@ -60,4 +60,9 @@ public class SuccessTransport implements IDashboardResponse { this.data = data; } + @Override + public String toString() { + return this.getClass().getName() + "[status=" + getStatus() + ", data=" + getData() + "]"; + } + } diff --git a/webapp-backend/src/main/resources/application.properties b/webapp-backend/src/main/resources/application.properties deleted file mode 100644 index a497f09f..00000000 --- a/webapp-backend/src/main/resources/application.properties +++ /dev/null @@ -1,66 +0,0 @@ -# ========================LICENSE_START================================= -# O-RAN-SC -# %% -# Copyright (C) 2019 AT&T Intellectual Property -# %% -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ========================LICENSE_END=================================== - -# Defines RIC Dashboard property keys and default values. -# Create a copy in the launch directory to override values; or -# copy to "application-abc.properties" as mentioned in the README. - -# A spring property but without a "spring" prefix; -# the port number is chosen RANDOMLY when running tests -server.port = 8080 - -# path to file that stores user details; -# use a persistent volume in a K8S deployment -userfile = users.json - -# boolean flag whether to enforce Portal user and roles on requests -portalapi.security = true -# class that decrypts ciphertext from Portal -portalapi.decryptor = org.oransc.ric.portal.dashboard.portalapi.PortalSdkDecryptorAes -# name of request cookie with user ID -portalapi.usercookie = UserId - -# portal credentials must be supplied at deployment time -portalapi.appname = RIC Dashboard -portalapi.username = -portalapi.password = - -# endpoint URLs must be supplied at deployment time -# A1 Mediator -a1med.url.prefix = http://jar-app-props-default-A1-URL-prefix -a1med.url.suffix = -# App Manager -appmgr.url.prefix = http://jar-app-props-default-Xapp-Mgr-URL -appmgr.url.suffix = /ric/v1 -# E2 Manager -e2mgr.url.prefix = http://jar-app-props-default-E2-URL -e2mgr.url.suffix = /v1 -# Kubernetes API via https://github.com/nokia/caas-ingress -# Set insecure=true to disable SSL certificate and hostname checking -caasingress.insecure = true -caasingress.aux.url.prefix = https://jar-app-props-default-caas-ingress-aux-URL -caasingress.aux.url.suffix = /api -caasingress.plt.url.prefix = https://jar-app-props-default-caas-ingress-plt-URL -caasingress.plt.url.suffix = /api - -# Mimic slow endpoints by defining sleep period, in milliseconds -mock.config.delay = 0 - -# Kibana report on metrics -metrics.url.ac = http://jar-app-props-kibana-url-ac -metrics.url.mc = http://jar-app-props-kibana-url-mc diff --git a/webapp-backend/src/main/resources/application.yaml b/webapp-backend/src/main/resources/application.yaml new file mode 100644 index 00000000..ae4bdee8 --- /dev/null +++ b/webapp-backend/src/main/resources/application.yaml @@ -0,0 +1,100 @@ +# ========================LICENSE_START================================= +# O-RAN-SC +# %% +# Copyright (C) 2019 AT&T Intellectual Property +# %% +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ========================LICENSE_END=================================== + +# Defines RIC Dashboard property keys and default values. +# Create a copy in the launch directory to override values. +--- + +# This file defines no profile(s). +# These properties are largely ignored when the test profile is active. + +# A spring property but without a "spring" prefix; +# the port number is chosen RANDOMLY when running tests +server: + port: 8080 + +# path to file that stores user details; +# use a persistent volume in a K8S deployment +userfile: users.json + +# Dashboard properties related to Portal +portalapi: + # boolean flag whether to enforce Portal user and roles on requests + security: true + # class that decrypts ciphertext from Portal + decryptor: org.oransc.ric.portal.dashboard.portalapi.PortalSdkDecryptorAes + # name of request cookie with user ID + usercookie: UserId + # portal credentials must be supplied at deployment time + appname: RIC Dashboard + username: + password: + +# endpoint URLs must be supplied at deployment time + +# A1 Mediator +a1med: + url: + prefix: http://jar-app-props-default-A1-URL-prefix + suffix: + +# App Manager +appmgr: + url: + prefix: http://jar-app-props-default-Xapp-Mgr-URL + suffix: /ric/v1 + +# E2 Manager +e2mgr: + url: + prefix: http://jar-app-props-default-E2-URL + suffix: /v1 + +# Kubernetes API via https://github.com/nokia/caas-ingress +caasingress: + # Set insecure=true to disable SSL certificate and hostname checking + insecure: true + aux: + url: + prefix: https://jar-app-props-default-caas-ingress-aux-URL + suffix: /api + plt: + url: + prefix: https://jar-app-props-default-caas-ingress-plt-URL + suffix: /api + +# Mimic slow endpoints by defining sleep period, in milliseconds +mock: + config: + delay: 0 + +# Kibana report on metrics +metrics: + url: + ac: http://jar-app-props-kibana-url-ac + mc: http://jar-app-props-kibana-url-mc + +# Instances +ric-instance-list: + instances: + - + key: i1 + name: Primary RIC Instance + - + key: i2 + name: RIC Instance Nr Two diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AdminControllerTest.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AdminControllerTest.java index 8e426ad8..f1c26806 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AdminControllerTest.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/AdminControllerTest.java @@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test; import org.onap.portalsdk.core.restful.domain.EcompUser; import org.oransc.ric.portal.dashboard.DashboardConstants; import org.oransc.ric.portal.dashboard.model.ErrorTransport; +import org.oransc.ric.portal.dashboard.model.InstanceTransport; import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,6 +58,16 @@ public class AdminControllerTest extends AbstractControllerTest { Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); } + @Test + public void getInstancesTest() { + URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.INSTANCE_METHOD); + logger.info("Invoking {}", uri); + ResponseEntity> response = testRestTemplateStandardRole().exchange(uri, HttpMethod.GET, + null, new ParameterizedTypeReference>() { + }); + Assertions.assertFalse(response.getBody().isEmpty()); + } + @Test public void getUsersTest() { URI uri = buildUri(null, AdminController.CONTROLLER_PATH, AdminController.USER_METHOD); diff --git a/webapp-frontend/pom.xml b/webapp-frontend/pom.xml index 9ae5d0b7..c10fe174 100644 --- a/webapp-frontend/pom.xml +++ b/webapp-frontend/pom.xml @@ -25,7 +25,7 @@ limitations under the License. org.o-ran-sc.portal.ric-dashboard ric-dash-parent - 1.3.0-SNAPSHOT + 2.0.0-SNAPSHOT ric-dash-fe RIC Dashboard Webapp frontend