Add API for restarting app

This commit is contained in:
Taylor Helsper 2022-07-02 16:31:14 -05:00
parent 6874be6869
commit 3945a1f6be

View File

@ -124,6 +124,20 @@ def api_get_app_info():
return jsonify(data) return jsonify(data)
@mynode_api.route("/api/restart_app")
def api_restart_app():
check_logged_in()
app = request.args.get("app")
if not app:
return "NO_APP_SPECIFIED"
if not is_application_valid(app):
return "INVALID_APP_NAME"
if not restart_application(app):
return "ERROR"
return "OK"
@mynode_api.route("/api/get_device_info") @mynode_api.route("/api/get_device_info")
def api_get_device_info(): def api_get_device_info():
check_logged_in() check_logged_in()