shutdown.py 389 B

123456789101112131415
  1. """HTTP handler to shut down the notebook server.
  2. """
  3. from tornado import web, ioloop
  4. from notebook.base.handlers import IPythonHandler
  5. class ShutdownHandler(IPythonHandler):
  6. @web.authenticated
  7. def post(self):
  8. self.log.info("Shutting down on /api/shutdown request.")
  9. ioloop.IOLoop.current().stop()
  10. default_handlers = [
  11. (r"/api/shutdown", ShutdownHandler),
  12. ]