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;
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 getVersion() {
+ logger.debug("getVersion enter");
+ 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());
}