mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-24 15:58:08 +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
|
pass
|
||||||
response.set_status(201)
|
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(
|
@Route.get(
|
||||||
r"/version",
|
r"/version",
|
||||||
description="Retrieve the server version number",
|
description="Retrieve the server version number",
|
||||||
|
Loading…
Reference in New Issue
Block a user