/** * Returns the live info of CDAP Services */ @Path("/system/services/{service-name}/live-info") @GET public void getServiceLiveInfo(HttpRequest request, HttpResponder responder, @PathParam("service-name") String serviceName) throws Exception { if (!serviceManagementMap.containsKey(serviceName)) { throw new NotFoundException(String.format("Invalid service name %s", serviceName)); } MasterServiceManager serviceManager = serviceManagementMap.get(serviceName); if (serviceManager.isServiceEnabled()) { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(serviceManager.getLiveInfo())); } else { throw new ForbiddenException(String.format("Service %s is not enabled", serviceName)); } }
/** * Returns the live info of CDAP Services */ @Path("/system/services/{service-name}/live-info") @GET public void getServiceLiveInfo(HttpRequest request, HttpResponder responder, @PathParam("service-name") String serviceName) throws Exception { if (!serviceManagementMap.containsKey(serviceName)) { throw new NotFoundException(String.format("Invalid service name %s", serviceName)); } MasterServiceManager serviceManager = serviceManagementMap.get(serviceName); if (serviceManager.isServiceEnabled()) { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(serviceManager.getLiveInfo())); } else { throw new ForbiddenException(String.format("Service %s is not enabled", serviceName)); } }