blob: 15b425337c2ae30f146830455db757a205882786 [file] [log] [blame]
package pta.de.resources;
import org.apache.log4j.Logger;
import org.hibernate.validator.constraints.NotEmpty;
import pta.de.core.controller.BackendController;
import pta.de.core.controller.BaseWebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/mics/central")
@Produces(MediaType.APPLICATION_JSON)
public class MicsCentralResource extends BaseWebService{
private static Logger logger = Logger.getLogger(MicsCentralResource.class.getName());
public MicsCentralResource() {
super(logger);
}
@GET
@Path("/serviceDistribution/{clustername}")
public Response getServiceDistribution(@PathParam("clustername") @NotEmpty String clustername) {
return invokeRunnable(() -> new BackendController().readServerDistribution(clustername));
}
@GET
@Path("/serviceHealthState/{clustername}/{servicename}")
public Response getClusterHealthState(@PathParam("clustername") @NotEmpty String clustername,
@PathParam("servicename") @NotEmpty String servicename) {
return invokeRunnable(() -> new BackendController().getServiceHealthState(clustername, servicename));
}
@GET
@Path("/versionInfo")
public Response getVersionInfo() {
return invokeRunnable(() -> new BackendController().getVersionInfo(getVersionString()));
}
}