Execute batch
This commit is contained in:
13
main.py
13
main.py
@@ -98,12 +98,13 @@ async def fastapi_sync_with_server(network: str, operationid: int) -> ChangeSet:
|
|||||||
|
|
||||||
@app.post("/batch/")
|
@app.post("/batch/")
|
||||||
async def fastapi_execute_batch_commands(network: str, req: Request)-> ChangeSet:
|
async def fastapi_execute_batch_commands(network: str, req: Request)-> ChangeSet:
|
||||||
jsTxt = await req.json()
|
jo_root = await req.json()
|
||||||
print(jsTxt)
|
print(jo_root)
|
||||||
print(type(jsTxt))
|
jo_operations = jo_root['operations']
|
||||||
jo = json.loads(jsTxt)
|
cs: ChangeSet = ChangeSet({})
|
||||||
print(jo)
|
for jo in jo_operations:
|
||||||
print(type(jo))
|
cs.add(jo)
|
||||||
|
return execute_batch_commands(network, cs)
|
||||||
|
|
||||||
# node
|
# node
|
||||||
@app.get("/getnodes/")
|
@app.get("/getnodes/")
|
||||||
|
|||||||
Reference in New Issue
Block a user