-
Notifications
You must be signed in to change notification settings - Fork 31
/
rest_api.yml
263 lines (262 loc) · 7.12 KB
/
rest_api.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
swagger: "2.0"
info:
description: "This is the REST API introduce by the Jupyter server extension `mamba_gator`; see [GitHub repository](https://github.com/mamba-org/mamba_gator) for more information."
version: "3.3.0"
title: "mamba_gator API"
license:
name: "BSD-3-Clause"
url: "https://opensource.org/licenses/BSD-3-Clause"
basePath: "/conda"
tags:
- name: "channel"
description: "Conda channel"
- name: "environment"
description: "Conda environment actions"
- name: "package"
description: "Conda package actions"
- name: "task"
description: "Long running task actions"
schemes:
- "https"
paths:
/channels:
get:
tags:
- "channel"
summary: "List conda channels"
responses:
"200":
description: "Conda channels"
"500":
description: "Fail to list conda channels"
/environments:
get:
tags:
- "environment"
summary: "List conda environments"
produces:
- "application/json"
parameters:
- name: "whitelist"
in: "query"
description: "Whether to respect KernelSpecManager.whitelist"
type: "integer"
default: 0
responses:
"200":
description: "Conda environments"
"500":
description: "Fail to list environments"
post:
tags:
- "environment"
summary: "Add a new conda environment"
consumes:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Environment option"
required: true
schema:
$ref: "#/definitions/EnvironmentPost"
responses:
"202":
description: "Redirect on tasks"
/environments/{environmentName}:
get:
tags:
- "environment"
summary: "List the environment content"
produces:
- "application/json"
- "attachment"
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to return"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
- name: "status"
in: "query"
description: "installed or has_update"
type: "string"
default: "installed"
enum: ["installed", "has_update"]
- name: "download"
in: "query"
description: "Whether to download the packages list"
type: "integer"
default: 0
- name: "history"
in: "query"
description: "Whether to export only from history"
type: "integer"
default: 0
responses:
"200":
description: "Package list"
schema:
type: "object"
properties:
packages:
type: "array"
items:
$ref: "#/definitions/Package"
"202":
description: "Redirect long running task"
"500":
description: "Error listing the packages"
patch:
tags:
- "environment"
summary: "Updates the packages environment"
consumes:
- "application/json"
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to update"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
responses:
"202":
description: "Long running task"
delete:
tags:
- "environment"
summary: "Deletes an environment"
description: ""
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to remove"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
responses:
"202":
description: "Redirect long running task"
/environments/{environmentName}/packages:
patch:
tags:
- "package"
summary: "Update environment packages"
consumes:
- "application/json"
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to modify"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
responses:
"202":
description: "Redirect long running task"
post:
tags:
- "package"
summary: "Install environment packages"
consumes:
- "application/json"
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to modify"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
- name: "develop"
in: "query"
description: "Whether to install the package in development mode"
type: "integer"
default: 0
responses:
"202":
description: "Redirect long running task"
delete:
tags:
- "package"
consumes:
- "application/json"
parameters:
- name: "environmentName"
in: "path"
description: "Environment name to modify"
required: true
type: "string"
pattern: /([^/&+$?@<>%*-][^/&+$?@<>%*]*)/
responses:
"202":
description: "Redirect long running task"
/packages:
get:
tags:
- "package"
summary: "Search for packages"
produces:
- "application/json"
parameters:
- name: "dependencies"
in: "query"
description: "Whether to return the package dependencies or doing a generic search"
type: "number"
default: "0"
- name: "query"
in: "query"
description: "Query string to pass to conda search"
type: "string"
default: ""
responses:
"200":
description: "Query result"
"202":
description: "Redirect long running task"
/tasks/{taskId}:
get:
tags:
- "task"
summary: "Get long running task result"
produces:
- "application/json"
parameters:
- name: "taskId"
in: "path"
description: "Task ID"
required: true
type: "integer"
responses:
"200":
description: "Successful execution of the task - returns its result"
"202":
description: "Task still running"
"404":
description: "Task not found"
"500":
description: "An error occurred when executing the task"
delete:
tags:
- "task"
summary: "Stop the long running task"
parameters:
- name: "taskId"
in: "path"
description: "ID of the order that needs to be deleted"
required: true
type: "integer"
responses:
"204":
description: "Task cancelled"
"404":
description: "Task not found"
definitions:
EnvironmentPost:
type: "object"
Package:
type: "object"
externalDocs:
description: "Find out more about mamba_gator"
url: "https://github.com/mamba-org/mamba_gator"