Search in sources :

Example 1 with ReportingTaskTypesEntity

use of org.apache.nifi.web.api.entity.ReportingTaskTypesEntity in project nifi by apache.

the class FlowResource method getReportingTaskTypes.

/**
 * Retrieves the types of reporting tasks that this NiFi supports.
 *
 * @return A controllerServicesTypesEntity.
 * @throws InterruptedException if interrupted
 */
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@Path("reporting-task-types")
@ApiOperation(value = "Retrieves the types of reporting tasks that this NiFi supports", notes = NON_GUARANTEED_ENDPOINT, response = ReportingTaskTypesEntity.class, authorizations = { @Authorization(value = "Read - /flow") })
@ApiResponses(value = { @ApiResponse(code = 400, message = "NiFi was unable to complete the request because it was invalid. The request should not be retried without modification."), @ApiResponse(code = 401, message = "Client could not be authenticated."), @ApiResponse(code = 403, message = "Client is not authorized to make this request."), @ApiResponse(code = 409, message = "The request was valid but NiFi was not in the appropriate state to process it. Retrying the same request later may be successful.") })
public Response getReportingTaskTypes(@ApiParam(value = "If specified, will only return types that are a member of this bundle group.", required = false) @QueryParam("bundleGroupFilter") String bundleGroupFilter, @ApiParam(value = "If specified, will only return types that are a member of this bundle artifact.", required = false) @QueryParam("bundleArtifactFilter") String bundleArtifactFilter, @ApiParam(value = "If specified, will only return types whose fully qualified classname matches.", required = false) @QueryParam("type") String typeFilter) throws InterruptedException {
    authorizeFlow();
    if (isReplicateRequest()) {
        return replicate(HttpMethod.GET);
    }
    // create response entity
    final ReportingTaskTypesEntity entity = new ReportingTaskTypesEntity();
    entity.setReportingTaskTypes(serviceFacade.getReportingTaskTypes(bundleGroupFilter, bundleArtifactFilter, typeFilter));
    // generate the response
    return generateOkResponse(entity).build();
}
Also used : ReportingTaskTypesEntity(org.apache.nifi.web.api.entity.ReportingTaskTypesEntity) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 Consumes (javax.ws.rs.Consumes)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 ReportingTaskTypesEntity (org.apache.nifi.web.api.entity.ReportingTaskTypesEntity)1