RFD 189: Console Access - Add console endpoint to CNAPI#44
RFD 189: Console Access - Add console endpoint to CNAPI#44
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.
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')); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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