Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Regenerate APIs

Tomas Valenta068ff5613f16
diff --git a/Makefile b/Makefile
index 842988b63..e98eb4eaf 100644
--- a/Makefile
+++ b/Makefile
@@ -5,4 +5,7 @@ update-api-spec:
generate:
+ # cd packages/python-sdk && make generate
+ cd packages/js-sdk && pnpm generate
+ cd packages/connect-python && make bin/protoc-gen-connect-python
cd spec && buf generate
\ No newline at end of file
diff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.json
index 03f4fc46f..e1e13cd54 100644
--- a/packages/js-sdk/package.json
+++ b/packages/js-sdk/package.json
@@ -91,4 +91,4 @@
"bufferutil": "^4.0.8",
"utf-8-validate": "^6.0.3"
}
-}
+}
\ No newline at end of file
diff --git a/packages/js-sdk/src/api/schema.gen.ts b/packages/js-sdk/src/api/schema.gen.ts
index 747c1d6a0..43833ea46 100644
--- a/packages/js-sdk/src/api/schema.gen.ts
+++ b/packages/js-sdk/src/api/schema.gen.ts
@@ -21,7 +21,7 @@ export interface paths {
/** Successfully returned all running sandboxes */
200: {
content: {
- "application/json": components["schemas"]["RunningSandboxes"][];
+ "application/json": components["schemas"]["RunningSandbox"][];
};
};
400: components["responses"]["400"];
@@ -57,7 +57,7 @@ export interface paths {
sandboxID: components["parameters"]["sandboxID"];
};
query: {
- /** Starting timestamp of the logs that should be returned */
+ /** Starting timestamp of the logs that should be returned in milliseconds */
start?: number;
/** Maximum number of logs that should be returned */
limit?: number;
@@ -93,6 +93,34 @@ export interface paths {
};
};
};
+ "/sandboxes/{sandboxID}/timeout": {
+ /** Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration. */
+ post: {
+ parameters: {
+ path: {
+ sandboxID: components["parameters"]["sandboxID"];
+ };
+ };
+ responses: {
+ /** Successfully set the sandbox timeout */
+ 204: never;
+ 401: components["responses"]["401"];
+ 404: components["responses"]["404"];
+ 500: components["responses"]["500"];
+ };
+ requestBody: {
+ content: {
+ "application/json": {
+ /**
+ * Format: int32
+ * @description Duration in seconds from the current time after which the sandbox should expire
+ */
+ duration?: number;
+ };
+ };
+ };
+ };
+ };
"/sandboxes/{sandboxID}/refreshes": {
/** Refresh the sandbox extending its time to live */
post: {
@@ -206,32 +234,6 @@ export interface paths {
};
};
};
- "/templates/{templateID}/builds/{buildID}/logs": {
- /** Add a build log */
- post: {
- parameters: {
- path: {
- templateID: components["parameters"]["templateID"];
- buildID: components["parameters"]["buildID"];
- };
- };
- responses: {
- /** Successfully added log */
- 201: unknown;
- 401: components["responses"]["401"];
- 404: components["responses"]["404"];
- };
- requestBody: {
- content: {
- "application/json": {
- /** @description API secret */
- apiSecret: string;
- logs: string[];
- };
- };
- };
- };
- };
"/templates/{templateID}/builds/{buildID}/status": {
/** Get template build info */
get: {
@@ -262,6 +264,16 @@ export interface paths {
export interface components {
schemas: {
+ /**
+ * Format: int32
+ * @description CPU cores for the sandbox
+ */
+ CPUCount: number;
+ /**
+ * Format: int32
+ * @description Memory for the sandbox in MB
+ */
+ MemoryMB: number;
SandboxMetadata: { [key: string]: string };
/** @description Log entry with timestamp and line */
SandboxLog: {
@@ -287,7 +299,7 @@ export interface components {
/** @description Identifier of the client */
clientID: string;
};
- RunningSandboxes: {
+ RunningSandbox: {
/** @description Identifier of the template from which is the sandbox created */
templateID: string;
/** @description Alias of the template */
@@ -301,15 +313,18 @@ export interface components {
* @description Time when the sandbox was started
*/
startedAt: string;
- /** @description CPU cores for the sandbox */
- cpuCount: number;
- /** @description Memory limit for the sandbox in MB */
- memoryMB: number;
+ cpuCount: components["schemas"]["CPUCount"];
+ memoryMB: components["schemas"]["MemoryMB"];
metadata?: components["schemas"]["SandboxMetadata"];
};
NewSandbox: {
/** @description Identifier of the required template */
templateID: string;
+ /**
+ * Format: int32
+ * @description Time to live for the sandbox in seconds.
+ */
+ timeout?: number;
metadata?: components["schemas"]["SandboxMetadata"];
};
Template: {
@@ -317,16 +332,12 @@ export interface components {
templateID: string;
/** @description Identifier of the last successful build for given template */
buildID: string;
- /** @description CPU cores for the sandbox */
- cpuCount: number;
- /** @description Memory limit for the sandbox in MB */
- memoryMB: number;
+ cpuCount: components["schemas"]["CPUCount"];
+ memoryMB: components["schemas"]["MemoryMB"];
/** @description Whether the template is public or only accessible by the team */
public: boolean;
/** @description Aliases of the template */
aliases?: string[];
- } & {
- storageGB: unknown;
};
TemplateBuildRequest: {
/** @description Alias of the template */
@@ -335,10 +346,8 @@ export interface components {
dockerfile: string;
/** @description Start command to execute in the template after the build */
startCmd?: string;
- /** @description CPU cores for the template */
- cpuCount?: number;
- /** @description Memory limit for the template in MB */
- memoryMB?: number;
+ cpuCount?: components["schemas"]["CPUCount"];
+ memoryMB?: components["schemas"]["MemoryMB"];
};
TemplateBuild: {
/**
@@ -354,9 +363,7 @@ export interface components {
* @description Status of the template
* @enum {string}
*/
- status?: "building" | "ready" | "error";
- } & {
- finished: unknown;
+ status: "building" | "ready" | "error";
};
Error: {
/**
diff --git a/packages/js-sdk/src/envd/filesystem/v1/filesystem_connect.ts b/packages/js-sdk/src/envd/filesystem/v1/filesystem_connect.ts
index c4d081766..0e5a76a46 100644
--- a/packages/js-sdk/src/envd/filesystem/v1/filesystem_connect.ts
+++ b/packages/js-sdk/src/envd/filesystem/v1/filesystem_connect.ts
@@ -3,7 +3,7 @@
/* eslint-disable */
// @ts-nocheck
-import { CopyRequest, CopyResponse, CreateDirRequest, CreateDirResponse, CreateFileRequest, CreateFileResponse, ListDirRequest, ListDirResponse, RemoveRequest, RemoveResponse, RenameRequest, RenameResponse, StatRequest, StatResponse, WatchRequest, WatchResponse } from "./filesystem_pb.js";
+import { CopyRequest, CopyResponse, CreateDirRequest, CreateDirResponse, ListDirRequest, ListDirResponse, RemoveRequest, RemoveResponse, RenameRequest, RenameResponse, StatRequest, StatResponse, WatchRequest, WatchResponse } from "./filesystem_pb.js";
import { MethodKind } from "@bufbuild/protobuf";
/**
@@ -21,15 +21,6 @@ export const FilesystemService = {
O: StatResponse,
kind: MethodKind.Unary,
},
- /**
- * @generated from rpc envd.filesystem.v1.FilesystemService.CreateFile
- */
- createFile: {
- name: "CreateFile",
- I: CreateFileRequest,
- O: CreateFileResponse,
- kind: MethodKind.Unary,
- },
/**
* @generated from rpc envd.filesystem.v1.FilesystemService.CreateDir
*/
diff --git a/packages/js-sdk/src/envd/filesystem/v1/filesystem_pb.ts b/packages/js-sdk/src/envd/filesystem/v1/filesystem_pb.ts
index 0f45c0122..4b480075b 100644
--- a/packages/js-sdk/src/envd/filesystem/v1/filesystem_pb.ts
+++ b/packages/js-sdk/src/envd/filesystem/v1/filesystem_pb.ts
@@ -25,24 +25,12 @@ export enum FileType {
* @generated from enum value: FILE_TYPE_DIRECTORY = 2;
*/
DIRECTORY = 2,
-
- /**
- * @generated from enum value: FILE_TYPE_LINK = 3;
- */
- LINK = 3,
-
- /**
- * @generated from enum value: FILE_TYPE_SYMLINK = 4;
- */
- SYMLINK = 4,
}
// Retrieve enum metadata with: proto3.getEnumType(FileType)
proto3.util.setEnumType(FileType, "envd.filesystem.v1.FileType", [
{ no: 0, name: "FILE_TYPE_UNSPECIFIED" },
{ no: 1, name: "FILE_TYPE_FILE" },
{ no: 2, name: "FILE_TYPE_DIRECTORY" },
- { no: 3, name: "FILE_TYPE_LINK" },
- { no: 4, name: "FILE_TYPE_SYMLINK" },
]);
/**
@@ -89,92 +77,6 @@ proto3.util.setEnumType(EventType, "envd.filesystem.v1.EventType", [
{ no: 5, name: "EVENT_TYPE_CHMOD" },
]);
-/**
- * @generated from message envd.filesystem.v1.CreateFileRequest
- */
-export class CreateFileRequest extends Message<CreateFileRequest> {
- /**
- * @generated from field: string path = 1;
- */
- path = "";
-
- /**
- * @generated from field: bool create_parents = 2;
- */
- createParents = false;
-
- /**
- * @generated from field: string mode = 3;
- */
- mode = "";
-
- /**
- * @generated from field: envd.permissions.v1.Credentials owner = 4;
- */
- owner?: Credentials;
-
- constructor(data?: PartialMessage<CreateFileRequest>) {
- super();
- proto3.util.initPartial(data, this);
- }
-
- static readonly runtime: typeof proto3 = proto3;
- static readonly typeName = "envd.filesystem.v1.CreateFileRequest";
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ },
- { no: 2, name: "create_parents", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
- { no: 3, name: "mode", kind: "scalar", T: 9 /* ScalarType.STRING */ },
- { no: 4, name: "owner", kind: "message", T: Credentials },
- ]);
-
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CreateFileRequest {
- return new CreateFileRequest().fromBinary(bytes, options);
- }
-
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CreateFileRequest {
- return new CreateFileRequest().fromJson(jsonValue, options);
- }
-
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CreateFileRequest {
- return new CreateFileRequest().fromJsonString(jsonString, options);
- }
-
- static equals(a: CreateFileRequest | PlainMessage<CreateFileRequest> | undefined, b: CreateFileRequest | PlainMessage<CreateFileRequest> | undefined): boolean {
- return proto3.util.equals(CreateFileRequest, a, b);
- }
-}
-
-/**
- * @generated from message envd.filesystem.v1.CreateFileResponse
- */
-export class CreateFileResponse extends Message<CreateFileResponse> {
- constructor(data?: PartialMessage<CreateFileResponse>) {
- super();
- proto3.util.initPartial(data, this);
- }
-
- static readonly runtime: typeof proto3 = proto3;
- static readonly typeName = "envd.filesystem.v1.CreateFileResponse";
- static readonly fields: FieldList = proto3.util.newFieldList(() => [
- ]);
-
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CreateFileResponse {
- return new CreateFileResponse().fromBinary(bytes, options);
- }
-
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CreateFileResponse {
- return new CreateFileResponse().fromJson(jsonValue, options);
- }
-
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CreateFileResponse {
- return new CreateFileResponse().fromJsonString(jsonString, options);
- }
-
- static equals(a: CreateFileResponse | PlainMessage<CreateFileResponse> | undefined, b: CreateFileResponse | PlainMessage<CreateFileResponse> | undefined): boolean {
- return proto3.util.equals(CreateFileResponse, a, b);
- }
-}
-
/**
* @generated from message envd.filesystem.v1.CreateDirRequest
*/
@@ -184,11 +86,6 @@ export class CreateDirRequest extends Message<CreateDirRequest> {
*/
path = "";
- /**
- * @generated from field: bool create_parents = 2;
- */
- createParents = false;
-
/**
* @generated from field: string mode = 3;
*/
@@ -208,7 +105,6 @@ export class CreateDirRequest extends Message<CreateDirRequest> {
static readonly typeName = "envd.filesystem.v1.CreateDirRequest";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ },
- { no: 2, name: "create_parents", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 3, name: "mode", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 4, name: "owner", kind: "message", T: Credentials },
]);
@@ -276,14 +172,9 @@ export class CopyRequest extends Message<CopyRequest> {
destination = "";
/**
- * @generated from field: bool recursive = 3;
- */
- recursive = false;
-
- /**
- * @generated from field: envd.permissions.v1.Credentials owner = 4;
+ * @generated from field: string mode = 3;
*/
- owner?: Credentials;
+ mode = "";
constructor(data?: PartialMessage<CopyRequest>) {
super();
@@ -295,8 +186,7 @@ export class CopyRequest extends Message<CopyRequest> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "source", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "destination", kind: "scalar", T: 9 /* ScalarType.STRING */ },
- { no: 3, name: "recursive", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
- { no: 4, name: "owner", kind: "message", T: Credentials },
+ { no: 3, name: "mode", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CopyRequest {
@@ -509,11 +399,6 @@ export class RenameRequest extends Message<RenameRequest> {
*/
destination = "";
- /**
- * @generated from field: envd.permissions.v1.Credentials owner = 4;
- */
- owner?: Credentials;
-
constructor(data?: PartialMessage<RenameRequest>) {
super();
proto3.util.initPartial(data, this);
@@ -524,7 +409,6 @@ export class RenameRequest extends Message<RenameRequest> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "source", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "destination", kind: "scalar", T: 9 /* ScalarType.STRING */ },
- { no: 4, name: "owner", kind: "message", T: Credentials },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RenameRequest {
@@ -589,11 +473,6 @@ export class EntryInfo extends Message<EntryInfo> {
*/
type = FileType.UNSPECIFIED;
- /**
- * @generated from field: envd.permissions.v1.Credentials owner = 6;
- */
- owner?: Credentials;
-
constructor(data?: PartialMessage<EntryInfo>) {
super();
proto3.util.initPartial(data, this);
@@ -604,7 +483,6 @@ export class EntryInfo extends Message<EntryInfo> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "type", kind: "enum", T: proto3.getEnumType(FileType) },
- { no: 6, name: "owner", kind: "message", T: Credentials },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EntryInfo {
@@ -786,11 +664,6 @@ export class FilesystemEvent extends Message<FilesystemEvent> {
*/
type = EventType.UNSPECIFIED;
- /**
- * @generated from field: envd.filesystem.v1.EntryInfo entry = 3;
- */
- entry?: EntryInfo;
-
constructor(data?: PartialMessage<FilesystemEvent>) {
super();
proto3.util.initPartial(data, this);
@@ -801,7 +674,6 @@ export class FilesystemEvent extends Message<FilesystemEvent> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "type", kind: "enum", T: proto3.getEnumType(EventType) },
- { no: 3, name: "entry", kind: "message", T: EntryInfo },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FilesystemEvent {
diff --git a/packages/js-sdk/src/envd/permissions/v1/permissions_pb.ts b/packages/js-sdk/src/envd/permissions/v1/permissions_pb.ts
index 3136179d8..ba7531e4d 100644
--- a/packages/js-sdk/src/envd/permissions/v1/permissions_pb.ts
+++ b/packages/js-sdk/src/envd/permissions/v1/permissions_pb.ts
@@ -15,10 +15,10 @@ export class Credentials extends Message<Credentials> {
*/
credentials: {
/**
- * @generated from field: string user = 1;
+ * @generated from field: string username = 1;
*/
value: string;
- case: "user";
+ case: "username";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<Credentials>) {
@@ -29,7 +29,7 @@ export class Credentials extends Message<Credentials> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "envd.permissions.v1.Credentials";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "user", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "credentials" },
+ { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "credentials" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Credentials {
diff --git a/packages/js-sdk/src/envd/process/v1/process_connect.ts b/packages/js-sdk/src/envd/process/v1/process_connect.ts
index 3810f85f5..108ba8618 100644
--- a/packages/js-sdk/src/envd/process/v1/process_connect.ts
+++ b/packages/js-sdk/src/envd/process/v1/process_connect.ts
@@ -3,7 +3,7 @@
/* eslint-disable */
// @ts-nocheck
-import { ListProcessesRequest, ListProcessesResponse, ReconnectProcessRequest, ReconnectProcessResponse, SendProcessInputRequest, SendProcessInputResponse, SendProcessSignalRequest, SendProcessSignalResponse, StartProcessRequest, StartProcessResponse, UpdateProcessRequest, UpdateProcessResponse } from "./process_pb.js";
+import { ListProcessesRequest, ListProcessesResponse, ReconnectProcessRequest, ReconnectProcessResponse, SendProcessInputRequest, SendProcessInputResponse, SendProcessInputStreamRequest, SendProcessInputStreamResponse, SendProcessSignalRequest, SendProcessSignalResponse, StartProcessRequest, StartProcessResponse, UpdateProcessRequest, UpdateProcessResponse } from "./process_pb.js";
import { MethodKind } from "@bufbuild/protobuf";
/**
@@ -48,6 +48,17 @@ export const ProcessService = {
O: UpdateProcessResponse,
kind: MethodKind.Unary,
},
+ /**
+ * Client input stream ensures ordering of messages
+ *
+ * @generated from rpc envd.process.v1.ProcessService.SendProcessInputStream
+ */
+ sendProcessInputStream: {
+ name: "SendProcessInputStream",
+ I: SendProcessInputStreamRequest,
+ O: SendProcessInputStreamResponse,
+ kind: MethodKind.ClientStreaming,
+ },
/**
* @generated from rpc envd.process.v1.ProcessService.SendProcessInput
*/
diff --git a/packages/js-sdk/src/envd/process/v1/process_pb.ts b/packages/js-sdk/src/envd/process/v1/process_pb.ts
index 240b6cac7..8d05a7c6e 100644
--- a/packages/js-sdk/src/envd/process/v1/process_pb.ts
+++ b/packages/js-sdk/src/envd/process/v1/process_pb.ts
@@ -17,20 +17,20 @@ export enum Signal {
UNSPECIFIED = 0,
/**
- * @generated from enum value: SIGNAL_SIGTERM = 1;
+ * @generated from enum value: SIGNAL_SIGTERM = 15;
*/
- SIGTERM = 1,
+ SIGTERM = 15,
/**
- * @generated from enum value: SIGNAL_SIGKILL = 2;
+ * @generated from enum value: SIGNAL_SIGKILL = 9;
*/
- SIGKILL = 2,
+ SIGKILL = 9,
}
// Retrieve enum metadata with: proto3.getEnumType(Signal)
proto3.util.setEnumType(Signal, "envd.process.v1.Signal", [
{ no: 0, name: "SIGNAL_UNSPECIFIED" },
- { no: 1, name: "SIGNAL_SIGTERM" },
- { no: 2, name: "SIGNAL_SIGKILL" },
+ { no: 15, name: "SIGNAL_SIGTERM" },
+ { no: 9, name: "SIGNAL_SIGKILL" },
]);
/**
@@ -128,9 +128,9 @@ export class ProcessConfig extends Message<ProcessConfig> {
args: string[] = [];
/**
- * @generated from field: map<string, string> env = 3;
+ * @generated from field: map<string, string> envs = 3;
*/
- env: { [key: string]: string } = {};
+ envs: { [key: string]: string } = {};
/**
* @generated from field: string cwd = 4;
@@ -147,7 +147,7 @@ export class ProcessConfig extends Message<ProcessConfig> {
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "cmd", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "args", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
- { no: 3, name: "env", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
+ { no: 3, name: "envs", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
{ no: 4, name: "cwd", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
@@ -364,9 +364,9 @@ export class UpdateProcessResponse extends Message<UpdateProcessResponse> {
*/
export class ProcessEvent extends Message<ProcessEvent> {
/**
- * @generated from oneof envd.process.v1.ProcessEvent.event_type
+ * @generated from oneof envd.process.v1.ProcessEvent.event
*/
- eventType: {
+ event: {
/**
* @generated from field: envd.process.v1.ProcessEvent.StartEvent start = 1;
*/
@@ -394,9 +394,9 @@ export class ProcessEvent extends Message<ProcessEvent> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "envd.process.v1.ProcessEvent";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "start", kind: "message", T: ProcessEvent_StartEvent, oneof: "event_type" },
- { no: 2, name: "data", kind: "message", T: ProcessEvent_DataEvent, oneof: "event_type" },
- { no: 3, name: "end", kind: "message", T: ProcessEvent_EndEvent, oneof: "event_type" },
+ { no: 1, name: "start", kind: "message", T: ProcessEvent_StartEvent, oneof: "event" },
+ { no: 2, name: "data", kind: "message", T: ProcessEvent_DataEvent, oneof: "event" },
+ { no: 3, name: "end", kind: "message", T: ProcessEvent_EndEvent, oneof: "event" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent {
@@ -421,7 +421,7 @@ export class ProcessEvent extends Message<ProcessEvent> {
*/
export class ProcessEvent_StartEvent extends Message<ProcessEvent_StartEvent> {
/**
- * @generated from field: uint32 pid = 5;
+ * @generated from field: uint32 pid = 1;
*/
pid = 0;
@@ -433,7 +433,7 @@ export class ProcessEvent_StartEvent extends Message<ProcessEvent_StartEvent> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "envd.process.v1.ProcessEvent.StartEvent";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 5, name: "pid", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
+ { no: 1, name: "pid", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent_StartEvent {
@@ -458,14 +458,21 @@ export class ProcessEvent_StartEvent extends Message<ProcessEvent_StartEvent> {
*/
export class ProcessEvent_DataEvent extends Message<ProcessEvent_DataEvent> {
/**
- * @generated from field: optional bytes stdout = 6;
+ * @generated from oneof envd.process.v1.ProcessEvent.DataEvent.output
*/
- stdout?: Uint8Array;
-
- /**
- * @generated from field: optional bytes stderr = 7;
- */
- stderr?: Uint8Array;
+ output: {
+ /**
+ * @generated from field: bytes stdout = 1;
+ */
+ value: Uint8Array;
+ case: "stdout";
+ } | {
+ /**
+ * @generated from field: bytes stderr = 2;
+ */
+ value: Uint8Array;
+ case: "stderr";
+ } | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<ProcessEvent_DataEvent>) {
super();
@@ -475,8 +482,8 @@ export class ProcessEvent_DataEvent extends Message<ProcessEvent_DataEvent> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "envd.process.v1.ProcessEvent.DataEvent";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 6, name: "stdout", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
- { no: 7, name: "stderr", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
+ { no: 1, name: "stdout", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "output" },
+ { no: 2, name: "stderr", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "output" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent_DataEvent {
@@ -501,12 +508,22 @@ export class ProcessEvent_DataEvent extends Message<ProcessEvent_DataEvent> {
*/
export class ProcessEvent_EndEvent extends Message<ProcessEvent_EndEvent> {
/**
- * @generated from field: sint32 exit_code = 8;
+ * @generated from field: sint32 exit_code = 1;
*/
exitCode = 0;
/**
- * @generated from field: optional string error = 9;
+ * @generated from field: bool terminated = 2;
+ */
+ terminated = false;
+
+ /**
+ * @generated from field: string status = 3;
+ */
+ status = "";
+
+ /**
+ * @generated from field: optional string error = 4;
*/
error?: string;
@@ -518,8 +535,10 @@ export class ProcessEvent_EndEvent extends Message<ProcessEvent_EndEvent> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "envd.process.v1.ProcessEvent.EndEvent";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 8, name: "exit_code", kind: "scalar", T: 17 /* ScalarType.SINT32 */ },
- { no: 9, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
+ { no: 1, name: "exit_code", kind: "scalar", T: 17 /* ScalarType.SINT32 */ },
+ { no: 2, name: "terminated", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 3, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ },
+ { no: 4, name: "error", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessEvent_EndEvent {
@@ -700,6 +719,12 @@ export class ProcessInput extends Message<ProcessInput> {
*/
value: Uint8Array;
case: "stdin";
+ } | {
+ /**
+ * @generated from field: bytes tty = 2;
+ */
+ value: Uint8Array;
+ case: "tty";
} | { case: undefined; value?: undefined } = { case: undefined };
constructor(data?: PartialMessage<ProcessInput>) {
@@ -711,6 +736,7 @@ export class ProcessInput extends Message<ProcessInput> {
static readonly typeName = "envd.process.v1.ProcessInput";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "stdin", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "input" },
+ { no: 2, name: "tty", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "input" },
]);
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ProcessInput {
@@ -730,6 +756,161 @@ export class ProcessInput extends Message<ProcessInput> {
}
}
+/**
+ * @generated from message envd.process.v1.SendProcessInputStreamRequest
+ */
+export class SendProcessInputStreamRequest extends Message<SendProcessInputStreamRequest> {
+ /**
+ * @generated from oneof envd.process.v1.SendProcessInputStreamRequest.event
+ */
+ event: {
+ /**
+ * @generated from field: envd.process.v1.SendProcessInputStreamRequest.StartEvent start = 1;
+ */
+ value: SendProcessInputStreamRequest_StartEvent;
+ case: "start";
+ } | {
+ /**
+ * @generated from field: envd.process.v1.SendProcessInputStreamRequest.DataEvent data = 2;
+ */
+ value: SendProcessInputStreamRequest_DataEvent;
+ case: "data";
+ } | { case: undefined; value?: undefined } = { case: undefined };
+
+ constructor(data?: PartialMessage<SendProcessInputStreamRequest>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "envd.process.v1.SendProcessInputStreamRequest";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ { no: 1, name: "start", kind: "message", T: SendProcessInputStreamRequest_StartEvent, oneof: "event" },
+ { no: 2, name: "data", kind: "message", T: SendProcessInputStreamRequest_DataEvent, oneof: "event" },
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendProcessInputStreamRequest {
+ return new SendProcessInputStreamRequest().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest {
+ return new SendProcessInputStreamRequest().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest {
+ return new SendProcessInputStreamRequest().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: SendProcessInputStreamRequest | PlainMessage<SendProcessInputStreamRequest> | undefined, b: SendProcessInputStreamRequest | PlainMessage<SendProcessInputStreamRequest> | undefined): boolean {
+ return proto3.util.equals(SendProcessInputStreamRequest, a, b);
+ }
+}
+
+/**
+ * @generated from message envd.process.v1.SendProcessInputStreamRequest.StartEvent
+ */
+export class SendProcessInputStreamRequest_StartEvent extends Message<SendProcessInputStreamRequest_StartEvent> {
+ /**
+ * @generated from field: envd.process.v1.ProcessSelector process = 1;
+ */
+ process?: ProcessSelector;
+
+ constructor(data?: PartialMessage<SendProcessInputStreamRequest_StartEvent>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "envd.process.v1.SendProcessInputStreamRequest.StartEvent";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ { no: 1, name: "process", kind: "message", T: ProcessSelector },
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendProcessInputStreamRequest_StartEvent {
+ return new SendProcessInputStreamRequest_StartEvent().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest_StartEvent {
+ return new SendProcessInputStreamRequest_StartEvent().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest_StartEvent {
+ return new SendProcessInputStreamRequest_StartEvent().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: SendProcessInputStreamRequest_StartEvent | PlainMessage<SendProcessInputStreamRequest_StartEvent> | undefined, b: SendProcessInputStreamRequest_StartEvent | PlainMessage<SendProcessInputStreamRequest_StartEvent> | undefined): boolean {
+ return proto3.util.equals(SendProcessInputStreamRequest_StartEvent, a, b);
+ }
+}
+
+/**
+ * @generated from message envd.process.v1.SendProcessInputStreamRequest.DataEvent
+ */
+export class SendProcessInputStreamRequest_DataEvent extends Message<SendProcessInputStreamRequest_DataEvent> {
+ /**
+ * @generated from field: envd.process.v1.ProcessInput input = 2;
+ */
+ input?: ProcessInput;
+
+ constructor(data?: PartialMessage<SendProcessInputStreamRequest_DataEvent>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "envd.process.v1.SendProcessInputStreamRequest.DataEvent";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ { no: 2, name: "input", kind: "message", T: ProcessInput },
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendProcessInputStreamRequest_DataEvent {
+ return new SendProcessInputStreamRequest_DataEvent().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest_DataEvent {
+ return new SendProcessInputStreamRequest_DataEvent().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendProcessInputStreamRequest_DataEvent {
+ return new SendProcessInputStreamRequest_DataEvent().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: SendProcessInputStreamRequest_DataEvent | PlainMessage<SendProcessInputStreamRequest_DataEvent> | undefined, b: SendProcessInputStreamRequest_DataEvent | PlainMessage<SendProcessInputStreamRequest_DataEvent> | undefined): boolean {
+ return proto3.util.equals(SendProcessInputStreamRequest_DataEvent, a, b);
+ }
+}
+
+/**
+ * @generated from message envd.process.v1.SendProcessInputStreamResponse
+ */
+export class SendProcessInputStreamResponse extends Message<SendProcessInputStreamResponse> {
+ constructor(data?: PartialMessage<SendProcessInputStreamResponse>) {
+ super();
+ proto3.util.initPartial(data, this);
+ }
+
+ static readonly runtime: typeof proto3 = proto3;
+ static readonly typeName = "envd.process.v1.SendProcessInputStreamResponse";
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
+ ]);
+
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendProcessInputStreamResponse {
+ return new SendProcessInputStreamResponse().fromBinary(bytes, options);
+ }
+
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendProcessInputStreamResponse {
+ return new SendProcessInputStreamResponse().fromJson(jsonValue, options);
+ }
+
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendProcessInputStreamResponse {
+ return new SendProcessInputStreamResponse().fromJsonString(jsonString, options);
+ }
+
+ static equals(a: SendProcessInputStreamResponse | PlainMessage<SendProcessInputStreamResponse> | undefined, b: SendProcessInputStreamResponse | PlainMessage<SendProcessInputStreamResponse> | undefined): boolean {
+ return proto3.util.equals(SendProcessInputStreamResponse, a, b);
+ }
+}
+
/**
* @generated from message envd.process.v1.SendProcessSignalRequest
*/
diff --git a/packages/python-sdk/Makefile b/packages/python-sdk/Makefile
index cec7bfabd..e882a18c1 100644
--- a/packages/python-sdk/Makefile
+++ b/packages/python-sdk/Makefile
@@ -43,7 +43,3 @@ generate-v1:
.PHONY: generate
generate: generate-v1 generate-v2
-
-.PHONE: generate-grpc
-generate-grpc:
- poetry run python -m grpc_tools.protoc -I ../../spec --python_out=. --pyi_out=. --grpc_python_out=. ../../spec/*.proto
diff --git a/packages/python-sdk/e2b/api/__init__.py b/packages/python-sdk/e2b/api/__init__.py
index fe9efa941..6336778e9 100644
--- a/packages/python-sdk/e2b/api/__init__.py
+++ b/packages/python-sdk/e2b/api/__init__.py
@@ -16,8 +16,6 @@ else:
import e2b.api.v2.client.exceptions as exceptions
-
-
class E2BApiClient(client.ApiClient):
def __init__(
self,
diff --git a/packages/python-sdk/e2b/api/metadata.py b/packages/python-sdk/e2b/api/metadata.py
index 24381e7a4..52e6820fd 100644
--- a/packages/python-sdk/e2b/api/metadata.py
+++ b/packages/python-sdk/e2b/api/metadata.py
@@ -1,4 +1,5 @@
import platform
+
# from importlib import metadata
default_headers = {
diff --git a/packages/python-sdk/e2b/api/v1/client/__init__.py b/packages/python-sdk/e2b/api/v1/client/__init__.py
index 30833ee92..5a151902c 100644
--- a/packages/python-sdk/e2b/api/v1/client/__init__.py
+++ b/packages/python-sdk/e2b/api/v1/client/__init__.py
@@ -33,16 +33,16 @@ from e2b.api.v1.client.exceptions import ApiException
# import models into sdk package
from e2b.api.v1.client.models.error import Error
from e2b.api.v1.client.models.new_sandbox import NewSandbox
-from e2b.api.v1.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v1.client.models.running_sandbox import RunningSandbox
from e2b.api.v1.client.models.sandbox import Sandbox
from e2b.api.v1.client.models.sandbox_log import SandboxLog
from e2b.api.v1.client.models.sandbox_logs import SandboxLogs
from e2b.api.v1.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v1.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v1.client.models.template import Template
from e2b.api.v1.client.models.template_build import TemplateBuild
from e2b.api.v1.client.models.template_build_request import TemplateBuildRequest
-from e2b.api.v1.client.models.templates_template_id_builds_build_id_logs_post_request import (
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest,
-)
diff --git a/packages/python-sdk/e2b/api/v1/client/api/sandboxes_api.py b/packages/python-sdk/e2b/api/v1/client/api/sandboxes_api.py
index 47d119712..bfe42d76f 100644
--- a/packages/python-sdk/e2b/api/v1/client/api/sandboxes_api.py
+++ b/packages/python-sdk/e2b/api/v1/client/api/sandboxes_api.py
@@ -19,17 +19,20 @@ import warnings
from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated
-from pydantic import Field, StrictInt, StrictStr
+from pydantic import Field, StrictStr, conint
from typing import List, Optional
from e2b.api.v1.client.models.new_sandbox import NewSandbox
-from e2b.api.v1.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v1.client.models.running_sandbox import RunningSandbox
from e2b.api.v1.client.models.sandbox import Sandbox
from e2b.api.v1.client.models.sandbox_logs import SandboxLogs
from e2b.api.v1.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v1.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v1.client.api_client import ApiClient
from e2b.api.v1.client.api_response import ApiResponse
@@ -49,7 +52,7 @@ class SandboxesApi:
self.api_client = api_client
@validate_arguments
- def sandboxes_get(self, **kwargs) -> List[RunningSandboxes]: # noqa: E501
+ def sandboxes_get(self, **kwargs) -> List[RunningSandbox]: # noqa: E501
"""sandboxes_get # noqa: E501
List all running sandboxes # noqa: E501
@@ -68,7 +71,7 @@ class SandboxesApi:
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: List[RunningSandboxes]
+ :rtype: List[RunningSandbox]
"""
kwargs["_return_http_data_only"] = True
if "_preload_content" in kwargs:
@@ -109,7 +112,7 @@ class SandboxesApi:
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
- :rtype: tuple(List[RunningSandboxes], status_code(int), headers(HTTPHeaderDict))
+ :rtype: tuple(List[RunningSandbox], status_code(int), headers(HTTPHeaderDict))
"""
_params = locals()
@@ -160,7 +163,7 @@ class SandboxesApi:
_auth_settings = ["ApiKeyAuth"] # noqa: E501
_response_types_map = {
- "200": "List[RunningSandboxes]",
+ "200": "List[RunningSandbox]",
"401": "Error",
"400": "Error",
"500": "Error",
@@ -490,11 +493,13 @@ class SandboxesApi:
self,
sandbox_id: StrictStr,
start: Annotated[
- Optional[StrictInt],
- Field(description="Starting timestamp of the logs that should be returned"),
+ Optional[conint(strict=True, ge=0)],
+ Field(
+ description="Starting timestamp of the logs that should be returned in milliseconds"
+ ),
] = None,
limit: Annotated[
- Optional[StrictInt],
+ Optional[conint(strict=True, ge=0)],
Field(description="Maximum number of logs that should be returned"),
] = None,
**kwargs
@@ -510,7 +515,7 @@ class SandboxesApi:
:param sandbox_id: (required)
:type sandbox_id: str
- :param start: Starting timestamp of the logs that should be returned
+ :param start: Starting timestamp of the logs that should be returned in milliseconds
:type start: int
:param limit: Maximum number of logs that should be returned
:type limit: int
@@ -538,11 +543,13 @@ class SandboxesApi:
self,
sandbox_id: StrictStr,
start: Annotated[
- Optional[StrictInt],
- Field(description="Starting timestamp of the logs that should be returned"),
+ Optional[conint(strict=True, ge=0)],
+ Field(
+ description="Starting timestamp of the logs that should be returned in milliseconds"
+ ),
] = None,
limit: Annotated[
- Optional[StrictInt],
+ Optional[conint(strict=True, ge=0)],
Field(description="Maximum number of logs that should be returned"),
] = None,
**kwargs
@@ -558,7 +565,7 @@ class SandboxesApi:
:param sandbox_id: (required)
:type sandbox_id: str
- :param start: Starting timestamp of the logs that should be returned
+ :param start: Starting timestamp of the logs that should be returned in milliseconds
:type start: int
:param limit: Maximum number of logs that should be returned
:type limit: int
@@ -836,3 +843,172 @@ class SandboxesApi:
collection_formats=_collection_formats,
_request_auth=_params.get("_request_auth"),
)
+
+ @validate_arguments
+ def sandboxes_sandbox_id_timeout_post(
+ self,
+ sandbox_id: StrictStr,
+ sandboxes_sandbox_id_timeout_post_request: Optional[
+ SandboxesSandboxIDTimeoutPostRequest
+ ] = None,
+ **kwargs
+ ) -> None: # noqa: E501
+ """sandboxes_sandbox_id_timeout_post # noqa: E501
+
+ Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sandboxes_sandbox_id_timeout_post(sandbox_id, sandboxes_sandbox_id_timeout_post_request, async_req=True)
+ >>> result = thread.get()
+
+ :param sandbox_id: (required)
+ :type sandbox_id: str
+ :param sandboxes_sandbox_id_timeout_post_request:
+ :type sandboxes_sandbox_id_timeout_post_request: SandboxesSandboxIDTimeoutPostRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _request_timeout: timeout setting for this request.
+ If one number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the sandboxes_sandbox_id_timeout_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.sandboxes_sandbox_id_timeout_post_with_http_info(
+ sandbox_id, sandboxes_sandbox_id_timeout_post_request, **kwargs
+ ) # noqa: E501
+
+ @validate_arguments
+ def sandboxes_sandbox_id_timeout_post_with_http_info(
+ self,
+ sandbox_id: StrictStr,
+ sandboxes_sandbox_id_timeout_post_request: Optional[
+ SandboxesSandboxIDTimeoutPostRequest
+ ] = None,
+ **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """sandboxes_sandbox_id_timeout_post # noqa: E501
+
+ Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.sandboxes_sandbox_id_timeout_post_with_http_info(sandbox_id, sandboxes_sandbox_id_timeout_post_request, async_req=True)
+ >>> result = thread.get()
+
+ :param sandbox_id: (required)
+ :type sandbox_id: str
+ :param sandboxes_sandbox_id_timeout_post_request:
+ :type sandboxes_sandbox_id_timeout_post_request: SandboxesSandboxIDTimeoutPostRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["sandbox_id", "sandboxes_sandbox_id_timeout_post_request"]
+ _all_params.extend(
+ [
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ]
+ )
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s'"
+ " to method sandboxes_sandbox_id_timeout_post" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["sandbox_id"] is not None:
+ _path_params["sandboxID"] = _params["sandbox_id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["sandboxes_sandbox_id_timeout_post_request"] is not None:
+ _body_params = _params["sandboxes_sandbox_id_timeout_post_request"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ ) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(["application/json"]),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiKeyAuth"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/sandboxes/{sandboxID}/timeout",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/packages/python-sdk/e2b/api/v1/client/models/__init__.py b/packages/python-sdk/e2b/api/v1/client/models/__init__.py
index db9f10ea8..28033b32e 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/__init__.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/__init__.py
@@ -16,16 +16,16 @@
# import models into model package
from e2b.api.v1.client.models.error import Error
from e2b.api.v1.client.models.new_sandbox import NewSandbox
-from e2b.api.v1.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v1.client.models.running_sandbox import RunningSandbox
from e2b.api.v1.client.models.sandbox import Sandbox
from e2b.api.v1.client.models.sandbox_log import SandboxLog
from e2b.api.v1.client.models.sandbox_logs import SandboxLogs
from e2b.api.v1.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v1.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v1.client.models.template import Template
from e2b.api.v1.client.models.template_build import TemplateBuild
from e2b.api.v1.client.models.template_build_request import TemplateBuildRequest
-from e2b.api.v1.client.models.templates_template_id_builds_build_id_logs_post_request import (
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest,
-)
diff --git a/packages/python-sdk/e2b/api/v1/client/models/new_sandbox.py b/packages/python-sdk/e2b/api/v1/client/models/new_sandbox.py
index d52ead018..052eb1fb5 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/new_sandbox.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/new_sandbox.py
@@ -19,7 +19,7 @@ import json
from typing import Any, Dict, Optional
-from pydantic import BaseModel, Field, StrictStr
+from pydantic import BaseModel, Field, StrictStr, conint
class NewSandbox(BaseModel):
@@ -30,9 +30,12 @@ class NewSandbox(BaseModel):
template_id: StrictStr = Field(
..., alias="templateID", description="Identifier of the required template"
)
+ timeout: Optional[conint(strict=True, ge=0)] = Field(
+ None, description="Time to live for the sandbox in seconds."
+ )
metadata: Optional[Dict[str, StrictStr]] = None
additional_properties: Dict[str, Any] = {}
- __properties = ["templateID", "metadata"]
+ __properties = ["templateID", "timeout", "metadata"]
class Config:
"""Pydantic configuration"""
@@ -75,7 +78,11 @@ class NewSandbox(BaseModel):
return NewSandbox.parse_obj(obj)
_obj = NewSandbox.parse_obj(
- {"template_id": obj.get("templateID"), "metadata": obj.get("metadata")}
+ {
+ "template_id": obj.get("templateID"),
+ "timeout": obj.get("timeout"),
+ "metadata": obj.get("metadata"),
+ }
)
# store additional fields in additional_properties
for _key in obj.keys():
diff --git a/packages/python-sdk/e2b/api/v1/client/models/running_sandboxes.py b/packages/python-sdk/e2b/api/v1/client/models/running_sandbox.py
similarity index 83%
rename from packages/python-sdk/e2b/api/v1/client/models/running_sandboxes.py
rename to packages/python-sdk/e2b/api/v1/client/models/running_sandbox.py
index 0454a173c..fe123da8f 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/running_sandboxes.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/running_sandbox.py
@@ -19,12 +19,12 @@ import json
from datetime import datetime
from typing import Any, Dict, Optional
-from pydantic import BaseModel, Field, StrictInt, StrictStr
+from pydantic import BaseModel, Field, StrictStr, conint
-class RunningSandboxes(BaseModel):
+class RunningSandbox(BaseModel):
"""
- RunningSandboxes
+ RunningSandbox
"""
template_id: StrictStr = Field(
@@ -42,11 +42,11 @@ class RunningSandboxes(BaseModel):
started_at: datetime = Field(
..., alias="startedAt", description="Time when the sandbox was started"
)
- cpu_count: StrictInt = Field(
+ cpu_count: conint(strict=True, le=8, ge=1) = Field(
..., alias="cpuCount", description="CPU cores for the sandbox"
)
- memory_mb: StrictInt = Field(
- ..., alias="memoryMB", description="Memory limit for the sandbox in MB"
+ memory_mb: conint(strict=True, le=8192, ge=128) = Field(
+ ..., alias="memoryMB", description="Memory for the sandbox in MB"
)
metadata: Optional[Dict[str, StrictStr]] = None
additional_properties: Dict[str, Any] = {}
@@ -76,8 +76,8 @@ class RunningSandboxes(BaseModel):
return json.dumps(self.to_dict())
@classmethod
- def from_json(cls, json_str: str) -> RunningSandboxes:
- """Create an instance of RunningSandboxes from a JSON string"""
+ def from_json(cls, json_str: str) -> RunningSandbox:
+ """Create an instance of RunningSandbox from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
@@ -93,15 +93,15 @@ class RunningSandboxes(BaseModel):
return _dict
@classmethod
- def from_dict(cls, obj: dict) -> RunningSandboxes:
- """Create an instance of RunningSandboxes from a dict"""
+ def from_dict(cls, obj: dict) -> RunningSandbox:
+ """Create an instance of RunningSandbox from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
- return RunningSandboxes.parse_obj(obj)
+ return RunningSandbox.parse_obj(obj)
- _obj = RunningSandboxes.parse_obj(
+ _obj = RunningSandbox.parse_obj(
{
"template_id": obj.get("templateID"),
"alias": obj.get("alias"),
diff --git a/packages/python-sdk/e2b/api/v1/client/models/templates_template_id_builds_build_id_logs_post_request.py b/packages/python-sdk/e2b/api/v1/client/models/sandboxes_sandbox_id_timeout_post_request.py
similarity index 64%
rename from packages/python-sdk/e2b/api/v1/client/models/templates_template_id_builds_build_id_logs_post_request.py
rename to packages/python-sdk/e2b/api/v1/client/models/sandboxes_sandbox_id_timeout_post_request.py
index bf4e42044..fd515c8ed 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/templates_template_id_builds_build_id_logs_post_request.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/sandboxes_sandbox_id_timeout_post_request.py
@@ -18,19 +18,21 @@ import re # noqa: F401
import json
-from typing import Any, Dict, List
-from pydantic import BaseModel, Field, StrictStr, conlist
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, Field, conint
-class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
+class SandboxesSandboxIDTimeoutPostRequest(BaseModel):
"""
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest
+ SandboxesSandboxIDTimeoutPostRequest
"""
- api_secret: StrictStr = Field(..., alias="apiSecret", description="API secret")
- logs: conlist(StrictStr) = Field(...)
+ duration: Optional[conint(strict=True, ge=0)] = Field(
+ None,
+ description="Duration in seconds from the current time after which the sandbox should expire",
+ )
additional_properties: Dict[str, Any] = {}
- __properties = ["apiSecret", "logs"]
+ __properties = ["duration"]
class Config:
"""Pydantic configuration"""
@@ -47,10 +49,8 @@ class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
return json.dumps(self.to_dict())
@classmethod
- def from_json(
- cls, json_str: str
- ) -> TemplatesTemplateIDBuildsBuildIDLogsPostRequest:
- """Create an instance of TemplatesTemplateIDBuildsBuildIDLogsPostRequest from a JSON string"""
+ def from_json(cls, json_str: str) -> SandboxesSandboxIDTimeoutPostRequest:
+ """Create an instance of SandboxesSandboxIDTimeoutPostRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self):
@@ -66,16 +66,16 @@ class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
return _dict
@classmethod
- def from_dict(cls, obj: dict) -> TemplatesTemplateIDBuildsBuildIDLogsPostRequest:
- """Create an instance of TemplatesTemplateIDBuildsBuildIDLogsPostRequest from a dict"""
+ def from_dict(cls, obj: dict) -> SandboxesSandboxIDTimeoutPostRequest:
+ """Create an instance of SandboxesSandboxIDTimeoutPostRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
- return TemplatesTemplateIDBuildsBuildIDLogsPostRequest.parse_obj(obj)
+ return SandboxesSandboxIDTimeoutPostRequest.parse_obj(obj)
- _obj = TemplatesTemplateIDBuildsBuildIDLogsPostRequest.parse_obj(
- {"api_secret": obj.get("apiSecret"), "logs": obj.get("logs")}
+ _obj = SandboxesSandboxIDTimeoutPostRequest.parse_obj(
+ {"duration": obj.get("duration")}
)
# store additional fields in additional_properties
for _key in obj.keys():
diff --git a/packages/python-sdk/e2b/api/v1/client/models/template.py b/packages/python-sdk/e2b/api/v1/client/models/template.py
index d3f5528ab..6aec647a1 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/template.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/template.py
@@ -19,7 +19,7 @@ import json
from typing import Any, Dict, List, Optional
-from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist
+from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, conlist
class Template(BaseModel):
@@ -35,11 +35,11 @@ class Template(BaseModel):
alias="buildID",
description="Identifier of the last successful build for given template",
)
- cpu_count: StrictInt = Field(
+ cpu_count: conint(strict=True, le=8, ge=1) = Field(
..., alias="cpuCount", description="CPU cores for the sandbox"
)
- memory_mb: StrictInt = Field(
- ..., alias="memoryMB", description="Memory limit for the sandbox in MB"
+ memory_mb: conint(strict=True, le=8192, ge=128) = Field(
+ ..., alias="memoryMB", description="Memory for the sandbox in MB"
)
public: StrictBool = Field(
..., description="Whether the template is public or only accessible by the team"
diff --git a/packages/python-sdk/e2b/api/v1/client/models/template_build.py b/packages/python-sdk/e2b/api/v1/client/models/template_build.py
index 2ba4a7334..1416d6b84 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/template_build.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/template_build.py
@@ -18,7 +18,7 @@ import re # noqa: F401
import json
-from typing import Any, Dict, List, Optional
+from typing import Any, Dict, List
from pydantic import BaseModel, Field, StrictStr, conlist, validator
@@ -34,16 +34,13 @@ class TemplateBuild(BaseModel):
build_id: StrictStr = Field(
..., alias="buildID", description="Identifier of the build"
)
- status: Optional[StrictStr] = Field(None, description="Status of the template")
+ status: StrictStr = Field(..., description="Status of the template")
additional_properties: Dict[str, Any] = {}
__properties = ["logs", "templateID", "buildID", "status"]
@validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
- if value is None:
- return value
-
if value not in ("building", "ready", "error"):
raise ValueError(
"must be one of enum values ('building', 'ready', 'error')"
diff --git a/packages/python-sdk/e2b/api/v1/client/models/template_build_request.py b/packages/python-sdk/e2b/api/v1/client/models/template_build_request.py
index cd4f3bbd8..b1d4b19ca 100644
--- a/packages/python-sdk/e2b/api/v1/client/models/template_build_request.py
+++ b/packages/python-sdk/e2b/api/v1/client/models/template_build_request.py
@@ -34,11 +34,11 @@ class TemplateBuildRequest(BaseModel):
alias="startCmd",
description="Start command to execute in the template after the build",
)
- cpu_count: Optional[conint(strict=True, ge=1)] = Field(
- None, alias="cpuCount", description="CPU cores for the template"
+ cpu_count: Optional[conint(strict=True, le=8, ge=1)] = Field(
+ None, alias="cpuCount", description="CPU cores for the sandbox"
)
- memory_mb: Optional[conint(strict=True, ge=128)] = Field(
- None, alias="memoryMB", description="Memory limit for the template in MB"
+ memory_mb: Optional[conint(strict=True, le=8192, ge=128)] = Field(
+ None, alias="memoryMB", description="Memory for the sandbox in MB"
)
additional_properties: Dict[str, Any] = {}
__properties = ["alias", "dockerfile", "startCmd", "cpuCount", "memoryMB"]
diff --git a/packages/python-sdk/e2b/api/v1/client_README.md b/packages/python-sdk/e2b/api/v1/client_README.md
index f473f8c21..db9465051 100644
--- a/packages/python-sdk/e2b/api/v1/client_README.md
+++ b/packages/python-sdk/e2b/api/v1/client_README.md
@@ -77,21 +77,22 @@ Class | Method | HTTP request | Description
*SandboxesApi* | [**sandboxes_sandbox_id_delete**](e2b/api/v1/client/docs/SandboxesApi.md#sandboxes_sandbox_id_delete) | **DELETE** /sandboxes/{sandboxID} |
*SandboxesApi* | [**sandboxes_sandbox_id_logs_get**](e2b/api/v1/client/docs/SandboxesApi.md#sandboxes_sandbox_id_logs_get) | **GET** /sandboxes/{sandboxID}/logs |
*SandboxesApi* | [**sandboxes_sandbox_id_refreshes_post**](e2b/api/v1/client/docs/SandboxesApi.md#sandboxes_sandbox_id_refreshes_post) | **POST** /sandboxes/{sandboxID}/refreshes |
+*SandboxesApi* | [**sandboxes_sandbox_id_timeout_post**](e2b/api/v1/client/docs/SandboxesApi.md#sandboxes_sandbox_id_timeout_post) | **POST** /sandboxes/{sandboxID}/timeout |
## Documentation For Models
- [Error](e2b/api/v1/client/docs/Error.md)
- [NewSandbox](e2b/api/v1/client/docs/NewSandbox.md)
- - [RunningSandboxes](e2b/api/v1/client/docs/RunningSandboxes.md)
+ - [RunningSandbox](e2b/api/v1/client/docs/RunningSandbox.md)
- [Sandbox](e2b/api/v1/client/docs/Sandbox.md)
- [SandboxLog](e2b/api/v1/client/docs/SandboxLog.md)
- [SandboxLogs](e2b/api/v1/client/docs/SandboxLogs.md)
- [SandboxesSandboxIDRefreshesPostRequest](e2b/api/v1/client/docs/SandboxesSandboxIDRefreshesPostRequest.md)
+ - [SandboxesSandboxIDTimeoutPostRequest](e2b/api/v1/client/docs/SandboxesSandboxIDTimeoutPostRequest.md)
- [Template](e2b/api/v1/client/docs/Template.md)
- [TemplateBuild](e2b/api/v1/client/docs/TemplateBuild.md)
- [TemplateBuildRequest](e2b/api/v1/client/docs/TemplateBuildRequest.md)
- - [TemplatesTemplateIDBuildsBuildIDLogsPostRequest](e2b/api/v1/client/docs/TemplatesTemplateIDBuildsBuildIDLogsPostRequest.md)
<a id="documentation-for-authorization"></a>
diff --git a/packages/python-sdk/e2b/api/v2/client/__init__.py b/packages/python-sdk/e2b/api/v2/client/__init__.py
index 309eab033..075fda49a 100644
--- a/packages/python-sdk/e2b/api/v2/client/__init__.py
+++ b/packages/python-sdk/e2b/api/v2/client/__init__.py
@@ -33,16 +33,16 @@ from e2b.api.v2.client.exceptions import ApiException
# import models into sdk package
from e2b.api.v2.client.models.error import Error
from e2b.api.v2.client.models.new_sandbox import NewSandbox
-from e2b.api.v2.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v2.client.models.running_sandbox import RunningSandbox
from e2b.api.v2.client.models.sandbox import Sandbox
from e2b.api.v2.client.models.sandbox_log import SandboxLog
from e2b.api.v2.client.models.sandbox_logs import SandboxLogs
from e2b.api.v2.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v2.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v2.client.models.template import Template
from e2b.api.v2.client.models.template_build import TemplateBuild
from e2b.api.v2.client.models.template_build_request import TemplateBuildRequest
-from e2b.api.v2.client.models.templates_template_id_builds_build_id_logs_post_request import (
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest,
-)
diff --git a/packages/python-sdk/e2b/api/v2/client/api/sandboxes_api.py b/packages/python-sdk/e2b/api/v2/client/api/sandboxes_api.py
index 9b51ca139..60c913be9 100644
--- a/packages/python-sdk/e2b/api/v2/client/api/sandboxes_api.py
+++ b/packages/python-sdk/e2b/api/v2/client/api/sandboxes_api.py
@@ -25,17 +25,20 @@ except ImportError:
from pydantic import Field
from typing_extensions import Annotated
-from pydantic import StrictInt, StrictStr
+from pydantic import StrictStr
from typing import List, Optional
from e2b.api.v2.client.models.new_sandbox import NewSandbox
-from e2b.api.v2.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v2.client.models.running_sandbox import RunningSandbox
from e2b.api.v2.client.models.sandbox import Sandbox
from e2b.api.v2.client.models.sandbox_logs import SandboxLogs
from e2b.api.v2.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v2.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v2.client.api_client import ApiClient
from e2b.api.v2.client.api_response import ApiResponse
@@ -68,7 +71,7 @@ class SandboxesApi:
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
- ) -> List[RunningSandboxes]:
+ ) -> List[RunningSandbox]:
"""sandboxes_get
List all running sandboxes
@@ -103,7 +106,7 @@ class SandboxesApi:
)
_response_types_map: Dict[str, Optional[str]] = {
- "200": "List[RunningSandboxes]",
+ "200": "List[RunningSandbox]",
"401": "Error",
"400": "Error",
"500": "Error",
@@ -131,7 +134,7 @@ class SandboxesApi:
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
- ) -> ApiResponse[List[RunningSandboxes]]:
+ ) -> ApiResponse[List[RunningSandbox]]:
"""sandboxes_get
List all running sandboxes
@@ -166,7 +169,7 @@ class SandboxesApi:
)
_response_types_map: Dict[str, Optional[str]] = {
- "200": "List[RunningSandboxes]",
+ "200": "List[RunningSandbox]",
"401": "Error",
"400": "Error",
"500": "Error",
@@ -229,7 +232,7 @@ class SandboxesApi:
)
_response_types_map: Dict[str, Optional[str]] = {
- "200": "List[RunningSandboxes]",
+ "200": "List[RunningSandbox]",
"401": "Error",
"400": "Error",
"500": "Error",
@@ -780,11 +783,13 @@ class SandboxesApi:
self,
sandbox_id: StrictStr,
start: Annotated[
- Optional[StrictInt],
- Field(description="Starting timestamp of the logs that should be returned"),
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
+ Field(
+ description="Starting timestamp of the logs that should be returned in milliseconds"
+ ),
] = None,
limit: Annotated[
- Optional[StrictInt],
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
Field(description="Maximum number of logs that should be returned"),
] = None,
_request_timeout: Union[
@@ -805,7 +810,7 @@ class SandboxesApi:
:param sandbox_id: (required)
:type sandbox_id: str
- :param start: Starting timestamp of the logs that should be returned
+ :param start: Starting timestamp of the logs that should be returned in milliseconds
:type start: int
:param limit: Maximum number of logs that should be returned
:type limit: int
@@ -861,11 +866,13 @@ class SandboxesApi:
self,
sandbox_id: StrictStr,
start: Annotated[
- Optional[StrictInt],
- Field(description="Starting timestamp of the logs that should be returned"),
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
+ Field(
+ description="Starting timestamp of the logs that should be returned in milliseconds"
+ ),
] = None,
limit: Annotated[
- Optional[StrictInt],
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
Field(description="Maximum number of logs that should be returned"),
] = None,
_request_timeout: Union[
@@ -886,7 +893,7 @@ class SandboxesApi:
:param sandbox_id: (required)
:type sandbox_id: str
- :param start: Starting timestamp of the logs that should be returned
+ :param start: Starting timestamp of the logs that should be returned in milliseconds
:type start: int
:param limit: Maximum number of logs that should be returned
:type limit: int
@@ -942,11 +949,13 @@ class SandboxesApi:
self,
sandbox_id: StrictStr,
start: Annotated[
- Optional[StrictInt],
- Field(description="Starting timestamp of the logs that should be returned"),
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
+ Field(
+ description="Starting timestamp of the logs that should be returned in milliseconds"
+ ),
] = None,
limit: Annotated[
- Optional[StrictInt],
+ Optional[Annotated[int, Field(strict=True, ge=0)]],
Field(description="Maximum number of logs that should be returned"),
] = None,
_request_timeout: Union[
@@ -967,7 +976,7 @@ class SandboxesApi:
:param sandbox_id: (required)
:type sandbox_id: str
- :param start: Starting timestamp of the logs that should be returned
+ :param start: Starting timestamp of the logs that should be returned in milliseconds
:type start: int
:param limit: Maximum number of logs that should be returned
:type limit: int
@@ -1334,3 +1343,266 @@ class SandboxesApi:
_host=_host,
_request_auth=_request_auth,
)
+
+ @validate_call
+ def sandboxes_sandbox_id_timeout_post(
+ self,
+ sandbox_id: StrictStr,
+ sandboxes_sandbox_id_timeout_post_request: Optional[
+ SandboxesSandboxIDTimeoutPostRequest
+ ] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """sandboxes_sandbox_id_timeout_post
+
+ Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
+
+ :param sandbox_id: (required)
+ :type sandbox_id: str
+ :param sandboxes_sandbox_id_timeout_post_request:
+ :type sandboxes_sandbox_id_timeout_post_request: SandboxesSandboxIDTimeoutPostRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sandboxes_sandbox_id_timeout_post_serialize(
+ sandbox_id=sandbox_id,
+ sandboxes_sandbox_id_timeout_post_request=sandboxes_sandbox_id_timeout_post_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {}
+ response_data = self.api_client.call_api(
+ *_param, _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+ @validate_call
+ def sandboxes_sandbox_id_timeout_post_with_http_info(
+ self,
+ sandbox_id: StrictStr,
+ sandboxes_sandbox_id_timeout_post_request: Optional[
+ SandboxesSandboxIDTimeoutPostRequest
+ ] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """sandboxes_sandbox_id_timeout_post
+
+ Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
+
+ :param sandbox_id: (required)
+ :type sandbox_id: str
+ :param sandboxes_sandbox_id_timeout_post_request:
+ :type sandboxes_sandbox_id_timeout_post_request: SandboxesSandboxIDTimeoutPostRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sandboxes_sandbox_id_timeout_post_serialize(
+ sandbox_id=sandbox_id,
+ sandboxes_sandbox_id_timeout_post_request=sandboxes_sandbox_id_timeout_post_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {}
+ response_data = self.api_client.call_api(
+ *_param, _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+ @validate_call
+ def sandboxes_sandbox_id_timeout_post_without_preload_content(
+ self,
+ sandbox_id: StrictStr,
+ sandboxes_sandbox_id_timeout_post_request: Optional[
+ SandboxesSandboxIDTimeoutPostRequest
+ ] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
+ ],
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """sandboxes_sandbox_id_timeout_post
+
+ Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
+
+ :param sandbox_id: (required)
+ :type sandbox_id: str
+ :param sandboxes_sandbox_id_timeout_post_request:
+ :type sandboxes_sandbox_id_timeout_post_request: SandboxesSandboxIDTimeoutPostRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._sandboxes_sandbox_id_timeout_post_serialize(
+ sandbox_id=sandbox_id,
+ sandboxes_sandbox_id_timeout_post_request=sandboxes_sandbox_id_timeout_post_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index,
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {}
+ response_data = self.api_client.call_api(
+ *_param, _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+ def _sandboxes_sandbox_id_timeout_post_serialize(
+ self,
+ sandbox_id,
+ sandboxes_sandbox_id_timeout_post_request,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> Tuple:
+ _host = None
+
+ _collection_formats: Dict[str, str] = {}
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[str, str] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if sandbox_id is not None:
+ _path_params["sandboxID"] = sandbox_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if sandboxes_sandbox_id_timeout_post_request is not None:
+ _body_params = sandboxes_sandbox_id_timeout_post_request
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(
+ ["application/json"]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params["Content-Type"] = _content_type
+ else:
+ _default_content_type = self.api_client.select_header_content_type(
+ ["application/json"]
+ )
+ if _default_content_type is not None:
+ _header_params["Content-Type"] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = ["ApiKeyAuth"]
+
+ return self.api_client.param_serialize(
+ method="POST",
+ resource_path="/sandboxes/{sandboxID}/timeout",
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth,
+ )
diff --git a/packages/python-sdk/e2b/api/v2/client/models/__init__.py b/packages/python-sdk/e2b/api/v2/client/models/__init__.py
index e7614f5b4..4946b684c 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/__init__.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/__init__.py
@@ -16,16 +16,16 @@
# import models into model package
from e2b.api.v2.client.models.error import Error
from e2b.api.v2.client.models.new_sandbox import NewSandbox
-from e2b.api.v2.client.models.running_sandboxes import RunningSandboxes
+from e2b.api.v2.client.models.running_sandbox import RunningSandbox
from e2b.api.v2.client.models.sandbox import Sandbox
from e2b.api.v2.client.models.sandbox_log import SandboxLog
from e2b.api.v2.client.models.sandbox_logs import SandboxLogs
from e2b.api.v2.client.models.sandboxes_sandbox_id_refreshes_post_request import (
SandboxesSandboxIDRefreshesPostRequest,
)
+from e2b.api.v2.client.models.sandboxes_sandbox_id_timeout_post_request import (
+ SandboxesSandboxIDTimeoutPostRequest,
+)
from e2b.api.v2.client.models.template import Template
from e2b.api.v2.client.models.template_build import TemplateBuild
from e2b.api.v2.client.models.template_build_request import TemplateBuildRequest
-from e2b.api.v2.client.models.templates_template_id_builds_build_id_logs_post_request import (
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest,
-)
diff --git a/packages/python-sdk/e2b/api/v2/client/models/new_sandbox.py b/packages/python-sdk/e2b/api/v2/client/models/new_sandbox.py
index 3c5d642b8..92a034d70 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/new_sandbox.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/new_sandbox.py
@@ -21,6 +21,7 @@ import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
+from typing_extensions import Annotated
try:
from typing import Self
@@ -36,9 +37,12 @@ class NewSandbox(BaseModel):
template_id: StrictStr = Field(
description="Identifier of the required template", alias="templateID"
)
+ timeout: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
+ default=None, description="Time to live for the sandbox in seconds."
+ )
metadata: Optional[Dict[str, StrictStr]] = None
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["templateID", "metadata"]
+ __properties: ClassVar[List[str]] = ["templateID", "timeout", "metadata"]
model_config = {"populate_by_name": True, "validate_assignment": True}
@@ -91,7 +95,11 @@ class NewSandbox(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate(
- {"templateID": obj.get("templateID"), "metadata": obj.get("metadata")}
+ {
+ "templateID": obj.get("templateID"),
+ "timeout": obj.get("timeout"),
+ "metadata": obj.get("metadata"),
+ }
)
# store additional fields in additional_properties
for _key in obj.keys():
diff --git a/packages/python-sdk/e2b/api/v2/client/models/running_sandboxes.py b/packages/python-sdk/e2b/api/v2/client/models/running_sandbox.py
similarity index 89%
rename from packages/python-sdk/e2b/api/v2/client/models/running_sandboxes.py
rename to packages/python-sdk/e2b/api/v2/client/models/running_sandbox.py
index 12ba16a43..396a4ead1 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/running_sandboxes.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/running_sandbox.py
@@ -19,8 +19,9 @@ import json
from datetime import datetime
from typing import Any, ClassVar, Dict, List, Optional
-from pydantic import BaseModel, StrictInt, StrictStr
+from pydantic import BaseModel, StrictStr
from pydantic import Field
+from typing_extensions import Annotated
try:
from typing import Self
@@ -28,9 +29,9 @@ except ImportError:
from typing_extensions import Self
-class RunningSandboxes(BaseModel):
+class RunningSandbox(BaseModel):
"""
- RunningSandboxes
+ RunningSandbox
""" # noqa: E501
template_id: StrictStr = Field(
@@ -49,11 +50,11 @@ class RunningSandboxes(BaseModel):
started_at: datetime = Field(
description="Time when the sandbox was started", alias="startedAt"
)
- cpu_count: StrictInt = Field(
+ cpu_count: Annotated[int, Field(le=8, strict=True, ge=1)] = Field(
description="CPU cores for the sandbox", alias="cpuCount"
)
- memory_mb: StrictInt = Field(
- description="Memory limit for the sandbox in MB", alias="memoryMB"
+ memory_mb: Annotated[int, Field(le=8192, strict=True, ge=128)] = Field(
+ description="Memory for the sandbox in MB", alias="memoryMB"
)
metadata: Optional[Dict[str, StrictStr]] = None
additional_properties: Dict[str, Any] = {}
@@ -81,7 +82,7 @@ class RunningSandboxes(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Self:
- """Create an instance of RunningSandboxes from a JSON string"""
+ """Create an instance of RunningSandbox from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@@ -111,7 +112,7 @@ class RunningSandboxes(BaseModel):
@classmethod
def from_dict(cls, obj: Dict) -> Self:
- """Create an instance of RunningSandboxes from a dict"""
+ """Create an instance of RunningSandbox from a dict"""
if obj is None:
return None
diff --git a/packages/python-sdk/e2b/api/v2/client/models/templates_template_id_builds_build_id_logs_post_request.py b/packages/python-sdk/e2b/api/v2/client/models/sandboxes_sandbox_id_timeout_post_request.py
similarity index 77%
rename from packages/python-sdk/e2b/api/v2/client/models/templates_template_id_builds_build_id_logs_post_request.py
rename to packages/python-sdk/e2b/api/v2/client/models/sandboxes_sandbox_id_timeout_post_request.py
index 4f1e96d2b..859dc2855 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/templates_template_id_builds_build_id_logs_post_request.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/sandboxes_sandbox_id_timeout_post_request.py
@@ -18,9 +18,10 @@ import re # noqa: F401
import json
-from typing import Any, ClassVar, Dict, List
-from pydantic import BaseModel, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from pydantic import BaseModel
from pydantic import Field
+from typing_extensions import Annotated
try:
from typing import Self
@@ -28,15 +29,17 @@ except ImportError:
from typing_extensions import Self
-class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
+class SandboxesSandboxIDTimeoutPostRequest(BaseModel):
"""
- TemplatesTemplateIDBuildsBuildIDLogsPostRequest
+ SandboxesSandboxIDTimeoutPostRequest
""" # noqa: E501
- api_secret: StrictStr = Field(description="API secret", alias="apiSecret")
- logs: List[StrictStr]
+ duration: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
+ default=None,
+ description="Duration in seconds from the current time after which the sandbox should expire",
+ )
additional_properties: Dict[str, Any] = {}
- __properties: ClassVar[List[str]] = ["apiSecret", "logs"]
+ __properties: ClassVar[List[str]] = ["duration"]
model_config = {"populate_by_name": True, "validate_assignment": True}
@@ -51,7 +54,7 @@ class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Self:
- """Create an instance of TemplatesTemplateIDBuildsBuildIDLogsPostRequest from a JSON string"""
+ """Create an instance of SandboxesSandboxIDTimeoutPostRequest from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@@ -81,16 +84,14 @@ class TemplatesTemplateIDBuildsBuildIDLogsPostRequest(BaseModel):
@classmethod
def from_dict(cls, obj: Dict) -> Self:
- """Create an instance of TemplatesTemplateIDBuildsBuildIDLogsPostRequest from a dict"""
+ """Create an instance of SandboxesSandboxIDTimeoutPostRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
- _obj = cls.model_validate(
- {"apiSecret": obj.get("apiSecret"), "logs": obj.get("logs")}
- )
+ _obj = cls.model_validate({"duration": obj.get("duration")})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
diff --git a/packages/python-sdk/e2b/api/v2/client/models/template.py b/packages/python-sdk/e2b/api/v2/client/models/template.py
index 5357bc750..7ae80a8aa 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/template.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/template.py
@@ -19,8 +19,9 @@ import json
from typing import Any, ClassVar, Dict, List, Optional
-from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
+from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
+from typing_extensions import Annotated
try:
from typing import Self
@@ -40,11 +41,11 @@ class Template(BaseModel):
description="Identifier of the last successful build for given template",
alias="buildID",
)
- cpu_count: StrictInt = Field(
+ cpu_count: Annotated[int, Field(le=8, strict=True, ge=1)] = Field(
description="CPU cores for the sandbox", alias="cpuCount"
)
- memory_mb: StrictInt = Field(
- description="Memory limit for the sandbox in MB", alias="memoryMB"
+ memory_mb: Annotated[int, Field(le=8192, strict=True, ge=128)] = Field(
+ description="Memory for the sandbox in MB", alias="memoryMB"
)
public: StrictBool = Field(
description="Whether the template is public or only accessible by the team"
diff --git a/packages/python-sdk/e2b/api/v2/client/models/template_build.py b/packages/python-sdk/e2b/api/v2/client/models/template_build.py
index aa86ffdf8..318fa13a3 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/template_build.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/template_build.py
@@ -18,7 +18,7 @@ import re # noqa: F401
import json
-from typing import Any, ClassVar, Dict, List, Optional
+from typing import Any, ClassVar, Dict, List
from pydantic import BaseModel, StrictStr, field_validator
from pydantic import Field
@@ -38,18 +38,13 @@ class TemplateBuild(BaseModel):
description="Identifier of the template", alias="templateID"
)
build_id: StrictStr = Field(description="Identifier of the build", alias="buildID")
- status: Optional[StrictStr] = Field(
- default=None, description="Status of the template"
- )
+ status: StrictStr = Field(description="Status of the template")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["logs", "templateID", "buildID", "status"]
@field_validator("status")
def status_validate_enum(cls, value):
"""Validates the enum"""
- if value is None:
- return value
-
if value not in ("building", "ready", "error"):
raise ValueError(
"must be one of enum values ('building', 'ready', 'error')"
diff --git a/packages/python-sdk/e2b/api/v2/client/models/template_build_request.py b/packages/python-sdk/e2b/api/v2/client/models/template_build_request.py
index e9d50c619..0c631058a 100644
--- a/packages/python-sdk/e2b/api/v2/client/models/template_build_request.py
+++ b/packages/python-sdk/e2b/api/v2/client/models/template_build_request.py
@@ -43,13 +43,11 @@ class TemplateBuildRequest(BaseModel):
description="Start command to execute in the template after the build",
alias="startCmd",
)
- cpu_count: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(
- default=None, description="CPU cores for the template", alias="cpuCount"
+ cpu_count: Optional[Annotated[int, Field(le=8, strict=True, ge=1)]] = Field(
+ default=None, description="CPU cores for the sandbox", alias="cpuCount"
)
- memory_mb: Optional[Annotated[int, Field(strict=True, ge=128)]] = Field(
- default=None,
- description="Memory limit for the template in MB",
- alias="memoryMB",
+ memory_mb: Optional[Annotated[int, Field(le=8192, strict=True, ge=128)]] = Field(
+ default=None, description="Memory for the sandbox in MB", alias="memoryMB"
)
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = [
diff --git a/packages/python-sdk/e2b/api/v2/client_README.md b/packages/python-sdk/e2b/api/v2/client_README.md
index 5ea83ebe2..5f94b028d 100644
--- a/packages/python-sdk/e2b/api/v2/client_README.md
+++ b/packages/python-sdk/e2b/api/v2/client_README.md
@@ -76,21 +76,22 @@ Class | Method | HTTP request | Description
*SandboxesApi* | [**sandboxes_sandbox_id_delete**](e2b/api/v2/client/docs/SandboxesApi.md#sandboxes_sandbox_id_delete) | **DELETE** /sandboxes/{sandboxID} |
*SandboxesApi* | [**sandboxes_sandbox_id_logs_get**](e2b/api/v2/client/docs/SandboxesApi.md#sandboxes_sandbox_id_logs_get) | **GET** /sandboxes/{sandboxID}/logs |
*SandboxesApi* | [**sandboxes_sandbox_id_refreshes_post**](e2b/api/v2/client/docs/SandboxesApi.md#sandboxes_sandbox_id_refreshes_post) | **POST** /sandboxes/{sandboxID}/refreshes |
+*SandboxesApi* | [**sandboxes_sandbox_id_timeout_post**](e2b/api/v2/client/docs/SandboxesApi.md#sandboxes_sandbox_id_timeout_post) | **POST** /sandboxes/{sandboxID}/timeout |
## Documentation For Models
- [Error](e2b/api/v2/client/docs/Error.md)
- [NewSandbox](e2b/api/v2/client/docs/NewSandbox.md)
- - [RunningSandboxes](e2b/api/v2/client/docs/RunningSandboxes.md)
+ - [RunningSandbox](e2b/api/v2/client/docs/RunningSandbox.md)
- [Sandbox](e2b/api/v2/client/docs/Sandbox.md)
- [SandboxLog](e2b/api/v2/client/docs/SandboxLog.md)
- [SandboxLogs](e2b/api/v2/client/docs/SandboxLogs.md)
- [SandboxesSandboxIDRefreshesPostRequest](e2b/api/v2/client/docs/SandboxesSandboxIDRefreshesPostRequest.md)
+ - [SandboxesSandboxIDTimeoutPostRequest](e2b/api/v2/client/docs/SandboxesSandboxIDTimeoutPostRequest.md)
- [Template](e2b/api/v2/client/docs/Template.md)
- [TemplateBuild](e2b/api/v2/client/docs/TemplateBuild.md)
- [TemplateBuildRequest](e2b/api/v2/client/docs/TemplateBuildRequest.md)
- - [TemplatesTemplateIDBuildsBuildIDLogsPostRequest](e2b/api/v2/client/docs/TemplatesTemplateIDBuildsBuildIDLogsPostRequest.md)
<a id="documentation-for-authorization"></a>
diff --git a/packages/python-sdk/envd/filesystem/v1/filesystem_connect.py b/packages/python-sdk/envd/filesystem/v1/filesystem_connect.py
index 6a04ef4a2..4d5fb44ef 100644
--- a/packages/python-sdk/envd/filesystem/v1/filesystem_connect.py
+++ b/packages/python-sdk/envd/filesystem/v1/filesystem_connect.py
@@ -18,14 +18,6 @@ class FilesystemServiceClient:
json=json,
**opts
)
- self._create_file = connect.Client(
- pool=pool,
- url=f"{base_url}/{FilesystemServiceName}/CreateFile",
- response_type=envd_dot_filesystem_dot_v1_dot_filesystem__pb2.CreateFileResponse,
- compressor=compressor,
- json=json,
- **opts
- )
self._create_dir = connect.Client(
pool=pool,
url=f"{base_url}/{FilesystemServiceName}/CreateDir",
@@ -78,9 +70,6 @@ class FilesystemServiceClient:
def stat(self, req: envd_dot_filesystem_dot_v1_dot_filesystem__pb2.StatRequest, **opts) -> envd_dot_filesystem_dot_v1_dot_filesystem__pb2.StatResponse:
return self._stat.call_unary(req, **opts)
- def create_file(self, req: envd_dot_filesystem_dot_v1_dot_filesystem__pb2.CreateFileRequest, **opts) -> envd_dot_filesystem_dot_v1_dot_filesystem__pb2.CreateFileResponse:
- return self._create_file.call_unary(req, **opts)
-
def create_dir(self, req: envd_dot_filesystem_dot_v1_dot_filesystem__pb2.CreateDirRequest, **opts) -> envd_dot_filesystem_dot_v1_dot_filesystem__pb2.CreateDirResponse:
return self._create_dir.call_unary(req, **opts)
diff --git a/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.py b/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.py
index 8117f63a7..3affed467 100644
--- a/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.py
+++ b/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.py
@@ -16,7 +16,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__
from envd.permissions.v1 import permissions_pb2 as envd_dot_permissions_dot_v1_dot_permissions__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#envd/filesystem/v1/filesystem.proto\x12\x12\x65nvd.filesystem.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a%envd/permissions/v1/permissions.proto\"\x9a\x01\n\x11\x43reateFileRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x0e\x63reate_parents\x18\x02 \x01(\x08R\rcreateParents\x12\x12\n\x04mode\x18\x03 \x01(\tR\x04mode\x12\x36\n\x05owner\x18\x04 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"\x14\n\x12\x43reateFileResponse\"\x99\x01\n\x10\x43reateDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12%\n\x0e\x63reate_parents\x18\x02 \x01(\x08R\rcreateParents\x12\x12\n\x04mode\x18\x03 \x01(\tR\x04mode\x12\x36\n\x05owner\x18\x04 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"\x13\n\x11\x43reateDirResponse\"\x9d\x01\n\x0b\x43opyRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\x12\x1c\n\trecursive\x18\x03 \x01(\x08R\trecursive\x12\x36\n\x05owner\x18\x04 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"\x0e\n\x0c\x43opyResponse\"!\n\x0bStatRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"C\n\x0cStatResponse\x12\x33\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x1d.envd.filesystem.v1.EntryInfoR\x05\x65ntry\"A\n\rRemoveRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x1c\n\trecursive\x18\x02 \x01(\x08R\trecursive\"\x10\n\x0eRemoveResponse\"\x81\x01\n\rRenameRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\x12\x36\n\x05owner\x18\x04 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"\x10\n\x0eRenameResponse\"\x89\x01\n\tEntryInfo\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04type\x18\x02 \x01(\x0e\x32\x1c.envd.filesystem.v1.FileTypeR\x04type\x12\x36\n\x05owner\x18\x06 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"$\n\x0eListDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"J\n\x0fListDirResponse\x12\x37\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1d.envd.filesystem.v1.EntryInfoR\x07\x65ntries\"\"\n\x0cWatchRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"J\n\rWatchResponse\x12\x39\n\x05\x65vent\x18\x01 \x01(\x0b\x32#.envd.filesystem.v1.FilesystemEventR\x05\x65vent\"\x8d\x01\n\x0f\x46ilesystemEvent\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32\x1d.envd.filesystem.v1.EventTypeR\x04type\x12\x33\n\x05\x65ntry\x18\x03 \x01(\x0b\x32\x1d.envd.filesystem.v1.EntryInfoR\x05\x65ntry*}\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46ILE_TYPE_FILE\x10\x01\x12\x17\n\x13\x46ILE_TYPE_DIRECTORY\x10\x02\x12\x12\n\x0e\x46ILE_TYPE_LINK\x10\x03\x12\x15\n\x11\x46ILE_TYPE_SYMLINK\x10\x04*\x98\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45VENT_TYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENT_TYPE_WRITE\x10\x02\x12\x15\n\x11\x45VENT_TYPE_REMOVE\x10\x03\x12\x15\n\x11\x45VENT_TYPE_RENAME\x10\x04\x12\x14\n\x10\x45VENT_TYPE_CHMOD\x10\x05\x32\xa6\x05\n\x11\x46ilesystemService\x12I\n\x04Stat\x12\x1f.envd.filesystem.v1.StatRequest\x1a .envd.filesystem.v1.StatResponse\x12[\n\nCreateFile\x12%.envd.filesystem.v1.CreateFileRequest\x1a&.envd.filesystem.v1.CreateFileResponse\x12X\n\tCreateDir\x12$.envd.filesystem.v1.CreateDirRequest\x1a%.envd.filesystem.v1.CreateDirResponse\x12R\n\x07ListDir\x12\".envd.filesystem.v1.ListDirRequest\x1a#.envd.filesystem.v1.ListDirResponse\x12N\n\x05Watch\x12 .envd.filesystem.v1.WatchRequest\x1a!.envd.filesystem.v1.WatchResponse0\x01\x12O\n\x06Rename\x12!.envd.filesystem.v1.RenameRequest\x1a\".envd.filesystem.v1.RenameResponse\x12O\n\x06Remove\x12!.envd.filesystem.v1.RemoveRequest\x1a\".envd.filesystem.v1.RemoveResponse\x12I\n\x04\x43opy\x12\x1f.envd.filesystem.v1.CopyRequest\x1a .envd.filesystem.v1.CopyResponseB\x93\x01\n\x16\x63om.envd.filesystem.v1B\x0f\x46ilesystemProtoP\x01\xa2\x02\x03\x45\x46X\xaa\x02\x12\x45nvd.Filesystem.V1\xca\x02\x12\x45nvd\\Filesystem\\V1\xe2\x02\x1e\x45nvd\\Filesystem\\V1\\GPBMetadata\xea\x02\x14\x45nvd::Filesystem::V1b\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#envd/filesystem/v1/filesystem.proto\x12\x12\x65nvd.filesystem.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a%envd/permissions/v1/permissions.proto\"r\n\x10\x43reateDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n\x04mode\x18\x03 \x01(\tR\x04mode\x12\x36\n\x05owner\x18\x04 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05owner\"\x13\n\x11\x43reateDirResponse\"[\n\x0b\x43opyRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\x12\x12\n\x04mode\x18\x03 \x01(\tR\x04mode\"\x0e\n\x0c\x43opyResponse\"!\n\x0bStatRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"C\n\x0cStatResponse\x12\x33\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\x1d.envd.filesystem.v1.EntryInfoR\x05\x65ntry\"A\n\rRemoveRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x1c\n\trecursive\x18\x02 \x01(\x08R\trecursive\"\x10\n\x0eRemoveResponse\"I\n\rRenameRequest\x12\x16\n\x06source\x18\x01 \x01(\tR\x06source\x12 \n\x0b\x64\x65stination\x18\x02 \x01(\tR\x0b\x64\x65stination\"\x10\n\x0eRenameResponse\"Q\n\tEntryInfo\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04type\x18\x02 \x01(\x0e\x32\x1c.envd.filesystem.v1.FileTypeR\x04type\"$\n\x0eListDirRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"J\n\x0fListDirResponse\x12\x37\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x1d.envd.filesystem.v1.EntryInfoR\x07\x65ntries\"\"\n\x0cWatchRequest\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\"J\n\rWatchResponse\x12\x39\n\x05\x65vent\x18\x01 \x01(\x0b\x32#.envd.filesystem.v1.FilesystemEventR\x05\x65vent\"X\n\x0f\x46ilesystemEvent\x12\x12\n\x04path\x18\x01 \x01(\tR\x04path\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32\x1d.envd.filesystem.v1.EventTypeR\x04type*R\n\x08\x46ileType\x12\x19\n\x15\x46ILE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46ILE_TYPE_FILE\x10\x01\x12\x17\n\x13\x46ILE_TYPE_DIRECTORY\x10\x02*\x98\x01\n\tEventType\x12\x1a\n\x16\x45VENT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x45VENT_TYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENT_TYPE_WRITE\x10\x02\x12\x15\n\x11\x45VENT_TYPE_REMOVE\x10\x03\x12\x15\n\x11\x45VENT_TYPE_RENAME\x10\x04\x12\x14\n\x10\x45VENT_TYPE_CHMOD\x10\x05\x32\xc9\x04\n\x11\x46ilesystemService\x12I\n\x04Stat\x12\x1f.envd.filesystem.v1.StatRequest\x1a .envd.filesystem.v1.StatResponse\x12X\n\tCreateDir\x12$.envd.filesystem.v1.CreateDirRequest\x1a%.envd.filesystem.v1.CreateDirResponse\x12R\n\x07ListDir\x12\".envd.filesystem.v1.ListDirRequest\x1a#.envd.filesystem.v1.ListDirResponse\x12N\n\x05Watch\x12 .envd.filesystem.v1.WatchRequest\x1a!.envd.filesystem.v1.WatchResponse0\x01\x12O\n\x06Rename\x12!.envd.filesystem.v1.RenameRequest\x1a\".envd.filesystem.v1.RenameResponse\x12O\n\x06Remove\x12!.envd.filesystem.v1.RemoveRequest\x1a\".envd.filesystem.v1.RemoveResponse\x12I\n\x04\x43opy\x12\x1f.envd.filesystem.v1.CopyRequest\x1a .envd.filesystem.v1.CopyResponseB\x93\x01\n\x16\x63om.envd.filesystem.v1B\x0f\x46ilesystemProtoP\x01\xa2\x02\x03\x45\x46X\xaa\x02\x12\x45nvd.Filesystem.V1\xca\x02\x12\x45nvd\\Filesystem\\V1\xe2\x02\x1e\x45nvd\\Filesystem\\V1\\GPBMetadata\xea\x02\x14\x45nvd::Filesystem::V1b\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -24,46 +24,42 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'envd.filesystem.v1.filesyst
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\n\026com.envd.filesystem.v1B\017FilesystemProtoP\001\242\002\003EFX\252\002\022Envd.Filesystem.V1\312\002\022Envd\\Filesystem\\V1\342\002\036Envd\\Filesystem\\V1\\GPBMetadata\352\002\024Envd::Filesystem::V1'
- _globals['_FILETYPE']._serialized_start=1512
- _globals['_FILETYPE']._serialized_end=1637
- _globals['_EVENTTYPE']._serialized_start=1640
- _globals['_EVENTTYPE']._serialized_end=1792
- _globals['_CREATEFILEREQUEST']._serialized_start=132
- _globals['_CREATEFILEREQUEST']._serialized_end=286
- _globals['_CREATEFILERESPONSE']._serialized_start=288
- _globals['_CREATEFILERESPONSE']._serialized_end=308
- _globals['_CREATEDIRREQUEST']._serialized_start=311
- _globals['_CREATEDIRREQUEST']._serialized_end=464
- _globals['_CREATEDIRRESPONSE']._serialized_start=466
- _globals['_CREATEDIRRESPONSE']._serialized_end=485
- _globals['_COPYREQUEST']._serialized_start=488
- _globals['_COPYREQUEST']._serialized_end=645
- _globals['_COPYRESPONSE']._serialized_start=647
- _globals['_COPYRESPONSE']._serialized_end=661
- _globals['_STATREQUEST']._serialized_start=663
- _globals['_STATREQUEST']._serialized_end=696
- _globals['_STATRESPONSE']._serialized_start=698
- _globals['_STATRESPONSE']._serialized_end=765
- _globals['_REMOVEREQUEST']._serialized_start=767
- _globals['_REMOVEREQUEST']._serialized_end=832
- _globals['_REMOVERESPONSE']._serialized_start=834
- _globals['_REMOVERESPONSE']._serialized_end=850
- _globals['_RENAMEREQUEST']._serialized_start=853
- _globals['_RENAMEREQUEST']._serialized_end=982
- _globals['_RENAMERESPONSE']._serialized_start=984
- _globals['_RENAMERESPONSE']._serialized_end=1000
- _globals['_ENTRYINFO']._serialized_start=1003
- _globals['_ENTRYINFO']._serialized_end=1140
- _globals['_LISTDIRREQUEST']._serialized_start=1142
- _globals['_LISTDIRREQUEST']._serialized_end=1178
- _globals['_LISTDIRRESPONSE']._serialized_start=1180
- _globals['_LISTDIRRESPONSE']._serialized_end=1254
- _globals['_WATCHREQUEST']._serialized_start=1256
- _globals['_WATCHREQUEST']._serialized_end=1290
- _globals['_WATCHRESPONSE']._serialized_start=1292
- _globals['_WATCHRESPONSE']._serialized_end=1366
- _globals['_FILESYSTEMEVENT']._serialized_start=1369
- _globals['_FILESYSTEMEVENT']._serialized_end=1510
- _globals['_FILESYSTEMSERVICE']._serialized_start=1795
- _globals['_FILESYSTEMSERVICE']._serialized_end=2473
+ _globals['_FILETYPE']._serialized_start=1058
+ _globals['_FILETYPE']._serialized_end=1140
+ _globals['_EVENTTYPE']._serialized_start=1143
+ _globals['_EVENTTYPE']._serialized_end=1295
+ _globals['_CREATEDIRREQUEST']._serialized_start=131
+ _globals['_CREATEDIRREQUEST']._serialized_end=245
+ _globals['_CREATEDIRRESPONSE']._serialized_start=247
+ _globals['_CREATEDIRRESPONSE']._serialized_end=266
+ _globals['_COPYREQUEST']._serialized_start=268
+ _globals['_COPYREQUEST']._serialized_end=359
+ _globals['_COPYRESPONSE']._serialized_start=361
+ _globals['_COPYRESPONSE']._serialized_end=375
+ _globals['_STATREQUEST']._serialized_start=377
+ _globals['_STATREQUEST']._serialized_end=410
+ _globals['_STATRESPONSE']._serialized_start=412
+ _globals['_STATRESPONSE']._serialized_end=479
+ _globals['_REMOVEREQUEST']._serialized_start=481
+ _globals['_REMOVEREQUEST']._serialized_end=546
+ _globals['_REMOVERESPONSE']._serialized_start=548
+ _globals['_REMOVERESPONSE']._serialized_end=564
+ _globals['_RENAMEREQUEST']._serialized_start=566
+ _globals['_RENAMEREQUEST']._serialized_end=639
+ _globals['_RENAMERESPONSE']._serialized_start=641
+ _globals['_RENAMERESPONSE']._serialized_end=657
+ _globals['_ENTRYINFO']._serialized_start=659
+ _globals['_ENTRYINFO']._serialized_end=740
+ _globals['_LISTDIRREQUEST']._serialized_start=742
+ _globals['_LISTDIRREQUEST']._serialized_end=778
+ _globals['_LISTDIRRESPONSE']._serialized_start=780
+ _globals['_LISTDIRRESPONSE']._serialized_end=854
+ _globals['_WATCHREQUEST']._serialized_start=856
+ _globals['_WATCHREQUEST']._serialized_end=890
+ _globals['_WATCHRESPONSE']._serialized_start=892
+ _globals['_WATCHRESPONSE']._serialized_end=966
+ _globals['_FILESYSTEMEVENT']._serialized_start=968
+ _globals['_FILESYSTEMEVENT']._serialized_end=1056
+ _globals['_FILESYSTEMSERVICE']._serialized_start=1298
+ _globals['_FILESYSTEMSERVICE']._serialized_end=1883
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.pyi b/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.pyi
index bb6963d89..8e0d7c1d1 100644
--- a/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.pyi
+++ b/packages/python-sdk/envd/filesystem/v1/filesystem_pb2.pyi
@@ -13,8 +13,6 @@ class FileType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
FILE_TYPE_UNSPECIFIED: _ClassVar[FileType]
FILE_TYPE_FILE: _ClassVar[FileType]
FILE_TYPE_DIRECTORY: _ClassVar[FileType]
- FILE_TYPE_LINK: _ClassVar[FileType]
- FILE_TYPE_SYMLINK: _ClassVar[FileType]
class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
@@ -27,8 +25,6 @@ class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
FILE_TYPE_UNSPECIFIED: FileType
FILE_TYPE_FILE: FileType
FILE_TYPE_DIRECTORY: FileType
-FILE_TYPE_LINK: FileType
-FILE_TYPE_SYMLINK: FileType
EVENT_TYPE_UNSPECIFIED: EventType
EVENT_TYPE_CREATE: EventType
EVENT_TYPE_WRITE: EventType
@@ -36,49 +32,29 @@ EVENT_TYPE_REMOVE: EventType
EVENT_TYPE_RENAME: EventType
EVENT_TYPE_CHMOD: EventType
-class CreateFileRequest(_message.Message):
- __slots__ = ("path", "create_parents", "mode", "owner")
- PATH_FIELD_NUMBER: _ClassVar[int]
- CREATE_PARENTS_FIELD_NUMBER: _ClassVar[int]
- MODE_FIELD_NUMBER: _ClassVar[int]
- OWNER_FIELD_NUMBER: _ClassVar[int]
- path: str
- create_parents: bool
- mode: str
- owner: _permissions_pb2.Credentials
- def __init__(self, path: _Optional[str] = ..., create_parents: bool = ..., mode: _Optional[str] = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
-
-class CreateFileResponse(_message.Message):
- __slots__ = ()
- def __init__(self) -> None: ...
-
class CreateDirRequest(_message.Message):
- __slots__ = ("path", "create_parents", "mode", "owner")
+ __slots__ = ("path", "mode", "owner")
PATH_FIELD_NUMBER: _ClassVar[int]
- CREATE_PARENTS_FIELD_NUMBER: _ClassVar[int]
MODE_FIELD_NUMBER: _ClassVar[int]
OWNER_FIELD_NUMBER: _ClassVar[int]
path: str
- create_parents: bool
mode: str
owner: _permissions_pb2.Credentials
- def __init__(self, path: _Optional[str] = ..., create_parents: bool = ..., mode: _Optional[str] = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
+ def __init__(self, path: _Optional[str] = ..., mode: _Optional[str] = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
class CreateDirResponse(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class CopyRequest(_message.Message):
- __slots__ = ("source", "destination", "recursive", "owner")
+ __slots__ = ("source", "destination", "mode")
SOURCE_FIELD_NUMBER: _ClassVar[int]
DESTINATION_FIELD_NUMBER: _ClassVar[int]
- RECURSIVE_FIELD_NUMBER: _ClassVar[int]
- OWNER_FIELD_NUMBER: _ClassVar[int]
+ MODE_FIELD_NUMBER: _ClassVar[int]
source: str
destination: str
- recursive: bool
- owner: _permissions_pb2.Credentials
- def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., recursive: bool = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
+ mode: str
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., mode: _Optional[str] = ...) -> None: ...
class CopyResponse(_message.Message):
__slots__ = ()
@@ -109,28 +85,24 @@ class RemoveResponse(_message.Message):
def __init__(self) -> None: ...
class RenameRequest(_message.Message):
- __slots__ = ("source", "destination", "owner")
+ __slots__ = ("source", "destination")
SOURCE_FIELD_NUMBER: _ClassVar[int]
DESTINATION_FIELD_NUMBER: _ClassVar[int]
- OWNER_FIELD_NUMBER: _ClassVar[int]
source: str
destination: str
- owner: _permissions_pb2.Credentials
- def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
+ def __init__(self, source: _Optional[str] = ..., destination: _Optional[str] = ...) -> None: ...
class RenameResponse(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class EntryInfo(_message.Message):
- __slots__ = ("name", "type", "owner")
+ __slots__ = ("name", "type")
NAME_FIELD_NUMBER: _ClassVar[int]
TYPE_FIELD_NUMBER: _ClassVar[int]
- OWNER_FIELD_NUMBER: _ClassVar[int]
name: str
type: FileType
- owner: _permissions_pb2.Credentials
- def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[FileType, str]] = ..., owner: _Optional[_Union[_permissions_pb2.Credentials, _Mapping]] = ...) -> None: ...
+ def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[FileType, str]] = ...) -> None: ...
class ListDirRequest(_message.Message):
__slots__ = ("path",)
@@ -157,11 +129,9 @@ class WatchResponse(_message.Message):
def __init__(self, event: _Optional[_Union[FilesystemEvent, _Mapping]] = ...) -> None: ...
class FilesystemEvent(_message.Message):
- __slots__ = ("path", "type", "entry")
+ __slots__ = ("path", "type")
PATH_FIELD_NUMBER: _ClassVar[int]
TYPE_FIELD_NUMBER: _ClassVar[int]
- ENTRY_FIELD_NUMBER: _ClassVar[int]
path: str
type: EventType
- entry: EntryInfo
- def __init__(self, path: _Optional[str] = ..., type: _Optional[_Union[EventType, str]] = ..., entry: _Optional[_Union[EntryInfo, _Mapping]] = ...) -> None: ...
+ def __init__(self, path: _Optional[str] = ..., type: _Optional[_Union[EventType, str]] = ...) -> None: ...
diff --git a/packages/python-sdk/envd/network/v1/network_connect.py b/packages/python-sdk/envd/network/v1/network_connect.py
index e5a5f6ab2..6d87a60c9 100644
--- a/packages/python-sdk/envd/network/v1/network_connect.py
+++ b/packages/python-sdk/envd/network/v1/network_connect.py
@@ -16,7 +16,7 @@ class NetworkServiceClient:
response_type=envd_dot_network_dot_v1_dot_network__pb2.ListPortsResponse,
compressor=compressor,
json=json,
- **opts
+ **opts,
)
self._watch_ports = connect.Client(
pool=pool,
@@ -24,11 +24,17 @@ class NetworkServiceClient:
response_type=envd_dot_network_dot_v1_dot_network__pb2.WatchPortsResponse,
compressor=compressor,
json=json,
- **opts
+ **opts,
)
- def list_ports(self, req: envd_dot_network_dot_v1_dot_network__pb2.ListPortsRequest, **opts) -> envd_dot_network_dot_v1_dot_network__pb2.ListPortsResponse:
+ def list_ports(
+ self, req: envd_dot_network_dot_v1_dot_network__pb2.ListPortsRequest, **opts
+ ) -> envd_dot_network_dot_v1_dot_network__pb2.ListPortsResponse:
return self._list_ports.call_unary(req, **opts)
- def watch_ports(self, req: envd_dot_network_dot_v1_dot_network__pb2.WatchPortsRequest , **opts) -> Generator[envd_dot_network_dot_v1_dot_network__pb2.WatchPortsResponse, Any, None]:
+ def watch_ports(
+ self, req: envd_dot_network_dot_v1_dot_network__pb2.WatchPortsRequest, **opts
+ ) -> Generator[
+ envd_dot_network_dot_v1_dot_network__pb2.WatchPortsResponse, Any, None
+ ]:
return self._watch_ports.call_server_stream(req, **opts)
diff --git a/packages/python-sdk/envd/network/v1/network_pb2.py b/packages/python-sdk/envd/network/v1/network_pb2.py
index 7ba42658a..8bd702703 100644
--- a/packages/python-sdk/envd/network/v1/network_pb2.py
+++ b/packages/python-sdk/envd/network/v1/network_pb2.py
@@ -7,36 +7,45 @@ from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
+
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
-from envd.permissions.v1 import permissions_pb2 as envd_dot_permissions_dot_v1_dot_permissions__pb2
+from envd.permissions.v1 import (
+ permissions_pb2 as envd_dot_permissions_dot_v1_dot_permissions__pb2,
+)
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x65nvd/network/v1/network.proto\x12\x0f\x65nvd.network.v1\x1a%envd/permissions/v1/permissions.proto\"\x12\n\x10ListPortsRequest\"@\n\x11ListPortsResponse\x12+\n\x05ports\x18\x01 \x03(\x0b\x32\x15.envd.network.v1.PortR\x05ports\"H\n\x11WatchPortsRequest\x12\x33\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x1b.envd.network.v1.PortFilterR\x06\x66ilter\"\"\n\nPortFilter\x12\x14\n\x05ports\x18\x01 \x03(\rR\x05ports\"A\n\x12WatchPortsResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.envd.network.v1.PortR\x05\x65vent\"L\n\x04Port\x12\x12\n\x04port\x18\x01 \x01(\rR\x04port\x12\x30\n\x05state\x18\x02 \x01(\x0e\x32\x1a.envd.network.v1.PortStateR\x05state*S\n\tPortState\x12\x1a\n\x16PORT_STATE_UNSPECIFIED\x10\x00\x12\x13\n\x0fPORT_STATE_OPEN\x10\x01\x12\x15\n\x11PORT_STATE_CLOSED\x10\x02\x32\xbd\x01\n\x0eNetworkService\x12R\n\tListPorts\x12!.envd.network.v1.ListPortsRequest\x1a\".envd.network.v1.ListPortsResponse\x12W\n\nWatchPorts\x12\".envd.network.v1.WatchPortsRequest\x1a#.envd.network.v1.WatchPortsResponse0\x01\x42\x81\x01\n\x13\x63om.envd.network.v1B\x0cNetworkProtoP\x01\xa2\x02\x03\x45NX\xaa\x02\x0f\x45nvd.Network.V1\xca\x02\x0f\x45nvd\\Network\\V1\xe2\x02\x1b\x45nvd\\Network\\V1\\GPBMetadata\xea\x02\x11\x45nvd::Network::V1b\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
+ b'\n\x1d\x65nvd/network/v1/network.proto\x12\x0f\x65nvd.network.v1\x1a%envd/permissions/v1/permissions.proto"\x12\n\x10ListPortsRequest"@\n\x11ListPortsResponse\x12+\n\x05ports\x18\x01 \x03(\x0b\x32\x15.envd.network.v1.PortR\x05ports"H\n\x11WatchPortsRequest\x12\x33\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x1b.envd.network.v1.PortFilterR\x06\x66ilter""\n\nPortFilter\x12\x14\n\x05ports\x18\x01 \x03(\rR\x05ports"A\n\x12WatchPortsResponse\x12+\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x15.envd.network.v1.PortR\x05\x65vent"L\n\x04Port\x12\x12\n\x04port\x18\x01 \x01(\rR\x04port\x12\x30\n\x05state\x18\x02 \x01(\x0e\x32\x1a.envd.network.v1.PortStateR\x05state*S\n\tPortState\x12\x1a\n\x16PORT_STATE_UNSPECIFIED\x10\x00\x12\x13\n\x0fPORT_STATE_OPEN\x10\x01\x12\x15\n\x11PORT_STATE_CLOSED\x10\x02\x32\xbd\x01\n\x0eNetworkService\x12R\n\tListPorts\x12!.envd.network.v1.ListPortsRequest\x1a".envd.network.v1.ListPortsResponse\x12W\n\nWatchPorts\x12".envd.network.v1.WatchPortsRequest\x1a#.envd.network.v1.WatchPortsResponse0\x01\x42\x81\x01\n\x13\x63om.envd.network.v1B\x0cNetworkProtoP\x01\xa2\x02\x03\x45NX\xaa\x02\x0f\x45nvd.Network.V1\xca\x02\x0f\x45nvd\\Network\\V1\xe2\x02\x1b\x45nvd\\Network\\V1\\GPBMetadata\xea\x02\x11\x45nvd::Network::V1b\x06proto3'
+)
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
-_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'envd.network.v1.network_pb2', _globals)
+_builder.BuildTopDescriptorsAndMessages(
+ DESCRIPTOR, "envd.network.v1.network_pb2", _globals
+)
if not _descriptor._USE_C_DESCRIPTORS:
- _globals['DESCRIPTOR']._loaded_options = None
- _globals['DESCRIPTOR']._serialized_options = b'\n\023com.envd.network.v1B\014NetworkProtoP\001\242\002\003ENX\252\002\017Envd.Network.V1\312\002\017Envd\\Network\\V1\342\002\033Envd\\Network\\V1\\GPBMetadata\352\002\021Envd::Network::V1'
- _globals['_PORTSTATE']._serialized_start=430
- _globals['_PORTSTATE']._serialized_end=513
- _globals['_LISTPORTSREQUEST']._serialized_start=89
- _globals['_LISTPORTSREQUEST']._serialized_end=107
- _globals['_LISTPORTSRESPONSE']._serialized_start=109
- _globals['_LISTPORTSRESPONSE']._serialized_end=173
- _globals['_WATCHPORTSREQUEST']._serialized_start=175
- _globals['_WATCHPORTSREQUEST']._serialized_end=247
- _globals['_PORTFILTER']._serialized_start=249
- _globals['_PORTFILTER']._serialized_end=283
- _globals['_WATCHPORTSRESPONSE']._serialized_start=285
- _globals['_WATCHPORTSRESPONSE']._serialized_end=350
- _globals['_PORT']._serialized_start=352
- _globals['_PORT']._serialized_end=428
- _globals['_NETWORKSERVICE']._serialized_start=516
- _globals['_NETWORKSERVICE']._serialized_end=705
+ _globals["DESCRIPTOR"]._loaded_options = None
+ _globals[
+ "DESCRIPTOR"
+ ]._serialized_options = b"\n\023com.envd.network.v1B\014NetworkProtoP\001\242\002\003ENX\252\002\017Envd.Network.V1\312\002\017Envd\\Network\\V1\342\002\033Envd\\Network\\V1\\GPBMetadata\352\002\021Envd::Network::V1"
+ _globals["_PORTSTATE"]._serialized_start = 430
+ _globals["_PORTSTATE"]._serialized_end = 513
+ _globals["_LISTPORTSREQUEST"]._serialized_start = 89
+ _globals["_LISTPORTSREQUEST"]._serialized_end = 107
+ _globals["_LISTPORTSRESPONSE"]._serialized_start = 109
+ _globals["_LISTPORTSRESPONSE"]._serialized_end = 173
+ _globals["_WATCHPORTSREQUEST"]._serialized_start = 175
+ _globals["_WATCHPORTSREQUEST"]._serialized_end = 247
+ _globals["_PORTFILTER"]._serialized_start = 249
+ _globals["_PORTFILTER"]._serialized_end = 283
+ _globals["_WATCHPORTSRESPONSE"]._serialized_start = 285
+ _globals["_WATCHPORTSRESPONSE"]._serialized_end = 350
+ _globals["_PORT"]._serialized_start = 352
+ _globals["_PORT"]._serialized_end = 428
+ _globals["_NETWORKSERVICE"]._serialized_start = 516
+ _globals["_NETWORKSERVICE"]._serialized_end = 705
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/envd/network/v1/network_pb2.pyi b/packages/python-sdk/envd/network/v1/network_pb2.pyi
index 1b101981e..502e83172 100644
--- a/packages/python-sdk/envd/network/v1/network_pb2.pyi
+++ b/packages/python-sdk/envd/network/v1/network_pb2.pyi
@@ -3,7 +3,13 @@ from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
-from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
+from typing import (
+ ClassVar as _ClassVar,
+ Iterable as _Iterable,
+ Mapping as _Mapping,
+ Optional as _Optional,
+ Union as _Union,
+)
DESCRIPTOR: _descriptor.FileDescriptor
@@ -12,6 +18,7 @@ class PortState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
PORT_STATE_UNSPECIFIED: _ClassVar[PortState]
PORT_STATE_OPEN: _ClassVar[PortState]
PORT_STATE_CLOSED: _ClassVar[PortState]
+
PORT_STATE_UNSPECIFIED: PortState
PORT_STATE_OPEN: PortState
PORT_STATE_CLOSED: PortState
@@ -24,13 +31,17 @@ class ListPortsResponse(_message.Message):
__slots__ = ("ports",)
PORTS_FIELD_NUMBER: _ClassVar[int]
ports: _containers.RepeatedCompositeFieldContainer[Port]
- def __init__(self, ports: _Optional[_Iterable[_Union[Port, _Mapping]]] = ...) -> None: ...
+ def __init__(
+ self, ports: _Optional[_Iterable[_Union[Port, _Mapping]]] = ...
+ ) -> None: ...
class WatchPortsRequest(_message.Message):
__slots__ = ("filter",)
FILTER_FIELD_NUMBER: _ClassVar[int]
filter: PortFilter
- def __init__(self, filter: _Optional[_Union[PortFilter, _Mapping]] = ...) -> None: ...
+ def __init__(
+ self, filter: _Optional[_Union[PortFilter, _Mapping]] = ...
+ ) -> None: ...
class PortFilter(_message.Message):
__slots__ = ("ports",)
@@ -50,4 +61,6 @@ class Port(_message.Message):
STATE_FIELD_NUMBER: _ClassVar[int]
port: int
state: PortState
- def __init__(self, port: _Optional[int] = ..., state: _Optional[_Union[PortState, str]] = ...) -> None: ...
+ def __init__(
+ self, port: _Optional[int] = ..., state: _Optional[_Union[PortState, str]] = ...
+ ) -> None: ...
diff --git a/packages/python-sdk/envd/permissions/v1/permissions_pb2.py b/packages/python-sdk/envd/permissions/v1/permissions_pb2.py
index f65242f6b..a14acb403 100644
--- a/packages/python-sdk/envd/permissions/v1/permissions_pb2.py
+++ b/packages/python-sdk/envd/permissions/v1/permissions_pb2.py
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%envd/permissions/v1/permissions.proto\x12\x13\x65nvd.permissions.v1\"2\n\x0b\x43redentials\x12\x14\n\x04user\x18\x01 \x01(\tH\x00R\x04userB\r\n\x0b\x63redentialsB\x99\x01\n\x17\x63om.envd.permissions.v1B\x10PermissionsProtoP\x01\xa2\x02\x03\x45PX\xaa\x02\x13\x45nvd.Permissions.V1\xca\x02\x13\x45nvd\\Permissions\\V1\xe2\x02\x1f\x45nvd\\Permissions\\V1\\GPBMetadata\xea\x02\x15\x45nvd::Permissions::V1b\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%envd/permissions/v1/permissions.proto\x12\x13\x65nvd.permissions.v1\":\n\x0b\x43redentials\x12\x1c\n\x08username\x18\x01 \x01(\tH\x00R\x08usernameB\r\n\x0b\x63redentialsB\x99\x01\n\x17\x63om.envd.permissions.v1B\x10PermissionsProtoP\x01\xa2\x02\x03\x45PX\xaa\x02\x13\x45nvd.Permissions.V1\xca\x02\x13\x45nvd\\Permissions\\V1\xe2\x02\x1f\x45nvd\\Permissions\\V1\\GPBMetadata\xea\x02\x15\x45nvd::Permissions::V1b\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -23,5 +23,5 @@ if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\n\027com.envd.permissions.v1B\020PermissionsProtoP\001\242\002\003EPX\252\002\023Envd.Permissions.V1\312\002\023Envd\\Permissions\\V1\342\002\037Envd\\Permissions\\V1\\GPBMetadata\352\002\025Envd::Permissions::V1'
_globals['_CREDENTIALS']._serialized_start=62
- _globals['_CREDENTIALS']._serialized_end=112
+ _globals['_CREDENTIALS']._serialized_end=120
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/envd/permissions/v1/permissions_pb2.pyi b/packages/python-sdk/envd/permissions/v1/permissions_pb2.pyi
index aca119f74..f6dd4882a 100644
--- a/packages/python-sdk/envd/permissions/v1/permissions_pb2.pyi
+++ b/packages/python-sdk/envd/permissions/v1/permissions_pb2.pyi
@@ -5,7 +5,7 @@ from typing import ClassVar as _ClassVar, Optional as _Optional
DESCRIPTOR: _descriptor.FileDescriptor
class Credentials(_message.Message):
- __slots__ = ("user",)
- USER_FIELD_NUMBER: _ClassVar[int]
- user: str
- def __init__(self, user: _Optional[str] = ...) -> None: ...
+ __slots__ = ("username",)
+ USERNAME_FIELD_NUMBER: _ClassVar[int]
+ username: str
+ def __init__(self, username: _Optional[str] = ...) -> None: ...
diff --git a/packages/python-sdk/envd/process/v1/process_connect.py b/packages/python-sdk/envd/process/v1/process_connect.py
index d946ee546..21b6cb518 100644
--- a/packages/python-sdk/envd/process/v1/process_connect.py
+++ b/packages/python-sdk/envd/process/v1/process_connect.py
@@ -42,6 +42,14 @@ class ProcessServiceClient:
json=json,
**opts
)
+ self._send_process_input_stream = connect.Client(
+ pool=pool,
+ url=f"{base_url}/{ProcessServiceName}/SendProcessInputStream",
+ response_type=envd_dot_process_dot_v1_dot_process__pb2.SendProcessInputStreamResponse,
+ compressor=compressor,
+ json=json,
+ **opts
+ )
self._send_process_input = connect.Client(
pool=pool,
url=f"{base_url}/{ProcessServiceName}/SendProcessInput",
@@ -71,6 +79,9 @@ class ProcessServiceClient:
def update_process(self, req: envd_dot_process_dot_v1_dot_process__pb2.UpdateProcessRequest, **opts) -> envd_dot_process_dot_v1_dot_process__pb2.UpdateProcessResponse:
return self._update_process.call_unary(req, **opts)
+ def send_process_input_stream(self, req: envd_dot_process_dot_v1_dot_process__pb2.SendProcessInputStreamRequest, **opts) -> envd_dot_process_dot_v1_dot_process__pb2.SendProcessInputStreamResponse:
+ return self._send_process_input_stream.call_client_stream(req, **opts)
+
def send_process_input(self, req: envd_dot_process_dot_v1_dot_process__pb2.SendProcessInputRequest, **opts) -> envd_dot_process_dot_v1_dot_process__pb2.SendProcessInputResponse:
return self._send_process_input.call_unary(req, **opts)
diff --git a/packages/python-sdk/envd/process/v1/process_pb2.py b/packages/python-sdk/envd/process/v1/process_pb2.py
index ba4423e8c..42e3fbb3d 100644
--- a/packages/python-sdk/envd/process/v1/process_pb2.py
+++ b/packages/python-sdk/envd/process/v1/process_pb2.py
@@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default()
from envd.permissions.v1 import permissions_pb2 as envd_dot_permissions_dot_v1_dot_permissions__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x65nvd/process/v1/process.proto\x12\x0f\x65nvd.process.v1\x1a%envd/permissions/v1/permissions.proto\"d\n\x03PTY\x12-\n\x04size\x18\x01 \x01(\x0b\x32\x19.envd.process.v1.PTY.SizeR\x04size\x1a.\n\x04Size\x12\x12\n\x04\x63ols\x18\x01 \x01(\rR\x04\x63ols\x12\x12\n\x04rows\x18\x02 \x01(\rR\x04rows\"\xba\x01\n\rProcessConfig\x12\x10\n\x03\x63md\x18\x01 \x01(\tR\x03\x63md\x12\x12\n\x04\x61rgs\x18\x02 \x03(\tR\x04\x61rgs\x12\x39\n\x03\x65nv\x18\x03 \x03(\x0b\x32\'.envd.process.v1.ProcessConfig.EnvEntryR\x03\x65nv\x12\x10\n\x03\x63wd\x18\x04 \x01(\tR\x03\x63wd\x1a\x36\n\x08\x45nvEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x16\n\x14ListProcessesRequest\"U\n\x15ListProcessesResponse\x12<\n\tprocesses\x18\x01 \x03(\x0b\x32\x1e.envd.process.v1.ProcessConfigR\tprocesses\"\xbc\x01\n\x13StartProcessRequest\x12\x38\n\x07process\x18\x01 \x01(\x0b\x32\x1e.envd.process.v1.ProcessConfigR\x07process\x12+\n\x03pty\x18\x02 \x01(\x0b\x32\x14.envd.process.v1.PTYH\x00R\x03pty\x88\x01\x01\x12\x36\n\x05owner\x18\x03 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05ownerB\x06\n\x04_pty\"\x87\x01\n\x14UpdateProcessRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12+\n\x03pty\x18\x02 \x01(\x0b\x32\x14.envd.process.v1.PTYH\x00R\x03pty\x88\x01\x01\x42\x06\n\x04_pty\"\x17\n\x15UpdateProcessResponse\"\xa4\x03\n\x0cProcessEvent\x12@\n\x05start\x18\x01 \x01(\x0b\x32(.envd.process.v1.ProcessEvent.StartEventH\x00R\x05start\x12=\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\'.envd.process.v1.ProcessEvent.DataEventH\x00R\x04\x64\x61ta\x12:\n\x03\x65nd\x18\x03 \x01(\x0b\x32&.envd.process.v1.ProcessEvent.EndEventH\x00R\x03\x65nd\x1a\x1e\n\nStartEvent\x12\x10\n\x03pid\x18\x05 \x01(\rR\x03pid\x1a[\n\tDataEvent\x12\x1b\n\x06stdout\x18\x06 \x01(\x0cH\x00R\x06stdout\x88\x01\x01\x12\x1b\n\x06stderr\x18\x07 \x01(\x0cH\x01R\x06stderr\x88\x01\x01\x42\t\n\x07_stdoutB\t\n\x07_stderr\x1aL\n\x08\x45ndEvent\x12\x1b\n\texit_code\x18\x08 \x01(\x11R\x08\x65xitCode\x12\x19\n\x05\x65rror\x18\t \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_errorB\x0c\n\nevent_type\"K\n\x14StartProcessResponse\x12\x33\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1d.envd.process.v1.ProcessEventR\x05\x65vent\"O\n\x18ReconnectProcessResponse\x12\x33\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1d.envd.process.v1.ProcessEventR\x05\x65vent\"\x8a\x01\n\x17SendProcessInputRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12\x33\n\x05input\x18\x02 \x01(\x0b\x32\x1d.envd.process.v1.ProcessInputR\x05input\"\x1a\n\x18SendProcessInputResponse\"/\n\x0cProcessInput\x12\x16\n\x05stdin\x18\x01 \x01(\x0cH\x00R\x05stdinB\x07\n\x05input\"\x87\x01\n\x18SendProcessSignalRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12/\n\x06signal\x18\x02 \x01(\x0e\x32\x17.envd.process.v1.SignalR\x06signal\"\x1b\n\x19SendProcessSignalResponse\"U\n\x17ReconnectProcessRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\"1\n\x0fProcessSelector\x12\x12\n\x03pid\x18\x01 \x01(\rH\x00R\x03pidB\n\n\x08selector*H\n\x06Signal\x12\x16\n\x12SIGNAL_UNSPECIFIED\x10\x00\x12\x12\n\x0eSIGNAL_SIGTERM\x10\x01\x12\x12\n\x0eSIGNAL_SIGKILL\x10\x02\x32\xef\x04\n\x0eProcessService\x12^\n\rListProcesses\x12%.envd.process.v1.ListProcessesRequest\x1a&.envd.process.v1.ListProcessesResponse\x12i\n\x10ReconnectProcess\x12(.envd.process.v1.ReconnectProcessRequest\x1a).envd.process.v1.ReconnectProcessResponse0\x01\x12]\n\x0cStartProcess\x12$.envd.process.v1.StartProcessRequest\x1a%.envd.process.v1.StartProcessResponse0\x01\x12^\n\rUpdateProcess\x12%.envd.process.v1.UpdateProcessRequest\x1a&.envd.process.v1.UpdateProcessResponse\x12g\n\x10SendProcessInput\x12(.envd.process.v1.SendProcessInputRequest\x1a).envd.process.v1.SendProcessInputResponse\x12j\n\x11SendProcessSignal\x12).envd.process.v1.SendProcessSignalRequest\x1a*.envd.process.v1.SendProcessSignalResponseB\x81\x01\n\x13\x63om.envd.process.v1B\x0cProcessProtoP\x01\xa2\x02\x03\x45PX\xaa\x02\x0f\x45nvd.Process.V1\xca\x02\x0f\x45nvd\\Process\\V1\xe2\x02\x1b\x45nvd\\Process\\V1\\GPBMetadata\xea\x02\x11\x45nvd::Process::V1b\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x65nvd/process/v1/process.proto\x12\x0f\x65nvd.process.v1\x1a%envd/permissions/v1/permissions.proto\"d\n\x03PTY\x12-\n\x04size\x18\x01 \x01(\x0b\x32\x19.envd.process.v1.PTY.SizeR\x04size\x1a.\n\x04Size\x12\x12\n\x04\x63ols\x18\x01 \x01(\rR\x04\x63ols\x12\x12\n\x04rows\x18\x02 \x01(\rR\x04rows\"\xbe\x01\n\rProcessConfig\x12\x10\n\x03\x63md\x18\x01 \x01(\tR\x03\x63md\x12\x12\n\x04\x61rgs\x18\x02 \x03(\tR\x04\x61rgs\x12<\n\x04\x65nvs\x18\x03 \x03(\x0b\x32(.envd.process.v1.ProcessConfig.EnvsEntryR\x04\x65nvs\x12\x10\n\x03\x63wd\x18\x04 \x01(\tR\x03\x63wd\x1a\x37\n\tEnvsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\x16\n\x14ListProcessesRequest\"U\n\x15ListProcessesResponse\x12<\n\tprocesses\x18\x01 \x03(\x0b\x32\x1e.envd.process.v1.ProcessConfigR\tprocesses\"\xbc\x01\n\x13StartProcessRequest\x12\x38\n\x07process\x18\x01 \x01(\x0b\x32\x1e.envd.process.v1.ProcessConfigR\x07process\x12+\n\x03pty\x18\x02 \x01(\x0b\x32\x14.envd.process.v1.PTYH\x00R\x03pty\x88\x01\x01\x12\x36\n\x05owner\x18\x03 \x01(\x0b\x32 .envd.permissions.v1.CredentialsR\x05ownerB\x06\n\x04_pty\"\x87\x01\n\x14UpdateProcessRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12+\n\x03pty\x18\x02 \x01(\x0b\x32\x14.envd.process.v1.PTYH\x00R\x03pty\x88\x01\x01\x42\x06\n\x04_pty\"\x17\n\x15UpdateProcessResponse\"\xc6\x03\n\x0cProcessEvent\x12@\n\x05start\x18\x01 \x01(\x0b\x32(.envd.process.v1.ProcessEvent.StartEventH\x00R\x05start\x12=\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\'.envd.process.v1.ProcessEvent.DataEventH\x00R\x04\x64\x61ta\x12:\n\x03\x65nd\x18\x03 \x01(\x0b\x32&.envd.process.v1.ProcessEvent.EndEventH\x00R\x03\x65nd\x1a\x1e\n\nStartEvent\x12\x10\n\x03pid\x18\x01 \x01(\rR\x03pid\x1aI\n\tDataEvent\x12\x18\n\x06stdout\x18\x01 \x01(\x0cH\x00R\x06stdout\x12\x18\n\x06stderr\x18\x02 \x01(\x0cH\x00R\x06stderrB\x08\n\x06output\x1a\x84\x01\n\x08\x45ndEvent\x12\x1b\n\texit_code\x18\x01 \x01(\x11R\x08\x65xitCode\x12\x1e\n\nterminated\x18\x02 \x01(\x08R\nterminated\x12\x16\n\x06status\x18\x03 \x01(\tR\x06status\x12\x19\n\x05\x65rror\x18\x04 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_errorB\x07\n\x05\x65vent\"K\n\x14StartProcessResponse\x12\x33\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1d.envd.process.v1.ProcessEventR\x05\x65vent\"O\n\x18ReconnectProcessResponse\x12\x33\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x1d.envd.process.v1.ProcessEventR\x05\x65vent\"\x8a\x01\n\x17SendProcessInputRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12\x33\n\x05input\x18\x02 \x01(\x0b\x32\x1d.envd.process.v1.ProcessInputR\x05input\"\x1a\n\x18SendProcessInputResponse\"C\n\x0cProcessInput\x12\x16\n\x05stdin\x18\x01 \x01(\x0cH\x00R\x05stdin\x12\x12\n\x03tty\x18\x02 \x01(\x0cH\x00R\x03ttyB\x07\n\x05input\"\xd7\x02\n\x1dSendProcessInputStreamRequest\x12Q\n\x05start\x18\x01 \x01(\x0b\x32\x39.envd.process.v1.SendProcessInputStreamRequest.StartEventH\x00R\x05start\x12N\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x38.envd.process.v1.SendProcessInputStreamRequest.DataEventH\x00R\x04\x64\x61ta\x1aH\n\nStartEvent\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x1a@\n\tDataEvent\x12\x33\n\x05input\x18\x02 \x01(\x0b\x32\x1d.envd.process.v1.ProcessInputR\x05inputB\x07\n\x05\x65vent\" \n\x1eSendProcessInputStreamResponse\"\x87\x01\n\x18SendProcessSignalRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\x12/\n\x06signal\x18\x02 \x01(\x0e\x32\x17.envd.process.v1.SignalR\x06signal\"\x1b\n\x19SendProcessSignalResponse\"U\n\x17ReconnectProcessRequest\x12:\n\x07process\x18\x01 \x01(\x0b\x32 .envd.process.v1.ProcessSelectorR\x07process\"1\n\x0fProcessSelector\x12\x12\n\x03pid\x18\x01 \x01(\rH\x00R\x03pidB\n\n\x08selector*H\n\x06Signal\x12\x16\n\x12SIGNAL_UNSPECIFIED\x10\x00\x12\x12\n\x0eSIGNAL_SIGTERM\x10\x0f\x12\x12\n\x0eSIGNAL_SIGKILL\x10\t2\xec\x05\n\x0eProcessService\x12^\n\rListProcesses\x12%.envd.process.v1.ListProcessesRequest\x1a&.envd.process.v1.ListProcessesResponse\x12i\n\x10ReconnectProcess\x12(.envd.process.v1.ReconnectProcessRequest\x1a).envd.process.v1.ReconnectProcessResponse0\x01\x12]\n\x0cStartProcess\x12$.envd.process.v1.StartProcessRequest\x1a%.envd.process.v1.StartProcessResponse0\x01\x12^\n\rUpdateProcess\x12%.envd.process.v1.UpdateProcessRequest\x1a&.envd.process.v1.UpdateProcessResponse\x12{\n\x16SendProcessInputStream\x12..envd.process.v1.SendProcessInputStreamRequest\x1a/.envd.process.v1.SendProcessInputStreamResponse(\x01\x12g\n\x10SendProcessInput\x12(.envd.process.v1.SendProcessInputRequest\x1a).envd.process.v1.SendProcessInputResponse\x12j\n\x11SendProcessSignal\x12).envd.process.v1.SendProcessSignalRequest\x1a*.envd.process.v1.SendProcessSignalResponseB\x81\x01\n\x13\x63om.envd.process.v1B\x0cProcessProtoP\x01\xa2\x02\x03\x45PX\xaa\x02\x0f\x45nvd.Process.V1\xca\x02\x0f\x45nvd\\Process\\V1\xe2\x02\x1b\x45nvd\\Process\\V1\\GPBMetadata\xea\x02\x11\x45nvd::Process::V1b\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -23,54 +23,62 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'envd.process.v1.process_pb2
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\n\023com.envd.process.v1B\014ProcessProtoP\001\242\002\003EPX\252\002\017Envd.Process.V1\312\002\017Envd\\Process\\V1\342\002\033Envd\\Process\\V1\\GPBMetadata\352\002\021Envd::Process::V1'
- _globals['_PROCESSCONFIG_ENVENTRY']._loaded_options = None
- _globals['_PROCESSCONFIG_ENVENTRY']._serialized_options = b'8\001'
- _globals['_SIGNAL']._serialized_start=1949
- _globals['_SIGNAL']._serialized_end=2021
+ _globals['_PROCESSCONFIG_ENVSENTRY']._loaded_options = None
+ _globals['_PROCESSCONFIG_ENVSENTRY']._serialized_options = b'8\001'
+ _globals['_SIGNAL']._serialized_start=2387
+ _globals['_SIGNAL']._serialized_end=2459
_globals['_PTY']._serialized_start=89
_globals['_PTY']._serialized_end=189
_globals['_PTY_SIZE']._serialized_start=143
_globals['_PTY_SIZE']._serialized_end=189
_globals['_PROCESSCONFIG']._serialized_start=192
- _globals['_PROCESSCONFIG']._serialized_end=378
- _globals['_PROCESSCONFIG_ENVENTRY']._serialized_start=324
- _globals['_PROCESSCONFIG_ENVENTRY']._serialized_end=378
- _globals['_LISTPROCESSESREQUEST']._serialized_start=380
- _globals['_LISTPROCESSESREQUEST']._serialized_end=402
- _globals['_LISTPROCESSESRESPONSE']._serialized_start=404
- _globals['_LISTPROCESSESRESPONSE']._serialized_end=489
- _globals['_STARTPROCESSREQUEST']._serialized_start=492
- _globals['_STARTPROCESSREQUEST']._serialized_end=680
- _globals['_UPDATEPROCESSREQUEST']._serialized_start=683
- _globals['_UPDATEPROCESSREQUEST']._serialized_end=818
- _globals['_UPDATEPROCESSRESPONSE']._serialized_start=820
- _globals['_UPDATEPROCESSRESPONSE']._serialized_end=843
- _globals['_PROCESSEVENT']._serialized_start=846
- _globals['_PROCESSEVENT']._serialized_end=1266
- _globals['_PROCESSEVENT_STARTEVENT']._serialized_start=1051
- _globals['_PROCESSEVENT_STARTEVENT']._serialized_end=1081
- _globals['_PROCESSEVENT_DATAEVENT']._serialized_start=1083
- _globals['_PROCESSEVENT_DATAEVENT']._serialized_end=1174
- _globals['_PROCESSEVENT_ENDEVENT']._serialized_start=1176
- _globals['_PROCESSEVENT_ENDEVENT']._serialized_end=1252
- _globals['_STARTPROCESSRESPONSE']._serialized_start=1268
- _globals['_STARTPROCESSRESPONSE']._serialized_end=1343
- _globals['_RECONNECTPROCESSRESPONSE']._serialized_start=1345
- _globals['_RECONNECTPROCESSRESPONSE']._serialized_end=1424
- _globals['_SENDPROCESSINPUTREQUEST']._serialized_start=1427
- _globals['_SENDPROCESSINPUTREQUEST']._serialized_end=1565
- _globals['_SENDPROCESSINPUTRESPONSE']._serialized_start=1567
- _globals['_SENDPROCESSINPUTRESPONSE']._serialized_end=1593
- _globals['_PROCESSINPUT']._serialized_start=1595
- _globals['_PROCESSINPUT']._serialized_end=1642
- _globals['_SENDPROCESSSIGNALREQUEST']._serialized_start=1645
- _globals['_SENDPROCESSSIGNALREQUEST']._serialized_end=1780
- _globals['_SENDPROCESSSIGNALRESPONSE']._serialized_start=1782
- _globals['_SENDPROCESSSIGNALRESPONSE']._serialized_end=1809
- _globals['_RECONNECTPROCESSREQUEST']._serialized_start=1811
- _globals['_RECONNECTPROCESSREQUEST']._serialized_end=1896
- _globals['_PROCESSSELECTOR']._serialized_start=1898
- _globals['_PROCESSSELECTOR']._serialized_end=1947
- _globals['_PROCESSSERVICE']._serialized_start=2024
- _globals['_PROCESSSERVICE']._serialized_end=2647
+ _globals['_PROCESSCONFIG']._serialized_end=382
+ _globals['_PROCESSCONFIG_ENVSENTRY']._serialized_start=327
+ _globals['_PROCESSCONFIG_ENVSENTRY']._serialized_end=382
+ _globals['_LISTPROCESSESREQUEST']._serialized_start=384
+ _globals['_LISTPROCESSESREQUEST']._serialized_end=406
+ _globals['_LISTPROCESSESRESPONSE']._serialized_start=408
+ _globals['_LISTPROCESSESRESPONSE']._serialized_end=493
+ _globals['_STARTPROCESSREQUEST']._serialized_start=496
+ _globals['_STARTPROCESSREQUEST']._serialized_end=684
+ _globals['_UPDATEPROCESSREQUEST']._serialized_start=687
+ _globals['_UPDATEPROCESSREQUEST']._serialized_end=822
+ _globals['_UPDATEPROCESSRESPONSE']._serialized_start=824
+ _globals['_UPDATEPROCESSRESPONSE']._serialized_end=847
+ _globals['_PROCESSEVENT']._serialized_start=850
+ _globals['_PROCESSEVENT']._serialized_end=1304
+ _globals['_PROCESSEVENT_STARTEVENT']._serialized_start=1055
+ _globals['_PROCESSEVENT_STARTEVENT']._serialized_end=1085
+ _globals['_PROCESSEVENT_DATAEVENT']._serialized_start=1087
+ _globals['_PROCESSEVENT_DATAEVENT']._serialized_end=1160
+ _globals['_PROCESSEVENT_ENDEVENT']._serialized_start=1163
+ _globals['_PROCESSEVENT_ENDEVENT']._serialized_end=1295
+ _globals['_STARTPROCESSRESPONSE']._serialized_start=1306
+ _globals['_STARTPROCESSRESPONSE']._serialized_end=1381
+ _globals['_RECONNECTPROCESSRESPONSE']._serialized_start=1383
+ _globals['_RECONNECTPROCESSRESPONSE']._serialized_end=1462
+ _globals['_SENDPROCESSINPUTREQUEST']._serialized_start=1465
+ _globals['_SENDPROCESSINPUTREQUEST']._serialized_end=1603
+ _globals['_SENDPROCESSINPUTRESPONSE']._serialized_start=1605
+ _globals['_SENDPROCESSINPUTRESPONSE']._serialized_end=1631
+ _globals['_PROCESSINPUT']._serialized_start=1633
+ _globals['_PROCESSINPUT']._serialized_end=1700
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST']._serialized_start=1703
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST']._serialized_end=2046
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST_STARTEVENT']._serialized_start=1899
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST_STARTEVENT']._serialized_end=1971
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST_DATAEVENT']._serialized_start=1973
+ _globals['_SENDPROCESSINPUTSTREAMREQUEST_DATAEVENT']._serialized_end=2037
+ _globals['_SENDPROCESSINPUTSTREAMRESPONSE']._serialized_start=2048
+ _globals['_SENDPROCESSINPUTSTREAMRESPONSE']._serialized_end=2080
+ _globals['_SENDPROCESSSIGNALREQUEST']._serialized_start=2083
+ _globals['_SENDPROCESSSIGNALREQUEST']._serialized_end=2218
+ _globals['_SENDPROCESSSIGNALRESPONSE']._serialized_start=2220
+ _globals['_SENDPROCESSSIGNALRESPONSE']._serialized_end=2247
+ _globals['_RECONNECTPROCESSREQUEST']._serialized_start=2249
+ _globals['_RECONNECTPROCESSREQUEST']._serialized_end=2334
+ _globals['_PROCESSSELECTOR']._serialized_start=2336
+ _globals['_PROCESSSELECTOR']._serialized_end=2385
+ _globals['_PROCESSSERVICE']._serialized_start=2462
+ _globals['_PROCESSSERVICE']._serialized_end=3210
# @@protoc_insertion_point(module_scope)
diff --git a/packages/python-sdk/envd/process/v1/process_pb2.pyi b/packages/python-sdk/envd/process/v1/process_pb2.pyi
index 9f4993c69..12139bba1 100644
--- a/packages/python-sdk/envd/process/v1/process_pb2.pyi
+++ b/packages/python-sdk/envd/process/v1/process_pb2.pyi
@@ -30,8 +30,8 @@ class PTY(_message.Message):
def __init__(self, size: _Optional[_Union[PTY.Size, _Mapping]] = ...) -> None: ...
class ProcessConfig(_message.Message):
- __slots__ = ("cmd", "args", "env", "cwd")
- class EnvEntry(_message.Message):
+ __slots__ = ("cmd", "args", "envs", "cwd")
+ class EnvsEntry(_message.Message):
__slots__ = ("key", "value")
KEY_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
@@ -40,13 +40,13 @@ class ProcessConfig(_message.Message):
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
CMD_FIELD_NUMBER: _ClassVar[int]
ARGS_FIELD_NUMBER: _ClassVar[int]
- ENV_FIELD_NUMBER: _ClassVar[int]
+ ENVS_FIELD_NUMBER: _ClassVar[int]
CWD_FIELD_NUMBER: _ClassVar[int]
cmd: str
args: _containers.RepeatedScalarFieldContainer[str]
- env: _containers.ScalarMap[str, str]
+ envs: _containers.ScalarMap[str, str]
cwd: str
- def __init__(self, cmd: _Optional[str] = ..., args: _Optional[_Iterable[str]] = ..., env: _Optional[_Mapping[str, str]] = ..., cwd: _Optional[str] = ...) -> None: ...
+ def __init__(self, cmd: _Optional[str] = ..., args: _Optional[_Iterable[str]] = ..., envs: _Optional[_Mapping[str, str]] = ..., cwd: _Optional[str] = ...) -> None: ...
class ListProcessesRequest(_message.Message):
__slots__ = ()
@@ -95,12 +95,16 @@ class ProcessEvent(_message.Message):
stderr: bytes
def __init__(self, stdout: _Optional[bytes] = ..., stderr: _Optional[bytes] = ...) -> None: ...
class EndEvent(_message.Message):
- __slots__ = ("exit_code", "error")
+ __slots__ = ("exit_code", "terminated", "status", "error")
EXIT_CODE_FIELD_NUMBER: _ClassVar[int]
+ TERMINATED_FIELD_NUMBER: _ClassVar[int]
+ STATUS_FIELD_NUMBER: _ClassVar[int]
ERROR_FIELD_NUMBER: _ClassVar[int]
exit_code: int
+ terminated: bool
+ status: str
error: str
- def __init__(self, exit_code: _Optional[int] = ..., error: _Optional[str] = ...) -> None: ...
+ def __init__(self, exit_code: _Optional[int] = ..., terminated: bool = ..., status: _Optional[str] = ..., error: _Optional[str] = ...) -> None: ...
START_FIELD_NUMBER: _ClassVar[int]
DATA_FIELD_NUMBER: _ClassVar[int]
END_FIELD_NUMBER: _ClassVar[int]
@@ -134,10 +138,34 @@ class SendProcessInputResponse(_message.Message):
def __init__(self) -> None: ...
class ProcessInput(_message.Message):
- __slots__ = ("stdin",)
+ __slots__ = ("stdin", "tty")
STDIN_FIELD_NUMBER: _ClassVar[int]
+ TTY_FIELD_NUMBER: _ClassVar[int]
stdin: bytes
- def __init__(self, stdin: _Optional[bytes] = ...) -> None: ...
+ tty: bytes
+ def __init__(self, stdin: _Optional[bytes] = ..., tty: _Optional[bytes] = ...) -> None: ...
+
+class SendProcessInputStreamRequest(_message.Message):
+ __slots__ = ("start", "data")
+ class StartEvent(_message.Message):
+ __slots__ = ("process",)
+ PROCESS_FIELD_NUMBER: _ClassVar[int]
+ process: ProcessSelector
+ def __init__(self, process: _Optional[_Union[ProcessSelector, _Mapping]] = ...) -> None: ...
+ class DataEvent(_message.Message):
+ __slots__ = ("input",)
+ INPUT_FIELD_NUMBER: _ClassVar[int]
+ input: ProcessInput
+ def __init__(self, input: _Optional[_Union[ProcessInput, _Mapping]] = ...) -> None: ...
+ START_FIELD_NUMBER: _ClassVar[int]
+ DATA_FIELD_NUMBER: _ClassVar[int]
+ start: SendProcessInputStreamRequest.StartEvent
+ data: SendProcessInputStreamRequest.DataEvent
+ def __init__(self, start: _Optional[_Union[SendProcessInputStreamRequest.StartEvent, _Mapping]] = ..., data: _Optional[_Union[SendProcessInputStreamRequest.DataEvent, _Mapping]] = ...) -> None: ...
+
+class SendProcessInputStreamResponse(_message.Message):
+ __slots__ = ()
+ def __init__(self) -> None: ...
class SendProcessSignalRequest(_message.Message):
__slots__ = ("process", "signal")
diff --git a/spec/envd/envd.yml b/spec/envd/envd.yaml
similarity index 61%
rename from spec/envd/envd.yml
rename to spec/envd/envd.yaml
index 66a377989..04c69f9da 100644
--- a/spec/envd/envd.yml
+++ b/spec/envd/envd.yaml
@@ -1,19 +1,14 @@
-# TODO: Way to auth read and write request for specific user+sandbox — system for generating signed upload urls?
-# TODO: Append
-# TODO: Add defaults
-# TODO: Basic auth also
-
openapi: 3.0.0
info:
title: envd
version: 0.1.0
- description: API for managing files content and controlling the envd
+ description: API for managing files' content and controlling envd
servers:
- url: /v1
paths:
- /sync:
+ /host/sync:
post:
summary: Ensure the time and metadata is synced with the host
responses:
@@ -31,26 +26,20 @@ paths:
500:
$ref: "#/components/responses/InternalServerError"
- /files:
+ /filesystem/files/{path}:
get:
- summary: Download a file or a specific byte range
+ summary: Download a file
parameters:
- $ref: "#/components/parameters/FilePath"
- - $ref: "#/components/parameters/Range"
responses:
200:
$ref: "#/components/responses/DownloadSuccess"
- 206:
- $ref: "#/components/responses/RangeDownloadSuccess"
400:
$ref: "#/components/responses/DirectoryPathError"
- 416:
- $ref: "#/components/responses/RangeNotSatisfiableError"
put:
- summary: Upload a file or a specific byte range
+ summary: Upload a file
parameters:
- $ref: "#/components/parameters/FilePath"
- - $ref: "#/components/parameters/Range"
- $ref: "#/components/parameters/User"
- $ref: "#/components/parameters/Mode"
- $ref: "#/components/parameters/Overwrite"
@@ -65,25 +54,9 @@ paths:
$ref: "#/components/responses/ConflictError"
400:
$ref: "#/components/responses/DirectoryPathError"
- 416:
- $ref: "#/components/responses/RangeNotSatisfiableError"
components:
parameters:
- Location:
- name: Location
- in: header
- description: The URL of the uploaded file
- schema:
- type: string
- format: uri
- ContentRange:
- name: Content-Range
- in: header
- description: The range of bytes returned up
- schema:
- type: string
- pattern: '^bytes=\d*-\d*(,\d*-\d*)*|bytes \d*-\d*/\d+$'
FilePath:
name: path
in: path
@@ -92,32 +65,26 @@ components:
description: Absolute path to the file, URL encoded.
schema:
type: string
- Range:
- name: Range
- in: header
- required: false
- description: Byte range for downloading or uploading a file, formatted as "bytes=start-end" for downloads and "bytes=start-end/total" for uploads.
- schema:
- type: string
- pattern: '^bytes=\d*-\d*(,\d*-\d*)*|bytes \d*-\d*/\d+$'
User:
name: User
- in: header
+ in: query
required: false
description: User owning the file
schema:
type: string
+ default: "root"
Mode:
name: Mode
- in: header
+ in: query
required: false
description: File permissions in octal format (e.g., 0755)
schema:
type: string
pattern: "^[0-7]{3,4}$"
+ default: "0777"
Overwrite:
name: overwrite
- in: header
+ in: query
required: false
description: Overwrite the file if it exists
schema:
@@ -140,31 +107,29 @@ components:
ExistingFileUploadSuccess:
description: The file was updated successfully.
headers:
- Content-Range:
- required: false
- $ref: "#/components/parameters/ContentRange"
+ Cache-Control:
+ schema:
+ type: string
+ example: "no-cache, no-store"
NewFileUploadSuccess:
description: The file was created successfully.
headers:
+ Cache-Control:
+ schema:
+ type: string
+ example: "no-cache, no-store"
Location:
- $ref: "#/components/parameters/Location"
- Content-Range:
- required: false
- $ref: "#/components/parameters/ContentRange"
+ description: The URL of the uploaded file
+ schema:
+ type: string
+ format: path
DownloadSuccess:
description: Entire file downloaded successfully.
- content:
- application/octet-stream:
+ headers:
+ Cache-Control:
schema:
type: string
- format: binary
- description: The file content
- RangeDownloadSuccess:
- description: Specified byte range(s) of the file downloaded successfully.
- headers:
- Content-Range:
- required: true
- $ref: "#/components/parameters/ContentRange"
+ example: "no-cache, no-store"
content:
application/octet-stream:
schema:
@@ -177,12 +142,6 @@ components:
application/json:
schema:
$ref: "#/components/schemas/Error"
- RangeNotSatisfiableError:
- description: Requested Range Not Satisfiable - The specified byte range is outside the size of the file, or the Range header is formatted incorrectly.
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Error"
ConflictError:
description: Conflict - The file already exists and overwrite is false.
content:
diff --git a/spec/envd/filesystem/v1/filesystem.proto b/spec/envd/filesystem/v1/filesystem.proto
index 2526bb910..becb441f3 100644
--- a/spec/envd/filesystem/v1/filesystem.proto
+++ b/spec/envd/filesystem/v1/filesystem.proto
@@ -9,8 +9,6 @@ package envd.filesystem.v1;
service FilesystemService {
rpc Stat(StatRequest) returns (StatResponse);
- rpc CreateFile(CreateFileRequest) returns (CreateFileResponse);
-
rpc CreateDir(CreateDirRequest) returns (CreateDirResponse);
rpc ListDir(ListDirRequest) returns (ListDirResponse);
@@ -21,20 +19,8 @@ service FilesystemService {
rpc Copy(CopyRequest) returns (CopyResponse);
}
-message CreateFileRequest {
- string path = 1;
- bool create_parents = 2;
-
- string mode = 3;
-
- envd.permissions.v1.Credentials owner = 4;
-}
-
-message CreateFileResponse {}
-
message CreateDirRequest {
string path = 1;
- bool create_parents = 2;
string mode = 3;
@@ -47,9 +33,7 @@ message CopyRequest {
string source = 1;
string destination = 2;
- bool recursive = 3;
-
- envd.permissions.v1.Credentials owner = 4;
+ string mode = 3;
}
message CopyResponse {}
@@ -73,8 +57,6 @@ message RemoveResponse {}
message RenameRequest {
string source = 1;
string destination = 2;
-
- envd.permissions.v1.Credentials owner = 4;
}
message RenameResponse {}
@@ -82,16 +64,12 @@ message RenameResponse {}
message EntryInfo {
string name = 1;
FileType type = 2;
-
- envd.permissions.v1.Credentials owner = 6;
}
enum FileType {
FILE_TYPE_UNSPECIFIED = 0;
FILE_TYPE_FILE = 1;
FILE_TYPE_DIRECTORY = 2;
- FILE_TYPE_LINK = 3;
- FILE_TYPE_SYMLINK = 4;
}
message ListDirRequest {
@@ -113,7 +91,6 @@ message WatchResponse {
message FilesystemEvent {
string path = 1;
EventType type = 2;
- EntryInfo entry = 3;
}
enum EventType {
diff --git a/spec/envd/network/v1/network.proto b/spec/envd/network/v1/network.proto
deleted file mode 100644
index 414e1405a..000000000
--- a/spec/envd/network/v1/network.proto
+++ /dev/null
@@ -1,39 +0,0 @@
-syntax = "proto3";
-
-import "envd/permissions/v1/permissions.proto";
-
-package envd.network.v1;
-
-service NetworkService {
- rpc ListPorts(ListPortsRequest) returns (ListPortsResponse);
- rpc WatchPorts(WatchPortsRequest) returns (stream WatchPortsResponse);
-}
-
-message ListPortsRequest {}
-
-message ListPortsResponse {
- repeated Port ports = 1;
-}
-
-message WatchPortsRequest {
- PortFilter filter = 1;
-}
-
-message PortFilter {
- repeated uint32 ports = 1;
-}
-
-message WatchPortsResponse {
- Port event = 1;
-}
-
-message Port {
- uint32 port = 1;
- PortState state = 2;
-}
-
-enum PortState {
- PORT_STATE_UNSPECIFIED = 0;
- PORT_STATE_OPEN = 1;
- PORT_STATE_CLOSED = 2;
-}
\ No newline at end of file
diff --git a/spec/envd/permissions/v1/permissions.proto b/spec/envd/permissions/v1/permissions.proto
index f62c9d073..aa7580153 100644
--- a/spec/envd/permissions/v1/permissions.proto
+++ b/spec/envd/permissions/v1/permissions.proto
@@ -4,6 +4,6 @@ package envd.permissions.v1;
message Credentials {
oneof credentials {
- string user = 1;
+ string username = 1;
}
}
diff --git a/spec/envd/process/v1/process.proto b/spec/envd/process/v1/process.proto
index b6e7be182..c8128a9f0 100644
--- a/spec/envd/process/v1/process.proto
+++ b/spec/envd/process/v1/process.proto
@@ -12,6 +12,8 @@ service ProcessService {
rpc UpdateProcess(UpdateProcessRequest) returns (UpdateProcessResponse);
+ // Client input stream ensures ordering of messages
+ rpc SendProcessInputStream(stream SendProcessInputStreamRequest) returns (SendProcessInputStreamResponse);
rpc SendProcessInput(SendProcessInputRequest) returns (SendProcessInputResponse);
rpc SendProcessSignal(SendProcessSignalRequest) returns (SendProcessSignalResponse);
}
@@ -29,7 +31,7 @@ message ProcessConfig {
string cmd = 1;
repeated string args = 2;
- map<string, string> env = 3;
+ map<string, string> envs = 3;
string cwd = 4;
}
@@ -55,24 +57,28 @@ message UpdateProcessRequest {
message UpdateProcessResponse {}
message ProcessEvent {
- oneof event_type {
+ oneof event {
StartEvent start = 1;
DataEvent data = 2;
EndEvent end = 3;
}
message StartEvent {
- uint32 pid = 5;
+ uint32 pid = 1;
}
message DataEvent {
- optional bytes stdout = 6;
- optional bytes stderr = 7;
+ oneof output {
+ bytes stdout = 1;
+ bytes stderr = 2;
+ }
}
message EndEvent {
- sint32 exit_code = 8;
- optional string error = 9;
+ sint32 exit_code = 1;
+ bool terminated = 2;
+ string status = 3;
+ optional string error = 4;
}
}
@@ -95,13 +101,31 @@ message SendProcessInputResponse {}
message ProcessInput {
oneof input {
bytes stdin = 1;
+ bytes tty = 2;
}
}
+message SendProcessInputStreamRequest {
+ oneof event {
+ StartEvent start = 1;
+ DataEvent data = 2;
+ }
+
+ message StartEvent {
+ ProcessSelector process = 1;
+ }
+
+ message DataEvent {
+ ProcessInput input = 2;
+ }
+}
+
+message SendProcessInputStreamResponse {}
+
enum Signal {
SIGNAL_UNSPECIFIED = 0;
- SIGNAL_SIGTERM = 1;
- SIGNAL_SIGKILL = 2;
+ SIGNAL_SIGTERM = 15;
+ SIGNAL_SIGKILL = 9;
}
message SendProcessSignalRequest {
diff --git a/spec/openapi.yml b/spec/openapi.yml
new file mode 100644
index 000000000..d995aecb1
--- /dev/null
+++ b/spec/openapi.yml
@@ -0,0 +1,567 @@
+openapi: 3.0.0
+info:
+ version: 0.1.0
+ title: E2B API
+
+servers:
+ - url: https://api.e2b.dev
+
+components:
+ securitySchemes:
+ ApiKeyAuth:
+ type: apiKey
+ in: header
+ name: X-API-Key
+ AccessTokenAuth:
+ type: http
+ scheme: bearer
+ bearerFormat: access_token
+
+ parameters:
+ templateID:
+ name: templateID
+ in: path
+ required: true
+ schema:
+ type: string
+ buildID:
+ name: buildID
+ in: path
+ required: true
+ schema:
+ type: string
+ sandboxID:
+ name: sandboxID
+ in: path
+ required: true
+ schema:
+ type: string
+
+ responses:
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ 401:
+ description: Authentication error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ 404:
+ description: Not found
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+
+ 500:
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+
+ schemas:
+ CPUCount:
+ type: integer
+ format: int32
+ minimum: 1
+ maximum: 8
+ description: CPU cores for the sandbox
+
+ MemoryMB:
+ type: integer
+ format: int32
+ minimum: 128
+ maximum: 8192
+ description: Memory for the sandbox in MB
+
+ SandboxMetadata:
+ additionalProperties:
+ type: string
+ description: Metadata of the sandbox
+
+ SandboxLog:
+ description: Log entry with timestamp and line
+ required:
+ - timestamp
+ - line
+ properties:
+ timestamp:
+ type: string
+ format: date-time
+ description: Timestamp of the log entry
+ line:
+ type: string
+ description: Log line content
+
+ SandboxLogs:
+ required:
+ - logs
+ properties:
+ logs:
+ description: Logs of the sandbox
+ type: array
+ items:
+ $ref: "#/components/schemas/SandboxLog"
+
+ Sandbox:
+ required:
+ - templateID
+ - sandboxID
+ - clientID
+ properties:
+ templateID:
+ type: string
+ description: Identifier of the template from which is the sandbox created
+ sandboxID:
+ type: string
+ description: Identifier of the sandbox
+ alias:
+ type: string
+ description: Alias of the template
+ clientID:
+ type: string
+ description: Identifier of the client
+
+ RunningSandbox:
+ required:
+ - templateID
+ - sandboxID
+ - clientID
+ - startedAt
+ - cpuCount
+ - memoryMB
+ properties:
+ templateID:
+ type: string
+ description: Identifier of the template from which is the sandbox created
+ alias:
+ type: string
+ description: Alias of the template
+ sandboxID:
+ type: string
+ description: Identifier of the sandbox
+ clientID:
+ type: string
+ description: Identifier of the client
+ startedAt:
+ type: string
+ format: date-time
+ description: Time when the sandbox was started
+ cpuCount:
+ $ref: "#/components/schemas/CPUCount"
+ memoryMB:
+ $ref: "#/components/schemas/MemoryMB"
+ metadata:
+ $ref: "#/components/schemas/SandboxMetadata"
+
+ NewSandbox:
+ required:
+ - templateID
+ properties:
+ templateID:
+ type: string
+ description: Identifier of the required template
+ timeout:
+ type: integer
+ format: int32
+ minimum: 0
+ description: Time to live for the sandbox in seconds.
+ metadata:
+ $ref: "#/components/schemas/SandboxMetadata"
+
+ Template:
+ required:
+ - templateID
+ - buildID
+ - cpuCount
+ - memoryMB
+ - public
+ properties:
+ templateID:
+ type: string
+ description: Identifier of the template
+ buildID:
+ type: string
+ description: Identifier of the last successful build for given template
+ cpuCount:
+ $ref: "#/components/schemas/CPUCount"
+ memoryMB:
+ $ref: "#/components/schemas/MemoryMB"
+ public:
+ type: boolean
+ description: Whether the template is public or only accessible by the team
+ aliases:
+ type: array
+ description: Aliases of the template
+ items:
+ type: string
+
+ TemplateBuildRequest:
+ required:
+ - dockerfile
+ properties:
+ alias:
+ description: Alias of the template
+ type: string
+ dockerfile:
+ description: Dockerfile for the template
+ type: string
+ startCmd:
+ description: Start command to execute in the template after the build
+ type: string
+ cpuCount:
+ $ref: "#/components/schemas/CPUCount"
+ memoryMB:
+ $ref: "#/components/schemas/MemoryMB"
+
+ TemplateBuild:
+ required:
+ - templateID
+ - buildID
+ - status
+ - logs
+ properties:
+ logs:
+ default: []
+ description: Build logs
+ type: array
+ items:
+ type: string
+ templateID:
+ type: string
+ description: Identifier of the template
+ buildID:
+ type: string
+ description: Identifier of the build
+ status:
+ type: string
+ description: Status of the template
+ enum:
+ - building
+ - ready
+ - error
+
+ Error:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ description: Error code
+ message:
+ type: string
+ description: Error
+
+tags:
+ - name: templates
+ - name: sandboxes
+
+paths:
+ /health:
+ get:
+ description: Health check
+ responses:
+ 200:
+ description: Request was successful
+ 401:
+ $ref: "#/components/responses/401"
+
+ /sandboxes:
+ get:
+ description: List all running sandboxes
+ tags: [sandboxes]
+ security:
+ - ApiKeyAuth: []
+ responses:
+ 200:
+ description: Successfully returned all running sandboxes
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ allOf:
+ - $ref: "#/components/schemas/RunningSandbox"
+ 401:
+ $ref: "#/components/responses/401"
+ 400:
+ $ref: "#/components/responses/400"
+ 500:
+ $ref: "#/components/responses/500"
+ post:
+ description: Create a sandbox from the template
+ tags: [sandboxes]
+ security:
+ - ApiKeyAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/NewSandbox"
+ responses:
+ 201:
+ description: The sandbox was created successfully
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Sandbox"
+ 401:
+ $ref: "#/components/responses/401"
+ 400:
+ $ref: "#/components/responses/400"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /sandboxes/{sandboxID}/logs:
+ get:
+ description: Get sandbox logs
+ tags: [sandboxes]
+ security:
+ - ApiKeyAuth: []
+ parameters:
+ - $ref: "#/components/parameters/sandboxID"
+ - in: query
+ name: start
+ schema:
+ type: integer
+ format: int64
+ minimum: 0
+ description: Starting timestamp of the logs that should be returned in milliseconds
+ - in: query
+ name: limit
+ schema:
+ default: 1000
+ format: int32
+ minimum: 0
+ type: integer
+ description: Maximum number of logs that should be returned
+ responses:
+ 200:
+ description: Successfully returned the sandbox logs
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/SandboxLogs"
+ 404:
+ $ref: "#/components/responses/404"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /sandboxes/{sandboxID}:
+ delete:
+ description: Kill a sandbox
+ tags: [sandboxes]
+ security:
+ - ApiKeyAuth: []
+ parameters:
+ - $ref: "#/components/parameters/sandboxID"
+ responses:
+ 204:
+ description: The sandbox was killed successfully
+ 404:
+ $ref: "#/components/responses/404"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /sandboxes/{sandboxID}/timeout:
+ post:
+ description: Set the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each time using the current timestamp as the starting point to measure the timeout duration.
+ security:
+ - ApiKeyAuth: []
+ tags: [sandboxes]
+ requestBody:
+ required: false
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ duration:
+ description: Duration in seconds from the current time after which the sandbox should expire
+ type: integer
+ format: int32
+ minimum: 0
+ parameters:
+ - $ref: "#/components/parameters/sandboxID"
+ responses:
+ 204:
+ description: Successfully set the sandbox timeout
+ 401:
+ $ref: "#/components/responses/401"
+ 404:
+ $ref: "#/components/responses/404"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /sandboxes/{sandboxID}/refreshes:
+ post:
+ description: Refresh the sandbox extending its time to live
+ security:
+ - ApiKeyAuth: []
+ tags: [sandboxes]
+ requestBody:
+ required: false
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ duration:
+ description: Duration for which the sandbox should be kept alive in seconds
+ type: integer
+ maximum: 3600 # 1 hour
+ minimum: 0
+ parameters:
+ - $ref: "#/components/parameters/sandboxID"
+ responses:
+ 204:
+ description: Successfully refreshed the sandbox
+ 401:
+ $ref: "#/components/responses/401"
+ 404:
+ $ref: "#/components/responses/404"
+
+ /templates:
+ get:
+ description: List all templates
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ responses:
+ 200:
+ description: Successfully returned all templates
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ allOf:
+ - $ref: "#/components/schemas/Template"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+ post:
+ description: Create a new template
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/TemplateBuildRequest"
+
+ responses:
+ 202:
+ description: The build was accepted
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Template"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /templates/{templateID}:
+ post:
+ description: Rebuild an template
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ parameters:
+ - $ref: "#/components/parameters/templateID"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/TemplateBuildRequest"
+
+ responses:
+ 202:
+ description: The build was accepted
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Template"
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+ delete:
+ description: Delete a template
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ parameters:
+ - $ref: "#/components/parameters/templateID"
+ responses:
+ 204:
+ description: The template was deleted successfully
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /templates/{templateID}/builds/{buildID}:
+ post:
+ description: Start the build
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ parameters:
+ - $ref: "#/components/parameters/templateID"
+ - $ref: "#/components/parameters/buildID"
+ responses:
+ 202:
+ description: The build has started
+ 401:
+ $ref: "#/components/responses/401"
+ 500:
+ $ref: "#/components/responses/500"
+
+ /templates/{templateID}/builds/{buildID}/status:
+ get:
+ description: Get template build info
+ tags: [templates]
+ security:
+ - AccessTokenAuth: []
+ parameters:
+ - $ref: "#/components/parameters/templateID"
+ - $ref: "#/components/parameters/buildID"
+ - in: query
+ name: logsOffset
+ schema:
+ default: 0
+ type: integer
+ format: int32
+ minimum: 0
+ description: Index of the starting build log that should be returned with the template
+ responses:
+ 200:
+ description: Successfully returned the template
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/TemplateBuild"
+ 401:
+ $ref: "#/components/responses/401"
+ 404:
+ $ref: "#/components/responses/404"
+ 500:
+ $ref: "#/components/responses/500"