GetVmSshKey
API Request
URLs
GET zstack/v1/vm-instances/{uuid}/ssh-keysHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 9f358fd3fb0c451aa999d9fd5f21d675" \
-X GET http://localhost:8080/zstack/v1/vm-instances/905b14166587498982db9aa14aee50c1/ssh-keysRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The VM instance UUID. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"sshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtgdrSt2i/4ayXoiR6qNd7dykOOcz205NVSUgw41GOZW3PdXa9WWMF1AP\
Htj8L2tYm3lKgIDSy1aQtpIEenu6L03BeqfPwepf2L89aZ/W4UPRpce9/bO4mSSJ6kvbZ7hFv+4KLUJCB9O7UrcFu7J/QwrkHNVNX1NsVUpq\
ebp3Ny8bxj0Wbr9ecqPKTclzygARRGz71iDQaEhLrQqy/Q8vr+/G1/uyAYfTnifCuuMTfh5DEsuKD1AEHMBVZEbJ4zupR4gywXnGRxHmEwE4\
64scACxeFWVx2flIXkTK8f3W0KBLCJ8VtTd8KxvKQBu2jJ70avmXNOzb5IaBDS root@172-20-12-46"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| sshKey | String | The SSH key of the VM instance. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
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()