VM Related Interfaces

Query Virtual Machine Device Address Group

GET/zstack/v1/vmInstance/device/address/group
GET/zstack/v1/vmInstance/device/address/group/{uuid}

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/vmInstance/device/address/group?q=uuid=15faf301daf53b75a5292b501110397e
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vmInstance/device/address/group/ce8802c036843741bfd429cddb5c0f26

Queryable Fields

Run the CLI command tool, enter QueryVmInstanceDeviceAddressGroup and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "77cc648bcbda321f9b5982627618b57f",
      "resourceUuid": "b28bd07303de3b8bb88ecc45778ebc10",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM",
      "addressList": [
        {
          "id": 1,
          "resourceUuid": "664783c1fb2432b6944602836377d61f",
          "vmInstanceUuid": "7f29c11b15b3348a95bc368b4ab60efb",
          "deviceAddress": "{\"bus\":\"00\",\"domain\":\"0000\",\"slot\":\"0d\",\"function\":\"0\"}",
          "addressGroupUuid": "77cc648bcbda321f9b5982627618b57f",
          "metadata": "{\"uuid\":\"726104d38c423fecac45c39a258b1338\",\"name\":\"Root-Volume-For-VM-70f0a99c825d3bed98c95932e5cd6d0b\",\"primaryStorageUuid\":\"0a2c36ffd5ff39d6a4ffd3d6a2a60ea8\",\"vmInstanceUuid\":\"70f0a99c825d3bed98c95932e5cd6d0b\",\"diskOfferingUuid\":\"a0c51ff80bba366d8350d63d02d56346\",\"rootImageUuid\":\"8473469c3e833afbb02db9ed227787bd\",\"installPath\":\"/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-726104d38c423fecac45c39a258b1338/726104d38c423fecac45c39a258b1338.qcow2\",\"type\":\"Root\",\"format\":\"qcow2\",\"size\":107374182400,\"actualSize\":21474836480,\"deviceId\":0,\"state\":\"Enabled\",\"status\":\"Ready\",\"createDate\":\"Nov 14, 2017 2:20:57 PM\",\"lastOpDate\":\"Nov 14, 2017 2:20:57 PM\"}",
          "metadataClass": "org.zstack.header.vm.devices.VmInstanceDeviceAddressGroupInventory",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.4.24
inventoriesListFor details, see inventories4.4.24
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error4.4.24

inventories

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.4.24
resourceUuidStringResource UUID4.4.24
vmInstanceUuidStringVirtual Machine UUID4.4.24
createDateTimestampCreate time4.4.24
lastOpDateTimestampLast modification time4.4.24
addressListListFor details, see addressList4.4.24

addressList

NameTypeDescriptionStarting Version
idlong 4.4.24
resourceUuidStringResource UUID4.4.24
vmInstanceUuidStringVirtual Machine UUID4.4.24
deviceAddressString 4.4.24
addressGroupUuidString 4.4.24
metadataString 4.4.24
metadataClassString 4.4.24
createDateTimestampCreate time4.4.24
lastOpDateTimestampLast modification time4.4.24

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

QueryVmInstanceDeviceAddressGroupAction action = new QueryVmInstanceDeviceAddressGroupAction();
action.conditions = asList("uuid=c6ac07294e923ed09d8ac26fb0bcd2de");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmInstanceDeviceAddressGroupAction.Result res = action.call();

Python SDK

QueryVmInstanceDeviceAddressGroupAction action = QueryVmInstanceDeviceAddressGroupAction()
action.conditions = ["uuid=089878d0a83330a8a0a07c878266fc52"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmInstanceDeviceAddressGroupAction.Result res = action.call()