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

    if top10:
        return jsonify(status="ok", top10=top10, total=len(top10))
    else:
        return jsonify(status="ok", message="not found", top10=[], total=0)
예제 #2
0
def get_top10_count():
    query = qb.from_params(request.args, customers=g.customers)
    top10 = Alert.get_top10_count(query)

    if top10:
        return jsonify(
            status='ok',
            top10=top10,
            total=len(top10),
            autoRefresh=Switch.find_by_name('auto-refresh-allow').is_on)
    else:
        return jsonify(
            status='ok',
            message='not found',
            top10=[],
            total=0,
            autoRefresh=Switch.find_by_name('auto-refresh-allow').is_on)
예제 #3
0
파일: alerts.py 프로젝트: kattunga/alerta
def get_top10_count():
    query = qb.from_params(request.args)
    top10 = Alert.get_top10_count(query)

    if top10:
        return jsonify(
            status="ok",
            top10=top10,
            total=len(top10)
        )
    else:
        return jsonify(
            status="ok",
            message="not found",
            top10=[],
            total=0
        )