- @ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = E2SetupResponse.class, responseContainer = "List")
- @RequestMapping(value = "/setup", method = RequestMethod.GET)
- public Iterable<E2SetupResponse> getRequests() {
- logger.debug("getRequests");
- return responses;
+ // This calls other methods to simplify the task of the front-end.
+ @ApiOperation(value = "Gets all RAN identities and statuses from the E2 manager.", response = RanDetailsTransport.class, responseContainer = "List")
+ @GetMapping(RAN_METHOD)
+ @Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
+ public List<RanDetailsTransport> getRanDetails() {
+ logger.debug("getRanDetails");
+ List<NodebIdentity> nodebIdList = e2NodebApi.getNodebIdList();
+ List<RanDetailsTransport> details = new ArrayList<>();
+ for (NodebIdentity nbid : nodebIdList) {
+ GetNodebResponse nbResp = null;
+ try {
+ // Catch exceptions to keep looping despite failures
+ nbResp = e2NodebApi.getNb(nbid.getInventoryName());
+ } catch (HttpStatusCodeException ex) {
+ logger.warn("E2 getNb failed for name {}: {}", nbid.getInventoryName(), ex.toString());
+ nbResp = new GetNodebResponse().connectionStatus("UNKNOWN").ip("UNKNOWN").port(-1)
+ .ranName(nbid.getInventoryName());
+ }
+ details.add(new RanDetailsTransport(nbid, nbResp));
+ }
+ return details;
+ }
+
+ @ApiOperation(value = "Get RAN identities list.", response = NodebIdentity.class, responseContainer = "List")
+ @GetMapping(NODEB_LIST_METHOD)
+ @Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
+ public List<NodebIdentity> getNodebIdList() {
+ logger.debug("getNodebIdList");
+ return e2NodebApi.getNodebIdList();