Ejemplo n.º 1
0
def off(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})
        
    if not get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already off'})

    remove_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
Ejemplo n.º 2
0
def off(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})

    if not get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already off'})

    remove_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
Ejemplo n.º 3
0
def on(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})
        
    if get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already on'})

    add_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})
Ejemplo n.º 4
0
def on(crontab_id):
    crontab = Crontab.get(crontab_id)
    if not crontab:
        return jsonify({'r': 1, 'msg': 'not found'})

    if get_crontab(crontab):
        return jsonify({'r': 1, 'msg': 'already on'})

    add_crontab(crontab)
    return jsonify({'r': 0, 'msg': 'ok'})