From 2e5705e2f285f1cfd042dc81562ee8123ad094bd Mon Sep 17 00:00:00 2001 From: DingZQ Date: Mon, 27 Feb 2023 23:17:35 +0800 Subject: [PATCH] Add method for tag and operation --- main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.py b/main.py index 86b1896..bbb3a12 100644 --- a/main.py +++ b/main.py @@ -163,6 +163,22 @@ async def fastapi_redo(network: str): async def fastapi_have_snapshot(network: str, tag: str) -> bool: return have_snapshot(network, tag) +@app.get('/havesnapshotforoperation/') +async def fastapi_have_snapshot_for_operation(network: str, operation: int) -> bool: + return have_snapshot_for_operation(network, operation) + +@app.get('/havesnapshotforcurrentoperation/') +async def fastapi_have_snapshot_for_current_operation(network: str) -> bool: + return have_snapshot_for_current_operation(network) + +@app.post('/takesnapshotforoperation/') +async def fastapi_take_snapshot_for_operation(network: str, operation: int, tag: str) -> None: + return take_snapshot_for_operation(network, operation, tag) + +@app.post('takenapshotforcurrentoperation') +async def fastapi_take_snapshot_for_current_operation(network: str, tag: str) -> None: + return take_snapshot_for_current_operation(network, tag) + @app.post('/takesnapshot/') def fastapi_take_snapshot(network: str, tag: str) -> int | None: return take_snapshot(network, tag)