use of org.apache.nifi.web.api.entity.ResourcesEntity in project nifi by apache.
the class ResourceResource method getResources.
/**
* Gets the available resources that support access/authorization policies.
*
* @return A resourcesEntity.
*/
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Gets the available resources that support access/authorization policies", response = ResourcesEntity.class, authorizations = { @Authorization(value = "Read - /resources") })
@ApiResponses(value = { @ApiResponse(code = 401, message = "Client could not be authenticated."), @ApiResponse(code = 403, message = "Client is not authorized to make this request.") })
public Response getResources() {
authorizeResource();
if (isReplicateRequest()) {
return replicate(HttpMethod.GET);
}
final List<ResourceDTO> resources = serviceFacade.getResources();
// create the response
final ResourcesEntity entity = new ResourcesEntity();
entity.setResources(resources);
// generate the response
return generateOkResponse(entity).build();
}
Aggregations