async def restart(request: web.Request) -> web.Response:
    """ Serves /update/server/restart """
    session = session_from_request(request)
    if session and session.stage != Stages.READY_FOR_RESTART:
        return web.json_response(
            data={'error': 'not-ready',
                  'message': 'System is not ready to restart '
                  f'(currently {session.stage.value.short})'},
            status=409)

    asyncio.get_event_loop().call_later(1, dbus_actions.restart)
    return web.json_response({'message': 'Restarting in 1s'},
                             status=200)
async def restart ( request : web . Request ) -> web . Response : session = session_from_request ( request ) if session and session . stage != Stages . READY_FOR_RESTART : return web . json_response ( data = { 'error' : 'not-ready' , 'message' : 'System is not ready to restart ' f'(currently {session.stage.value.short})' } , status = 409 ) asyncio . get_event_loop ( ) . call_later ( 1 , dbus_actions . restart ) return web . json_response ( { 'message' : 'Restarting in 1s' } , status = 200 )
Serves /update/server/restart