1
0
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:
grossmj 2021-08-01 16:20:30 +09:30
parent 6cf268ca93
commit 1a24ebfc19

View File

@ -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",