Document navigation

QueryVmInstanceResourceMetadataGroup

API Request

URLs
GET zstack/v1/vmInstance/resource/metadata/group
GET zstack/v1/vmInstance/resource/metadata/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/resource/metadata/group?q=uuid=a4e2d7e087e63e14af4890acad6b2d5f
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vmInstance/resource/metadata/group/9e9e781ccf3931a39751c55a7f41ea07

Queryable Fields

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

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "54cf17e0b4be38b59b43abb778c56379",
      "resourceUuid": "688ee3ed522d33d9a4ec9d3740938972",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM",
      "addressList": [
        {
          "id": 1,
          "resourceUuid": "fe925ba7d1a4342a8d86bd57dafe09ef",
          "vmInstanceUuid": "7534a094abe63aa08ddf8b6d43ed451b",
          "deviceAddress": "{\"bus\":\"00\",\"domain\":\"0000\",\"slot\":\"0d\",\"function\":\"0\"}",
          "addressGroupUuid": "54cf17e0b4be38b59b43abb778c56379",
          "metadata": "{\"uuid\":\"6b493e7c870d362d8dd75bf3cd3a26eb\",\"name\":\"Root-Volume-For-VM-7da78e9e53d9339fb2f034e19cc2e160\",\"primaryStorageUuid\":\"cc2e2c3954233a489648e9df8f90825c\",\"vmInstanceUuid\":\"7da78e9e53d9339fb2f034e19cc2e160\",\"diskOfferingUuid\":\"53a9fea90a9c38899367b0a2c338bc4a\",\"rootImageUuid\":\"6bf5558add1d3f6481940fb0575ce806\",\"installPath\":\"/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-6b493e7c870d362d8dd75bf3cd3a26eb/6b493e7c870d362d8dd75bf3cd3a26eb.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.VmInstanceResourceMetadataGroupInventory",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        }
      ]
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the request is successful 4.10.16
inventories List For details, see inventories 4.10.16
error ErrorCode For details, see error 4.10.16
#inventories
Name Type Description Starting Version
uuid String UUID of the resource, uniquely identifying the resource 4.10.16
resourceUuid String Resource UUID 4.10.16
vmInstanceUuid String Virtual Machine UUID 4.10.16
createDate Timestamp Create time 4.10.16
lastOpDate Timestamp Last modification time 4.10.16
addressList List For details, see addressList 4.10.16
#addressList
Name Type Description Starting Version
id long The resource ID. 4.10.16
resourceUuid String Resource UUID 4.10.16
vmInstanceUuid String Virtual Machine UUID 4.10.16
deviceAddress String Device Address 4.10.16
addressGroupUuid String The address group UUID. 4.10.16
metadata String The metadata. 4.10.16
metadataClass String The metadata class. 4.10.16
createDate Timestamp Create time 4.10.16
lastOpDate Timestamp Last modification time 4.10.16
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, default is null 0.6
opaque LinkedHashMap Reserved field, default is null 0.6
cause ErrorCode Root cause: the source error that triggered the current error. If there is no original error, this field is null 0.6

SDK Examples

Java SDK
QueryVmInstanceResourceMetadataGroupAction action = new QueryVmInstanceResourceMetadataGroupAction();
action.conditions = asList("uuid=c3189c8e616b31828a84dfbdfa521f66");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmInstanceResourceMetadataGroupAction.Result res = action.call();
Python SDK
action = QueryVmInstanceResourceMetadataGroupAction()
action.conditions = ["uuid=cce5160da0323ea28420e866318be200"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center