Search in sources :

Example 1 with LogQuery

use of io.gravitee.management.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.

the class ApiHealthResource method healthcheckLogs.

@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 healthcheckLogs(@PathParam("api") String api, @BeanParam LogsParam param) {
    param.validate();
    LogQuery logQuery = new LogQuery();
    logQuery.setQuery(param.getQuery());
    logQuery.setPage(param.getPage());
    logQuery.setSize(param.getSize());
    return healthCheckService.findByApi(api, logQuery);
}
Also used : LogQuery(io.gravitee.management.model.analytics.query.LogQuery) ApiOperation(io.swagger.annotations.ApiOperation) Permissions(io.gravitee.management.rest.security.Permissions) ApiResponses(io.swagger.annotations.ApiResponses)

Example 2 with LogQuery

use of io.gravitee.management.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.

the class ApplicationLogsResource method applicationLogs.

@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 applicationLogs(@PathParam("application") String application, @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 logsService.findByApplication(application, logQuery);
}
Also used : LogQuery(io.gravitee.management.model.analytics.query.LogQuery) ApiOperation(io.swagger.annotations.ApiOperation) Permissions(io.gravitee.management.rest.security.Permissions) ApiResponses(io.swagger.annotations.ApiResponses)

Example 3 with LogQuery

use of io.gravitee.management.model.analytics.query.LogQuery in project gravitee-management-rest-api by gravitee-io.

the class ApiLogsResource method apiLogs.

@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 apiLogs(@PathParam("api") String api, @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 logsService.findByApi(api, logQuery);
}
Also used : LogQuery(io.gravitee.management.model.analytics.query.LogQuery) ApiOperation(io.swagger.annotations.ApiOperation) Permissions(io.gravitee.management.rest.security.Permissions) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

LogQuery (io.gravitee.management.model.analytics.query.LogQuery)3 Permissions (io.gravitee.management.rest.security.Permissions)3 ApiOperation (io.swagger.annotations.ApiOperation)3 ApiResponses (io.swagger.annotations.ApiResponses)3