mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Support to reset links. Fixes https://github.com/GNS3/gns3-server/issues/1620
This commit is contained in:
1 parent
cbcdaabcce
commit
f97d346c34
4 files changed
+51
-2
No files matched your search
@@ -200,6 +200,26 @@ class LinkHandler:
|
||||
await project.delete_link(request.match_info["link_id"])
|
||||
response.set_status(204)
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/links/{link_id}/reset",
|
||||
parameters={
|
||||
"project_id": "Project UUID",
|
||||
"link_id": "Link UUID"
|
||||
},
|
||||
status_codes={
|
||||
201: "Link reset",
|
||||
400: "Invalid request"
|
||||
},
|
||||
description="Reset link instance",
|
||||
output=LINK_OBJECT_SCHEMA)
|
||||
async def reset(request, response):
|
||||
|
||||
project = await Controller.instance().get_loaded_project(request.match_info["project_id"])
|
||||
link = project.get_link(request.match_info["link_id"])
|
||||
await link.reset()
|
||||
response.set_status(201)
|
||||
response.json(link)
|
||||
|
||||
@Route.get(
|
||||
r"/projects/{project_id}/links/{link_id}/pcap",
|
||||
parameters={
|
||||
|
||||
Reference in new issue
Block a user