VM Related Interfaces
Query Virtual Machine Device Address Archive
Headers
Authorization: OAuth the-session-uuidCurl 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=2fb96aa3ba1e3cc394a3da88a7dbfcaccurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vmInstance/resource/metadata/archive/a69a76218ec8365c9b521199fe6ee76bQueryable 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"
}
]
}| 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 |
|---|---|---|---|
| id | long | 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 | 4.10.16 | |
| metadata | String | 4.10.16 | |
| metadataClass | String | 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
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()