Search in sources :

Example 1 with CleanupStaleFeedRevisions

use of com.thinkbiganalytics.feedmgr.nifi.CleanupStaleFeedRevisions in project kylo by Teradata.

the class NifiIntegrationRestController method cleanupVersionedProcessGroups.

@GET
@Path("/cleanup-versions/{processGroupId}")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Performs a cleanup of the specified process group.", notes = "This method will list all of the child process groups and delete the ones where the name matches the regular expression: .* - \\d{13}")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns the number of process groups deleted.", response = RestResponseStatus.class), @ApiResponse(code = 500, message = "The process group is unavailable.", response = RestResponseStatus.class) })
public Response cleanupVersionedProcessGroups(@PathParam("processGroupId") String processGroupId) {
    accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.ADMIN_FEEDS);
    RestResponseStatus status;
    CleanupStaleFeedRevisions cleanupStaleFeedRevisions = new CleanupStaleFeedRevisions(legacyNifiRestClient, processGroupId, propertyDescriptorTransform);
    cleanupStaleFeedRevisions.cleanup();
    String msg = "Cleaned up " + cleanupStaleFeedRevisions.getDeletedProcessGroups().size() + " Process Groups";
    status = new RestResponseStatus.ResponseStatusBuilder().message(msg).buildSuccess();
    return Response.ok(status).build();
}
Also used : CleanupStaleFeedRevisions(com.thinkbiganalytics.feedmgr.nifi.CleanupStaleFeedRevisions) RestResponseStatus(com.thinkbiganalytics.rest.model.RestResponseStatus) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

CleanupStaleFeedRevisions (com.thinkbiganalytics.feedmgr.nifi.CleanupStaleFeedRevisions)1 RestResponseStatus (com.thinkbiganalytics.rest.model.RestResponseStatus)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1