AsyncSshClient
Source: leap0/_async/ssh.py
Signature
Section titled “Signature”AsyncSshClient(transport: AsyncTransport)Overview
Section titled “Overview”Manage SSH access credentials for a sandbox.
Each sandbox supports a single set of SSH credentials at a time. Creating
access when credentials already exist returns 409 Conflict. Use
:meth:regenerate_access to rotate credentials without revoking first.
Example:
sandbox = await client.sandboxes.create()access = await sandbox.ssh.create_access()print(access.command)Attributes: None.
Methods
Section titled “Methods”create_access
Section titled “create_access”async create_access(sandbox: SandboxRef, http_timeout: float | None = None) -> SshAccessGenerate SSH credentials for a sandbox.
Returns an access ID (used as the SSH username), a password, and the full SSH command to connect.
Args: sandbox: Sandbox ID or object. http_timeout: Optional HTTP request timeout in seconds for this SDK call.
Returns: SshAccess: Generated SSH credential bundle.
delete_access
Section titled “delete_access”async delete_access(sandbox: SandboxRef, http_timeout: float | None = None) -> NoneRevoke SSH access for a sandbox. The credential is invalidated immediately.
Args: sandbox: Sandbox ID or object. http_timeout: Optional HTTP request timeout in seconds for this SDK call.
validate_access
Section titled “validate_access”async validate_access(sandbox: SandboxRef, *, access_id: str, password: str, http_timeout: float | None = None) -> SshValidationCheck whether an SSH access credential is still valid and not expired.
Args: sandbox: Sandbox ID or object. access_id: SSH access identifier. password: SSH password. http_timeout: Optional HTTP request timeout in seconds for this SDK call.
Returns: SshValidation: Validation result for the supplied credential pair.
regenerate_access
Section titled “regenerate_access”async regenerate_access(sandbox: SandboxRef, http_timeout: float | None = None) -> SshAccessInvalidate the current credential and generate a new one. The expiry is also reset.
Args: sandbox: Sandbox ID or object. http_timeout: Optional HTTP request timeout in seconds for this SDK call.
Returns: object: Result returned by this operation.