Skip to content

AsyncSandbox

Source: leap0/_async/sandbox.py

AsyncSandbox(client: 'AsyncLeap0Client', data: SandboxData | SandboxStatus)

Sandbox object with bound asynchronous service clients.

Attributes: filesystem: Bound filesystem client. git: Bound git client. process: Bound process client. pty: Bound PTY client. lsp: Bound LSP client. ssh: Bound SSH client. code_interpreter: Bound code interpreter client. desktop: Bound desktop client.

async refresh() -> AsyncSandbox

Refresh this sandbox object with the latest metadata.

Returns: AsyncSandbox: This sandbox object with refreshed metadata.

async pause(http_timeout: float | None = None) -> AsyncSandbox

Pause the sandbox and return updated metadata.

Args: http_timeout: Optional HTTP request timeout in seconds for this SDK call.

Returns: AsyncSandbox: This sandbox object with updated metadata.

async delete(http_timeout: float | None = None) -> None

Terminate and delete a sandbox.

Args: http_timeout: Optional HTTP request timeout in seconds for this SDK call.

invoke_url(path: str = '/', *, port: int | None = None) -> str

Build an HTTPS URL for this sandbox.

Args: path: Request path inside the sandbox application. port: Port number for the generated URL.

Returns: str: Sandbox-scoped HTTPS URL.

websocket_url(path: str = '/', *, port: int | None = None) -> str

Build a websocket URL for this sandbox.

Args: path: Request path inside the sandbox application. port: Port number for the generated URL.

Returns: str: Sandbox-scoped websocket URL.