<groupId>org.o-ran-sc.ric.anrxapp.client</groupId>
<artifactId>anr-xapp-client</artifactId>
<name>RIC ANR xApp client</name>
- <version>0.0.5-SNAPSHOT</version>
+ <version>0.0.6-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<goal>generate</goal>
</goals>
<configuration>
- <inputSpec>${project.basedir}/src/main/resources/anr_swagger_0.0.5.yaml</inputSpec>
+ <inputSpec>${project.basedir}/src/main/resources/anr_swagger_0.0.6.yaml</inputSpec>
<language>java</language>
<configOptions>
<groupId>${project.groupId}</groupId>
swagger : '2.0'
info :
description : REST API specification for RIC ANR closed xAPP
- version : 0.0.5
+ version : 0.0.6
title : RIC ANR
license:
name : Nokia Closed App
/health/alive :
get :
summary : Health check of ANR - Liveness probe
- tags :
+ tags :
- health
operationId : getHealthAlive
responses :
/health/ready :
get :
summary : Health check of ANR - Readiness probe
- tags :
+ tags :
- health
operationId : getHealthReady
responses :
'200':
- description : Status of ANR xApp is ok
- /ncrt/cell :
- parameters :
- - $ref : '#/parameters/ggnbId'
- - $ref : '#/parameters/startIndex'
- - $ref : '#/parameters/limit'
+ description : ANR xApp is ready to serve
+ /gnodebs :
get :
- summary : Returns neighbor cell relation table for all gnodeBs or based on query string
- tags :
- - ncrt
- operationId : getNcrtInfo
+ 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/neighborCellRelationTable'
- '400' :
- description : Non-existant identifier {ggnbId | neighborCellIdentifier | start Index} in request
- /ncrt/cell/{cellIdentifier} :
- parameters :
- - $ref : '#/parameters/cellIdentifier'
+ $ref : '#/definitions/ggNodeBTable'
+ '500' :
+ description : Unable to retrieve gNodeBs
+ /ncrt :
get :
- summary : Returns neighbor cell relation table for a Source Cell (NR CGI) and optionally a neighbor cell based on query string
- tags :
+ summary : Returns neighbor cell relation table for all gNodeBs or based on query string
+ tags :
- ncrt
- operationId : getCellNcrtInfo
- produces :
- - application/json
+ operationId : getNcrtInfo
parameters :
- - $ref : '#/parameters/startIndex'
- - $ref : '#/parameters/limit'
+ - $ref : '#/parameters/ggnodeb'
+ - $ref : '#/parameters/servingCellNrcgi'
- $ref : '#/parameters/neighborCellNrpci'
- - $ref : '#/parameters/neighborCellNrcgi'
+ produces :
+ - application/json
responses :
'200' :
description : successful operation
schema :
$ref : '#/definitions/neighborCellRelationTable'
- '400' :
- description : Non-existant identifier {cellIdentifier | neighborCellNrpci | neighborCellNrcgi} in request
+ '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 Source Cell NR CGI and Target Cell NR PCI / NR CGI
- tags :
+ summary : Modify neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI
+ tags :
- ncrt
operationId : modifyNcrt
consumes :
description : Parameters to modify neighbor cell relation
required : true
schema :
- $ref : '#/definitions/neighborCellRelationModTable'
+ $ref : '#/definitions/neighborCellRelationMod'
responses :
'200' :
description : Successfully modified neighbor cell relation
'400' :
description : Modification failed.
- { Identifier neighborCellNrpci / neighborCellNrcgi not provided |
- Non-existant identifier {cellIdentifier | neighborCellNrpci | neighborCellNrcgi} in request |
+ { 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 NR CGI and Target Cell NR PCI / NR CGI
- tags :
+ summary : Delete neighbor cell relation based on Source Cell NRCGI and Neighbor Cell NRPCI
+ tags :
- ncrt
operationId : deleteNcrt
- parameters :
- - name : NcrtDeletionParameters
- in : body
- description : Parameters to delete neighbor cell relation
- required : true
- schema :
- $ref : '#/definitions/neighborCellRelationDelTable'
responses :
'204' :
description : Successfully deleted neighbor cell relation
'400' :
description : Deletion failed.
- { Identifier neighborCellNrpci / neighborCellNrcgi not provided |
- Non-existant identifier {cellIdentifier | neighborCellNrpci | neighborCellNrcgi} in request
- }
+ { Non-existent identifier {servCellNrcgi | neighCellNrpci} in request }
+ '500' :
+ description : Deletion failed
parameters :
- ggnbId :
+ ggnodeb :
type : string
- name : ggnbId
+ name : ggnodeb
description : Global gNodeB Identifier
in : query
- startIndex :
+ servingCellNrcgi :
type : string
- name : startIndex
- description : Pagination Index
- in : query
- limit :
- type : integer
- name : limit
- description : Limit of results that client can handle
+ name : servingCellNrcgi
+ description : Serving Cell Identifier (NR CGI)
in : query
- cellIdentifier :
- type : string
- name : cellIdentifier
- description : Source Cell Identifier (NR CGI)
- in : path
- required : true
neighborCellNrpci :
type : string
name : neighborCellNrpci
description : Neighbor Cell Identifier (NR PCI)
in : query
- neighborCellNrcgi :
+ servCellNrcgi :
type : string
- name : neighborCellNrcgi
- description : Neigbhor Cell Identifier (NR CGI)
- in : query
+ 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 :
+ properties :
+ ncrtRelations :
type : array
items :
$ref : '#/definitions/neighborCellRelation'
- startIndex :
- type : string
- description : Index to use in REST API to process multipage results
- example : 1245A:6740B
- neighborCellRelationModTable :
- type : array
- items :
- $ref : '#/definitions/neighborCellRelationMod'
- neighborCellRelationDelTable :
- type : array
- items :
- $ref : '#/definitions/neighborCellRelationDel'
+ ggnodebId :
+ type : string
+ description : Global gNodeB Identifier
+ example : ABCDE, EFGHI
neighborCellRelation :
type : object
- required :
- - cellIdentifierNrcgi
+ required :
+ - servingCellNrcgi
- neighborCellNrpci
- neighborCellNrcgi
- flagNoHo
- flagNoXn
- flagNoRemove
properties :
- cellIdentifierNrcgi :
+ servingCellNrcgi :
type : string
- description : Source / Serving Cell Identifier (NR CGI)
+ description : Serving Cell Identifier (NR CGI)
example : E12345
neighborCellNrpci :
type : string
- neighborCellIdentifierType
- action
properties :
- neighborCellIdentifierType :
- type : string
- description : Neighbor Cell Identifier Type
- enum :
- - nrpci
- - nrcgi
- action :
- type : string
- description : Modification action to be performed
- enum :
- - nrpciToNrcgiMapping
- - flagUpdates
- - nrcgiMappingAndFlagUpdates
- neighborCellNrpci :
- type : string
- description : Neighbor Cell Identifier (NR PCI)
- example : E12345
neighborCellNrcgi :
type : string
description : Neighbor Cell Identifier (NR CGI)
type : boolean
description : Flag for DELETION NOT ALLOWED
example : True
- neighborCellRelationDel :
- type : object
- required :
- - idType
- properties :
- idType :
- type : string
- description : Modification action to be performed
- enum :
- - nrpci
- - nrcgi
- neighborCellNrpci :
- type : string
- description : Neighbor Cell Identifier (NR PCI)
- example : E12345
- neighborCellNrcgi :
- type : string
- description : Neighbor Cell Identifier (NR PCI)
- example : E12345
* 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.5
+* Update ANR xApp client to spec version 0.0.6
* 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
<dependency>
<groupId>org.o-ran-sc.ric.anrxapp.client</groupId>
<artifactId>anr-xapp-client</artifactId>
- <version>0.0.5-SNAPSHOT</version>
+ <version>0.0.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
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;
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;
import org.oransc.ric.anrxapp.client.model.NeighborCellRelation;
-import org.oransc.ric.anrxapp.client.model.NeighborCellRelationDelTable;
-import org.oransc.ric.anrxapp.client.model.NeighborCellRelationModTable;
+import org.oransc.ric.anrxapp.client.model.NeighborCellRelationMod;
import org.oransc.ric.anrxapp.client.model.NeighborCellRelationTable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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();
+ ncrtNodeB2 = new NeighborCellRelationTable();
+ ncrt = new NeighborCellRelationTable();
+ String[] cells1 = { "A", "B", "C", "D" };
+ for (String s : cells1)
+ 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)
+ ncrtNodeB2.addNcrtRelationsItem(
+ new NeighborCellRelation().servingCellNrcgi(s + "12345").neighborCellNrpci(s + "12346")
+ .neighborCellNrcgi(s + "12347").flagNoHo(true).flagNoXn(true).flagNoRemove(true));
+ for (NeighborCellRelation ncr : ncrtNodeB1.getNcrtRelations())
+ ncrt.addNcrtRelationsItem(ncr);
+ for (NeighborCellRelation ncr : ncrtNodeB2.getNcrtRelations())
+ ncrt.addNcrtRelationsItem(ncr);
}
private ApiClient apiClient() {
}).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 ncrtPapi() {
+ public NcrtApi ncrtMockApi() {
ApiClient apiClient = apiClient();
NcrtApi mockApi = mock(NcrtApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
-
- NeighborCellRelation a = new NeighborCellRelation().cellIdentifierNrcgi("A12345").neighborCellNrpci("A123456")
- .neighborCellNrcgi("A12347").flagNoHo(true).flagNoXn(true).flagNoRemove(true);
- NeighborCellRelation e = new NeighborCellRelation().cellIdentifierNrcgi("E12345").neighborCellNrpci("E123456")
- .neighborCellNrcgi("E12347").flagNoHo(true).flagNoXn(true).flagNoRemove(true);
- NeighborCellRelationTable ncrt = new NeighborCellRelationTable().addNcrtRelationsItem(a)
- .addNcrtRelationsItem(e);
-
- when(mockApi.getNcrtInfo(any(String.class), any(String.class), any(Integer.class))).thenReturn(ncrt);
- when(mockApi.getCellNcrtInfo(any(String.class), any(String.class), any(Integer.class), any(String.class),
- any(String.class))).thenReturn(ncrt);
-
+ // 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);
doAnswer(i -> {
return null;
- }).when(mockApi).deleteNcrt(any(String.class), any(NeighborCellRelationDelTable.class));
-
+ }).when(mockApi).deleteNcrt(any(String.class), any(String.class));
doAnswer(i -> {
return null;
- }).when(mockApi).modifyNcrt(any(String.class), any(NeighborCellRelationModTable.class));
-
+ }).when(mockApi).modifyNcrt(any(String.class), any(String.class), any(NeighborCellRelationMod.class));
return mockApi;
}
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.NeighborCellRelationDelTable;
-import org.oransc.ric.anrxapp.client.model.NeighborCellRelationModTable;
+import org.oransc.ric.anrxapp.client.model.GgNodeBTable;
+import org.oransc.ric.anrxapp.client.model.NeighborCellRelationMod;
import org.oransc.ric.anrxapp.client.model.NeighborCellRelationTable;
import org.oransc.ric.portal.dashboard.DashboardApplication;
import org.oransc.ric.portal.dashboard.DashboardConstants;
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- private static final String CELL_ID = "cellIdentifier";
- private static final String GGNBID = "ggnbId";
- private static final String START_INDEX = "startIndex";
- private static final String LIMIT = "limit";
- private static final String NRPCI = "neighborCellIdentifierNrpci";
- private static final String NRCGI = "neighborCellIdentifierNrcgi";
+ // Query parameters
+ private static final String QP_NODEB = "ggnodeb";
+ private static final String QP_SERVING = "servingCellNrcgi";
+ private static final String QP_NEIGHBOR = "neighborCellNrpci";
+ // Path parameters
+ private static final String PP_SERVING = "servingcells";
+ private static final String PP_NEIGHBOR = "neighborcells";
// Populated by the autowired constructor
private final HealthApi healthApi;
+ private final GnodebsApi gnodebsApi;
private final NcrtApi ncrtApi;
@Autowired
- public AnrXappController(final HealthApi healthApi, final NcrtApi ncrtApi) {
+ public AnrXappController(final HealthApi healthApi, final GnodebsApi gnodebsApi, 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;
}
response.setStatus(healthApi.getApiClient().getStatusCode().value());
}
- @ApiOperation(value = "Query NCRT of all cells, all or one gNB(s)", response = NeighborCellRelationTable.class)
- @RequestMapping(value = "/cell", method = RequestMethod.GET)
- public NeighborCellRelationTable getNcrtInfo( //
- @RequestParam(name = GGNBID, required = false) String ggnbId, //
- @RequestParam(name = START_INDEX, required = false) String startIndex, //
- @RequestParam(name = LIMIT, required = false) Integer limit) {
- logger.debug("queryNcrtAllCells: ggnbid {}, startIndex {} limit {}", ggnbId, startIndex, limit);
- return ncrtApi.getNcrtInfo(ggnbId, startIndex, limit);
+ @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();
}
- @ApiOperation(value = "Query NCRT of a single serving cell", response = NeighborCellRelationTable.class)
- @RequestMapping(value = "/cell/" + CELL_ID + "/{" + CELL_ID + "}", method = RequestMethod.GET)
- public NeighborCellRelationTable getCellNcrtInfo(@PathVariable(CELL_ID) String cellIdentifier, //
- @RequestParam(name = START_INDEX, required = false) String startIndex, //
- @RequestParam(name = LIMIT, required = false) Integer limit,
- @RequestParam(name = NRPCI, required = false) String nrpci,
- @RequestParam(name = NRCGI, required = false) String nrcgi) {
- logger.debug("queryNcrtAllCells: cellIdentifier {}, startIndex {} limit {} nrpci {} nrcgi {}", cellIdentifier,
- startIndex, limit, nrpci, nrcgi);
- return ncrtApi.getCellNcrtInfo(cellIdentifier, startIndex, limit, nrpci, nrcgi);
+ @ApiOperation(value = "Returns neighbor cell relation table for all gNodeBs or based on query parameters", response = NeighborCellRelationTable.class)
+ @RequestMapping(value = "/ncrt", method = RequestMethod.GET)
+ public NeighborCellRelationTable getNcrtInfo( //
+ @RequestParam(name = QP_NODEB, required = false) String ggnbId, //
+ @RequestParam(name = QP_SERVING, required = false) String servingCellNrcgi, //
+ @RequestParam(name = QP_NEIGHBOR, required = false) String neighborCellNrpci) {
+ logger.debug("getNcrtInfo: ggnbid {}, servingCellNrpci {} neighborCellNrcgi {}", ggnbId, servingCellNrcgi,
+ neighborCellNrpci);
+ return ncrtApi.getNcrtInfo(ggnbId, servingCellNrcgi, neighborCellNrpci);
}
- @ApiOperation(value = "Modify neighbor cell relation based on Source Cell NR CGI and Target Cell NR PCI / NR CGI")
- @RequestMapping(value = "/cell/" + CELL_ID + "/{" + CELL_ID + "}", method = RequestMethod.PUT)
- public void modifyNcrt(@PathVariable(CELL_ID) String cellIdentifier, //
- @RequestBody NeighborCellRelationModTable ncrtModTable, //
- HttpServletResponse response) {
- logger.debug("modifyNcrt: cellIdentifier {} modTable {}", cellIdentifier, ncrtModTable);
- ncrtApi.modifyNcrt(cellIdentifier, ncrtModTable);
+ // /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} :
+ @ApiOperation(value = "Modify neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
+ @RequestMapping(value = "/ncrt/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR
+ + "}", method = RequestMethod.PUT)
+ public void modifyNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
+ @PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
+ @RequestBody NeighborCellRelationMod ncrMod, HttpServletResponse response) {
+ logger.debug("modifyNcrt: servingCellNrcgi {}, neighborCellNrpci {}, ncrMod {}", servingCellNrcgi,
+ neighborCellNrpci, ncrMod);
+ ncrtApi.modifyNcrt(servingCellNrcgi, neighborCellNrpci, ncrMod);
response.setStatus(healthApi.getApiClient().getStatusCode().value());
}
- /*
- * TODO: DELETE should not have a body - the path should identify the resource to be deleted.
- */
- @ApiOperation(value = "Delete neighbor cell relation based on Source Cell NR CGI and Target Cell NR PCI / NR CGI")
- @RequestMapping(value = "/cell/" + CELL_ID + "/{" + CELL_ID + "}", method = RequestMethod.DELETE)
- public void deleteNcrt(@PathVariable(CELL_ID) String cellIdentifier, //
- @RequestBody NeighborCellRelationDelTable ncrtDelTable, //
+ @ApiOperation(value = "Delete neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
+ @RequestMapping(value = "/ncrt/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR
+ + "}", method = RequestMethod.PUT)
+ public void deleteNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
+ @PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
HttpServletResponse response) {
- logger.debug("modifyNcrt: cellIdentifier {} delTable {}", cellIdentifier, ncrtDelTable);
- ncrtApi.deleteNcrt(cellIdentifier, ncrtDelTable);
+ logger.debug("deleteNcrt: servingCellNrcgi {}, neighborCellNrpci {}", servingCellNrcgi, neighborCellNrpci);
+ ncrtApi.deleteNcrt(servingCellNrcgi, neighborCellNrpci);
response.setStatus(healthApi.getApiClient().getStatusCode().value());
}