updated
This commit is contained in:
parent
984c3edf31
commit
52d456a9b3
|
@ -21,6 +21,7 @@ import org.gcube.application.geoportal.service.engine.providers.ucd.ProfileMap;
|
|||
import org.gcube.application.geoportal.service.engine.providers.ucd.SingleISResourceUCDProvider;
|
||||
import org.gcube.application.geoportal.service.engine.providers.ucd.UCDManager;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
import org.gcube.application.geoportal.service.rest.GeoportalHealthCheck;
|
||||
import org.gcube.application.geoportal.service.rest.Plugins;
|
||||
import org.gcube.application.geoportal.service.rest.ProfiledDocuments;
|
||||
import org.gcube.application.geoportal.service.rest.UseCaseDescriptors;
|
||||
|
@ -53,6 +54,7 @@ public class GeoPortalService extends ResourceConfig{
|
|||
registerClasses(ProfiledDocuments.class);
|
||||
registerClasses(UseCaseDescriptors.class);
|
||||
registerClasses(Plugins.class);
|
||||
registerClasses(GeoportalHealthCheck.class);
|
||||
//registerClasses(DocsGenerator.class);
|
||||
|
||||
log.info("Setting implementations .. ");
|
||||
|
|
|
@ -21,14 +21,17 @@ import org.gcube.common.scope.api.ScopeProvider;
|
|||
|
||||
import com.mongodb.client.MongoIterable;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Path("/health")
|
||||
@Slf4j
|
||||
public class GeoportalHealthCheck implements HealthCheck {
|
||||
|
||||
@GET
|
||||
@Path("")
|
||||
@Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||
public Response check() {
|
||||
|
||||
log.info("Check called");
|
||||
HealthCheckResponse hcr = call();
|
||||
return Response.ok().entity(hcr).build();
|
||||
}
|
||||
|
@ -44,7 +47,7 @@ public class GeoportalHealthCheck implements HealthCheck {
|
|||
@Path("/mongo")
|
||||
@Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||
public Response checkDatabase(@QueryParam("context") String context) {
|
||||
|
||||
log.info("checkDatabase called in the context {}", context);
|
||||
if (context == null)
|
||||
return Response.status(400).entity("'context' paramater (e.g. '/gcube/devsec/devVRE' is required").build();
|
||||
|
||||
|
|
Loading…
Reference in New Issue