From 3af4964975f0ea5e1ca35222eac8e6848c5edf2d Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 4 Jun 2019 06:08:07 -0400 Subject: [PATCH] Upgrade ANR client to API spec version 0.0.8 Make mock data match examples given with the new spec Change-Id: I80bb9658af2ccf4ca356237b24369be90f8a7608 Signed-off-by: Lott, Christopher (cl778h) --- anr-xapp-client/pom.xml | 4 +- .../src/main/resources/anr_swagger_0.0.6.yaml | 228 --------------------- ...r_swagger_0.0.7.yaml => anr_swagger_0.0.8.yaml} | 23 ++- docs/release-notes.rst | 3 +- webapp-backend/pom.xml | 2 +- .../dashboard/config/AnrXappMockConfiguration.java | 39 ++-- .../app/anr-xapp/anr-edit-ncr-dialog.component.ts | 3 +- .../src/app/anr-xapp/anr-xapp.component.html | 10 +- .../src/app/anr-xapp/anr-xapp.component.scss | 29 ++- 9 files changed, 77 insertions(+), 264 deletions(-) delete mode 100644 anr-xapp-client/src/main/resources/anr_swagger_0.0.6.yaml rename anr-xapp-client/src/main/resources/{anr_swagger_0.0.7.yaml => anr_swagger_0.0.8.yaml} (90%) diff --git a/anr-xapp-client/pom.xml b/anr-xapp-client/pom.xml index 2a73208d..f0f66bbe 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.7-SNAPSHOT + 0.0.8-SNAPSHOT UTF-8 UTF-8 @@ -104,7 +104,7 @@ limitations under the License. generate - ${project.basedir}/src/main/resources/anr_swagger_0.0.7.yaml + ${project.basedir}/src/main/resources/anr_swagger_0.0.8.yaml java ${project.groupId} diff --git a/anr-xapp-client/src/main/resources/anr_swagger_0.0.6.yaml b/anr-xapp-client/src/main/resources/anr_swagger_0.0.6.yaml deleted file mode 100644 index 16af69bd..00000000 --- a/anr-xapp-client/src/main/resources/anr_swagger_0.0.6.yaml +++ /dev/null @@ -1,228 +0,0 @@ -# ========================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.6 - 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 - /gnodebs : - get : - summary : Returns list of gNodeB IDs based on NCRT in ANR - tags : - - gnodebs - operationId : getgNodeB - produces : - - application/json - responses : - '200' : - description : successful operation - schema : - $ref : '#/definitions/ggNodeBTable' - '500' : - description : Unable to retrieve gNodeBs - /ncrt : - get : - summary : Returns neighbor cell relation table for all gNodeBs or based on query string - tags : - - ncrt - operationId : getNcrtInfo - 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/anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml b/anr-xapp-client/src/main/resources/anr_swagger_0.0.8.yaml similarity index 90% rename from anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml rename to anr-xapp-client/src/main/resources/anr_swagger_0.0.8.yaml index 2818b020..b5602731 100644 --- a/anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml +++ b/anr-xapp-client/src/main/resources/anr_swagger_0.0.8.yaml @@ -18,7 +18,7 @@ swagger : '2.0' info : description : REST API specification for RIC ANR closed xAPP - version : 0.0.7 + version : 0.0.8 title : RIC ANR license: name : Nokia Closed App @@ -105,11 +105,19 @@ paths : description : Successfully modified neighbor cell relation '400' : description : Modification failed. - { Non-existent identifier {servCellNrcgi | neighCellNrpci} in request | - Invalid data in body + { + Non-existent servCellNrcgi in request. | + Non-existent neighCellNrpci in request. + } + '405' : + description : Modification failed. + { + No data to udpate. | + Invalid data in BODY. | + Parameter missing in BODY. } '500' : - description : Modification failed + description : Modification failed. delete : summary : Delete neighbor cell relation based on Source Cell NRCGI and Neighbor Cell NRPCI tags : @@ -120,9 +128,12 @@ paths : description : Successfully deleted neighbor cell relation '400' : description : Deletion failed. - { Non-existent identifier {servCellNrcgi | neighCellNrpci} in request } + { + Non-existent servCellNrcgi in request. | + Non-existent neighCellNrpci in request. + } '500' : - description : Deletion failed + description : Deletion failed. parameters : ggnodeb : type : string diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 71b23a66..fb494f6c 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -20,12 +20,13 @@ RIC Dashboard Release Notes =========================== -Version 1.0.4, 30 May 2019 +Version 1.0.4, 4 June 2019 -------------------------- * Add ANR xApp neighbor cell relation table * Drop the pendulum xApp control screen * Add column sorting on xApp catalog, xApp control, ANR * Add disconnect-all button to RAN connection screen +* Update ANR xApp client to spec version 0.0.8 Version 1.0.3, 28 May 2019 -------------------------- diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index 0f19b875..c9ebdaaf 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.7-SNAPSHOT + 0.0.8-SNAPSHOT org.o-ran-sc.ric.e2mgr.client 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 550963b3..4d80d4f3 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 @@ -22,7 +22,6 @@ package org.oransc.ric.portal.dashboard.config; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNull; -import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -52,30 +51,43 @@ public class AnrXappMockConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - private final NeighborCellRelationTable ncrt, ncrtNodeB1, ncrtNodeB2; + private final NeighborCellRelationTable ncrt, ncrtNodeB1, ncrtNodeB2, ncrtNodeB3; private final GgNodeBTable gNodebTable; + private static final String gnodeb1 = "GNB:001EF5:0045FE50"; + private static final String gnodeb2 = "GNB:001EF6:0045FE51"; + private static final String gnodeb3 = "GNB:001EF7:0045FE52"; + public AnrXappMockConfiguration() { + logger.info("Configuring mock ANR xApp client"); gNodebTable = new GgNodeBTable(); - gNodebTable.addGNodeBIdsItem("A").addGNodeBIdsItem("B"); + gNodebTable.addGNodeBIdsItem(gnodeb1).addGNodeBIdsItem(gnodeb2).addGNodeBIdsItem(gnodeb3); ncrtNodeB1 = new NeighborCellRelationTable(); ncrtNodeB2 = new NeighborCellRelationTable(); + ncrtNodeB3 = new NeighborCellRelationTable(); ncrt = new NeighborCellRelationTable(); - String[] cells1 = { "A", "B", "C", "D" }; - for (String s : cells1) + String[] neighbors1 = { "1104", "1105", "1106" }; + for (String n : neighbors1) ncrtNodeB1.addNcrtRelationsItem( - new NeighborCellRelation().servingCellNrcgi(s + "12345").neighborCellNrpci(s + "12346") - .neighborCellNrcgi(s + "12347").flagNoHo(true).flagNoXn(true).flagNoRemove(true)); - String[] cells2 = { "E", "F", "G", "H" }; - for (String s : cells2) + new NeighborCellRelation().servingCellNrcgi(gnodeb1 + ":1100").neighborCellNrpci(n) + .neighborCellNrcgi(gnodeb1 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true)); + String[] neighbors2 = { "1471", "1472", "1473" }; + for (String n : neighbors2) ncrtNodeB2.addNcrtRelationsItem( - new NeighborCellRelation().servingCellNrcgi(s + "12345").neighborCellNrpci(s + "12346") - .neighborCellNrcgi(s + "12347").flagNoHo(true).flagNoXn(true).flagNoRemove(true)); + new NeighborCellRelation().servingCellNrcgi(gnodeb2 + ":1400").neighborCellNrpci(n) + .neighborCellNrcgi(gnodeb2 + ":" + n).flagNoHo(false).flagNoXn(false).flagNoRemove(false)); + String[] neighbors3 = { "3601", "3601", "3602" }; + for (String n : neighbors3) + ncrtNodeB3.addNcrtRelationsItem( + new NeighborCellRelation().servingCellNrcgi(gnodeb3 + ":3600").neighborCellNrpci(n) + .neighborCellNrcgi(gnodeb3 + ":" + n).flagNoHo(true).flagNoXn(true).flagNoRemove(true)); for (NeighborCellRelation ncr : ncrtNodeB1.getNcrtRelations()) ncrt.addNcrtRelationsItem(ncr); for (NeighborCellRelation ncr : ncrtNodeB2.getNcrtRelations()) ncrt.addNcrtRelationsItem(ncr); + for (NeighborCellRelation ncr : ncrtNodeB3.getNcrtRelations()) + ncrt.addNcrtRelationsItem(ncr); } private ApiClient apiClient() { @@ -107,8 +119,9 @@ public class AnrXappMockConfiguration { // Swagger sends nulls; front end sends empty strings 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); + when(mockApi.getNcrt(eq(gnodeb1), any(String.class), any(String.class))).thenReturn(ncrtNodeB1); + when(mockApi.getNcrt(eq(gnodeb2), any(String.class), any(String.class))).thenReturn(ncrtNodeB2); + when(mockApi.getNcrt(eq(gnodeb3), any(String.class), any(String.class))).thenReturn(ncrtNodeB3); doAnswer(i -> { return null; }).when(mockApi).deleteNcrt(any(String.class), any(String.class)); diff --git a/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts b/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts index 2857f55d..57a4b64a 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts +++ b/webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts @@ -43,11 +43,10 @@ export class ANREditNCRDialogComponent implements OnInit { } ngOnInit() { - const namePattern = /^([A-Z])+([0-9])+$/; this.ncrDialogForm = new FormGroup({ servingCellNrcgi: new FormControl(this.data.servingCellNrcgi), // readonly neighborCellNrpci: new FormControl(this.data.neighborCellNrpci), // readonly - neighborCellNrcgi: new FormControl(this.data.neighborCellNrcgi, [Validators.required, Validators.pattern(namePattern)]), + neighborCellNrcgi: new FormControl(this.data.neighborCellNrcgi, [Validators.required]), flagNoHo: new FormControl(this.data.flagNoHo), flagNoXn: new FormControl(this.data.flagNoXn), flagNoRemove: new FormControl(this.data.flagNoRemove) diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html index 49182f2e..09e676d4 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html +++ b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html @@ -20,19 +20,19 @@

ANR xApp Neighbor Cell Relation Table

- + GgNodeB - - + - - + +
diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss index bcac3a0e..fd034462 100644 --- a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss +++ b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss @@ -41,8 +41,16 @@ margin: 130px auto 0 auto; } +.input-pad-left { + padding-left: 10px; +} + +.input-width { + min-width: 250px; +} + .ncr-table { - width: 99%; /* 100 looks wrong */ + width: 99%; /* 100% triggers horiz scroll bar */ min-height: 150px; margin-top: 10px; background-color:transparent; @@ -52,12 +60,21 @@ color: white; } -.input-pad-left { - padding-left: 10px; +/* column classes are magically defined by Angular */ +.mat-column-neighborCellNrpci { + max-width: 150px; } - -.input-pad-right { - padding-right: 10px; +.mat-column-flagNoHo { + max-width: 75px; +} +.mat-column-flagNoXn { + max-width: 75px; +} +.mat-column-flagNoRemove { + max-width: 75px; +} +.mat-column-action { + max-width: 85px; } .version__text { -- 2.16.6