mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Add an endpoint for listing the links of a project
This commit is contained in:
2 files changed
+43
No files matched your search
@@ -31,6 +31,21 @@ class LinkHandler:
|
||||
API entry point for Link
|
||||
"""
|
||||
|
||||
@Route.get(
|
||||
r"/projects/{project_id}/links",
|
||||
parameters={
|
||||
"project_id": "Project UUID"
|
||||
},
|
||||
status_codes={
|
||||
200: "List of links returned",
|
||||
},
|
||||
description="List links of a project")
|
||||
def list_links(request, response):
|
||||
|
||||
controller = Controller.instance()
|
||||
project = controller.get_project(request.match_info["project_id"])
|
||||
response.json([v for v in project.links.values()])
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/links",
|
||||
parameters={
|
||||
|
||||
Reference in new issue
Block a user