mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-04-10 01:15:54 +02:00
Add endpoint to restart Frigate (#8440)
* Add endpoint to restart Frigate The only means of restarting Frigate remotely is to issue a restart topic on the server's websocket. It's convenient to also expose this capability via HTTP endpoint. * Add new section to API docs * Remove extra line
This commit is contained in:
parent
ef750e73a2
commit
ac53993f70
@ -365,3 +365,7 @@ Recording retention config still applies to manual events, if frigate is configu
|
|||||||
### `PUT /api/events/<event_id>/end`
|
### `PUT /api/events/<event_id>/end`
|
||||||
|
|
||||||
End a specific manual event without a predetermined length.
|
End a specific manual event without a predetermined length.
|
||||||
|
|
||||||
|
### `POST /api/restart`
|
||||||
|
|
||||||
|
Restarts Frigate process.
|
||||||
|
@ -2103,3 +2103,30 @@ def logs(service: str):
|
|||||||
jsonify({"success": False, "message": "Could not find log file"}),
|
jsonify({"success": False, "message": "Could not find log file"}),
|
||||||
500,
|
500,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/restart", methods=["POST"])
|
||||||
|
def restart():
|
||||||
|
try:
|
||||||
|
restart_frigate()
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"Error restarting Frigate: {e}")
|
||||||
|
return make_response(
|
||||||
|
jsonify(
|
||||||
|
{
|
||||||
|
"success": False,
|
||||||
|
"message": "Unable to restart Frigate.",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
500,
|
||||||
|
)
|
||||||
|
|
||||||
|
return make_response(
|
||||||
|
jsonify(
|
||||||
|
{
|
||||||
|
"success": True,
|
||||||
|
"message": "Restarting (this can take up to one minute)...",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
200,
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user