GetVmDeviceAddress
API Request
URLs
GET zstack/v1/vm-instances/devicesHeaders
Authorization: OAuth the-session-uuidCurl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/devices?uuid=a761ac08ca483af4a81d9ed3d9930ef4&resourceTypes=VolumeVORequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | query | The VM UUID. | 3.10.0 | |
| resourceTypes | List | query | The resource type. | VolumeVO | 3.10.0 |
| systemTags | List | query | Optional. The system tags. | 3.10.0 | |
| userTags | List | query | Optional. The user tags. | 3.10.0 |
API Response
Sample Response
{
"addresses": {
"VolumeVO": [
{
"address": "0000:01:00:0",
"addressType": "pci",
"deviceType": "disk",
"resourceType": "VolumeVO"
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| addresses | Map | The device addresses. | 3.10.0 |
| success | boolean | 3.10.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.10.0 |
#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. | 3.10.0 |
| description | String | The brief description of the error. | 3.10.0 |
| details | String | The details about the error. | 3.10.0 |
| elaboration | String | The reserved field. Default value: null. | 3.10.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.10.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.10.0 |
SDK Sample
Java
SDK
GetVmDeviceAddressAction action = new GetVmDeviceAddressAction();
action.uuid = "a761ac08ca483af4a81d9ed3d9930ef4";
action.resourceTypes = asList("VolumeVO");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVmDeviceAddressAction.Result res = action.call();Python
SDK
GetVmDeviceAddressAction action = GetVmDeviceAddressAction()
action.uuid = "a761ac08ca483af4a81d9ed3d9930ef4"
action.resourceTypes = [VolumeVO]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVmDeviceAddressAction.Result res = action.call()