From: Lott, Christopher (cl778h) Date: Tue, 30 Apr 2019 19:49:49 +0000 (-0400) Subject: Log configuration details to ease debugging X-Git-Tag: R2~121 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=0f3312b36f849df0e1671c333e0072aca3a1acf6;hp=1275b31b7d0d4b9056e671614761452c151be008;p=portal%2Fric-dashboard.git Log configuration details to ease debugging Add rudimentary docs dir Change-Id: Ie5b4b98c1b001d4969b485f3dbdcbff2c220d6f1 Signed-off-by: Lott, Christopher (cl778h) --- diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..f3a7116a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,33 @@ +.. ===============LICENSE_START======================================================= +.. O-RAN SC CC-BY-4.0 +.. %% +.. Copyright (C) 2019 AT&T Intellectual Property and Nokia +.. %% +.. 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========================================================= + +.. RIC Dashboard documentation master + +============= +RIC Dashboard +============= + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + overview.rst + release-notes.rst + +* :ref:`search` diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 00000000..21029052 --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1,25 @@ +.. ===============LICENSE_START======================================================= +.. O-RAN SC CC-BY-4.0 +.. %% +.. Copyright (C) 2019 AT&T Intellectual Property and Nokia +.. %% +.. 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========================================================= + +====================== +RIC Dashboard Overview +====================== + +The O-RAN SC RIC Dashboard provides administrative and operator functions. +The web app is built as a single-page app using an Angular front end and a +Java Spring-Boot back end. diff --git a/docs/release-notes.rst b/docs/release-notes.rst new file mode 100644 index 00000000..05e1c236 --- /dev/null +++ b/docs/release-notes.rst @@ -0,0 +1,25 @@ +.. ===============LICENSE_START======================================================= +.. O-RAN SC CC-BY-4.0 +.. %% +.. Copyright (C) 2019 AT&T Intellectual Property and Nokia +.. %% +.. 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========================================================= + +=========================== +RIC Dashboard Release Notes +=========================== + +Version 1.0.0, 30 Apr 2019 +-------------------------- +* Initial version diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java index 78d02c40..6498ee1c 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerConfiguration.java @@ -19,12 +19,17 @@ */ package org.oranosc.ric.portal.dash.config; +import java.lang.invoke.MethodHandles; + import org.oranosc.ric.e2mgr.client.api.DefaultApi; import org.oranosc.ric.e2mgr.client.invoker.ApiClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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; @@ -32,14 +37,18 @@ import org.springframework.web.client.RestTemplate; * Creates an E2 manager client as a bean to be managed by the Spring container. */ @Configuration +@Profile("!mock") public class E2ManagerConfiguration { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + // Populated by the autowired constructor private final String e2mgrBasepath; @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; } diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java index e57992ae..3ce923b3 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/E2ManagerMockConfiguration.java @@ -24,12 +24,15 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.lang.invoke.MethodHandles; + import org.oranosc.ric.e2mgr.client.api.DefaultApi; import org.oranosc.ric.e2mgr.client.invoker.ApiClient; import org.oranosc.ric.e2mgr.client.model.RanSetupRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Profile; import org.springframework.http.HttpStatus; @@ -41,8 +44,13 @@ import org.springframework.http.HttpStatus; @Configuration public class E2ManagerMockConfiguration { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + public E2ManagerMockConfiguration() { + logger.info("Configuring mock E2 Manager"); + } + @Bean - @Primary public DefaultApi e2ManagerMockClient() { ApiClient mockClient = mock(ApiClient.class); when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK); diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java index 28183234..a980e16d 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerConfiguration.java @@ -19,12 +19,17 @@ */ package org.oranosc.ric.portal.dash.config; +import java.lang.invoke.MethodHandles; + import org.oranosc.ric.xappmgr.client.api.DefaultApi; import org.oranosc.ric.xappmgr.client.invoker.ApiClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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; @@ -33,14 +38,18 @@ import org.springframework.web.client.RestTemplate; * container. */ @Configuration +@Profile("!mock") public class XappManagerConfiguration { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + // Populated by the autowired constructor private final String xappMgrBasepath; @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; } diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java index 48290972..c1e1675e 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/config/XappManagerMockConfiguration.java @@ -24,6 +24,8 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.lang.invoke.MethodHandles; + import org.oranosc.ric.xappmgr.client.api.DefaultApi; import org.oranosc.ric.xappmgr.client.invoker.ApiClient; import org.oranosc.ric.xappmgr.client.model.AllXapps; @@ -32,9 +34,10 @@ import org.oranosc.ric.xappmgr.client.model.SubscriptionResponse; import org.oranosc.ric.xappmgr.client.model.XAppInfo; import org.oranosc.ric.xappmgr.client.model.Xapp; import org.oranosc.ric.xappmgr.client.model.Xapp.StatusEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Profile; import org.springframework.http.HttpStatus; @@ -46,9 +49,12 @@ import org.springframework.http.HttpStatus; @Configuration public class XappManagerMockConfiguration { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private final AllXapps allXapps; public XappManagerMockConfiguration() { + logger.info("Configuring mock xApp Manager"); allXapps = new AllXapps(); allXapps.add(new Xapp().name("Pendulum Control").version("v1").status(StatusEnum.DEPLOYED)); allXapps.add(new Xapp().name("Dual Connectivity").version("v2").status(StatusEnum.DELETED)); @@ -57,7 +63,6 @@ public class XappManagerMockConfiguration { } @Bean - @Primary public DefaultApi xappManagerMockClient() { ApiClient mockClient = mock(ApiClient.class); when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK); diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java index 67cfadf0..ea46c198 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/E2ManagerController.java @@ -65,6 +65,8 @@ public class E2ManagerController { @Autowired public E2ManagerController(final DefaultApi e2MgrClient) { Assert.notNull(e2MgrClient, "client must not be null"); + if (logger.isDebugEnabled()) + logger.debug("ctor: configured with client type {}", e2MgrClient.getClass().getName()); this.e2MgrClient = e2MgrClient; } diff --git a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java index 094d518b..9eb62e8a 100644 --- a/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java +++ b/webapp-backend/src/main/java/org/oranosc/ric/portal/dash/controller/XappManagerController.java @@ -61,6 +61,8 @@ public class XappManagerController { @Autowired public XappManagerController(final DefaultApi xappMgrClient) { Assert.notNull(xappMgrClient, "client must not be null"); + if (logger.isDebugEnabled()) + logger.debug("ctor: configured with client type {}", xappMgrClient.getClass().getName()); this.xappMgrClient = xappMgrClient; } @@ -75,7 +77,8 @@ public class XappManagerController { @ApiOperation(value = "Calls the xApp Manager to get the list of xApps.", response = AllXapps.class) @RequestMapping(value = "/xapps", method = RequestMethod.GET) public AllXapps getAllXapps() { - logger.debug("getAllXapps via " + xappMgrClient.getApiClient().getBasePath()); + if (logger.isDebugEnabled()) + logger.debug("getAllXapps via {}", xappMgrClient.getApiClient().getBasePath()); return xappMgrClient.getAllXapps(); } diff --git a/webapp-backend/src/main/resources/logback.xml b/webapp-backend/src/main/resources/logback.xml index 8291117e..4f213aeb 100644 --- a/webapp-backend/src/main/resources/logback.xml +++ b/webapp-backend/src/main/resources/logback.xml @@ -63,6 +63,6 @@ > - +