Skip to content

AsyncLeap0Client

Source: leap0/_async/client.py

AsyncLeap0Client(*, config: Leap0Config | None = None, api_key: str | None = None, base_url: str | None = None, sandbox_domain: str | None = None, timeout: float = DEFAULT_CLIENT_TIMEOUT, auth_header: str = 'authorization', bearer: bool = True, sdk_otel_enabled: bool | None = None)

Top-level asynchronous client for the Leap0 API.

Use this client to create sandboxes and access top-level control-plane services. Sandbox-scoped services are exposed through bound sandbox objects.

Attributes: sandboxes: Client for sandbox lifecycle operations. snapshots: Client for snapshot lifecycle operations. templates: Client for template management.

async get_sandbox(sandbox_id: str) -> AsyncSandbox

Get a sandbox by ID.

Args: sandbox_id: Sandbox identifier.

Returns: AsyncSandbox: Sandbox object with bound service clients.

async create_sandbox(**kwargs: object) -> AsyncSandbox

Create a sandbox.

Args: **kwargs: Keyword arguments forwarded to client.sandboxes.create.

Returns: AsyncSandbox: Sandbox object with bound service clients.

async close() -> None

Close the client and release resources.