GetVmHostname
API Request
URLs
GET zstack/v1/vm-instances/{uuid}/hostnamesHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth: 0e3cbe22c03a43bc9b7b3ae76c57a0e7" \
-X GET http://localhost:8080/zstack/v1/vm-instances/c5c6665ccbe2444e9cfa393366cdb5d4/hostnamesRequest 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
{
"hostname": "vm1.zstack.orgl"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostname | String | The VM instance hostname. | 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
GetVmHostnameAction action = new GetVmHostnameAction();
action.uuid = "82c0f5918de14f65abe7ba5d37c28502";
action.sessionId = "24f9301f25784707a477483c5702c034";
GetVmHostnameAction.Result res = action.call();Python
SDK
GetVmHostnameAction action = GetVmHostnameAction()
action.uuid = "5070e337b731448ca0698f83c7fc4c26"
action.sessionId = "f13e0ed993134a8ea35a3d382a971b14"
GetVmHostnameAction.Result res = action.call()