Get Remote Console
POST
/v2.1/servers/{server_id}/remote-consolesReturns a temporary URL that opens the VM console in a browser. This is the API behind the console button in the dashboard, and it is the way back into a VM whose network or SSH access is broken.
info
Source: create-console
Request
Parameters
server_idstringrequiredpathThe UUID of the VM.
remote_consoleobjectrequiredbodyConsole request wrapper.
2 fields
protocolstringrequiredbodyConsole protocol. The valid value is vnc.
typestringrequiredbodyConsole client type. The valid value is novnc.
Sample Request
- cURL
- HTTP
curl -ks -X POST -H 'Content-Type: application/json' \
-H 'X-OpenStack-Nova-API-Version: 2.8' -H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"remote_console": {
"protocol": "vnc",
"type": "novnc"
}
}' https://api.vietnix.cloud:8774/v2.1/servers/{server_id}/remote-consoles
POST https://api.vietnix.cloud:8774/v2.1/servers/{server_id}/remote-consoles
Content-Type: application/json
X-OpenStack-Nova-API-Version: 2.8
X-Auth-Token: gAAAAA<...>
{
"remote_console": {
"protocol": "vnc",
"type": "novnc"
}
}
Response
Sample Response
{
"remote_console": {
"protocol": "vnc",
"type": "novnc",
"url": "https://console.vietnix.cloud/vnc_auto.html?path=websockify&token=7d1f9c2e4b6a"
}
}
remote_console.protocolstringrequiredConsole protocol that was granted.
remote_console.typestringrequiredClient type that was granted.
remote_console.urlstringrequiredConsole URL. Open it in a browser.
Status Code
Success
| Status Code | Description |
|---|---|
| 200 - OK | Console URL returned. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | The request body or its parameters are invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
| 404 - Not Found | The VM does not exist, or is not visible to your project. |
| 409 - Conflict | The VM is in a status that cannot be reached by a console. |
| 501 - Not Implemented | Remote console is not implemented for this VM or deployment. |
warning
The URL is a bearer credential: anyone who has it can watch and type into the console until the token expires. Do not paste it into tickets, chat, or logs. Every call returns a new token.