Esempio n. 1
0
 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."
Esempio n. 2
0
 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."