VM Related Interfaces

Get Virtual Machine SSH Key

GET/zstack/v1/vm-instances/{uuid}/ssh-keys

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 9f358fd3fb0c451aa999d9fd5f21d675" \
-X GET http://localhost:8080/zstack/v1/vm-instances/905b14166587498982db9aa14aee50c1/ssh-keys

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

{
  "sshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtgdrSt2i/4ayXoiR6qNd7dykOOcz205NVSUgw41GOZW3PdXa9WWMF1AP\
Htj8L2tYm3lKgIDSy1aQtpIEenu6L03BeqfPwepf2L89aZ/W4UPRpce9/bO4mSSJ6kvbZ7hFv+4KLUJCB9O7UrcFu7J/QwrkHNVNX1NsVUpq\
ebp3Ny8bxj0Wbr9ecqPKTclzygARRGz71iDQaEhLrQqy/Q8vr+/G1/uyAYfTnifCuuMTfh5DEsuKD1AEHMBVZEbJ4zupR4gywXnGRxHmEwE4\
64scACxeFWVx2flIXkTK8f3W0KBLCJ8VtTd8KxvKQBu2jJ70avmXNOzb5IaBDS root@172-20-12-46"
}
NameTypeDescriptionStarting Version
successboolean 0.6
sshKeyStringVirtual Machine SSH Key0.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

GetVmSshKeyAction action = new GetVmSshKeyAction();
action.uuid = "71e1defb50aa42128605fc702cc00137";
action.sessionId = "2f3fe0048fc6485f9123541a1244411f";
GetVmSshKeyAction.Result res = action.call();

Python SDK

GetVmSshKeyAction action = GetVmSshKeyAction()
action.uuid = "c66da31c27004804b59f672002d4371c"
action.sessionId = "2b883a9c99e942f295beab6761ff8657"
GetVmSshKeyAction.Result res = action.call()