Query VM and MDEV Device Spec Relationship

GET/zstack/v1/vm-instances/{vmInstanceUuid}/mdev-device-specs
GET zstack/v1/vm-instances/{vmInstanceUuid}/mdev-device-specs/{mdevSpecUuid}

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/{vmInstanceUuid}/mdev-device-specs?q=vmInstanceUuid=15ea1f7027833d9ea566ea590184d5d2
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/{vmInstanceUuid}/mdev-device-specs/{mdevSpecUuid}?q=vmInstanceUuid=5e3c68fed5ef39089614830ff30dfd50

Queryable Fields

Run the CLI command tool, enter QueryVmInstanceMdevDeviceSpecRef and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Response Example

{
  "inventories": [
    {
      "vmInstanceUuid": "87fbb32e8d5b47be9c79611ea8b8dbca",
      "mdevSpecUuid": "75c34cf335f84f7e85bba4289a9d5257",
      "mdevDeviceNumber": 1,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error3.5.0
inventoriesListSee inventories3.5.0

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. SYS.1000, HOST.10013.5.0
descriptionStringBrief description of the error3.5.0
detailsStringDetailed error information3.5.0
elaborationStringReserved field, defaults to null3.5.0
opaqueLinkedHashMapReserved field, defaults to null3.5.0
causeErrorCodeRoot cause, the source error that caused the current error, null if no original error3.5.0

inventories

NameTypeDescriptionStarting Version
vmInstanceUuidStringVirtual Machine UUID3.5.0
mdevSpecUuidStringMDEV device spec UUID3.5.0
mdevDeviceNumberIntegerNumber of mdev devices that meet the spec to attach to the VM, defaults to 13.5.0
createDateTimestampCreate date3.5.0
lastOpDateTimestampLast update date3.5.0

SDK Examples

Java SDK

QueryVmInstanceMdevDeviceSpecRefAction action = new QueryVmInstanceMdevDeviceSpecRefAction();
action.conditions = asList("vmInstanceUuid=308f8eccec9b320bbe082f233e7f822c");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmInstanceMdevDeviceSpecRefAction.Result res = action.call();

Python SDK

QueryVmInstanceMdevDeviceSpecRefAction action = QueryVmInstanceMdevDeviceSpecRefAction()
action.conditions = ["vmInstanceUuid=254f7f2f30bb3b7bb26595fc5120a63b"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmInstanceMdevDeviceSpecRefAction.Result res = action.call()