-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add SSH terminal access support #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add NanoKVMSSH class and paramiko dependency - Add SSH usage examples to README.md
- Fix line length violations (Ruff E501) - Add proper exception chaining (Ruff B904) - Fix MyPy union attribute errors with type assertions - Improve code formatting and readability
- Break long exception message line to comply with Ruff E501
- Add trailing comma for consistency
|
This SSH client submodule is fully independent of the main client, sharing zero code. Is there a reason you can't use |
- Reformat run_in_executor call to single line
|
Yeah, I went out of my way to keep everything separated so as not to mess with existing functionality. I thought about this SSH wrapper while I was thinking about the Home Assistant integration, since I wanted to pull some information from the NanoKVM that the API didn't provide. This wrapper provides specific error handling and simplifies things. For users who just want to run commands without dealing with paramiko's async complexities, this wrapper makes it much simpler. At one point I implemented specific commands and parsing, like memory info and uptime info, but I felt that this should be implemented by the user, what do you think? Anyway, it's your call. |
|
Ahh. That makes sense.
|
|
- SSH exceptions now inherit from NanoKVMError for unified error handling - Users can catch all NanoKVM errors (API + SSH) with single base class
Add SSH Terminal Access Support
This PR adds SSH terminal access functionality to the NanoKVM Python client, providing an independent SSH client alongside the existing HTTP API client.
New Features
NanoKVMSSH Class
A new generic SSH client that allows executing commands on the NanoKVM device:
Key Features:
Architecture:
Usage Examples
Dependencies
paramikofor SSH functionalityThis provides users with both structured API access (HTTP) and direct terminal access (SSH) to their NanoKVM devices, making the library more versatile for different use cases.