- try {
- e2HealthCheckApi.healthGet();
- response.setStatus(e2HealthCheckApi.getApiClient().getStatusCode().value());
- return null;
- } catch (HttpStatusCodeException ex) {
- logger.warn("healthGet failed: {}", ex.toString());
- return ResponseEntity.status(HttpServletResponse.SC_BAD_GATEWAY).body(ex.getResponseBodyAsString());
+ e2HealthCheckApi.healthGet();
+ response.setStatus(e2HealthCheckApi.getApiClient().getStatusCode().value());
+ }
+
+ // 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));