Add getnodes
This commit is contained in:
11
main.py
11
main.py
@@ -72,15 +72,8 @@ async def fastapi_delete_project(network: str):
|
|||||||
|
|
||||||
# element operations
|
# element operations
|
||||||
@app.get("/getnodes/")
|
@app.get("/getnodes/")
|
||||||
async def fastapi_get_nodes(network: str):
|
async def fastapi_get_nodes(network: str) -> list[str]:
|
||||||
nodeCount = get_count(network, NODE_COUNT)
|
return get_nodes(network)
|
||||||
nodes = []
|
|
||||||
for i in range(nodeCount.value):
|
|
||||||
node_id = get_node_id(network, i + 1)
|
|
||||||
if node_id.error_code == 0:
|
|
||||||
nodes.append(node_id.value)
|
|
||||||
|
|
||||||
return nodes
|
|
||||||
|
|
||||||
# junction
|
# junction
|
||||||
@app.post("/addjunction/")
|
@app.post("/addjunction/")
|
||||||
|
|||||||
Reference in New Issue
Block a user