Search in sources :

Example 21 with Permissions

use of io.gravitee.management.rest.security.Permissions 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

Permissions (io.gravitee.management.rest.security.Permissions)21 ApiOperation (io.swagger.annotations.ApiOperation)9 ApiResponses (io.swagger.annotations.ApiResponses)7 GET (javax.ws.rs.GET)5 Produces (javax.ws.rs.Produces)5 MemberEntity (io.gravitee.management.model.MemberEntity)4 ApplicationEntity (io.gravitee.management.model.ApplicationEntity)3 Analytics (io.gravitee.management.model.analytics.Analytics)3 LogQuery (io.gravitee.management.model.analytics.query.LogQuery)3 SubscriptionQuery (io.gravitee.management.model.subscription.SubscriptionQuery)3 MediaType (io.gravitee.common.http.MediaType)2 ApiEntity (io.gravitee.management.model.ApiEntity)2 GroupMemberEntity (io.gravitee.management.model.GroupMemberEntity)2 AuditQuery (io.gravitee.management.model.audit.AuditQuery)2 RolePermission (io.gravitee.management.model.permissions.RolePermission)2 RolePermissionAction (io.gravitee.management.model.permissions.RolePermissionAction)2 PagedResult (io.gravitee.management.rest.model.PagedResult)2 Permission (io.gravitee.management.rest.security.Permission)2 ApplicationService (io.gravitee.management.service.ApplicationService)2 MembershipService (io.gravitee.management.service.MembershipService)2