예제 #1
0
def history():
    query = qb.from_params(request.args)
    history = Alert.get_history(query)

    if history:
        return jsonify(status="ok",
                       history=[h.serialize for h in history],
                       total=len(history))
    else:
        return jsonify(status="ok", message="not found", history=[], total=0)
예제 #2
0
def history():
    query = qb.from_params(request.args, customers=g.customers)
    paging = Page.from_params(request.args, items=0)
    history = Alert.get_history(query, paging.page, paging.page_size)

    if history:
        return jsonify(status='ok',
                       history=[h.serialize for h in history],
                       total=len(history))
    else:
        return jsonify(status='ok', message='not found', history=[], total=0)
예제 #3
0
파일: alerts.py 프로젝트: kattunga/alerta
def history():
    query = qb.from_params(request.args)
    history = Alert.get_history(query)

    if history:
        return jsonify(
            status="ok",
            history=[h.serialize for h in history],
            total=len(history)
        )
    else:
        return jsonify(
            status="ok",
            message="not found",
            history=[],
            total=0
        )