web app updates for deleting a node and disabling node context options
This commit is contained in:
parent
8c31b75c39
commit
f004d20b79
5 changed files with 104 additions and 35 deletions
|
@ -250,6 +250,23 @@ def get_node(session_id, node_id):
|
|||
)
|
||||
|
||||
|
||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>/terminal")
|
||||
def node_terminal(session_id, node_id):
|
||||
session = coreemu.sessions.get(session_id)
|
||||
if not session:
|
||||
return jsonify(error="session does not exist"), 404
|
||||
|
||||
if node_id.isdigit():
|
||||
node_id = int(node_id)
|
||||
node = session.objects.get(node_id)
|
||||
if not node:
|
||||
return jsonify(error="node does not exist"), 404
|
||||
|
||||
node.client.term("bash")
|
||||
|
||||
return jsonify()
|
||||
|
||||
|
||||
@app.route("/sessions/<int:session_id>/nodes/<node_id>", methods=["DELETE"])
|
||||
@synchronized
|
||||
def delete_node(session_id, node_id):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue