public async Task <IActionResult> Pause([FromBody] KeyModel model) { if (!EnsureValidKey(model)) { return(BadRequest()); } await Scheduler.PauseTrigger(model.ToTriggerKey()); return(NoContent()); }
public async Task <IActionResult> Resume([FromBody] KeyModel model) { if (!EnsureValidKey(model)) { return(new BadRequestResult()); } await Scheduler.ResumeTrigger(model.ToTriggerKey()); return(new EmptyResult()); }
public async Task <IActionResult> Delete([FromBody] KeyModel model) { if (!EnsureValidKey(model)) { return(BadRequest()); } var key = model.ToTriggerKey(); if (!await Scheduler.UnscheduleJob(key)) { throw new InvalidOperationException("Cannot unschedule job " + key); } return(NoContent()); }