VM Related Interfaces

Query Virtual Machine Device Address Archive

GET/zstack/v1/vmInstance/resource/metadata/archive
GET/zstack/v1/vmInstance/resource/metadata/archive/{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/archive?q=uuid=2fb96aa3ba1e3cc394a3da88a7dbfcac
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vmInstance/resource/metadata/archive/a69a76218ec8365c9b521199fe6ee76b

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "id": 1,
      "resourceUuid": "407c6a2680a73506b3b4df1674505a14",
      "deviceAddress": "{\"bus\":\"00\",\"domain\":\"0000\",\"slot\":\"0d\",\"function\":\"0\"}",
      "addressGroupUuid": "b415541c97ac340dbd88c3256a0f6829",
      "metadata": "Metadata",
      "metadataClass": "org.zstack.header.vm.devices.VmInstanceResourceMetadataArchiveInventory",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successbooleanWhether the request is successful4.10.16
inventoriesListFor details, see inventories4.10.16
errorErrorCodeFor details, see error4.10.16

inventories

NameTypeDescriptionStarting Version
idlong 4.10.16
resourceUuidStringResource UUID4.10.16
vmInstanceUuidStringVirtual Machine UUID4.10.16
deviceAddressStringDevice Address4.10.16
addressGroupUuidString 4.10.16
metadataString 4.10.16
metadataClassString 4.10.16
createDateTimestampCreate time4.10.16
lastOpDateTimestampLast modification time4.10.16

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

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

Python SDK

action = QueryVmInstanceResourceMetadataArchiveAction()
action.conditions = ["uuid=a7025094e4d63dd29180ae7b08450029"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()