mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Add API endpoint to return all links attached to a node.
This commit is contained in:
1 parent
fd5df0052a
commit
62f87de23a
4 files changed
+29
-7
No files matched your search
@@ -307,6 +307,28 @@ class NodeHandler:
|
||||
yield from project.delete_node(request.match_info["node_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.get(
|
||||
r"/projects/{project_id}/nodes/{node_id}/links",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"node_id": "Node UUID"
|
||||
},
|
||||
status_codes={
|
||||
200: "Links returned",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
description="Return all the links connected to this node")
|
||||
def links(request, response):
|
||||
|
||||
project = yield from Controller.instance().get_loaded_project(request.match_info["project_id"])
|
||||
node = project.get_node(request.match_info["node_id"])
|
||||
links = []
|
||||
for link in node.links:
|
||||
links.append(link.__json__())
|
||||
response.json(links)
|
||||
response.set_status(200)
|
||||
|
||||
@Route.get(
|
||||
r"/projects/{project_id}/nodes/{node_id}/dynamips/auto_idlepc",
|
||||
parameters={
|
||||
|
||||
Reference in new issue
Block a user