Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }