1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
|
swagger: '2.0'
info:
title: Jupyter Notebook API
description: Notebook API
version: "4"
contact:
name: Jupyter Project
url: jupyter.org
# will be prefixed to all paths
basePath: /api
produces:
- application/json
consumes:
- application/json
parameters:
kernel:
name: kernel
required: true
in: path
description: kernel uuid
type: string
format: uuid
session:
name: session
required: true
in: path
description: session uuid
type: string
format: uuid
paths:
/sessions/{session}:
parameters:
- $ref: '#/parameters/session'
get:
summary: Get session
tags:
- sessions
responses:
200:
description: Session
schema:
$ref: '#/definitions/Session'
patch:
summary: This can be used to rename the notebook, or move it to a new directory.
tags:
- sessions
parameters:
- name: model
in: body
required: true
schema:
type: object
properties:
notebook:
type: object
properties:
path:
type: string
format: path
description: new path for notebook
responses:
200:
description: Session
schema:
$ref: '#/definitions/Session'
400:
description: No data provided
delete:
summary: Delete a session
tags:
- sessions
responses:
204:
description: Session (and kernel) were deleted
410:
description: Kernel was deleted before the session, and the session was *not* deleted (TODO - check to make sure session wasn't deleted)
/sessions:
get:
summary: List available sessions
tags:
- sessions
responses:
200:
description: List of current sessions
schema:
type: array
items:
$ref: '#/definitions/Session'
post:
summary: Create a new session, or return an existing session if a session for the notebook path already exists
tags:
- sessions
parameters:
- name: session
in: body
schema:
type: object
properties:
notebook:
type: object
required:
- path
properties:
path:
type: string
description: path to notebook file
kernel:
type: object
properties:
name:
type: string
description: Kernel spec name, defaults to default kernel spec
responses:
201:
description: Session created or returned
schema:
$ref: '#/definitions/Session'
headers:
Location:
description: URL for session commands
type: string
format: url
501:
description: Kernel not available
schema:
type: object
description: error message
properties:
message:
type: string
short_message:
type: string
/kernels:
get:
summary: List the JSON data for all kernels that are currently running
tags:
- kernels
responses:
200:
description: List of currently-running kernel uuids
schema:
type: array
items:
$ref: '#/definitions/Kernel'
post:
summary: Start a kernel and return the uuid
tags:
- kernels
parameters:
- name: name
in: body
description: Kernel spec name (defaults to default kernel spec for server)
schema:
type: object
properties:
name:
type: string
responses:
201:
description: Kernel started
headers:
Location:
description: URL for kernel commands
type: string
format: url
/kernels/{kernel}:
parameters:
- $ref: '#/parameters/kernel'
get:
summary: Get kernel information
tags:
- kernels
responses:
200:
description: Kernel information
schema:
$ref: '#/definitions/Kernel'
delete:
summary: Kill a kernel and delete the kernel id
tags:
- kernels
responses:
204:
description: Kernel deleted
/kernels/{kernel}/interrupt:
parameters:
- $ref: '#/parameters/kernel'
post:
summary: Interrupt a kernel
tags:
- kernels
responses:
204:
description: Kernel interrupted
/kernels/{kernel}/restart:
parameters:
- $ref: '#/parameters/kernel'
post:
summary: Restart a kernel
tags:
- kernels
responses:
200:
description: Kernel interrupted
headers:
Location:
description: URL for kernel commands
type: string
format: url
schema:
$ref: '#/definitions/Kernel'
/kernelspecs:
get:
summary: List kernel specs
tags:
- kernelspecs
responses:
200:
description: Kernel specs
schema:
type: object
properties:
default:
type: string
description: Default kernel name
kernelspecs:
type: array
items:
$ref: '#/definitions/KernelSpec'
/kernelspecs/{kernel}:
parameters:
- $ref: '#/parameters/kernel'
get:
summary: Kernel information
tags:
- kernelspecs
responses:
200:
description: The contents of kernel.json
schema:
$ref: '#/definitions/KernelSpec'
404:
description: Kernel spec not found
/kernelspecs/{kernel}/{filename}:
get:
summary: Retrieve a file from the kernel directory
tags:
- kernelspecs
parameters:
- name: kernel
in: path
description: Kernel uuid
type: string
required: true
- name: filename
in: path
description: filename
type: string
required: true
responses:
200:
description: file
definitions:
KernelSpec:
description: Kernel spec (contents of kernel.json)
properties:
name:
type: string
description: Unique name for kernel
spec:
$ref: '#/definitions/KernelSpecFile'
description: Kernel spec json file
resources:
type: object
properties:
kernel.js:
type: string
format: filename
description: path for kernel.js file
kernel.css:
type: string
format: filename
description: path for kernel.css file
logo-*:
type: string
format: filename
description: path for logo file. Logo filenames are of the form `logo-widthxheight`
KernelSpecFile:
description: Kernel spec json file
required:
- argv
- display_name
- language
properties:
language:
type: string
description: The programming language which this kernel runs. This will be stored in notebook metadata.
argv:
type: array
description: A list of command line arguments used to start the kernel. The text `{connection_file}` in any argument will be replaced with the path to the connection file.
items:
type: string
display_name:
type: string
description: The kernel's name as it should be displayed in the UI. Unlike the kernel name used in the API, this can contain arbitrary unicode characters.
codemirror_mode:
type: string
description: Codemirror mode. Can be a string *or* an valid Codemirror mode object. This defaults to the string from the `language` property.
env:
type: object
description: A dictionary of environment variables to set for the kernel. These will be added to the current environment variables.
additionalProperties:
type: string
help_links:
type: array
description: Help items to be displayed in the help menu in the notebook UI.
items:
type: object
required:
- text
- url
properties:
text:
type: string
description: menu item link text
url:
type: string
format: URL
description: menu item link url
Kernel:
description: Kernel information
required:
- id
- name
properties:
id:
type: string
format: uuid
description: uuid of kernel
name:
type: string
description: kernel spec name
Session:
description: A session
type: object
properties:
id:
type: string
format: uuid
notebook:
type: object
properties:
path:
type: string
description: path to notebook
kernel:
$ref: '#/definitions/Kernel'
|