public static Result listBackupsFor_JSON(String username, Long jobId) { Logger.info("Listing backups for job " + jobId); Job job = Job.findById(jobId); if (job == null) return notFound(); List<Backup> backups = Backup.findByJob(job); return ok(Json.toJson(BackupFilter.map(backups))); }
public static Result deleteJob(String username, Long jobId) { Job job = Job.findById(jobId); if (job != null) Job.deleteCascaded(job); return noContent(); }