Upgrade to E2Manager API version 4.4.4 22/3222/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 8 Apr 2020 20:11:21 +0000 (16:11 -0400)
committerChris Lott <cl778h@att.com>
Fri, 24 Apr 2020 17:26:26 +0000 (17:26 +0000)
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) <cl778h@att.com>
dashboard/e2-mgr-client/pom.xml
dashboard/e2-mgr-client/ric-plt-e2mgr
dashboard/webapp-backend/pom.xml
dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java
dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java
dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/E2ManagerControllerTest.java
docs/release-notes.rst

index d19f810..564ff70 100644 (file)
@@ -31,7 +31,7 @@ limitations under the License.
        <groupId>org.o-ran-sc.ric-plt.e2mgr.client</groupId>
        <artifactId>e2-mgr-client</artifactId>
        <name>RIC E2 Manager Client</name>
-       <version>3.0.3-SNAPSHOT</version>
+       <version>4.4.4-SNAPSHOT</version>
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -102,7 +102,7 @@ limitations under the License.
                                                        <goal>generate</goal>
                                                </goals>
                                                <configuration>
-                                                       <inputSpec>${project.basedir}/ric-plt-e2mgr/Swagger/E2Manager_API.yaml</inputSpec>
+                                                       <inputSpec>${project.basedir}/ric-plt-e2mgr/Swagger/E2M_API_2020-04-23.yaml</inputSpec>
                                                        <language>java</language>
                                                        <packageName>${client.base.package.name}</packageName>
                                                        <modelPackage>${client.base.package.name}.model</modelPackage>
index 380b7a2..4c67d61 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 380b7a2a46087a054ebfac57f3dbf7949d318cc6
+Subproject commit 4c67d61c4898a775d1280ee6fadd83637317037a
index 9df3855..247ba83 100644 (file)
@@ -52,7 +52,7 @@ limitations under the License.
                <dependency>
                        <groupId>org.o-ran-sc.ric-plt.e2mgr.client</groupId>
                        <artifactId>e2-mgr-client</artifactId>
-                       <version>3.0.3-SNAPSHOT</version>
+                       <version>4.4.4-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>org.onap.portal.sdk</groupId>
index 349a607..dabb6b4 100644 (file)
@@ -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<String> 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<String> 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);
        }
 
index 16e2c75..942c3c3 100644 (file)
@@ -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<NodebIdentity> nodebIdList = new ArrayList<>();
                final Map<String, GetNodebResponse> 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);
index 844e7e2..64dc4a7 100644 (file)
@@ -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<UpdateGnbRequest> entity = new HttpEntity<>(update);
+               ResponseEntity<Void> 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<ResetRequest> entity = new HttpEntity<>(reset);
-               ResponseEntity<Void> 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);
index 2252822..122844f 100644 (file)
@@ -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
 --------------------------