def routes(pk=None): """Get routes for routeserver id with protocol""" protocol_id = request.args.get('protocol', None) if not protocol_id: return jsonify({'details': 'no protocol given'}), 404 bird_api = _bird_api_base(pk) bird = client.Bird(bird_api) return jsonify(bird.routes(protocol_id))
def status(pk=None): """Get status""" bird_api = _bird_api_base(pk) bird = client.Bird(bird_api) status = bird.status() # Filter last reboot in case it is not public if not settings.UI['rs_show_last_reboot']: status['last_reboot'] = None return jsonify(status)
def protocol(pk=None, protocol="bgp"): """Get protocols: default protocol=bgp""" bird_api = _bird_api_base(pk) bird = client.Bird(bird_api) return jsonify(bird.protocols(protocol))
def tables(pk=None): """Get tables""" bird_api = _bird_api_base(pk) bird = client.Bird(bird_api) return jsonify(bird.tables())
def symbols(pk=None): """Get symbols""" bird_api = _bird_api_base(pk) bird = client.Bird(bird_api) return jsonify(bird.symbols())