31 lines
646 B
Python
31 lines
646 B
Python
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
from enum import Enum
|
|
from uuid import UUID
|
|
|
|
|
|
class SandboxStatus(str, Enum):
|
|
STARTING = 'starting'
|
|
RUNNING = 'running'
|
|
STOPPING = 'stopping'
|
|
STOPPED = 'stopped'
|
|
FAILED = 'failed'
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class SandboxEndpoint:
|
|
ip: str
|
|
port: int
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class SandboxSession:
|
|
session_id: UUID
|
|
chat_id: UUID
|
|
container_id: str
|
|
status: SandboxStatus
|
|
created_at: datetime
|
|
expires_at: datetime
|
|
agent_id: str = ''
|
|
volume_host_path: str = ''
|
|
endpoint: SandboxEndpoint | None = None
|