agentfense 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentfense/__init__.py +191 -0
- agentfense/_async/__init__.py +21 -0
- agentfense/_async/client.py +679 -0
- agentfense/_async/sandbox.py +667 -0
- agentfense/_gen/__init__.py +0 -0
- agentfense/_gen/codebase_pb2.py +78 -0
- agentfense/_gen/codebase_pb2.pyi +141 -0
- agentfense/_gen/codebase_pb2_grpc.py +366 -0
- agentfense/_gen/common_pb2.py +47 -0
- agentfense/_gen/common_pb2.pyi +68 -0
- agentfense/_gen/common_pb2_grpc.py +24 -0
- agentfense/_gen/sandbox_pb2.py +123 -0
- agentfense/_gen/sandbox_pb2.pyi +255 -0
- agentfense/_gen/sandbox_pb2_grpc.py +678 -0
- agentfense/_shared.py +238 -0
- agentfense/client.py +751 -0
- agentfense/exceptions.py +333 -0
- agentfense/presets.py +192 -0
- agentfense/sandbox.py +672 -0
- agentfense/types.py +256 -0
- agentfense/utils.py +286 -0
- agentfense-0.2.1.dist-info/METADATA +378 -0
- agentfense-0.2.1.dist-info/RECORD +25 -0
- agentfense-0.2.1.dist-info/WHEEL +5 -0
- agentfense-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import message as _message
|
|
4
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
5
|
+
|
|
6
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
7
|
+
|
|
8
|
+
class Permission(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
9
|
+
__slots__ = ()
|
|
10
|
+
PERMISSION_UNSPECIFIED: _ClassVar[Permission]
|
|
11
|
+
PERMISSION_NONE: _ClassVar[Permission]
|
|
12
|
+
PERMISSION_VIEW: _ClassVar[Permission]
|
|
13
|
+
PERMISSION_READ: _ClassVar[Permission]
|
|
14
|
+
PERMISSION_WRITE: _ClassVar[Permission]
|
|
15
|
+
|
|
16
|
+
class PatternType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
17
|
+
__slots__ = ()
|
|
18
|
+
PATTERN_TYPE_UNSPECIFIED: _ClassVar[PatternType]
|
|
19
|
+
PATTERN_TYPE_GLOB: _ClassVar[PatternType]
|
|
20
|
+
PATTERN_TYPE_DIRECTORY: _ClassVar[PatternType]
|
|
21
|
+
PATTERN_TYPE_FILE: _ClassVar[PatternType]
|
|
22
|
+
|
|
23
|
+
class SandboxStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
24
|
+
__slots__ = ()
|
|
25
|
+
SANDBOX_STATUS_UNSPECIFIED: _ClassVar[SandboxStatus]
|
|
26
|
+
SANDBOX_STATUS_PENDING: _ClassVar[SandboxStatus]
|
|
27
|
+
SANDBOX_STATUS_RUNNING: _ClassVar[SandboxStatus]
|
|
28
|
+
SANDBOX_STATUS_STOPPED: _ClassVar[SandboxStatus]
|
|
29
|
+
SANDBOX_STATUS_ERROR: _ClassVar[SandboxStatus]
|
|
30
|
+
|
|
31
|
+
class SessionStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
32
|
+
__slots__ = ()
|
|
33
|
+
SESSION_STATUS_UNSPECIFIED: _ClassVar[SessionStatus]
|
|
34
|
+
SESSION_STATUS_ACTIVE: _ClassVar[SessionStatus]
|
|
35
|
+
SESSION_STATUS_CLOSED: _ClassVar[SessionStatus]
|
|
36
|
+
PERMISSION_UNSPECIFIED: Permission
|
|
37
|
+
PERMISSION_NONE: Permission
|
|
38
|
+
PERMISSION_VIEW: Permission
|
|
39
|
+
PERMISSION_READ: Permission
|
|
40
|
+
PERMISSION_WRITE: Permission
|
|
41
|
+
PATTERN_TYPE_UNSPECIFIED: PatternType
|
|
42
|
+
PATTERN_TYPE_GLOB: PatternType
|
|
43
|
+
PATTERN_TYPE_DIRECTORY: PatternType
|
|
44
|
+
PATTERN_TYPE_FILE: PatternType
|
|
45
|
+
SANDBOX_STATUS_UNSPECIFIED: SandboxStatus
|
|
46
|
+
SANDBOX_STATUS_PENDING: SandboxStatus
|
|
47
|
+
SANDBOX_STATUS_RUNNING: SandboxStatus
|
|
48
|
+
SANDBOX_STATUS_STOPPED: SandboxStatus
|
|
49
|
+
SANDBOX_STATUS_ERROR: SandboxStatus
|
|
50
|
+
SESSION_STATUS_UNSPECIFIED: SessionStatus
|
|
51
|
+
SESSION_STATUS_ACTIVE: SessionStatus
|
|
52
|
+
SESSION_STATUS_CLOSED: SessionStatus
|
|
53
|
+
|
|
54
|
+
class PermissionRule(_message.Message):
|
|
55
|
+
__slots__ = ("pattern", "type", "permission", "priority")
|
|
56
|
+
PATTERN_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
+
PERMISSION_FIELD_NUMBER: _ClassVar[int]
|
|
59
|
+
PRIORITY_FIELD_NUMBER: _ClassVar[int]
|
|
60
|
+
pattern: str
|
|
61
|
+
type: PatternType
|
|
62
|
+
permission: Permission
|
|
63
|
+
priority: int
|
|
64
|
+
def __init__(self, pattern: _Optional[str] = ..., type: _Optional[_Union[PatternType, str]] = ..., permission: _Optional[_Union[Permission, str]] = ..., priority: _Optional[int] = ...) -> None: ...
|
|
65
|
+
|
|
66
|
+
class Empty(_message.Message):
|
|
67
|
+
__slots__ = ()
|
|
68
|
+
def __init__(self) -> None: ...
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
GRPC_GENERATED_VERSION = '1.76.0'
|
|
8
|
+
GRPC_VERSION = grpc.__version__
|
|
9
|
+
_version_not_supported = False
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from grpc._utilities import first_version_is_lower
|
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
14
|
+
except ImportError:
|
|
15
|
+
_version_not_supported = True
|
|
16
|
+
|
|
17
|
+
if _version_not_supported:
|
|
18
|
+
raise RuntimeError(
|
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
20
|
+
+ ' but the generated code in common_pb2_grpc.py depends on'
|
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
24
|
+
)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: sandbox.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'sandbox.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
|
|
26
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
27
|
+
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
|
|
28
|
+
from . import common_pb2 as common__pb2
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rsandbox.proto\x12\nsandbox.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x0c\x63ommon.proto\"a\n\x0eResourceLimits\x12\x14\n\x0cmemory_bytes\x18\x01 \x01(\x03\x12\x11\n\tcpu_quota\x18\x02 \x01(\x03\x12\x12\n\ncpu_shares\x18\x03 \x01(\x03\x12\x12\n\npids_limit\x18\x04 \x01(\x03\"\x8e\x04\n\x07Sandbox\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x63odebase_id\x18\x02 \x01(\t\x12/\n\x0bpermissions\x18\x03 \x03(\x0b\x32\x1a.sandbox.v1.PermissionRule\x12)\n\x06status\x18\x04 \x01(\x0e\x32\x19.sandbox.v1.SandboxStatus\x12/\n\x06labels\x18\x05 \x03(\x0b\x32\x1f.sandbox.v1.Sandbox.LabelsEntry\x12.\n\ncreated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstarted_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstopped_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nexpires_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12(\n\x07runtime\x18\n \x01(\x0e\x32\x17.sandbox.v1.RuntimeType\x12\r\n\x05image\x18\x0b \x01(\t\x12-\n\tresources\x18\x0c \x01(\x0b\x32\x1a.sandbox.v1.ResourceLimits\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe0\x02\n\x14\x43reateSandboxRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12/\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x1a.sandbox.v1.PermissionRule\x12-\n\nexpires_in\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12<\n\x06labels\x18\x04 \x03(\x0b\x32,.sandbox.v1.CreateSandboxRequest.LabelsEntry\x12(\n\x07runtime\x18\x05 \x01(\x0e\x32\x17.sandbox.v1.RuntimeType\x12\r\n\x05image\x18\x06 \x01(\t\x12-\n\tresources\x18\x07 \x01(\x0b\x32\x1a.sandbox.v1.ResourceLimits\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\'\n\x11GetSandboxRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\"R\n\x14ListSandboxesRequest\x12\x13\n\x0b\x63odebase_id\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"X\n\x15ListSandboxesResponse\x12&\n\tsandboxes\x18\x01 \x03(\x0b\x32\x13.sandbox.v1.Sandbox\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\")\n\x13StartSandboxRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\"(\n\x12StopSandboxRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\"+\n\x15\x44\x65stroySandboxRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\"\xd9\x01\n\x0b\x45xecRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\x12\x0f\n\x07\x63ommand\x18\x02 \x01(\t\x12\r\n\x05stdin\x18\x03 \x01(\t\x12-\n\x03\x65nv\x18\x04 \x03(\x0b\x32 .sandbox.v1.ExecRequest.EnvEntry\x12\x0f\n\x07workdir\x18\x05 \x01(\t\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"l\n\nExecResult\x12\x0e\n\x06stdout\x18\x01 \x01(\t\x12\x0e\n\x06stderr\x18\x02 \x01(\t\x12\x11\n\texit_code\x18\x03 \x01(\x05\x12+\n\x08\x64uration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xa6\x01\n\nExecOutput\x12/\n\x04type\x18\x01 \x01(\x0e\x32!.sandbox.v1.ExecOutput.OutputType\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"Y\n\nOutputType\x12\x1b\n\x17OUTPUT_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OUTPUT_TYPE_STDOUT\x10\x01\x12\x16\n\x12OUTPUT_TYPE_STDERR\x10\x02\"\xc2\x01\n\x07Session\x12\n\n\x02id\x18\x01 \x01(\t\x12\x12\n\nsandbox_id\x18\x02 \x01(\t\x12)\n\x06status\x18\x03 \x01(\x0e\x32\x19.sandbox.v1.SessionStatus\x12\r\n\x05shell\x18\x04 \x01(\t\x12.\n\ncreated_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tclosed_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x9d\x01\n\x14\x43reateSessionRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\x12\r\n\x05shell\x18\x02 \x01(\t\x12\x36\n\x03\x65nv\x18\x03 \x03(\x0b\x32).sandbox.v1.CreateSessionRequest.EnvEntry\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\'\n\x11GetSessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\")\n\x13ListSessionsRequest\x12\x12\n\nsandbox_id\x18\x01 \x01(\t\"=\n\x14ListSessionsResponse\x12%\n\x08sessions\x18\x01 \x03(\x0b\x32\x13.sandbox.v1.Session\"+\n\x15\x44\x65stroySessionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\"e\n\x12SessionExecRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0f\n\x07\x63ommand\x18\x02 \x01(\t\x12*\n\x07timeout\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration*\\\n\x0bRuntimeType\x12\x1c\n\x18RUNTIME_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12RUNTIME_TYPE_BWRAP\x10\x01\x12\x17\n\x13RUNTIME_TYPE_DOCKER\x10\x02\x32\xbd\x0b\n\x0eSandboxService\x12`\n\rCreateSandbox\x12 .sandbox.v1.CreateSandboxRequest\x1a\x13.sandbox.v1.Sandbox\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/v1/sandboxes:\x01*\x12\x64\n\nGetSandbox\x12\x1d.sandbox.v1.GetSandboxRequest\x1a\x13.sandbox.v1.Sandbox\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/sandboxes/{sandbox_id}\x12k\n\rListSandboxes\x12 .sandbox.v1.ListSandboxesRequest\x1a!.sandbox.v1.ListSandboxesResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/v1/sandboxes\x12n\n\x0cStartSandbox\x12\x1f.sandbox.v1.StartSandboxRequest\x1a\x13.sandbox.v1.Sandbox\"(\x82\xd3\xe4\x93\x02\"\" /v1/sandboxes/{sandbox_id}/start\x12k\n\x0bStopSandbox\x12\x1e.sandbox.v1.StopSandboxRequest\x1a\x13.sandbox.v1.Sandbox\"\'\x82\xd3\xe4\x93\x02!\"\x1f/v1/sandboxes/{sandbox_id}/stop\x12j\n\x0e\x44\x65stroySandbox\x12!.sandbox.v1.DestroySandboxRequest\x1a\x11.sandbox.v1.Empty\"\"\x82\xd3\xe4\x93\x02\x1c*\x1a/v1/sandboxes/{sandbox_id}\x12\x63\n\x04\x45xec\x12\x17.sandbox.v1.ExecRequest\x1a\x16.sandbox.v1.ExecResult\"*\x82\xd3\xe4\x93\x02$\"\x1f/v1/sandboxes/{sandbox_id}/exec:\x01*\x12?\n\nExecStream\x12\x17.sandbox.v1.ExecRequest\x1a\x16.sandbox.v1.ExecOutput0\x01\x12v\n\rCreateSession\x12 .sandbox.v1.CreateSessionRequest\x1a\x13.sandbox.v1.Session\".\x82\xd3\xe4\x93\x02(\"#/v1/sandboxes/{sandbox_id}/sessions:\x01*\x12\x63\n\nGetSession\x12\x1d.sandbox.v1.GetSessionRequest\x1a\x13.sandbox.v1.Session\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/sessions/{session_id}\x12~\n\x0cListSessions\x12\x1f.sandbox.v1.ListSessionsRequest\x1a .sandbox.v1.ListSessionsResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/sandboxes/{sandbox_id}/sessions\x12i\n\x0e\x44\x65stroySession\x12!.sandbox.v1.DestroySessionRequest\x1a\x11.sandbox.v1.Empty\"!\x82\xd3\xe4\x93\x02\x1b*\x19/v1/sessions/{session_id}\x12p\n\x0bSessionExec\x12\x1e.sandbox.v1.SessionExecRequest\x1a\x16.sandbox.v1.ExecResult\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/sessions/{session_id}/exec:\x01*\x12M\n\x11SessionExecStream\x12\x1e.sandbox.v1.SessionExecRequest\x1a\x16.sandbox.v1.ExecOutput0\x01\x42=Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1b\x06proto3')
|
|
32
|
+
|
|
33
|
+
_globals = globals()
|
|
34
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
35
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'sandbox_pb2', _globals)
|
|
36
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
37
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
38
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z;github.com/AjaxZhan/AgentFense/api/gen/sandbox/v1;sandboxv1'
|
|
39
|
+
_globals['_SANDBOX_LABELSENTRY']._loaded_options = None
|
|
40
|
+
_globals['_SANDBOX_LABELSENTRY']._serialized_options = b'8\001'
|
|
41
|
+
_globals['_CREATESANDBOXREQUEST_LABELSENTRY']._loaded_options = None
|
|
42
|
+
_globals['_CREATESANDBOXREQUEST_LABELSENTRY']._serialized_options = b'8\001'
|
|
43
|
+
_globals['_EXECREQUEST_ENVENTRY']._loaded_options = None
|
|
44
|
+
_globals['_EXECREQUEST_ENVENTRY']._serialized_options = b'8\001'
|
|
45
|
+
_globals['_CREATESESSIONREQUEST_ENVENTRY']._loaded_options = None
|
|
46
|
+
_globals['_CREATESESSIONREQUEST_ENVENTRY']._serialized_options = b'8\001'
|
|
47
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['CreateSandbox']._loaded_options = None
|
|
48
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['CreateSandbox']._serialized_options = b'\202\323\344\223\002\022\"\r/v1/sandboxes:\001*'
|
|
49
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['GetSandbox']._loaded_options = None
|
|
50
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['GetSandbox']._serialized_options = b'\202\323\344\223\002\034\022\032/v1/sandboxes/{sandbox_id}'
|
|
51
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['ListSandboxes']._loaded_options = None
|
|
52
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['ListSandboxes']._serialized_options = b'\202\323\344\223\002\017\022\r/v1/sandboxes'
|
|
53
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['StartSandbox']._loaded_options = None
|
|
54
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['StartSandbox']._serialized_options = b'\202\323\344\223\002\"\" /v1/sandboxes/{sandbox_id}/start'
|
|
55
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['StopSandbox']._loaded_options = None
|
|
56
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['StopSandbox']._serialized_options = b'\202\323\344\223\002!\"\037/v1/sandboxes/{sandbox_id}/stop'
|
|
57
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['DestroySandbox']._loaded_options = None
|
|
58
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['DestroySandbox']._serialized_options = b'\202\323\344\223\002\034*\032/v1/sandboxes/{sandbox_id}'
|
|
59
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['Exec']._loaded_options = None
|
|
60
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['Exec']._serialized_options = b'\202\323\344\223\002$\"\037/v1/sandboxes/{sandbox_id}/exec:\001*'
|
|
61
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['CreateSession']._loaded_options = None
|
|
62
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['CreateSession']._serialized_options = b'\202\323\344\223\002(\"#/v1/sandboxes/{sandbox_id}/sessions:\001*'
|
|
63
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['GetSession']._loaded_options = None
|
|
64
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['GetSession']._serialized_options = b'\202\323\344\223\002\033\022\031/v1/sessions/{session_id}'
|
|
65
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['ListSessions']._loaded_options = None
|
|
66
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['ListSessions']._serialized_options = b'\202\323\344\223\002%\022#/v1/sandboxes/{sandbox_id}/sessions'
|
|
67
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['DestroySession']._loaded_options = None
|
|
68
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['DestroySession']._serialized_options = b'\202\323\344\223\002\033*\031/v1/sessions/{session_id}'
|
|
69
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['SessionExec']._loaded_options = None
|
|
70
|
+
_globals['_SANDBOXSERVICE'].methods_by_name['SessionExec']._serialized_options = b'\202\323\344\223\002#\"\036/v1/sessions/{session_id}/exec:\001*'
|
|
71
|
+
_globals['_RUNTIMETYPE']._serialized_start=2617
|
|
72
|
+
_globals['_RUNTIMETYPE']._serialized_end=2709
|
|
73
|
+
_globals['_RESOURCELIMITS']._serialized_start=138
|
|
74
|
+
_globals['_RESOURCELIMITS']._serialized_end=235
|
|
75
|
+
_globals['_SANDBOX']._serialized_start=238
|
|
76
|
+
_globals['_SANDBOX']._serialized_end=764
|
|
77
|
+
_globals['_SANDBOX_LABELSENTRY']._serialized_start=719
|
|
78
|
+
_globals['_SANDBOX_LABELSENTRY']._serialized_end=764
|
|
79
|
+
_globals['_CREATESANDBOXREQUEST']._serialized_start=767
|
|
80
|
+
_globals['_CREATESANDBOXREQUEST']._serialized_end=1119
|
|
81
|
+
_globals['_CREATESANDBOXREQUEST_LABELSENTRY']._serialized_start=719
|
|
82
|
+
_globals['_CREATESANDBOXREQUEST_LABELSENTRY']._serialized_end=764
|
|
83
|
+
_globals['_GETSANDBOXREQUEST']._serialized_start=1121
|
|
84
|
+
_globals['_GETSANDBOXREQUEST']._serialized_end=1160
|
|
85
|
+
_globals['_LISTSANDBOXESREQUEST']._serialized_start=1162
|
|
86
|
+
_globals['_LISTSANDBOXESREQUEST']._serialized_end=1244
|
|
87
|
+
_globals['_LISTSANDBOXESRESPONSE']._serialized_start=1246
|
|
88
|
+
_globals['_LISTSANDBOXESRESPONSE']._serialized_end=1334
|
|
89
|
+
_globals['_STARTSANDBOXREQUEST']._serialized_start=1336
|
|
90
|
+
_globals['_STARTSANDBOXREQUEST']._serialized_end=1377
|
|
91
|
+
_globals['_STOPSANDBOXREQUEST']._serialized_start=1379
|
|
92
|
+
_globals['_STOPSANDBOXREQUEST']._serialized_end=1419
|
|
93
|
+
_globals['_DESTROYSANDBOXREQUEST']._serialized_start=1421
|
|
94
|
+
_globals['_DESTROYSANDBOXREQUEST']._serialized_end=1464
|
|
95
|
+
_globals['_EXECREQUEST']._serialized_start=1467
|
|
96
|
+
_globals['_EXECREQUEST']._serialized_end=1684
|
|
97
|
+
_globals['_EXECREQUEST_ENVENTRY']._serialized_start=1642
|
|
98
|
+
_globals['_EXECREQUEST_ENVENTRY']._serialized_end=1684
|
|
99
|
+
_globals['_EXECRESULT']._serialized_start=1686
|
|
100
|
+
_globals['_EXECRESULT']._serialized_end=1794
|
|
101
|
+
_globals['_EXECOUTPUT']._serialized_start=1797
|
|
102
|
+
_globals['_EXECOUTPUT']._serialized_end=1963
|
|
103
|
+
_globals['_EXECOUTPUT_OUTPUTTYPE']._serialized_start=1874
|
|
104
|
+
_globals['_EXECOUTPUT_OUTPUTTYPE']._serialized_end=1963
|
|
105
|
+
_globals['_SESSION']._serialized_start=1966
|
|
106
|
+
_globals['_SESSION']._serialized_end=2160
|
|
107
|
+
_globals['_CREATESESSIONREQUEST']._serialized_start=2163
|
|
108
|
+
_globals['_CREATESESSIONREQUEST']._serialized_end=2320
|
|
109
|
+
_globals['_CREATESESSIONREQUEST_ENVENTRY']._serialized_start=1642
|
|
110
|
+
_globals['_CREATESESSIONREQUEST_ENVENTRY']._serialized_end=1684
|
|
111
|
+
_globals['_GETSESSIONREQUEST']._serialized_start=2322
|
|
112
|
+
_globals['_GETSESSIONREQUEST']._serialized_end=2361
|
|
113
|
+
_globals['_LISTSESSIONSREQUEST']._serialized_start=2363
|
|
114
|
+
_globals['_LISTSESSIONSREQUEST']._serialized_end=2404
|
|
115
|
+
_globals['_LISTSESSIONSRESPONSE']._serialized_start=2406
|
|
116
|
+
_globals['_LISTSESSIONSRESPONSE']._serialized_end=2467
|
|
117
|
+
_globals['_DESTROYSESSIONREQUEST']._serialized_start=2469
|
|
118
|
+
_globals['_DESTROYSESSIONREQUEST']._serialized_end=2512
|
|
119
|
+
_globals['_SESSIONEXECREQUEST']._serialized_start=2514
|
|
120
|
+
_globals['_SESSIONEXECREQUEST']._serialized_end=2615
|
|
121
|
+
_globals['_SANDBOXSERVICE']._serialized_start=2712
|
|
122
|
+
_globals['_SANDBOXSERVICE']._serialized_end=4181
|
|
123
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from google.api import annotations_pb2 as _annotations_pb2
|
|
4
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
5
|
+
from google.protobuf import duration_pb2 as _duration_pb2
|
|
6
|
+
import common_pb2 as _common_pb2
|
|
7
|
+
from google.protobuf.internal import containers as _containers
|
|
8
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
9
|
+
from google.protobuf import descriptor as _descriptor
|
|
10
|
+
from google.protobuf import message as _message
|
|
11
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
12
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
13
|
+
|
|
14
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
15
|
+
|
|
16
|
+
class RuntimeType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
17
|
+
__slots__ = ()
|
|
18
|
+
RUNTIME_TYPE_UNSPECIFIED: _ClassVar[RuntimeType]
|
|
19
|
+
RUNTIME_TYPE_BWRAP: _ClassVar[RuntimeType]
|
|
20
|
+
RUNTIME_TYPE_DOCKER: _ClassVar[RuntimeType]
|
|
21
|
+
RUNTIME_TYPE_UNSPECIFIED: RuntimeType
|
|
22
|
+
RUNTIME_TYPE_BWRAP: RuntimeType
|
|
23
|
+
RUNTIME_TYPE_DOCKER: RuntimeType
|
|
24
|
+
|
|
25
|
+
class ResourceLimits(_message.Message):
|
|
26
|
+
__slots__ = ("memory_bytes", "cpu_quota", "cpu_shares", "pids_limit")
|
|
27
|
+
MEMORY_BYTES_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
CPU_QUOTA_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
CPU_SHARES_FIELD_NUMBER: _ClassVar[int]
|
|
30
|
+
PIDS_LIMIT_FIELD_NUMBER: _ClassVar[int]
|
|
31
|
+
memory_bytes: int
|
|
32
|
+
cpu_quota: int
|
|
33
|
+
cpu_shares: int
|
|
34
|
+
pids_limit: int
|
|
35
|
+
def __init__(self, memory_bytes: _Optional[int] = ..., cpu_quota: _Optional[int] = ..., cpu_shares: _Optional[int] = ..., pids_limit: _Optional[int] = ...) -> None: ...
|
|
36
|
+
|
|
37
|
+
class Sandbox(_message.Message):
|
|
38
|
+
__slots__ = ("id", "codebase_id", "permissions", "status", "labels", "created_at", "started_at", "stopped_at", "expires_at", "runtime", "image", "resources")
|
|
39
|
+
class LabelsEntry(_message.Message):
|
|
40
|
+
__slots__ = ("key", "value")
|
|
41
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
42
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
43
|
+
key: str
|
|
44
|
+
value: str
|
|
45
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
46
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
47
|
+
CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
48
|
+
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
|
|
49
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
50
|
+
LABELS_FIELD_NUMBER: _ClassVar[int]
|
|
51
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
52
|
+
STARTED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
53
|
+
STOPPED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
54
|
+
EXPIRES_AT_FIELD_NUMBER: _ClassVar[int]
|
|
55
|
+
RUNTIME_FIELD_NUMBER: _ClassVar[int]
|
|
56
|
+
IMAGE_FIELD_NUMBER: _ClassVar[int]
|
|
57
|
+
RESOURCES_FIELD_NUMBER: _ClassVar[int]
|
|
58
|
+
id: str
|
|
59
|
+
codebase_id: str
|
|
60
|
+
permissions: _containers.RepeatedCompositeFieldContainer[_common_pb2.PermissionRule]
|
|
61
|
+
status: _common_pb2.SandboxStatus
|
|
62
|
+
labels: _containers.ScalarMap[str, str]
|
|
63
|
+
created_at: _timestamp_pb2.Timestamp
|
|
64
|
+
started_at: _timestamp_pb2.Timestamp
|
|
65
|
+
stopped_at: _timestamp_pb2.Timestamp
|
|
66
|
+
expires_at: _timestamp_pb2.Timestamp
|
|
67
|
+
runtime: RuntimeType
|
|
68
|
+
image: str
|
|
69
|
+
resources: ResourceLimits
|
|
70
|
+
def __init__(self, id: _Optional[str] = ..., codebase_id: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[_common_pb2.PermissionRule, _Mapping]]] = ..., status: _Optional[_Union[_common_pb2.SandboxStatus, str]] = ..., labels: _Optional[_Mapping[str, str]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., started_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., stopped_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., runtime: _Optional[_Union[RuntimeType, str]] = ..., image: _Optional[str] = ..., resources: _Optional[_Union[ResourceLimits, _Mapping]] = ...) -> None: ...
|
|
71
|
+
|
|
72
|
+
class CreateSandboxRequest(_message.Message):
|
|
73
|
+
__slots__ = ("codebase_id", "permissions", "expires_in", "labels", "runtime", "image", "resources")
|
|
74
|
+
class LabelsEntry(_message.Message):
|
|
75
|
+
__slots__ = ("key", "value")
|
|
76
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
77
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
78
|
+
key: str
|
|
79
|
+
value: str
|
|
80
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
81
|
+
CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
|
|
83
|
+
EXPIRES_IN_FIELD_NUMBER: _ClassVar[int]
|
|
84
|
+
LABELS_FIELD_NUMBER: _ClassVar[int]
|
|
85
|
+
RUNTIME_FIELD_NUMBER: _ClassVar[int]
|
|
86
|
+
IMAGE_FIELD_NUMBER: _ClassVar[int]
|
|
87
|
+
RESOURCES_FIELD_NUMBER: _ClassVar[int]
|
|
88
|
+
codebase_id: str
|
|
89
|
+
permissions: _containers.RepeatedCompositeFieldContainer[_common_pb2.PermissionRule]
|
|
90
|
+
expires_in: _duration_pb2.Duration
|
|
91
|
+
labels: _containers.ScalarMap[str, str]
|
|
92
|
+
runtime: RuntimeType
|
|
93
|
+
image: str
|
|
94
|
+
resources: ResourceLimits
|
|
95
|
+
def __init__(self, codebase_id: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[_common_pb2.PermissionRule, _Mapping]]] = ..., expires_in: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., labels: _Optional[_Mapping[str, str]] = ..., runtime: _Optional[_Union[RuntimeType, str]] = ..., image: _Optional[str] = ..., resources: _Optional[_Union[ResourceLimits, _Mapping]] = ...) -> None: ...
|
|
96
|
+
|
|
97
|
+
class GetSandboxRequest(_message.Message):
|
|
98
|
+
__slots__ = ("sandbox_id",)
|
|
99
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
100
|
+
sandbox_id: str
|
|
101
|
+
def __init__(self, sandbox_id: _Optional[str] = ...) -> None: ...
|
|
102
|
+
|
|
103
|
+
class ListSandboxesRequest(_message.Message):
|
|
104
|
+
__slots__ = ("codebase_id", "page_size", "page_token")
|
|
105
|
+
CODEBASE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
106
|
+
PAGE_SIZE_FIELD_NUMBER: _ClassVar[int]
|
|
107
|
+
PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
108
|
+
codebase_id: str
|
|
109
|
+
page_size: int
|
|
110
|
+
page_token: str
|
|
111
|
+
def __init__(self, codebase_id: _Optional[str] = ..., page_size: _Optional[int] = ..., page_token: _Optional[str] = ...) -> None: ...
|
|
112
|
+
|
|
113
|
+
class ListSandboxesResponse(_message.Message):
|
|
114
|
+
__slots__ = ("sandboxes", "next_page_token")
|
|
115
|
+
SANDBOXES_FIELD_NUMBER: _ClassVar[int]
|
|
116
|
+
NEXT_PAGE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
117
|
+
sandboxes: _containers.RepeatedCompositeFieldContainer[Sandbox]
|
|
118
|
+
next_page_token: str
|
|
119
|
+
def __init__(self, sandboxes: _Optional[_Iterable[_Union[Sandbox, _Mapping]]] = ..., next_page_token: _Optional[str] = ...) -> None: ...
|
|
120
|
+
|
|
121
|
+
class StartSandboxRequest(_message.Message):
|
|
122
|
+
__slots__ = ("sandbox_id",)
|
|
123
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
124
|
+
sandbox_id: str
|
|
125
|
+
def __init__(self, sandbox_id: _Optional[str] = ...) -> None: ...
|
|
126
|
+
|
|
127
|
+
class StopSandboxRequest(_message.Message):
|
|
128
|
+
__slots__ = ("sandbox_id",)
|
|
129
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
130
|
+
sandbox_id: str
|
|
131
|
+
def __init__(self, sandbox_id: _Optional[str] = ...) -> None: ...
|
|
132
|
+
|
|
133
|
+
class DestroySandboxRequest(_message.Message):
|
|
134
|
+
__slots__ = ("sandbox_id",)
|
|
135
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
136
|
+
sandbox_id: str
|
|
137
|
+
def __init__(self, sandbox_id: _Optional[str] = ...) -> None: ...
|
|
138
|
+
|
|
139
|
+
class ExecRequest(_message.Message):
|
|
140
|
+
__slots__ = ("sandbox_id", "command", "stdin", "env", "workdir", "timeout")
|
|
141
|
+
class EnvEntry(_message.Message):
|
|
142
|
+
__slots__ = ("key", "value")
|
|
143
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
144
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
145
|
+
key: str
|
|
146
|
+
value: str
|
|
147
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
148
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
149
|
+
COMMAND_FIELD_NUMBER: _ClassVar[int]
|
|
150
|
+
STDIN_FIELD_NUMBER: _ClassVar[int]
|
|
151
|
+
ENV_FIELD_NUMBER: _ClassVar[int]
|
|
152
|
+
WORKDIR_FIELD_NUMBER: _ClassVar[int]
|
|
153
|
+
TIMEOUT_FIELD_NUMBER: _ClassVar[int]
|
|
154
|
+
sandbox_id: str
|
|
155
|
+
command: str
|
|
156
|
+
stdin: str
|
|
157
|
+
env: _containers.ScalarMap[str, str]
|
|
158
|
+
workdir: str
|
|
159
|
+
timeout: _duration_pb2.Duration
|
|
160
|
+
def __init__(self, sandbox_id: _Optional[str] = ..., command: _Optional[str] = ..., stdin: _Optional[str] = ..., env: _Optional[_Mapping[str, str]] = ..., workdir: _Optional[str] = ..., timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ...
|
|
161
|
+
|
|
162
|
+
class ExecResult(_message.Message):
|
|
163
|
+
__slots__ = ("stdout", "stderr", "exit_code", "duration")
|
|
164
|
+
STDOUT_FIELD_NUMBER: _ClassVar[int]
|
|
165
|
+
STDERR_FIELD_NUMBER: _ClassVar[int]
|
|
166
|
+
EXIT_CODE_FIELD_NUMBER: _ClassVar[int]
|
|
167
|
+
DURATION_FIELD_NUMBER: _ClassVar[int]
|
|
168
|
+
stdout: str
|
|
169
|
+
stderr: str
|
|
170
|
+
exit_code: int
|
|
171
|
+
duration: _duration_pb2.Duration
|
|
172
|
+
def __init__(self, stdout: _Optional[str] = ..., stderr: _Optional[str] = ..., exit_code: _Optional[int] = ..., duration: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ...
|
|
173
|
+
|
|
174
|
+
class ExecOutput(_message.Message):
|
|
175
|
+
__slots__ = ("type", "data")
|
|
176
|
+
class OutputType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
177
|
+
__slots__ = ()
|
|
178
|
+
OUTPUT_TYPE_UNSPECIFIED: _ClassVar[ExecOutput.OutputType]
|
|
179
|
+
OUTPUT_TYPE_STDOUT: _ClassVar[ExecOutput.OutputType]
|
|
180
|
+
OUTPUT_TYPE_STDERR: _ClassVar[ExecOutput.OutputType]
|
|
181
|
+
OUTPUT_TYPE_UNSPECIFIED: ExecOutput.OutputType
|
|
182
|
+
OUTPUT_TYPE_STDOUT: ExecOutput.OutputType
|
|
183
|
+
OUTPUT_TYPE_STDERR: ExecOutput.OutputType
|
|
184
|
+
TYPE_FIELD_NUMBER: _ClassVar[int]
|
|
185
|
+
DATA_FIELD_NUMBER: _ClassVar[int]
|
|
186
|
+
type: ExecOutput.OutputType
|
|
187
|
+
data: bytes
|
|
188
|
+
def __init__(self, type: _Optional[_Union[ExecOutput.OutputType, str]] = ..., data: _Optional[bytes] = ...) -> None: ...
|
|
189
|
+
|
|
190
|
+
class Session(_message.Message):
|
|
191
|
+
__slots__ = ("id", "sandbox_id", "status", "shell", "created_at", "closed_at")
|
|
192
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
193
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
194
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
195
|
+
SHELL_FIELD_NUMBER: _ClassVar[int]
|
|
196
|
+
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
197
|
+
CLOSED_AT_FIELD_NUMBER: _ClassVar[int]
|
|
198
|
+
id: str
|
|
199
|
+
sandbox_id: str
|
|
200
|
+
status: _common_pb2.SessionStatus
|
|
201
|
+
shell: str
|
|
202
|
+
created_at: _timestamp_pb2.Timestamp
|
|
203
|
+
closed_at: _timestamp_pb2.Timestamp
|
|
204
|
+
def __init__(self, id: _Optional[str] = ..., sandbox_id: _Optional[str] = ..., status: _Optional[_Union[_common_pb2.SessionStatus, str]] = ..., shell: _Optional[str] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., closed_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
|
|
205
|
+
|
|
206
|
+
class CreateSessionRequest(_message.Message):
|
|
207
|
+
__slots__ = ("sandbox_id", "shell", "env")
|
|
208
|
+
class EnvEntry(_message.Message):
|
|
209
|
+
__slots__ = ("key", "value")
|
|
210
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
|
211
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
|
212
|
+
key: str
|
|
213
|
+
value: str
|
|
214
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
|
215
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
216
|
+
SHELL_FIELD_NUMBER: _ClassVar[int]
|
|
217
|
+
ENV_FIELD_NUMBER: _ClassVar[int]
|
|
218
|
+
sandbox_id: str
|
|
219
|
+
shell: str
|
|
220
|
+
env: _containers.ScalarMap[str, str]
|
|
221
|
+
def __init__(self, sandbox_id: _Optional[str] = ..., shell: _Optional[str] = ..., env: _Optional[_Mapping[str, str]] = ...) -> None: ...
|
|
222
|
+
|
|
223
|
+
class GetSessionRequest(_message.Message):
|
|
224
|
+
__slots__ = ("session_id",)
|
|
225
|
+
SESSION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
226
|
+
session_id: str
|
|
227
|
+
def __init__(self, session_id: _Optional[str] = ...) -> None: ...
|
|
228
|
+
|
|
229
|
+
class ListSessionsRequest(_message.Message):
|
|
230
|
+
__slots__ = ("sandbox_id",)
|
|
231
|
+
SANDBOX_ID_FIELD_NUMBER: _ClassVar[int]
|
|
232
|
+
sandbox_id: str
|
|
233
|
+
def __init__(self, sandbox_id: _Optional[str] = ...) -> None: ...
|
|
234
|
+
|
|
235
|
+
class ListSessionsResponse(_message.Message):
|
|
236
|
+
__slots__ = ("sessions",)
|
|
237
|
+
SESSIONS_FIELD_NUMBER: _ClassVar[int]
|
|
238
|
+
sessions: _containers.RepeatedCompositeFieldContainer[Session]
|
|
239
|
+
def __init__(self, sessions: _Optional[_Iterable[_Union[Session, _Mapping]]] = ...) -> None: ...
|
|
240
|
+
|
|
241
|
+
class DestroySessionRequest(_message.Message):
|
|
242
|
+
__slots__ = ("session_id",)
|
|
243
|
+
SESSION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
244
|
+
session_id: str
|
|
245
|
+
def __init__(self, session_id: _Optional[str] = ...) -> None: ...
|
|
246
|
+
|
|
247
|
+
class SessionExecRequest(_message.Message):
|
|
248
|
+
__slots__ = ("session_id", "command", "timeout")
|
|
249
|
+
SESSION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
250
|
+
COMMAND_FIELD_NUMBER: _ClassVar[int]
|
|
251
|
+
TIMEOUT_FIELD_NUMBER: _ClassVar[int]
|
|
252
|
+
session_id: str
|
|
253
|
+
command: str
|
|
254
|
+
timeout: _duration_pb2.Duration
|
|
255
|
+
def __init__(self, session_id: _Optional[str] = ..., command: _Optional[str] = ..., timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ...
|