File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,6 +416,33 @@ export interface VersionedModuleAliasesPaginatedResult {
416416 data ?: VersionedModuleAlias [ ] ;
417417}
418418
419+ /**
420+ * Sandboxes
421+ */
422+ export interface CreateSandboxInput {
423+ imageId : string ;
424+ name ?: string ;
425+ metadata ?: Record < string , string > ;
426+ timeoutMs ?: number ;
427+ publicHttpPorts ?: number [ ] ;
428+ publicHttpPortsBasicAuth ?: string ;
429+ }
430+
431+ export interface Sandbox {
432+ id : string ;
433+ name : string ;
434+ grpcServerUrl ?: string ;
435+ grpcApiKey ?: string ;
436+ imageId : string ;
437+ publicHttpPorts ?: number [ ] ;
438+ metadata ?: Record < string , string > ;
439+ timeoutAt : string ;
440+ }
441+
442+ export interface UpdateSandboxTimeoutInput {
443+ timeoutMs : number ;
444+ }
445+
419446/**
420447 * Storage
421448 */
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ import {
3838 ServiceAccountInput ,
3939 ServiceAccount ,
4040 ServiceAccountsListResult ,
41+ Sandbox ,
42+ CreateSandboxInput ,
43+ UpdateSandboxTimeoutInput ,
4144} from "./types" ;
4245import { Readable } from "stream" ;
4346
@@ -622,6 +625,21 @@ export class YepCodeApi {
622625 return this . request ( "DELETE" , `/variables/${ id } ` ) ;
623626 }
624627
628+ async createSandbox ( data : CreateSandboxInput ) : Promise < Sandbox > {
629+ return this . request ( "POST" , "/sandboxes" , { data } ) ;
630+ }
631+
632+ async updateSandboxTimeout (
633+ id : string ,
634+ data : UpdateSandboxTimeoutInput
635+ ) : Promise < Sandbox > {
636+ return this . request ( "POST" , `/sandboxes/${ id } ` , { data } ) ;
637+ }
638+
639+ async killSandbox ( id : string ) : Promise < Sandbox > {
640+ return this . request ( "POST" , `/sandboxes/${ id } /kill` , { } ) ;
641+ }
642+
625643 async getModules (
626644 params : {
627645 keywords ?: string ;
You can’t perform that action at this time.
0 commit comments