From: Lott, Christopher (cl778h) Date: Wed, 8 Apr 2020 20:11:21 +0000 (-0400) Subject: Upgrade to E2Manager API version 4.4.4 X-Git-Tag: 2.0.2~2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=731af08c2d94f769098a56a41204125b12c7a578;p=portal%2Fric-dashboard.git Upgrade to E2Manager API version 4.4.4 The change adds method updateGnb, drops method reset. Update back-end controllers for the API changes. No changes to front end; there is no UI for updateGnb. Issue-ID: OAM-71 Change-Id: I7854491c757a3fc734fe020c6dfbc836e0190f63 Signed-off-by: Lott, Christopher (cl778h) --- diff --git a/dashboard/e2-mgr-client/pom.xml b/dashboard/e2-mgr-client/pom.xml index d19f810c..564ff700 100644 --- a/dashboard/e2-mgr-client/pom.xml +++ b/dashboard/e2-mgr-client/pom.xml @@ -31,7 +31,7 @@ limitations under the License. org.o-ran-sc.ric-plt.e2mgr.client e2-mgr-client RIC E2 Manager Client - 3.0.3-SNAPSHOT + 4.4.4-SNAPSHOT UTF-8 UTF-8 @@ -102,7 +102,7 @@ limitations under the License. generate - ${project.basedir}/ric-plt-e2mgr/Swagger/E2Manager_API.yaml + ${project.basedir}/ric-plt-e2mgr/Swagger/E2M_API_2020-04-23.yaml java ${client.base.package.name} ${client.base.package.name}.model diff --git a/dashboard/e2-mgr-client/ric-plt-e2mgr b/dashboard/e2-mgr-client/ric-plt-e2mgr index 380b7a2a..4c67d61c 160000 --- a/dashboard/e2-mgr-client/ric-plt-e2mgr +++ b/dashboard/e2-mgr-client/ric-plt-e2mgr @@ -1 +1 @@ -Subproject commit 380b7a2a46087a054ebfac57f3dbf7949d318cc6 +Subproject commit 4c67d61c4898a775d1280ee6fadd83637317037a diff --git a/dashboard/webapp-backend/pom.xml b/dashboard/webapp-backend/pom.xml index 9df38550..247ba83a 100644 --- a/dashboard/webapp-backend/pom.xml +++ b/dashboard/webapp-backend/pom.xml @@ -52,7 +52,7 @@ limitations under the License. org.o-ran-sc.ric-plt.e2mgr.client e2-mgr-client - 3.0.3-SNAPSHOT + 4.4.4-SNAPSHOT org.onap.portal.sdk diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java index 349a607a..dabb6b47 100644 --- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java +++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java @@ -32,7 +32,7 @@ import org.oransc.ricplt.e2mgr.client.api.HealthCheckApi; import org.oransc.ricplt.e2mgr.client.api.NodebApi; import org.oransc.ricplt.e2mgr.client.model.GetNodebResponse; import org.oransc.ricplt.e2mgr.client.model.NodebIdentity; -import org.oransc.ricplt.e2mgr.client.model.ResetRequest; +import org.oransc.ricplt.e2mgr.client.model.UpdateGnbRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -75,8 +75,6 @@ public class E2ManagerController { public static final String RAN_METHOD = NODEB_PREFIX + "/ran"; public static final String NODEB_SHUTDOWN_METHOD = NODEB_PREFIX + "/shutdown"; public static final String NODEB_LIST_METHOD = NODEB_PREFIX + "/ids"; - // Reset uses prefix, adds a path parameter below - public static final String RESET_METHOD = "reset"; // Path parameters private static final String PP_RANNAME = "ranName"; @@ -165,15 +163,15 @@ public class E2ManagerController { return ResponseEntity.status(api.getApiClient().getStatusCode().value()).body(null); } - @ApiOperation(value = "Abort any other ongoing procedures over X2 between the RIC and the RAN.") + @ApiOperation(value = "Update GNB.") @PutMapping(DashboardConstants.RIC_INSTANCE_KEY + "/{" + DashboardConstants.RIC_INSTANCE_KEY + "}/" + NODEB_PREFIX - + "/{" + PP_RANNAME + "}/" + RESET_METHOD) + + "/{" + PP_RANNAME + "}") @Secured({ DashboardConstants.ROLE_ADMIN }) - public ResponseEntity reset(@PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey, - @PathVariable(PP_RANNAME) String ranName, @RequestBody ResetRequest resetRequest) { - logger.debug("reset instance {} name {}", instanceKey, ranName); + public ResponseEntity updateGnb(@PathVariable(DashboardConstants.RIC_INSTANCE_KEY) String instanceKey, + @PathVariable(PP_RANNAME) String ranName, @RequestBody UpdateGnbRequest updateGnbRequest) { + logger.debug("updateGnb instance {} ran {}", instanceKey, ranName); NodebApi api = e2ManagerApiBuilder.getNodebApi(instanceKey); - api.reset(ranName, resetRequest); + api.updateGnb(updateGnbRequest, ranName); return ResponseEntity.status(api.getApiClient().getStatusCode().value()).body(null); } diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java index 16e2c75c..942c3c36 100644 --- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java +++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java @@ -36,8 +36,8 @@ import org.oransc.ricplt.e2mgr.client.api.NodebApi; import org.oransc.ricplt.e2mgr.client.invoker.ApiClient; import org.oransc.ricplt.e2mgr.client.model.GetNodebResponse; import org.oransc.ricplt.e2mgr.client.model.NodebIdentity; -import org.oransc.ricplt.e2mgr.client.model.NodebIdentityGlobalNbId; -import org.oransc.ricplt.e2mgr.client.model.ResetRequest; +import org.oransc.ricplt.e2mgr.client.model.UpdateGnbRequest; +import org.oransc.ricplt.e2mgr.client.model.UpdateGnbResponseGlobalNbId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -95,7 +95,7 @@ public class E2ManagerMockConfiguration { */ private NodebApi nodebApi(String instanceKey) { - final NodebIdentityGlobalNbId globalNbId = new NodebIdentityGlobalNbId().nbId("mockNbId-" + instanceKey) + final UpdateGnbResponseGlobalNbId globalNbId = new UpdateGnbResponseGlobalNbId().nbId("mockNbId-" + instanceKey) .plmnId("mockPlmId"); final List nodebIdList = new ArrayList<>(); final Map nodebResponseMap = new HashMap<>(); @@ -128,11 +128,11 @@ public class E2ManagerMockConfiguration { }).when(mockApi).nodebShutdownPut(); doAnswer(inv -> { if (delayMs > 0) { - logger.debug("reset sleeping {}", delayMs); + logger.debug("updateGnb sleeping {}", delayMs); Thread.sleep(delayMs); } return null; - }).when(mockApi).reset(any(String.class), any(ResetRequest.class)); + }).when(mockApi).updateGnb(any(UpdateGnbRequest.class), any(String.class)); doAnswer(inv -> { if (delayMs > 0) { logger.debug("getNb sleeping {}", delayMs); diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java index 844e7e2c..64dc4a7b 100644 --- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java +++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java @@ -35,7 +35,7 @@ import org.oransc.ric.portal.dashboard.model.RanDetailsTransport; import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.oransc.ricplt.e2mgr.client.model.GetNodebResponse; import org.oransc.ricplt.e2mgr.client.model.NodebIdentity; -import org.oransc.ricplt.e2mgr.client.model.ResetRequest; +import org.oransc.ricplt.e2mgr.client.model.UpdateGnbRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.ParameterizedTypeReference; @@ -48,6 +48,17 @@ public class E2ManagerControllerTest extends AbstractControllerTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @Test + public void updateGnb() { + URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, + RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_PREFIX, "nobeb"); + logger.info("Invoking {}", uri); + UpdateGnbRequest update = new UpdateGnbRequest(); + HttpEntity entity = new HttpEntity<>(update); + ResponseEntity voidResponse = testRestTemplateAdminRole().exchange(uri, HttpMethod.PUT, entity, Void.class); + Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); + } + @Test @Order(1) public void versionTest() { @@ -102,25 +113,9 @@ public class E2ManagerControllerTest extends AbstractControllerTest { Assertions.assertNotNull(response.getRanName()); } - // This empties the list of RAN elements - @Test - @Order(6) - public void resetTest() { - URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, - RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_PREFIX, "ignored", - E2ManagerController.RESET_METHOD); - logger.info("Invoking {}", uri); - ResetRequest reset = new ResetRequest(); - HttpEntity entity = new HttpEntity<>(reset); - ResponseEntity voidResponse = testRestTemplateAdminRole().exchange(uri, HttpMethod.PUT, entity, - Void.class); - logger.debug("resetTest: response {}", voidResponse); - Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); - } - // Aka big--button test, run this last @Test - @Order(7) + @Order(6) public void nodebShutdownPutTest() { URI uri = buildUri(null, E2ManagerController.CONTROLLER_PATH, DashboardConstants.RIC_INSTANCE_KEY, RICInstanceMockConfiguration.INSTANCE_KEY_1, E2ManagerController.NODEB_SHUTDOWN_METHOD); diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 22528226..122844fa 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,7 +5,7 @@ RIC Dashboard Release Notes =========================== -Version 2.0.1, 15 Apr 2020 +Version 2.0.1, 23 Apr 2020 -------------------------- * update and relocate the theme selector button * Revise controllers to use ResponseEntity @@ -16,6 +16,7 @@ Version 2.0.1, 15 Apr 2020 * Set the first instance as the default one * Add methods to create, update and delete xApp stat metric URLs * Rearrange property files to support testing default context +* Update E2Manager API to version 4.4.4 with updateGnb method Version 2.0.0, 5 Feb 2020 --------------------------