From 0d109ab39573a2d912bc1d963ab93f3006730721 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 28 May 2019 09:17:51 -0400 Subject: [PATCH] Upgrade ANR API to version 0.0.7 Change-Id: I5c21964e98c5a8202dd40ed10ceca6b39f72dcf2 Signed-off-by: Lott, Christopher (cl778h) --- anr-xapp-client/pom.xml | 4 +- .../src/main/resources/anr_swagger_0.0.7.yaml | 228 +++++++++++++++++++++ docs/release-notes.rst | 2 +- webapp-backend/pom.xml | 2 +- .../ric/portal/dashboard/DashboardApplication.java | 3 +- .../dashboard/config/AnrXappConfiguration.java | 6 - .../dashboard/config/AnrXappMockConfiguration.java | 20 +- .../config/E2ManagerMockConfiguration.java | 2 +- .../dashboard/controller/AnrXappController.java | 10 +- .../controller/HealthcheckController.java | 3 +- 10 files changed, 245 insertions(+), 35 deletions(-) create mode 100644 anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml diff --git a/anr-xapp-client/pom.xml b/anr-xapp-client/pom.xml index 168a252c..83f79e28 100644 --- a/anr-xapp-client/pom.xml +++ b/anr-xapp-client/pom.xml @@ -31,7 +31,7 @@ limitations under the License. org.o-ran-sc.ric.anrxapp.client anr-xapp-client RIC ANR xApp client - 0.0.6-SNAPSHOT + 0.0.7-SNAPSHOT UTF-8 UTF-8 @@ -104,7 +104,7 @@ limitations under the License. generate - ${project.basedir}/src/main/resources/anr_swagger_0.0.6.yaml + ${project.basedir}/src/main/resources/anr_swagger_0.0.7.yaml java ${project.groupId} diff --git a/anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml b/anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml new file mode 100644 index 00000000..2818b020 --- /dev/null +++ b/anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml @@ -0,0 +1,228 @@ +# ========================LICENSE_START================================= +# O-RAN-SC +# %% +# 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=================================== +swagger : '2.0' +info : + description : REST API specification for RIC ANR closed xAPP + version : 0.0.7 + title : RIC ANR + license: + name : Nokia Closed App + url : 'http://www.nokia.com' +host : anr-service +basePath : /ric/v1 +schemes : + - http +paths : + /health/alive : + get : + summary : Health check of ANR - Liveness probe + tags : + - health + operationId : getHealthAlive + responses : + '200' : + description : Status of ANR xApp is ok + /health/ready : + get : + summary : Health check of ANR - Readiness probe + tags : + - health + operationId : getHealthReady + responses : + '200': + description : ANR xApp is ready to serve + /ncrt/gnodebs : + get : + summary : Returns list of gNodeB IDs based on NCRT in ANR + tags : + - ncrt + operationId : getgNodeB + produces : + - application/json + responses : + '200' : + description : successful operation + schema : + $ref : '#/definitions/ggNodeBTable' + '500' : + description : Unable to retrieve gNodeBs + /ncrt/servingcells : + get : + summary : Returns neighbor cell relation table for all gNodeBs or based on query string + tags : + - ncrt + operationId : getNcrt + parameters : + - $ref : '#/parameters/ggnodeb' + - $ref : '#/parameters/servingCellNrcgi' + - $ref : '#/parameters/neighborCellNrpci' + produces : + - application/json + responses : + '200' : + description : successful operation + schema : + $ref : '#/definitions/neighborCellRelationTable' + '500' : + description : Unable to retrieve NCRT + /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} : + parameters : + - $ref : '#/parameters/servCellNrcgi' + - $ref : '#/parameters/neighCellNrpci' + put : + summary : Modify neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI + tags : + - ncrt + operationId : modifyNcrt + consumes : + - application/json + produces : + - application/json + parameters : + - name : NcrtModificationParameters + in : body + description : Parameters to modify neighbor cell relation + required : true + schema : + $ref : '#/definitions/neighborCellRelationMod' + responses : + '200' : + description : Successfully modified neighbor cell relation + '400' : + description : Modification failed. + { Non-existent identifier {servCellNrcgi | neighCellNrpci} in request | + Invalid data in body + } + '500' : + description : Modification failed + delete : + summary : Delete neighbor cell relation based on Source Cell NRCGI and Neighbor Cell NRPCI + tags : + - ncrt + operationId : deleteNcrt + responses : + '204' : + description : Successfully deleted neighbor cell relation + '400' : + description : Deletion failed. + { Non-existent identifier {servCellNrcgi | neighCellNrpci} in request } + '500' : + description : Deletion failed +parameters : + ggnodeb : + type : string + name : ggnodeb + description : Global gNodeB Identifier + in : query + servingCellNrcgi : + type : string + name : servingCellNrcgi + description : Serving Cell Identifier (NR CGI) + in : query + neighborCellNrpci : + type : string + name : neighborCellNrpci + description : Neighbor Cell Identifier (NR PCI) + in : query + servCellNrcgi : + type : string + name : servCellNrcgi + description : Serving Cell Identifier (NR CGI) + in : path + required : true + neighCellNrpci : + type : string + name : neighCellNrpci + description : Neighbor Cell Identifier (NR PCI) + in : path + required : true +definitions : + ggNodeBTable : + type : object + properties : + gNodeBIds : + type : array + items : + $ref : '#/definitions/ggnodebId' + neighborCellRelationTable : + type : object + properties : + ncrtRelations : + type : array + items : + $ref : '#/definitions/neighborCellRelation' + ggnodebId : + type : string + description : Global gNodeB Identifier + example : ABCDE, EFGHI + neighborCellRelation : + type : object + required : + - servingCellNrcgi + - neighborCellNrpci + - neighborCellNrcgi + - flagNoHo + - flagNoXn + - flagNoRemove + properties : + servingCellNrcgi : + type : string + description : Serving Cell Identifier (NR CGI) + example : E12345 + neighborCellNrpci : + type : string + description : Neighbor Cell Identifier (NR PCI) + example : E12345 + neighborCellNrcgi : + type : string + description : Neighbor Cell Identifier (NR CGI) + example : E12345 + flagNoHo : + type : boolean + description : Flag for HANDOVER NOT ALLOWED + example : True + flagNoXn : + type : boolean + description : Flag for Xn CONNECTION NOT ALLOWED + example : True + flagNoRemove : + type : boolean + description : Flag for DELETION NOT ALLOWED + example : True + neighborCellRelationMod : + type : object + required : + - neighborCellIdentifierType + - action + properties : + neighborCellNrcgi : + type : string + description : Neighbor Cell Identifier (NR CGI) + example : E12345 + flagNoHo : + type : boolean + description : Flag for HANDOVER NOT ALLOWED + example : True + flagNoXn : + type : boolean + description : Flag for Xn CONNECTION NOT ALLOWED + example : True + flagNoRemove : + type : boolean + description : Flag for DELETION NOT ALLOWED + example : True diff --git a/docs/release-notes.rst b/docs/release-notes.rst index a15feb54..5b453f42 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -25,7 +25,7 @@ Version 1.0.3, 22 May 2019 * Add AC xApp controller to backend * Add AC xApp interface to frontend * Add RAN type radio selector to connection setup -* Update ANR xApp client to spec version 0.0.6 +* Update ANR xApp client to spec version 0.0.7 * Update E2 manager client to spec version 20190515 * Update xApp manager client to spec version 0.1.3 * Add get-version methods to all controllers diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index 81e332d4..a0425276 100644 --- a/webapp-backend/pom.xml +++ b/webapp-backend/pom.xml @@ -42,7 +42,7 @@ limitations under the License. org.o-ran-sc.ric.anrxapp.client anr-xapp-client - 0.0.6-SNAPSHOT + 0.0.7-SNAPSHOT org.o-ran-sc.ric.e2mgr.client 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 c9a98e43..4cf2fd2a 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 @@ -38,7 +38,8 @@ public class DashboardApplication { public static void main(String[] args) { SpringApplication.run(DashboardApplication.class, args); // Force this onto the console by using level WARN - logger.warn("main: version '{}' successful start", getImplementationVersion(MethodHandles.lookup().lookupClass())); + logger.warn("main: version '{}' successful start", + getImplementationVersion(MethodHandles.lookup().lookupClass())); } /** diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java index d6063abb..3a2e810b 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappConfiguration.java @@ -21,7 +21,6 @@ package org.oransc.ric.portal.dashboard.config; import java.lang.invoke.MethodHandles; -import org.oransc.ric.anrxapp.client.api.GnodebsApi; import org.oransc.ric.anrxapp.client.api.HealthApi; import org.oransc.ric.anrxapp.client.api.NcrtApi; import org.oransc.ric.anrxapp.client.invoker.ApiClient; @@ -65,11 +64,6 @@ public class AnrXappConfiguration { return new HealthApi(apiClient()); } - @Bean - public GnodebsApi anrGnodebsApi() { - return new GnodebsApi(apiClient()); - } - @Bean public NcrtApi anrNcrtApi() { return new NcrtApi(apiClient()); diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java index bfaad92c..578107f8 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java @@ -29,7 +29,6 @@ import static org.mockito.Mockito.when; import java.lang.invoke.MethodHandles; -import org.oransc.ric.anrxapp.client.api.GnodebsApi; import org.oransc.ric.anrxapp.client.api.HealthApi; import org.oransc.ric.anrxapp.client.api.NcrtApi; import org.oransc.ric.anrxapp.client.invoker.ApiClient; @@ -53,7 +52,7 @@ public class AnrXappMockConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final NeighborCellRelationTable ncrt, ncrtNodeB1, ncrtNodeB2; - + public AnrXappMockConfiguration() { logger.info("Configuring mock ANR xApp client"); ncrtNodeB1 = new NeighborCellRelationTable(); @@ -95,15 +94,6 @@ public class AnrXappMockConfiguration { }).when(mockApi).getHealthReady(); return mockApi; } - - @Bean - public GnodebsApi anrGnodebsMockApi() { - ApiClient mockClient = mock(ApiClient.class); - when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK); - GnodebsApi mockApi = mock(GnodebsApi.class); - - return mockApi; - } @Bean public NcrtApi ncrtMockApi() { @@ -111,10 +101,10 @@ public class AnrXappMockConfiguration { NcrtApi mockApi = mock(NcrtApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); // Swagger sends nulls; front end sends empty strings - when(mockApi.getNcrtInfo((String) isNull(), (String) isNull(), (String) isNull())).thenReturn(ncrt); - when(mockApi.getNcrtInfo(eq(""), any(String.class), any(String.class))).thenReturn(ncrt); - when(mockApi.getNcrtInfo(startsWith("A"), any(String.class), any(String.class))).thenReturn(ncrtNodeB1); - when(mockApi.getNcrtInfo(startsWith("B"), any(String.class), any(String.class))).thenReturn(ncrtNodeB2); + when(mockApi.getNcrt((String) isNull(), (String) isNull(), (String) isNull())).thenReturn(ncrt); + when(mockApi.getNcrt(eq(""), any(String.class), any(String.class))).thenReturn(ncrt); + when(mockApi.getNcrt(startsWith("A"), any(String.class), any(String.class))).thenReturn(ncrtNodeB1); + when(mockApi.getNcrt(startsWith("B"), any(String.class), any(String.class))).thenReturn(ncrtNodeB2); doAnswer(i -> { return null; }).when(mockApi).deleteNcrt(any(String.class), any(String.class)); diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java index 74d8c554..d6ff9b8e 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java @@ -66,7 +66,7 @@ public class E2ManagerMockConfiguration { doAnswer(i -> { return null; }).when(mockApi).healthGet(); - + return mockApi; } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java index b3cdcbbf..7f14cdee 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java @@ -23,7 +23,6 @@ import java.lang.invoke.MethodHandles; import javax.servlet.http.HttpServletResponse; -import org.oransc.ric.anrxapp.client.api.GnodebsApi; import org.oransc.ric.anrxapp.client.api.HealthApi; import org.oransc.ric.anrxapp.client.api.NcrtApi; import org.oransc.ric.anrxapp.client.model.GgNodeBTable; @@ -68,16 +67,13 @@ public class AnrXappController { // Populated by the autowired constructor private final HealthApi healthApi; - private final GnodebsApi gnodebsApi; private final NcrtApi ncrtApi; @Autowired - public AnrXappController(final HealthApi healthApi, final GnodebsApi gnodebsApi, final NcrtApi ncrtApi) { + public AnrXappController(final HealthApi healthApi, final NcrtApi ncrtApi) { Assert.notNull(healthApi, "API must not be null"); - Assert.notNull(gnodebsApi, "API must not be null"); Assert.notNull(ncrtApi, "API must not be null"); this.healthApi = healthApi; - this.gnodebsApi = gnodebsApi; this.ncrtApi = ncrtApi; } @@ -107,7 +103,7 @@ public class AnrXappController { @ApiOperation(value = "Returns list of gNodeB IDs based on NCRT in ANR", response = GgNodeBTable.class) @RequestMapping(value = "/gnodebs", method = RequestMethod.GET) public GgNodeBTable getGnodebs() { - return gnodebsApi.getgNodeB(); + return ncrtApi.getgNodeB(); } @ApiOperation(value = "Returns neighbor cell relation table for all gNodeBs or based on query parameters", response = NeighborCellRelationTable.class) @@ -118,7 +114,7 @@ public class AnrXappController { @RequestParam(name = QP_NEIGHBOR, required = false) String neighborCellNrpci) { logger.debug("getNcrtInfo: ggnbid {}, servingCellNrpci {} neighborCellNrcgi {}", ggnbId, servingCellNrcgi, neighborCellNrpci); - return ncrtApi.getNcrtInfo(ggnbId, servingCellNrcgi, neighborCellNrpci); + return ncrtApi.getNcrt(ggnbId, servingCellNrcgi, neighborCellNrpci); } // /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} : diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/HealthcheckController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/HealthcheckController.java index 9509c71e..f12c59a0 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/HealthcheckController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/HealthcheckController.java @@ -54,7 +54,8 @@ public class HealthcheckController { @RequestMapping(value = DashboardConstants.VERSION_PATH, method = RequestMethod.GET) public SuccessTransport getVersion() { logger.debug("getVersion enter"); - return new SuccessTransport(200, DashboardApplication.getImplementationVersion(MethodHandles.lookup().lookupClass())); + return new SuccessTransport(200, + DashboardApplication.getImplementationVersion(MethodHandles.lookup().lookupClass())); } } -- 2.16.6