mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Allow controller to be reloaded using the API. Fixes #1743
This commit is contained in:
1 parent
8be015cd86
commit
f64b5cd9b6
2 files changed
+15
-2
No files matched your search
@@ -67,6 +67,19 @@ def check_version(version: schemas.Version) -> dict:
|
||||
return {"version": __version__}
|
||||
|
||||
|
||||
@router.post(
|
||||
"/reload",
|
||||
dependencies=[Depends(get_current_active_user)],
|
||||
status_code=status.HTTP_204_NO_CONTENT,
|
||||
)
|
||||
async def reload() -> None:
|
||||
"""
|
||||
Reload the controller
|
||||
"""
|
||||
|
||||
await Controller.instance().reload()
|
||||
|
||||
|
||||
@router.post(
|
||||
"/shutdown",
|
||||
dependencies=[Depends(get_current_active_user)],
|
||||
@@ -75,7 +88,7 @@ def check_version(version: schemas.Version) -> dict:
|
||||
)
|
||||
async def shutdown() -> None:
|
||||
"""
|
||||
Shutdown the local server
|
||||
Shutdown the server
|
||||
"""
|
||||
|
||||
if Config.instance().settings.Server.local is False:
|
||||
|
||||
Reference in new issue
Block a user