From 4371d551f920c9585a5f15f64f45be21d6c31018 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Mon, 24 Oct 2022 21:44:05 +0800 Subject: [PATCH] Add tack snapshot and pick snapshot --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index afd490f..5e921dc 100644 --- a/main.py +++ b/main.py @@ -103,6 +103,14 @@ async def fastapi_execute_batch_commands(network: str, req: Request)-> ChangeSet cs: ChangeSet = ChangeSet() cs.operations = jo_root['operations'] return execute_batch_commands(network, cs) + +@app.post("/tacksnapshot/") +async def fastapi_take_snapeshot(network: str, snapshot: str)-> int: + return take_snapshot(network, snapshot) + +@app.post("/picksnapshot/") +async def fastapi_pick_snapeshot(network: str, snapshot: str)-> ChangeSet: + return pick_snapshot(network, snapshot) # node @app.get("/getnodes/")