--Added Read Registered nodes API
	--Added DEL unregister Node
This commit is contained in:
george committed 2026-09-09 15:02:53 +05:30
1 parent 7a0e8c7cd6
commit 9977440c2d
4 files changed
+149 -18

No files matched your search

+44 -1
View File
@@ -60,6 +60,14 @@ class LinkNodeRequest(BaseModel):
# JWT TOKEN CREATION
# ============================================================
@app.post("/spock/nodesoo")
def get_node_interfaces1():
print("Fetching node interfaces from the database...")
return {
"status": "working"
}
@app.post("/get-token")
def get_token():
@@ -504,4 +512,39 @@ def get_spock_subscription_status(
cursor.close()
if conn:
conn.close()
conn.close()
# @app.get("/spock/node-interfaces")
# def get_node_interfaces():
# print("Fetching node interfaces from the database...")
# db = SessionLocal()
# try:
# interfaces = db.query(NodeInterface).all()
# return {
# "status": "success",
# "count": len(interfaces),
# "nodes": [
# {
# "if_id": node.if_id,
# "if_name": node.if_name,
# "if_nodeid": node.if_nodeid,
# "host": node.host,
# "port": node.port,
# "dbname": node.dbname,
# "user": node.user
# }
# for node in interfaces
# ]
# }
# except Exception as e:
# raise HTTPException(
# status_code=500,
# detail=str(e)
# )
# finally:
# db.close()