def get_top10_flapping(): query = qb.from_params(request.args) top10 = Alert.get_top10_flapping(query) if top10: return jsonify(status="ok", top10=top10, total=len(top10)) else: return jsonify(status="ok", message="not found", top10=[], total=0)
def get_top10_flapping(): query = qb.from_params(request.args, customers=g.customers) top10 = Alert.get_top10_flapping(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)
def get_top10_flapping(): query = qb.from_params(request.args) top10 = Alert.get_top10_flapping(query) if top10: return jsonify( status="ok", top10=top10, total=len(top10) ) else: return jsonify( status="ok", message="not found", top10=[], total=0 )