VM Related Interfaces

Get VM Device Address

GET/zstack/v1/vm-instances/devices

Headers

Authorization: OAuth the-session-uuid

Curl Example

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=VolumeVO

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringqueryVirtual Machine UUID 3.10.0
resourceTypesListqueryResource typeVolumeVO3.10.0
systemTags (Optional)ListquerySystem Tag 3.10.0
userTags (Optional)ListqueryUser Tag 3.10.0

API Response

Response Example

{
  "addresses": {
    "VolumeVO": [
      {
        "address": "0000:01:00:0",
        "addressType": "pci",
        "deviceType": "disk",
        "resourceType": "VolumeVO"
      }
    ]
  }
}
NameTypeDescriptionStarting Version
addressesMapDevice address details3.10.0
successboolean 3.10.0
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error3.10.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10013.10.0
descriptionStringBrief description of the error3.10.0
detailsStringDetailed error information3.10.0
elaborationStringReserved field, defaults to null3.10.0
opaqueLinkedHashMapReserved field, defaults to null3.10.0
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null3.10.0

SDK Examples

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()