Upgrade ANR client to API spec version 0.0.8 46/246/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Tue, 4 Jun 2019 10:08:07 +0000 (06:08 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Tue, 4 Jun 2019 12:32:20 +0000 (08:32 -0400)
Make mock data match examples given with the new spec

Change-Id: I80bb9658af2ccf4ca356237b24369be90f8a7608
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
anr-xapp-client/pom.xml
anr-xapp-client/src/main/resources/anr_swagger_0.0.6.yaml [deleted file]
anr-xapp-client/src/main/resources/anr_swagger_0.0.8.yaml [moved from anr-xapp-client/src/main/resources/anr_swagger_0.0.7.yaml with 90% similarity]
docs/release-notes.rst
webapp-backend/pom.xml
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/AnrXappMockConfiguration.java
webapp-frontend/src/app/anr-xapp/anr-edit-ncr-dialog.component.ts
webapp-frontend/src/app/anr-xapp/anr-xapp.component.html
webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss

index 2a73208..f0f66bb 100644 (file)
@@ -31,7 +31,7 @@ limitations under the License.
        <groupId>org.o-ran-sc.ric.anrxapp.client</groupId>
        <artifactId>anr-xapp-client</artifactId>
        <name>RIC ANR xApp client</name>
-       <version>0.0.7-SNAPSHOT</version>
+       <version>0.0.8-SNAPSHOT</version>
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -104,7 +104,7 @@ limitations under the License.
                                                        <goal>generate</goal>
                                                </goals>
                                                <configuration>
-                                                       <inputSpec>${project.basedir}/src/main/resources/anr_swagger_0.0.7.yaml</inputSpec>
+                                                       <inputSpec>${project.basedir}/src/main/resources/anr_swagger_0.0.8.yaml</inputSpec>
                                                        <language>java</language>
                                                        <configOptions>
                                                                <groupId>${project.groupId}</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 (file)
index 16af69b..0000000
+++ /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
@@ -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
index 71b23a6..fb494f6 100644 (file)
 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
 --------------------------
index 0f19b87..c9ebdaa 100644 (file)
@@ -42,7 +42,7 @@ limitations under the License.
                <dependency>
                        <groupId>org.o-ran-sc.ric.anrxapp.client</groupId>
                        <artifactId>anr-xapp-client</artifactId>
-                       <version>0.0.7-SNAPSHOT</version>
+                       <version>0.0.8-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
index 550963b..4d80d4f 100644 (file)
@@ -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));
index 2857f55..57a4b64 100644 (file)
@@ -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)
index 49182f2..09e676d 100644 (file)
 <div class="anr__section">
   <h3 class="anr__header">ANR xApp Neighbor Cell Relation Table</h3>
 
-  <mat-form-field>
+  <mat-form-field class="input-width">
     <mat-label>GgNodeB</mat-label>
     <!-- use a native selection widget -->
-    <select matNativeControl #ggNodeB (selectionChange)="loadNcrtPage()">
+    <select matNativeControl #ggNodeB (change)="loadNcrtPage()">
       <option value="" selected>Select..</option>
       <option *ngFor="let g of gNodeBIds" [value]="g">{{g}}</option>
     </select>
   </mat-form-field>
-  <mat-form-field class="input-pad-left">
+  <mat-form-field class="input-width input-pad-left">
     <input matInput placeholder="Serving Cell NRCGI" #servingCellNrcgi>
   </mat-form-field>
-  <mat-form-field class="input-pad-left">
-      <input matInput placeholder="Neighbor cell NRPCI" #neighborCellNrpci>
+  <mat-form-field class="input-width input-pad-left">
+      <input matInput placeholder="Neighbor Cell NRPCI" #neighborCellNrpci>
   </mat-form-field>
 
   <div class="spinner-container" *ngIf="dataSource.loading$ | async">
index bcac3a0..fd03446 100644 (file)
     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;
     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 {