VM Related Interfaces

Get Virtual Machine Console Password

GET/zstack/v1/vm-instances/{uuid}/console-passwords

Get the console password of a Virtual Machine.

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 64bdb6ac8c3044d589ab6a0e96745fc2" \
-X GET http://localhost:8080/zstack/v1/vm-instances/3bc9f63f0de6492991c59bef96b27565/console-passwords

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlVirtual Machine UUID 0.6
systemTags (Optional)ListquerySystem Tag 0.6
userTags (Optional)ListqueryUser Tag 0.6

API Response

Response Example

{
  "consolePassword": "password"
}
NameTypeDescriptionStarting Version
successboolean 0.6
passwordStringConsole password0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation is successful. For details, see error0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that caused the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

GetVmConsolePasswordAction action = new GetVmConsolePasswordAction();
action.uuid = "b06703c5616e4c29ba4d080ea6b3d760";
action.sessionId = "4cf31da078ce44348e0d77af4269c756";
GetVmConsolePasswordAction.Result res = action.call();

Python SDK

GetVmConsolePasswordAction action = GetVmConsolePasswordAction()
action.uuid = "73b0881a95c0456ca9d20f2896ea6b76"
action.sessionId = "d568904f39914ffbaf6245aa3c949b37"
GetVmConsolePasswordAction.Result res = action.call()