@alibaba-group/opensandbox 0.1.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +212 -0
- package/dist/adapters/commandsAdapter.d.ts +22 -0
- package/dist/adapters/commandsAdapter.d.ts.map +1 -0
- package/dist/adapters/commandsAdapter.js +76 -0
- package/dist/adapters/filesystemAdapter.d.ts +52 -0
- package/dist/adapters/filesystemAdapter.d.ts.map +1 -0
- package/dist/adapters/filesystemAdapter.js +398 -0
- package/dist/adapters/healthAdapter.d.ts +8 -0
- package/dist/adapters/healthAdapter.d.ts.map +1 -0
- package/dist/adapters/healthAdapter.js +25 -0
- package/dist/adapters/metricsAdapter.d.ts +9 -0
- package/dist/adapters/metricsAdapter.d.ts.map +1 -0
- package/dist/adapters/metricsAdapter.js +43 -0
- package/dist/adapters/openapiError.d.ts +5 -0
- package/dist/adapters/openapiError.d.ts.map +1 -0
- package/dist/adapters/openapiError.js +33 -0
- package/dist/adapters/sandboxesAdapter.d.ts +18 -0
- package/dist/adapters/sandboxesAdapter.d.ts.map +1 -0
- package/dist/adapters/sandboxesAdapter.js +146 -0
- package/dist/adapters/sse.d.ts +9 -0
- package/dist/adapters/sse.d.ts.map +1 -0
- package/dist/adapters/sse.js +84 -0
- package/dist/api/execd.d.ts +1555 -0
- package/dist/api/execd.d.ts.map +1 -0
- package/dist/api/execd.js +14 -0
- package/dist/api/lifecycle.d.ts +787 -0
- package/dist/api/lifecycle.d.ts.map +1 -0
- package/dist/api/lifecycle.js +14 -0
- package/dist/config/connection.d.ts +58 -0
- package/dist/config/connection.d.ts.map +1 -0
- package/dist/config/connection.js +171 -0
- package/dist/core/constants.d.ts +9 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +24 -0
- package/dist/core/exceptions.d.ts +74 -0
- package/dist/core/exceptions.d.ts.map +1 -0
- package/dist/core/exceptions.js +103 -0
- package/dist/factory/adapterFactory.d.ts +33 -0
- package/dist/factory/adapterFactory.d.ts.map +1 -0
- package/dist/factory/adapterFactory.js +14 -0
- package/dist/factory/defaultAdapterFactory.d.ts +7 -0
- package/dist/factory/defaultAdapterFactory.d.ts.map +1 -0
- package/dist/factory/defaultAdapterFactory.js +61 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/internal.d.ts +22 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +30 -0
- package/dist/manager.d.ts +40 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +71 -0
- package/dist/models/execd.d.ts +54 -0
- package/dist/models/execd.d.ts.map +1 -0
- package/dist/models/execd.js +14 -0
- package/dist/models/execution.d.ts +52 -0
- package/dist/models/execution.d.ts.map +1 -0
- package/dist/models/execution.js +14 -0
- package/dist/models/executionEventDispatcher.d.ts +15 -0
- package/dist/models/executionEventDispatcher.d.ts.map +1 -0
- package/dist/models/executionEventDispatcher.js +95 -0
- package/dist/models/filesystem.d.ts +77 -0
- package/dist/models/filesystem.d.ts.map +1 -0
- package/dist/models/filesystem.js +14 -0
- package/dist/models/sandboxes.d.ts +105 -0
- package/dist/models/sandboxes.d.ts.map +1 -0
- package/dist/models/sandboxes.js +15 -0
- package/dist/openapi/execdClient.d.ts +25 -0
- package/dist/openapi/execdClient.d.ts.map +1 -0
- package/dist/openapi/execdClient.js +21 -0
- package/dist/openapi/lifecycleClient.d.ts +28 -0
- package/dist/openapi/lifecycleClient.d.ts.map +1 -0
- package/dist/openapi/lifecycleClient.js +35 -0
- package/dist/sandbox.d.ts +132 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +250 -0
- package/dist/services/execdCommands.d.ts +19 -0
- package/dist/services/execdCommands.d.ts.map +1 -0
- package/dist/services/execdCommands.js +14 -0
- package/dist/services/execdHealth.d.ts +4 -0
- package/dist/services/execdHealth.d.ts.map +1 -0
- package/dist/services/execdHealth.js +14 -0
- package/dist/services/execdMetrics.d.ts +5 -0
- package/dist/services/execdMetrics.d.ts.map +1 -0
- package/dist/services/execdMetrics.js +14 -0
- package/dist/services/filesystem.d.ts +30 -0
- package/dist/services/filesystem.d.ts.map +1 -0
- package/dist/services/filesystem.js +14 -0
- package/dist/services/sandboxes.d.ts +12 -0
- package/dist/services/sandboxes.d.ts.map +1 -0
- package/dist/services/sandboxes.js +14 -0
- package/package.json +52 -0
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export interface paths {
|
|
6
|
+
"/sandboxes": {
|
|
7
|
+
parameters: {
|
|
8
|
+
query?: never;
|
|
9
|
+
header?: never;
|
|
10
|
+
path?: never;
|
|
11
|
+
cookie?: never;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* List sandboxes
|
|
15
|
+
* @description List all sandboxes with optional filtering and pagination using query parameters.
|
|
16
|
+
* All filter conditions use AND logic. Multiple `state` parameters use OR logic within states.
|
|
17
|
+
*/
|
|
18
|
+
get: {
|
|
19
|
+
parameters: {
|
|
20
|
+
query?: {
|
|
21
|
+
/**
|
|
22
|
+
* @description Filter by lifecycle state. Pass multiple times for OR logic.
|
|
23
|
+
* Example: `?state=Running&state=Paused`
|
|
24
|
+
*/
|
|
25
|
+
state?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* @description Arbitrary metadata key-value pairs for filtering,keys and values must be url encoded
|
|
28
|
+
* Example: To filter by `project=Apollo` and `note=Demo Test`: `?metadata=project%3DApollo%26note%3DDemo%252520Test`
|
|
29
|
+
*/
|
|
30
|
+
metadata?: string;
|
|
31
|
+
/** @description Page number for pagination */
|
|
32
|
+
page?: number;
|
|
33
|
+
/** @description Number of items per page */
|
|
34
|
+
pageSize?: number;
|
|
35
|
+
};
|
|
36
|
+
header?: never;
|
|
37
|
+
path?: never;
|
|
38
|
+
cookie?: never;
|
|
39
|
+
};
|
|
40
|
+
requestBody?: never;
|
|
41
|
+
responses: {
|
|
42
|
+
/** @description Paginated collection of sandboxes */
|
|
43
|
+
200: {
|
|
44
|
+
headers: {
|
|
45
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
46
|
+
[name: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
content: {
|
|
49
|
+
"application/json": components["schemas"]["ListSandboxesResponse"];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
400: components["responses"]["BadRequest"];
|
|
53
|
+
401: components["responses"]["Unauthorized"];
|
|
54
|
+
500: components["responses"]["InternalServerError"];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
put?: never;
|
|
58
|
+
/**
|
|
59
|
+
* Create a sandbox from a container image
|
|
60
|
+
* @description Creates a new sandbox from a container image with optional resource limits,
|
|
61
|
+
* environment variables, and metadata. Sandboxes are provisioned directly from
|
|
62
|
+
* the specified image without requiring a pre-created template.
|
|
63
|
+
*
|
|
64
|
+
* ## Authentication
|
|
65
|
+
*
|
|
66
|
+
* API Key authentication is required via:
|
|
67
|
+
* - `OPEN-SANDBOX-API-KEY: <api-key>` header
|
|
68
|
+
*/
|
|
69
|
+
post: {
|
|
70
|
+
parameters: {
|
|
71
|
+
query?: never;
|
|
72
|
+
header?: never;
|
|
73
|
+
path?: never;
|
|
74
|
+
cookie?: never;
|
|
75
|
+
};
|
|
76
|
+
requestBody: {
|
|
77
|
+
content: {
|
|
78
|
+
"application/json": components["schemas"]["CreateSandboxRequest"];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
responses: {
|
|
82
|
+
/**
|
|
83
|
+
* @description Sandbox created and accepted for provisioning.
|
|
84
|
+
*
|
|
85
|
+
* The returned sandbox includes:
|
|
86
|
+
* - `id`: Unique sandbox identifier
|
|
87
|
+
* - `status.state: "Pending"` (auto-starting provisioning)
|
|
88
|
+
* - `status.reason` and `status.message` indicating initialization stage
|
|
89
|
+
* - `metadata`, `expiresAt`, `createdAt`: Core sandbox information
|
|
90
|
+
*
|
|
91
|
+
* Note: `image` and `updatedAt` are not included in the create response.
|
|
92
|
+
* Use GET /sandboxes/{sandboxId} to retrieve the complete sandbox information including image spec.
|
|
93
|
+
*
|
|
94
|
+
* To track provisioning progress, poll GET /sandboxes/{sandboxId}.
|
|
95
|
+
* The sandbox will automatically transition to `Running` state once provisioning completes.
|
|
96
|
+
*/
|
|
97
|
+
202: {
|
|
98
|
+
headers: {
|
|
99
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
100
|
+
Location: components["headers"]["Location"];
|
|
101
|
+
[name: string]: unknown;
|
|
102
|
+
};
|
|
103
|
+
content: {
|
|
104
|
+
"application/json": components["schemas"]["CreateSandboxResponse"];
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
400: components["responses"]["BadRequest"];
|
|
108
|
+
401: components["responses"]["Unauthorized"];
|
|
109
|
+
409: components["responses"]["Conflict"];
|
|
110
|
+
500: components["responses"]["InternalServerError"];
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
delete?: never;
|
|
114
|
+
options?: never;
|
|
115
|
+
head?: never;
|
|
116
|
+
patch?: never;
|
|
117
|
+
trace?: never;
|
|
118
|
+
};
|
|
119
|
+
"/sandboxes/{sandboxId}": {
|
|
120
|
+
parameters: {
|
|
121
|
+
query?: never;
|
|
122
|
+
header?: never;
|
|
123
|
+
path: {
|
|
124
|
+
/** @description Unique sandbox identifier */
|
|
125
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
126
|
+
};
|
|
127
|
+
cookie?: never;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Fetch a sandbox by id
|
|
131
|
+
* @description Returns the complete sandbox information including:
|
|
132
|
+
* - `id`, `status`, `metadata`, `expiresAt`, `createdAt`: Core information
|
|
133
|
+
* - `image`: Container image specification (not included in create response)
|
|
134
|
+
* - `entrypoint`: Entry process specification
|
|
135
|
+
*
|
|
136
|
+
* This is the complete representation of the sandbox resource.
|
|
137
|
+
*/
|
|
138
|
+
get: {
|
|
139
|
+
parameters: {
|
|
140
|
+
query?: never;
|
|
141
|
+
header?: never;
|
|
142
|
+
path: {
|
|
143
|
+
/** @description Unique sandbox identifier */
|
|
144
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
145
|
+
};
|
|
146
|
+
cookie?: never;
|
|
147
|
+
};
|
|
148
|
+
requestBody?: never;
|
|
149
|
+
responses: {
|
|
150
|
+
/** @description Sandbox current state and metadata */
|
|
151
|
+
200: {
|
|
152
|
+
headers: {
|
|
153
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
154
|
+
[name: string]: unknown;
|
|
155
|
+
};
|
|
156
|
+
content: {
|
|
157
|
+
"application/json": components["schemas"]["Sandbox"];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
401: components["responses"]["Unauthorized"];
|
|
161
|
+
403: components["responses"]["Forbidden"];
|
|
162
|
+
404: components["responses"]["NotFound"];
|
|
163
|
+
500: components["responses"]["InternalServerError"];
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
put?: never;
|
|
167
|
+
post?: never;
|
|
168
|
+
/**
|
|
169
|
+
* Delete a sandbox
|
|
170
|
+
* @description Delete a sandbox, terminating its execution. The sandbox will transition through Stopping state to Terminated.
|
|
171
|
+
*/
|
|
172
|
+
delete: {
|
|
173
|
+
parameters: {
|
|
174
|
+
query?: never;
|
|
175
|
+
header?: never;
|
|
176
|
+
path: {
|
|
177
|
+
/** @description Unique sandbox identifier */
|
|
178
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
179
|
+
};
|
|
180
|
+
cookie?: never;
|
|
181
|
+
};
|
|
182
|
+
requestBody?: never;
|
|
183
|
+
responses: {
|
|
184
|
+
/**
|
|
185
|
+
* @description Sandbox successfully deleted.
|
|
186
|
+
*
|
|
187
|
+
* Sandbox has been scheduled for termination and will transition to Stopping state, then Terminated.
|
|
188
|
+
*/
|
|
189
|
+
204: {
|
|
190
|
+
headers: {
|
|
191
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
192
|
+
[name: string]: unknown;
|
|
193
|
+
};
|
|
194
|
+
content?: never;
|
|
195
|
+
};
|
|
196
|
+
401: components["responses"]["Unauthorized"];
|
|
197
|
+
403: components["responses"]["Forbidden"];
|
|
198
|
+
404: components["responses"]["NotFound"];
|
|
199
|
+
409: components["responses"]["Conflict"];
|
|
200
|
+
500: components["responses"]["InternalServerError"];
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
options?: never;
|
|
204
|
+
head?: never;
|
|
205
|
+
patch?: never;
|
|
206
|
+
trace?: never;
|
|
207
|
+
};
|
|
208
|
+
"/sandboxes/{sandboxId}/pause": {
|
|
209
|
+
parameters: {
|
|
210
|
+
query?: never;
|
|
211
|
+
header?: never;
|
|
212
|
+
path?: never;
|
|
213
|
+
cookie?: never;
|
|
214
|
+
};
|
|
215
|
+
get?: never;
|
|
216
|
+
put?: never;
|
|
217
|
+
/**
|
|
218
|
+
* Pause execution while retaining state
|
|
219
|
+
* @description Pause a running sandbox while preserving its state. Poll GET /sandboxes/{sandboxId} to track state transition to Paused.
|
|
220
|
+
*/
|
|
221
|
+
post: {
|
|
222
|
+
parameters: {
|
|
223
|
+
query?: never;
|
|
224
|
+
header?: never;
|
|
225
|
+
path: {
|
|
226
|
+
/** @description Unique sandbox identifier */
|
|
227
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
228
|
+
};
|
|
229
|
+
cookie?: never;
|
|
230
|
+
};
|
|
231
|
+
requestBody?: never;
|
|
232
|
+
responses: {
|
|
233
|
+
/**
|
|
234
|
+
* @description Pause operation accepted.
|
|
235
|
+
*
|
|
236
|
+
* Sandbox will transition to Pausing state.
|
|
237
|
+
* Poll GET /sandboxes/{sandboxId} to track progress.
|
|
238
|
+
*/
|
|
239
|
+
202: {
|
|
240
|
+
headers: {
|
|
241
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
242
|
+
[name: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
content?: never;
|
|
245
|
+
};
|
|
246
|
+
401: components["responses"]["Unauthorized"];
|
|
247
|
+
403: components["responses"]["Forbidden"];
|
|
248
|
+
404: components["responses"]["NotFound"];
|
|
249
|
+
409: components["responses"]["Conflict"];
|
|
250
|
+
500: components["responses"]["InternalServerError"];
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
delete?: never;
|
|
254
|
+
options?: never;
|
|
255
|
+
head?: never;
|
|
256
|
+
patch?: never;
|
|
257
|
+
trace?: never;
|
|
258
|
+
};
|
|
259
|
+
"/sandboxes/{sandboxId}/resume": {
|
|
260
|
+
parameters: {
|
|
261
|
+
query?: never;
|
|
262
|
+
header?: never;
|
|
263
|
+
path?: never;
|
|
264
|
+
cookie?: never;
|
|
265
|
+
};
|
|
266
|
+
get?: never;
|
|
267
|
+
put?: never;
|
|
268
|
+
/**
|
|
269
|
+
* Resume a paused sandbox
|
|
270
|
+
* @description Resume execution of a paused sandbox. Poll GET /sandboxes/{sandboxId} to track state transition to Running.
|
|
271
|
+
*/
|
|
272
|
+
post: {
|
|
273
|
+
parameters: {
|
|
274
|
+
query?: never;
|
|
275
|
+
header?: never;
|
|
276
|
+
path: {
|
|
277
|
+
/** @description Unique sandbox identifier */
|
|
278
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
279
|
+
};
|
|
280
|
+
cookie?: never;
|
|
281
|
+
};
|
|
282
|
+
requestBody?: never;
|
|
283
|
+
responses: {
|
|
284
|
+
/**
|
|
285
|
+
* @description Resume operation accepted.
|
|
286
|
+
*
|
|
287
|
+
* Sandbox will transition from Paused → Running.
|
|
288
|
+
* Poll GET /sandboxes/{sandboxId} to track progress.
|
|
289
|
+
*/
|
|
290
|
+
202: {
|
|
291
|
+
headers: {
|
|
292
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
293
|
+
[name: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
content?: never;
|
|
296
|
+
};
|
|
297
|
+
401: components["responses"]["Unauthorized"];
|
|
298
|
+
403: components["responses"]["Forbidden"];
|
|
299
|
+
404: components["responses"]["NotFound"];
|
|
300
|
+
409: components["responses"]["Conflict"];
|
|
301
|
+
500: components["responses"]["InternalServerError"];
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
delete?: never;
|
|
305
|
+
options?: never;
|
|
306
|
+
head?: never;
|
|
307
|
+
patch?: never;
|
|
308
|
+
trace?: never;
|
|
309
|
+
};
|
|
310
|
+
"/sandboxes/{sandboxId}/renew-expiration": {
|
|
311
|
+
parameters: {
|
|
312
|
+
query?: never;
|
|
313
|
+
header?: never;
|
|
314
|
+
path?: never;
|
|
315
|
+
cookie?: never;
|
|
316
|
+
};
|
|
317
|
+
get?: never;
|
|
318
|
+
put?: never;
|
|
319
|
+
/**
|
|
320
|
+
* Renew sandbox expiration
|
|
321
|
+
* @description Renew the absolute expiration time of a sandbox.
|
|
322
|
+
*/
|
|
323
|
+
post: {
|
|
324
|
+
parameters: {
|
|
325
|
+
query?: never;
|
|
326
|
+
header?: never;
|
|
327
|
+
path: {
|
|
328
|
+
/** @description Unique sandbox identifier */
|
|
329
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
330
|
+
};
|
|
331
|
+
cookie?: never;
|
|
332
|
+
};
|
|
333
|
+
requestBody: {
|
|
334
|
+
content: {
|
|
335
|
+
"application/json": components["schemas"]["RenewSandboxExpirationRequest"];
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
responses: {
|
|
339
|
+
/**
|
|
340
|
+
* @description Sandbox expiration updated successfully.
|
|
341
|
+
*
|
|
342
|
+
* Returns only the updated expiresAt field.
|
|
343
|
+
*/
|
|
344
|
+
200: {
|
|
345
|
+
headers: {
|
|
346
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
347
|
+
[name: string]: unknown;
|
|
348
|
+
};
|
|
349
|
+
content: {
|
|
350
|
+
"application/json": components["schemas"]["RenewSandboxExpirationResponse"];
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
400: components["responses"]["BadRequest"];
|
|
354
|
+
401: components["responses"]["Unauthorized"];
|
|
355
|
+
403: components["responses"]["Forbidden"];
|
|
356
|
+
404: components["responses"]["NotFound"];
|
|
357
|
+
409: components["responses"]["Conflict"];
|
|
358
|
+
500: components["responses"]["InternalServerError"];
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
delete?: never;
|
|
362
|
+
options?: never;
|
|
363
|
+
head?: never;
|
|
364
|
+
patch?: never;
|
|
365
|
+
trace?: never;
|
|
366
|
+
};
|
|
367
|
+
"/sandboxes/{sandboxId}/endpoints/{port}": {
|
|
368
|
+
parameters: {
|
|
369
|
+
query?: never;
|
|
370
|
+
header?: never;
|
|
371
|
+
path?: never;
|
|
372
|
+
cookie?: never;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* Get sandbox access endpoint
|
|
376
|
+
* @description Get the public access endpoint URL for accessing a service running on a specific port
|
|
377
|
+
* within the sandbox. The service must be listening on the specified port inside
|
|
378
|
+
* the sandbox for the endpoint to be available.
|
|
379
|
+
*/
|
|
380
|
+
get: {
|
|
381
|
+
parameters: {
|
|
382
|
+
query?: never;
|
|
383
|
+
header?: never;
|
|
384
|
+
path: {
|
|
385
|
+
/** @description Unique sandbox identifier */
|
|
386
|
+
sandboxId: components["parameters"]["SandboxId"];
|
|
387
|
+
/** @description Port number where the service is listening inside the sandbox */
|
|
388
|
+
port: number;
|
|
389
|
+
};
|
|
390
|
+
cookie?: never;
|
|
391
|
+
};
|
|
392
|
+
requestBody?: never;
|
|
393
|
+
responses: {
|
|
394
|
+
/**
|
|
395
|
+
* @description Endpoint retrieved successfully.
|
|
396
|
+
*
|
|
397
|
+
* Returns the public URL for accessing the service on the specified port.
|
|
398
|
+
*/
|
|
399
|
+
200: {
|
|
400
|
+
headers: {
|
|
401
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
402
|
+
[name: string]: unknown;
|
|
403
|
+
};
|
|
404
|
+
content: {
|
|
405
|
+
"application/json": components["schemas"]["Endpoint"];
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
401: components["responses"]["Unauthorized"];
|
|
409
|
+
403: components["responses"]["Forbidden"];
|
|
410
|
+
404: components["responses"]["NotFound"];
|
|
411
|
+
500: components["responses"]["InternalServerError"];
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
put?: never;
|
|
415
|
+
post?: never;
|
|
416
|
+
delete?: never;
|
|
417
|
+
options?: never;
|
|
418
|
+
head?: never;
|
|
419
|
+
patch?: never;
|
|
420
|
+
trace?: never;
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
export type webhooks = Record<string, never>;
|
|
424
|
+
export interface components {
|
|
425
|
+
schemas: {
|
|
426
|
+
ListSandboxesResponse: {
|
|
427
|
+
items: components["schemas"]["Sandbox"][];
|
|
428
|
+
pagination: components["schemas"]["PaginationInfo"];
|
|
429
|
+
};
|
|
430
|
+
/** @description Pagination metadata for list responses */
|
|
431
|
+
PaginationInfo: {
|
|
432
|
+
/** @description Current page number */
|
|
433
|
+
page: number;
|
|
434
|
+
/** @description Number of items per page */
|
|
435
|
+
pageSize: number;
|
|
436
|
+
/** @description Total number of items matching the filter */
|
|
437
|
+
totalItems: number;
|
|
438
|
+
/** @description Total number of pages */
|
|
439
|
+
totalPages: number;
|
|
440
|
+
/** @description Whether there are more pages after the current one */
|
|
441
|
+
hasNextPage: boolean;
|
|
442
|
+
};
|
|
443
|
+
/** @description Response from creating a new sandbox. Contains essential information without image and updatedAt. */
|
|
444
|
+
CreateSandboxResponse: {
|
|
445
|
+
/** @description Unique sandbox identifier */
|
|
446
|
+
id: string;
|
|
447
|
+
/** @description Current lifecycle status and detailed state information */
|
|
448
|
+
status: components["schemas"]["SandboxStatus"];
|
|
449
|
+
/** @description Custom metadata from creation request */
|
|
450
|
+
metadata?: {
|
|
451
|
+
[key: string]: string;
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* Format: date-time
|
|
455
|
+
* @description Timestamp when sandbox will auto-terminate
|
|
456
|
+
*/
|
|
457
|
+
expiresAt: string;
|
|
458
|
+
/**
|
|
459
|
+
* Format: date-time
|
|
460
|
+
* @description Sandbox creation timestamp
|
|
461
|
+
*/
|
|
462
|
+
createdAt: string;
|
|
463
|
+
/** @description Entry process specification from creation request */
|
|
464
|
+
entrypoint: string[];
|
|
465
|
+
};
|
|
466
|
+
/** @description Runtime execution environment provisioned from a container image */
|
|
467
|
+
Sandbox: {
|
|
468
|
+
/** @description Unique sandbox identifier */
|
|
469
|
+
id: string;
|
|
470
|
+
/**
|
|
471
|
+
* @description Container image specification used to provision this sandbox.
|
|
472
|
+
* Only present in responses for GET/LIST operations. Not returned in createSandbox response.
|
|
473
|
+
*/
|
|
474
|
+
image: components["schemas"]["ImageSpec"];
|
|
475
|
+
/** @description Current lifecycle status and detailed state information */
|
|
476
|
+
status: components["schemas"]["SandboxStatus"];
|
|
477
|
+
/** @description Custom metadata from creation request */
|
|
478
|
+
metadata?: {
|
|
479
|
+
[key: string]: string;
|
|
480
|
+
};
|
|
481
|
+
/**
|
|
482
|
+
* @description The command to execute as the sandbox's entry process.
|
|
483
|
+
* Always present in responses since entrypoint is required in creation requests.
|
|
484
|
+
*/
|
|
485
|
+
entrypoint: string[];
|
|
486
|
+
/**
|
|
487
|
+
* Format: date-time
|
|
488
|
+
* @description Timestamp when sandbox will auto-terminate
|
|
489
|
+
*/
|
|
490
|
+
expiresAt: string;
|
|
491
|
+
/**
|
|
492
|
+
* Format: date-time
|
|
493
|
+
* @description Sandbox creation timestamp
|
|
494
|
+
*/
|
|
495
|
+
createdAt: string;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* @description High-level lifecycle state of the sandbox.
|
|
499
|
+
*
|
|
500
|
+
* Common state values:
|
|
501
|
+
* - Pending: Sandbox is being provisioned
|
|
502
|
+
* - Running: Sandbox is running and ready to accept requests
|
|
503
|
+
* - Pausing: Sandbox is in the process of pausing
|
|
504
|
+
* - Paused: Sandbox has been paused while retaining its state
|
|
505
|
+
* - Stopping: Sandbox is being terminated
|
|
506
|
+
* - Terminated: Sandbox has been successfully terminated
|
|
507
|
+
* - Failed: Sandbox encountered a critical error
|
|
508
|
+
*
|
|
509
|
+
* State transitions:
|
|
510
|
+
* - Pending → Running (after creation completes)
|
|
511
|
+
* - Running → Pausing (when pause is requested)
|
|
512
|
+
* - Pausing → Paused (pause operation completes)
|
|
513
|
+
* - Paused → Running (when resume is requested)
|
|
514
|
+
* - Running/Paused → Stopping (when kill is requested or TTL expires)
|
|
515
|
+
* - Stopping → Terminated (kill/timeout operation completes)
|
|
516
|
+
* - Pending/Running/Paused → Failed (on error)
|
|
517
|
+
*
|
|
518
|
+
* Note: New state values may be added in future versions.
|
|
519
|
+
* Clients should handle unknown state values gracefully.
|
|
520
|
+
*/
|
|
521
|
+
SandboxState: string;
|
|
522
|
+
/** @description Detailed status information with lifecycle state and transition details */
|
|
523
|
+
SandboxStatus: {
|
|
524
|
+
/** @description Current lifecycle state of the sandbox */
|
|
525
|
+
state: components["schemas"]["SandboxState"];
|
|
526
|
+
/**
|
|
527
|
+
* @description Short machine-readable reason code for the current state.
|
|
528
|
+
* Examples: "user_delete", "ttl_expiry", "provision_timeout", "runtime_error"
|
|
529
|
+
*/
|
|
530
|
+
reason?: string;
|
|
531
|
+
/** @description Human-readable message describing the current state or reason for state transition */
|
|
532
|
+
message?: string;
|
|
533
|
+
/**
|
|
534
|
+
* Format: date-time
|
|
535
|
+
* @description Timestamp of the last state transition
|
|
536
|
+
*/
|
|
537
|
+
lastTransitionAt?: string;
|
|
538
|
+
};
|
|
539
|
+
/**
|
|
540
|
+
* @description Container image specification for sandbox provisioning.
|
|
541
|
+
*
|
|
542
|
+
* Supports public registry images and private registry images with authentication.
|
|
543
|
+
*/
|
|
544
|
+
ImageSpec: {
|
|
545
|
+
/**
|
|
546
|
+
* @description Container image URI in standard format.
|
|
547
|
+
*
|
|
548
|
+
* Examples:
|
|
549
|
+
* - "python:3.11" (Docker Hub)
|
|
550
|
+
* - "ubuntu:22.04"
|
|
551
|
+
* - "gcr.io/my-project/model-server:v1.0"
|
|
552
|
+
* - "private-registry.company.com:5000/app:latest"
|
|
553
|
+
*/
|
|
554
|
+
uri: string;
|
|
555
|
+
/** @description Registry authentication credentials (required for private registries) */
|
|
556
|
+
auth?: {
|
|
557
|
+
/** @description Registry username or service account */
|
|
558
|
+
username?: string;
|
|
559
|
+
/** @description Registry password or authentication token */
|
|
560
|
+
password?: string;
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* @description Request to create a new sandbox from a container image.
|
|
565
|
+
*
|
|
566
|
+
* **Note**: API Key authentication is required via the `OPEN-SANDBOX-API-KEY` header.
|
|
567
|
+
*/
|
|
568
|
+
CreateSandboxRequest: {
|
|
569
|
+
/** @description Container image specification for the sandbox */
|
|
570
|
+
image: components["schemas"]["ImageSpec"];
|
|
571
|
+
/**
|
|
572
|
+
* @description Sandbox timeout in seconds. The sandbox will automatically terminate after this duration.
|
|
573
|
+
* SDK clients should provide a default value (e.g., 3600 seconds / 1 hour).
|
|
574
|
+
*/
|
|
575
|
+
timeout: number;
|
|
576
|
+
/**
|
|
577
|
+
* @description Runtime resource constraints for the sandbox instance.
|
|
578
|
+
* SDK clients should provide sensible defaults (e.g., cpu: "500m", memory: "512Mi").
|
|
579
|
+
*/
|
|
580
|
+
resourceLimits: components["schemas"]["ResourceLimits"];
|
|
581
|
+
/**
|
|
582
|
+
* @description Environment variables to inject into the sandbox runtime.
|
|
583
|
+
* @example {
|
|
584
|
+
* "API_KEY": "secret-key",
|
|
585
|
+
* "DEBUG": "true",
|
|
586
|
+
* "LOG_LEVEL": "info"
|
|
587
|
+
* }
|
|
588
|
+
*/
|
|
589
|
+
env?: {
|
|
590
|
+
[key: string]: string;
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* @description Custom key-value metadata for management, filtering, and tagging.
|
|
594
|
+
* Use "name" key for a human-readable identifier.
|
|
595
|
+
* @example {
|
|
596
|
+
* "name": "Data Processing Sandbox",
|
|
597
|
+
* "project": "data-processing",
|
|
598
|
+
* "team": "ml",
|
|
599
|
+
* "environment": "staging"
|
|
600
|
+
* }
|
|
601
|
+
*/
|
|
602
|
+
metadata?: {
|
|
603
|
+
[key: string]: string;
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* @description The command to execute as the sandbox's entry process (required).
|
|
607
|
+
*
|
|
608
|
+
* Explicitly specifies the user's expected main process, allowing the sandbox management
|
|
609
|
+
* service to reliably inject control processes before executing this command.
|
|
610
|
+
*
|
|
611
|
+
* Format: [executable, arg1, arg2, ...]
|
|
612
|
+
*
|
|
613
|
+
* Examples:
|
|
614
|
+
* - ["python", "/app/main.py"]
|
|
615
|
+
* - ["/bin/bash"]
|
|
616
|
+
* - ["java", "-jar", "/app/app.jar"]
|
|
617
|
+
* - ["node", "server.js"]
|
|
618
|
+
* @example [
|
|
619
|
+
* "python",
|
|
620
|
+
* "/app/main.py"
|
|
621
|
+
* ]
|
|
622
|
+
*/
|
|
623
|
+
entrypoint: string[];
|
|
624
|
+
/**
|
|
625
|
+
* @description Opaque container for provider-specific or transient parameters not supported by the core API.
|
|
626
|
+
*
|
|
627
|
+
* **Note**: This field is reserved for internal features, experimental flags, or temporary behaviors. Standard parameters should be proposed as core API fields.
|
|
628
|
+
*
|
|
629
|
+
* **Best Practices**:
|
|
630
|
+
* - **Namespacing**: Use prefixed keys (e.g., `storage.id`) to prevent collisions.
|
|
631
|
+
* - **Pass-through**: SDKs and middleware must treat this object as opaque and pass it through transparently.
|
|
632
|
+
*/
|
|
633
|
+
extensions?: {
|
|
634
|
+
[key: string]: string;
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* @description Runtime resource constraints as key-value pairs. Similar to Kubernetes resource specifications,
|
|
639
|
+
* allows flexible definition of resource limits. Common resource types include:
|
|
640
|
+
* - `cpu`: CPU allocation in millicores (e.g., "250m" for 0.25 CPU cores)
|
|
641
|
+
* - `memory`: Memory allocation in bytes or human-readable format (e.g., "512Mi", "1Gi")
|
|
642
|
+
* - `gpu`: Number of GPU devices (e.g., "1")
|
|
643
|
+
*
|
|
644
|
+
* New resource types can be added without API changes.
|
|
645
|
+
* @example {
|
|
646
|
+
* "cpu": "500m",
|
|
647
|
+
* "memory": "512Mi",
|
|
648
|
+
* "gpu": "1"
|
|
649
|
+
* }
|
|
650
|
+
*/
|
|
651
|
+
ResourceLimits: {
|
|
652
|
+
[key: string]: string;
|
|
653
|
+
};
|
|
654
|
+
RenewSandboxExpirationRequest: {
|
|
655
|
+
/**
|
|
656
|
+
* Format: date-time
|
|
657
|
+
* @description New absolute expiration time in UTC (RFC 3339 format).
|
|
658
|
+
* Must be in the future and after the current expiresAt time.
|
|
659
|
+
*
|
|
660
|
+
* Example: "2025-11-16T14:30:45Z"
|
|
661
|
+
*/
|
|
662
|
+
expiresAt: string;
|
|
663
|
+
};
|
|
664
|
+
RenewSandboxExpirationResponse: {
|
|
665
|
+
/**
|
|
666
|
+
* Format: date-time
|
|
667
|
+
* @description The new absolute expiration time in UTC (RFC 3339 format).
|
|
668
|
+
*
|
|
669
|
+
* Example: "2025-11-16T14:30:45Z"
|
|
670
|
+
*/
|
|
671
|
+
expiresAt: string;
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
674
|
+
* @description Standard error response for all non-2xx HTTP responses.
|
|
675
|
+
* HTTP status code indicates the error category; code and message provide details.
|
|
676
|
+
*/
|
|
677
|
+
ErrorResponse: {
|
|
678
|
+
/**
|
|
679
|
+
* @description Machine-readable error code (e.g., INVALID_REQUEST, NOT_FOUND, INTERNAL_ERROR).
|
|
680
|
+
* Use this for programmatic error handling.
|
|
681
|
+
*/
|
|
682
|
+
code: string;
|
|
683
|
+
/** @description Human-readable error message describing what went wrong and how to fix it. */
|
|
684
|
+
message: string;
|
|
685
|
+
};
|
|
686
|
+
/**
|
|
687
|
+
* @description Endpoint for accessing a service running in the sandbox.
|
|
688
|
+
* The service must be listening on the specified port inside the sandbox for the endpoint to be available.
|
|
689
|
+
*/
|
|
690
|
+
Endpoint: {
|
|
691
|
+
/**
|
|
692
|
+
* @description Public URL to access the service from outside the sandbox.
|
|
693
|
+
* Format: {endpoint-host}/sandboxes/{sandboxId}/port/{port}
|
|
694
|
+
* Example: endpoint.opensandbox.io/sandboxes/abc123/port/8080
|
|
695
|
+
*/
|
|
696
|
+
endpoint: string;
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
responses: {
|
|
700
|
+
/** @description Error response envelope */
|
|
701
|
+
Error: {
|
|
702
|
+
headers: {
|
|
703
|
+
[name: string]: unknown;
|
|
704
|
+
};
|
|
705
|
+
content: {
|
|
706
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
/** @description The request was invalid or malformed */
|
|
710
|
+
BadRequest: {
|
|
711
|
+
headers: {
|
|
712
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
713
|
+
[name: string]: unknown;
|
|
714
|
+
};
|
|
715
|
+
content: {
|
|
716
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
/** @description Authentication credentials are missing or invalid */
|
|
720
|
+
Unauthorized: {
|
|
721
|
+
headers: {
|
|
722
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
723
|
+
[name: string]: unknown;
|
|
724
|
+
};
|
|
725
|
+
content: {
|
|
726
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
/** @description The authenticated user lacks permission for this operation */
|
|
730
|
+
Forbidden: {
|
|
731
|
+
headers: {
|
|
732
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
733
|
+
[name: string]: unknown;
|
|
734
|
+
};
|
|
735
|
+
content: {
|
|
736
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
/** @description The requested resource does not exist */
|
|
740
|
+
NotFound: {
|
|
741
|
+
headers: {
|
|
742
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
743
|
+
[name: string]: unknown;
|
|
744
|
+
};
|
|
745
|
+
content: {
|
|
746
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
/** @description The operation conflicts with the current state */
|
|
750
|
+
Conflict: {
|
|
751
|
+
headers: {
|
|
752
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
753
|
+
[name: string]: unknown;
|
|
754
|
+
};
|
|
755
|
+
content: {
|
|
756
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
/** @description An unexpected server error occurred */
|
|
760
|
+
InternalServerError: {
|
|
761
|
+
headers: {
|
|
762
|
+
"X-Request-ID": components["headers"]["XRequestId"];
|
|
763
|
+
[name: string]: unknown;
|
|
764
|
+
};
|
|
765
|
+
content: {
|
|
766
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
767
|
+
};
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
parameters: {
|
|
771
|
+
/** @description Unique sandbox identifier */
|
|
772
|
+
SandboxId: string;
|
|
773
|
+
};
|
|
774
|
+
requestBodies: never;
|
|
775
|
+
headers: {
|
|
776
|
+
/** @description Unique request identifier for tracing */
|
|
777
|
+
XRequestId: string;
|
|
778
|
+
/** @description URI of the newly created or related resource */
|
|
779
|
+
Location: string;
|
|
780
|
+
/** @description Suggested delay in seconds before retrying */
|
|
781
|
+
RetryAfter: number;
|
|
782
|
+
};
|
|
783
|
+
pathItems: never;
|
|
784
|
+
}
|
|
785
|
+
export type $defs = Record<string, never>;
|
|
786
|
+
export type operations = Record<string, never>;
|
|
787
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|