AsyncSandboxClient¶
- class baseten.sandbox.AsyncSandboxClient(*, api_key, team_id=None, token_provider=None, base_url_override=None, headers=None, retry=None, http2=None, http_client_override=None, close_http_client_on_close=None)¶
Bases:
objectAsync form of
SandboxClient.Can be used as an async context manager to ensure the underlying HTTP client is closed on exit.
- Parameters:
- async close()¶
Close the client, optionally closing the underlying HTTP client.
- Return type:
None
- async create(*, name=None, create_if_not_exists=None, image=None, memory=None, region=None, envs=None, labels=None, external_id=None, lifecycle=None, ports=None, network=None, filesystem=None)¶
Create a sandbox. As
SandboxClient.create().- Parameters:
name (str | None)
create_if_not_exists (bool | None)
image (str | None)
memory (int | None)
region (str | None)
envs (Mapping[str, SandboxEnvValue] | None)
external_id (str | None)
lifecycle (SandboxLifecycle | None)
ports (Sequence[SandboxPort] | None)
network (SandboxNetwork | None)
filesystem (SandboxFileSystemOptions | None)
- Return type:
- async delete(*, name)¶
Delete a sandbox. As
SandboxClient.delete().- Parameters:
name (str)
- Return type:
- async get(*, name: str) AsyncSandbox¶
- async get(*, info: SandboxInfo) AsyncSandbox
Get an
AsyncSandboxto work in. AsSandboxClient.get().- Parameters:
name (str | None)
info (SandboxInfo | None)
- Return type:
- async get_info(*, name, show_secrets=None)¶
Get a sandbox’s current record. As
SandboxClient.get_info().- Parameters:
- Return type:
- property http_client: AsyncClient¶
The underlying HTTP client.
- property images: AsyncImageClient¶
Images that sandboxes are created from.
- async list(*, query=None, statuses=None, external_id=None, page_size=None)¶
List sandboxes. As
SandboxClient.list().- Parameters:
- Return type:
- property options: SandboxClientOptions¶
Client options.
- property raw_api: AsyncApiClient¶
The generated management API client, authenticated for sandboxes.
For operations this SDK does not wrap. The generated API surface is not covered by stability guarantees and may change between versions.
- sandbox_from_url(*, url)¶
Get an
AsyncSandboxfor a URL. AsSandboxClient.sandbox_from_url().- Parameters:
url (str)
- Return type:
- async update(*, name, lifecycle=None, envs=None, external_id=None, labels=None)¶
Update a sandbox’s configuration. As
SandboxClient.update().- Parameters:
name (str)
lifecycle (SandboxLifecycle | None)
envs (Mapping[str, SandboxEnvValue] | None)
external_id (str | None)
- Return type: