Exemple #1
0
        public async Task <IActionResult> ResumeJob([FromBody] KeyModel model)
        {
            if (!EnsureValidKey(model))
            {
                return(BadRequest());
            }
            await Scheduler.ResumeJob(model.ToJobKey());

            return(NoContent());
        }
        public async Task <IActionResult> PauseJob([FromBody] KeyModel model)
        {
            if (!EnsureValidKey(model))
            {
                return(new BadRequestResult());
            }
            await Scheduler.PauseJob(model.ToJobKey());

            return(new EmptyResult());
        }
Exemple #3
0
        public async Task <IActionResult> Delete([FromBody] KeyModel model)
        {
            if (!EnsureValidKey(model))
            {
                return(BadRequest());
            }

            var key = model.ToJobKey();

            if (!await Scheduler.DeleteJob(key))
            {
                throw new InvalidOperationException("Cannot delete job " + key);
            }

            return(NoContent());
        }