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();
}
Aggregations