def post(self, direction): if direction == "import": return app.import_topology( **{ "replace": request.form["replace"] == "True", "file": request.files["file"], }) else: app.export_topology(**request.get_json(force=True)) return "Topology Export successfully executed."
def post(self, direction): if direction == "import": result = app.import_topology( **{ "replace": request.form["replace"] == "True", "file": request.files["file"], }) status = 206 if "Partial" in result else 200 return result, status else: app.export_topology(**request.get_json(force=True)) return "Topology Export successfully executed."