SshClient
Source: leap0/_sync/ssh.py
Signature
Section titled “Signature”SshClient(transport: Transport)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 = client.sandboxes.create()access = sandbox.ssh.create_access()print(access.command)Attributes: None.
Methods
Section titled “Methods”create_access
Section titled “create_access”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”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”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”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: SshAccess: Newly generated SSH credential bundle.