Leap0Client
Source: leap0/_sync/client.py
Signature
Section titled “Signature”Leap0Client(*, 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, otel_enabled: bool | None = None, sdk_otel_enabled: bool | None = None)Overview
Section titled “Overview”Top-level 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. It can be used directly or as a context manager.
Args:
api_key: API key for authentication. Falls back to LEAP0_API_KEY.
base_url: Control-plane base URL. Falls back to LEAP0_BASE_URL.
sandbox_domain: Sandbox domain suffix. Falls back to
LEAP0_SANDBOX_DOMAIN.
timeout: Default HTTP timeout in seconds.
auth_header: Header name used to send the API key.
bearer: Whether to prefix the API key with Bearer.
Attributes: sandboxes: Client for sandbox lifecycle operations. snapshots: Client for snapshot lifecycle operations. templates: Client for template management.
Methods
Section titled “Methods”get_sandbox
Section titled “get_sandbox”get_sandbox(sandbox_id: str) -> SandboxGet a sandbox object with bound service clients by ID.
Args: sandbox_id: Sandbox identifier.
Returns: Sandbox: Sandbox object with bound service clients.
create_sandbox
Section titled “create_sandbox”create_sandbox(**kwargs: object) -> SandboxCreate a sandbox and return it as a bound sandbox object.
Args:
**kwargs: Keyword arguments forwarded to client.sandboxes.create.
Returns: Sandbox: Sandbox object with bound service clients.
close() -> NoneClose the underlying HTTP transport.
Call this when you are done with the client if you are not using a context manager.