Add table with automatic neighbor relation data
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / XappManagerController.java
index ef1a918..efb296d 100644 (file)
@@ -23,8 +23,10 @@ import java.lang.invoke.MethodHandles;
 
 import javax.servlet.http.HttpServletResponse;
 
+import org.oransc.ric.portal.dashboard.DashboardApplication;
 import org.oransc.ric.portal.dashboard.DashboardConstants;
 import org.oransc.ric.portal.dashboard.model.ErrorTransport;
+import org.oransc.ric.portal.dashboard.model.SuccessTransport;
 import org.oransc.ric.xappmgr.client.api.HealthApi;
 import org.oransc.ric.xappmgr.client.api.XappApi;
 import org.oransc.ric.xappmgr.client.model.AllXapps;
@@ -71,11 +73,25 @@ public class XappManagerController {
                this.xappApi = xappApi;
        }
 
-       @ApiOperation(value = "Calls the xApp Manager health check.")
-       @RequestMapping(value = "/health", method = RequestMethod.GET)
+       @ApiOperation(value = "Gets the XApp manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
+       @RequestMapping(value = DashboardConstants.VERSION_PATH, method = RequestMethod.GET)
+       public SuccessTransport getXappManagerClientVersion() {
+               return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
+       }
+
+       @ApiOperation(value = "Calls the xApp Manager liveness health check.")
+       @RequestMapping(value = "/health/alive", method = RequestMethod.GET)
        public void getHealth(HttpServletResponse response) {
-               logger.debug("getHealt");
-               healthApi.getHealth();
+               logger.debug("getHealth");
+               healthApi.getHealthAlive();
+               response.setStatus(healthApi.getApiClient().getStatusCode().value());
+       }
+
+       @ApiOperation(value = "Calls the xApp Manager readiness health check.")
+       @RequestMapping(value = "/health/ready", method = RequestMethod.GET)
+       public void getHealthReady(HttpServletResponse response) {
+               logger.debug("getHealthReady");
+               healthApi.getHealthReady();
                response.setStatus(healthApi.getApiClient().getStatusCode().value());
        }