mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-23 22:52:25 +00:00
Allow controller to be reloaded using the API. Fixes #1743
This commit is contained in:
parent
8be015cd86
commit
f64b5cd9b6
@ -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:
|
||||
|
@ -1,4 +1,4 @@
|
||||
uvicorn==0.13.4
|
||||
uvicorn==0.14.0
|
||||
fastapi==0.65.1
|
||||
websockets==9.1
|
||||
python-multipart==0.0.5
|
||||
|
Loading…
Reference in New Issue
Block a user