-
Notifications
You must be signed in to change notification settings - Fork 17
RFD 189: Console Access - Add console endpoint to CNAPI #44
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
base: master
Are you sure you want to change the base?
Conversation
Add GET /servers/:server_uuid/vms/:uuid/console endpoint to query console connection details from vm-agent. Returns: - host: IP address of compute node admin interface - port: TCP port for console proxy - type: 'socket' (KVM) or 'zcons' (Bhyve/Joyent/LX) This endpoint queries vmadmd for console proxy details and returns them for CloudAPI to establish WebSocket connections. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new console endpoint to CNAPI that allows querying console connection details for virtual machines. The endpoint provides the necessary information (host, port, type) for CloudAPI to establish WebSocket connections to VM consoles.
- Adds GET /servers/:server_uuid/vms/:uuid/console endpoint
- Implements console information validation and error handling
- Provides console connection details (host, port, type) for different VM brands
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| var timeout = setTimeout(function () { | ||
| responded = true; | ||
| next(new restify.InternalError( | ||
| 'Time-out reached waiting for machine_load request to return')); |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message references 'machine_load request' but this endpoint is for console information, not machine loading. The message should be updated to reflect the actual operation.
| 'Time-out reached waiting for machine_load request to return')); | |
| 'Time-out reached waiting for VM console information to return')); |
| } | ||
|
|
||
| // Ensure console info exists | ||
| if (!vminfo.console || !vminfo.console.host || !vminfo.console.port) { |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation should also check for vminfo.console.type since it's used later and returned in the response. Missing type could cause undefined to be returned.
| if (!vminfo.console || !vminfo.console.host || !vminfo.console.port) { | |
| if (!vminfo.console || !vminfo.console.host || !vminfo.console.port || !vminfo.console.type) { |
- Update timeout error message to reference "VM console information" instead of "machine_load request" for clarity - Add validation for console.type field since it is returned to callers and should be required alongside host and port Addresses PR review feedback from #44 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add GET /servers/:server_uuid/vms/:uuid/console endpoint to query console connection details from vm-agent.
Returns:
This endpoint queries vmadmd for console proxy details and returns them for CloudAPI to establish WebSocket connections.
🤖 Generated with Claude Code