Example #1
0
def schedule_job(ticket=None):
    """
        Schedule action
    """
    body = request.get_json()
    if not body.get('action') or not body.get('delay'):
        return 400, {'status': 'Bad Request', 'code': 400, 'message': 'Missing action or delay in body'}
    code, resp = TicketsController.schedule_asynchronous_job(ticket, body.get('action'), g.user, body.get('delay'))
    return code, resp