File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export interface DependenciesConfigInput {
4343 autoDetect ?: boolean ;
4444}
4545export interface ExecuteProcessInput {
46- parameters ?: Record < string , any > ,
46+ parameters ?: Record < string , any > ;
4747 tag ?: string ;
4848 comment ?: string ;
4949 settings ?: ExecuteProcessSettingsInput ;
@@ -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+ timeout ?: 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 UpdateSandboxInput {
443+ timeout : 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+ UpdateSandboxInput ,
4144} from "./types" ;
4245import { Readable } from "stream" ;
4346
@@ -622,6 +625,18 @@ 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 updateSandbox ( id : string , data : UpdateSandboxInput ) : Promise < Sandbox > {
633+ return this . request ( "POST" , `/sandboxes/${ id } ` , { data } ) ;
634+ }
635+
636+ async killSandbox ( id : string ) : Promise < Sandbox > {
637+ return this . request ( "POST" , `/sandboxes/${ id } /kill` , { } ) ;
638+ }
639+
625640 async getModules (
626641 params : {
627642 keywords ?: string ;
You can’t perform that action at this time.
0 commit comments