Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # # ConfigTreeQuery
- # @app.route('/api/test_config', methods=['GET'])
- # def test_config():
- # if 'user_id' not in session:
- # return jsonify(error="Not authenticated"), 401
- # try:
- # config = ConfigTreeQuery()
- # response = config.get_config_dict(["interfaces", "ethernet"])
- # return jsonify({
- # "success": True,
- # "data": response,
- # "message": "load config success"
- # })
- # except Exception as e:
- # return jsonify({
- # "success": False,
- # "data": None,
- # "message": str(e)
- # })
- # # VbashOpRun
- # @app.route('/api/test_config1', methods=['GET'])
- # def test_config1():
- # if 'user_id' not in session:
- # return jsonify(error="Not authenticated"), 401
- # try:
- # config = VbashOpRun()
- # response = config.run(["show interfaces"])
- # return jsonify({
- # "success": True,
- # "data": response,
- # "message": "load config success"
- # })
- # except Exception as e:
- # return jsonify({
- # "success": False,
- # "data": None,
- # "message": str(e)
- # })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement