Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
32
venv/Lib/site-packages/notebook/terminal/api_handlers.py
Normal file
32
venv/Lib/site-packages/notebook/terminal/api_handlers.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
import json
|
||||
from tornado import web, gen
|
||||
from ..base.handlers import APIHandler
|
||||
|
||||
|
||||
class TerminalRootHandler(APIHandler):
|
||||
@web.authenticated
|
||||
def get(self):
|
||||
models = self.terminal_manager.list()
|
||||
self.finish(json.dumps(models))
|
||||
|
||||
@web.authenticated
|
||||
def post(self):
|
||||
"""POST /terminals creates a new terminal and redirects to it"""
|
||||
model = self.terminal_manager.create()
|
||||
self.finish(json.dumps(model))
|
||||
|
||||
|
||||
class TerminalHandler(APIHandler):
|
||||
SUPPORTED_METHODS = ('GET', 'DELETE')
|
||||
|
||||
@web.authenticated
|
||||
def get(self, name):
|
||||
model = self.terminal_manager.get(name)
|
||||
self.finish(json.dumps(model))
|
||||
|
||||
@web.authenticated
|
||||
@gen.coroutine
|
||||
def delete(self, name):
|
||||
yield self.terminal_manager.terminate(name, force=True)
|
||||
self.set_status(204)
|
||||
self.finish()
|
Loading…
Add table
Add a link
Reference in a new issue