mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-23 23:38:21 +00:00
Add a reload
server endpoint. Fixes #1926
This commit is contained in:
parent
6cf268ca93
commit
1a24ebfc19
@ -78,6 +78,22 @@ class ServerHandler:
|
||||
pass
|
||||
response.set_status(201)
|
||||
|
||||
@classmethod
|
||||
@Route.post(
|
||||
r"/reload",
|
||||
description="Reload the local server",
|
||||
status_codes={
|
||||
200: "Server has reloaded"
|
||||
})
|
||||
async def reload(request, response):
|
||||
|
||||
from gns3server.web.web_server import WebServer
|
||||
server = WebServer.instance()
|
||||
try:
|
||||
asyncio.ensure_future(server.reload_server())
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
@Route.get(
|
||||
r"/version",
|
||||
description="Retrieve the server version number",
|
||||
|
Loading…
Reference in New Issue
Block a user