use of io.gravitee.rest.api.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.
the class ApiHealthResource method getApiHealthCheckLogs.
@GET
@Path("logs")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Health-check logs")
@ApiResponses({ @ApiResponse(code = 200, message = "API logs"), @ApiResponse(code = 500, message = "Internal server error") })
@Permissions({ @Permission(value = RolePermission.API_HEALTH, acls = RolePermissionAction.READ) })
public SearchLogResponse getApiHealthCheckLogs(@BeanParam LogsParam param) {
param.validate();
LogQuery logQuery = new LogQuery();
logQuery.setQuery(param.getQuery());
logQuery.setPage(param.getPage());
logQuery.setSize(param.getSize());
logQuery.setFrom(param.getFrom());
logQuery.setTo(param.getTo());
return healthCheckService.findByApi(api, logQuery, param.isTransition());
}
use of io.gravitee.rest.api.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.
the class ApplicationLogsResource method getSearchLogResponse.
@SuppressWarnings("unchecked")
protected SearchLogResponse<ApplicationRequestItem> getSearchLogResponse(String applicationId, PaginationParam paginationParam, LogsParam logsParam) {
logsParam.validate();
LogQuery logQuery = new LogQuery();
logQuery.setPage(paginationParam.getPage());
logQuery.setSize(paginationParam.getSize());
logQuery.setQuery(logsParam.getQuery());
logQuery.setFrom(logsParam.getFrom());
logQuery.setTo(logsParam.getTo());
logQuery.setField(logsParam.getField());
logQuery.setOrder(!"DESC".equals(logsParam.getOrder()));
return logsService.findByApplication(applicationId, logQuery);
}
use of io.gravitee.rest.api.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.
the class PlatformLogsResource method getPlatformLogs.
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get platform logs", notes = "User must have the MANAGEMENT_PLATFORM[READ] permission to use this service")
@ApiResponses({ @ApiResponse(code = 200, message = "Platform logs", response = SearchLogResponse.class), @ApiResponse(code = 500, message = "Internal server error") })
@Permissions({ @Permission(value = RolePermission.ENVIRONMENT_PLATFORM, acls = RolePermissionAction.READ) })
public SearchLogResponse getPlatformLogs(@BeanParam LogsParam param) {
param.validate();
LogQuery logQuery = new LogQuery();
logQuery.setQuery(param.getQuery());
logQuery.setPage(param.getPage());
logQuery.setSize(param.getSize());
logQuery.setFrom(param.getFrom());
logQuery.setTo(param.getTo());
logQuery.setField(param.getField());
logQuery.setOrder(param.isOrder());
return logsService.findPlatform(logQuery);
}
use of io.gravitee.rest.api.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.
the class ApiLogsResource method getApiLogs.
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get API logs")
@ApiResponses({ @ApiResponse(code = 200, message = "API logs"), @ApiResponse(code = 500, message = "Internal server error") })
@Permissions({ @Permission(value = RolePermission.API_LOG, acls = RolePermissionAction.READ) })
public SearchLogResponse getApiLogs(@BeanParam LogsParam param) {
param.validate();
LogQuery logQuery = new LogQuery();
logQuery.setQuery(param.getQuery());
logQuery.setPage(param.getPage());
logQuery.setSize(param.getSize());
logQuery.setFrom(param.getFrom());
logQuery.setTo(param.getTo());
logQuery.setField(param.getField());
logQuery.setOrder(param.isOrder());
return logsService.findByApi(api, logQuery);
}
use of io.gravitee.rest.api.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.
the class ApplicationLogsResource method getApplicationLogs.
@GET
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Get application logs")
@ApiResponses({ @ApiResponse(code = 200, message = "Application logs"), @ApiResponse(code = 500, message = "Internal server error") })
@Permissions({ @Permission(value = RolePermission.APPLICATION_LOG, acls = RolePermissionAction.READ) })
public SearchLogResponse getApplicationLogs(@BeanParam LogsParam param) {
param.validate();
LogQuery logQuery = new LogQuery();
logQuery.setQuery(param.getQuery());
logQuery.setPage(param.getPage());
logQuery.setSize(param.getSize());
logQuery.setFrom(param.getFrom());
logQuery.setTo(param.getTo());
logQuery.setField(param.getField());
logQuery.setOrder(param.isOrder());
return logsService.findByApplication(application, logQuery);
}
Aggregations