-
Notifications
You must be signed in to change notification settings - Fork 4
/
openapi.yml
278 lines (274 loc) · 8.21 KB
/
openapi.yml
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
openapi: "3.0.3"
info:
title: Jupyter Drives API
version: "1"
contact:
name: Jupyter Contribution Project
url: https://github.com/QuantStack/jupyter-drives
paths:
/api/drives:
get:
summary: Get available drives
responses:
400:
description: Bad request
content:
'application/json':
schema:
type: object
properties:
error:
type: string
description: Error condition
reason:
type: string
description: Explanation of error reason
200:
description: List of drives
content:
'application/json':
schema:
$ref: "#/components/schemas/Drives"
post:
summary: Mount a drive
requestBody:
description: Name of drive to mount
content:
'application/json':
schema:
type: object
responses:
201:
description: Drive mounted
content:
'application/json':
schema:
$ref: "#/components/schemas/Drive"
400:
description: Bad request
content:
'application/json':
schema:
type: object
properties:
error:
type: string
description: Error condition
reason:
type: string
description: Explanation of error reason
409:
description: Drive already mounted
content:
'application/json':
schema:
type: object
properties:
reason:
type: string
description: Explanation of error reason
/api/drives/{drive}/{path}:
parameters:
- $ref: "#/components/parameters/path"
- $ref: "#/components/parameters/drive"
get:
summary: Get contents of file or directory
description: "Retrieving contents of a drive, file or directory. If path is left empty the contents of the entire drive is retrived."
responses:
404:
description: No item found
400:
description: Bad request
content:
'application/json':
schema:
type: object
properties:
error:
type: string
description: Error condition
reason:
type: string
description: Explanation of error reason
200:
description: Contents of file or directory
content:
'application/json':
schema:
$ref: "#/components/schemas/Contents"
500:
description: Model key error
post:
summary: Create a new file in the specified drive
description: "A POST to /api/drives/drive/path creates a New untitled, empty file or directory."
requestBody:
description: Name of drive where new content should be created and type of content.
content:
'application/json':
schema:
type: object
properties:
drive_name:
type: string
type:
type: string
required: true
responses:
201:
description: File created
content:
'application/json':
schema:
$ref: "#/components/schemas/Contents"
404:
description: No item found
400:
description: Bad request
content:
'application/json':
schema:
type: object
properties:
error:
type: string
description: Error condition
reason:
type: string
description: Explanation of error reason
patch:
summary: Rename a file or directory
requestBody:
required: true
description: New path for file or directory.
content:
'application/json':
schema:
type: object
properties:
drive_name:
type: string
description: Name of drive where renaming is taking place
new_file_name:
type: string
description: New name of file
path:
type: string
format: path
description: New path for file or directory
responses:
200:
description: Path updated
headers:
Location:
description: Updated URL for the file or directory
schema:
type: string
format: url
content:
'application/json':
schema:
$ref: "#/components/schemas/Contents"
404:
description: No item found
400:
description: No data provided
content:
'application/json':
schema:
type: object
properties:
error:
type: string
description: Error condition
reason:
type: string
description: Explanation of error reason
components:
parameters:
drive:
name: drive
required: true
in: path
description: Drive name
schema:
type: string
path:
name: path
required: true
in: path
description: file path
schema:
type: string
permissions:
name: permissions
schema:
type: string
required: false
in: query
description: |
JSON-serialized dictionary of `{"resource": ["action",]}`
(dict of lists of strings) to check.
The same dictionary structure will be returned,
containing only the actions for which the user is authorized.
schemas:
Contents:
description: "A contents object. The content and format keys may be null if content is not contained. If type is 'file', then the mimetype will be null."
type: object
required:
- type
- name
- path
- writable
- created
- last_modified
- mimetype
- format
- content
properties:
name:
type: string
description: "Name of file or directory, equivalent to the last part of the path"
path:
type: string
description: Full path for file or directory
drive:
type: string
description: Drive name for file or directory
type:
type: string
description: Type of content
enum:
- directory
- file
- notebook
writable:
type: boolean
description: indicates whether the requester has permission to edit the file
created:
type: string
description: Creation timestamp
format: dateTime
last_modified:
type: string
description: Last modified timestamp
format: dateTime
size:
type: integer
description: "The size of the file or notebook in bytes. If no size is provided, defaults to null."
mimetype:
type: string
description: "The mimetype of a file. If content is not null, and type is 'file', this will contain the mimetype of the file, otherwise this will be null."
content:
type: string
description: "The content, if requested (otherwise null). Will be an array if type is 'directory'"
format:
type: string
description: Format of content (one of null, 'text', 'base64', 'json')
Drive:
description: A drive object.
type: object
Drives:
description: A list of drives.
type: array
items:
$ref: "#/components/schemas/Drive"