Query MDEV Devices Sliced from PCI Device

GET/zstack/v1/mdev-devices
GET zstack/v1/mdev-devices/{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/mdev-devices
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/mdev-devices/9fa9e261caad306f89ccde6f0dca7a1d

Queryable Fields

Run the CLI command tool, enter QueryMdevDevice and press Tab to view all queryable fields and cross-resource names.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "597624b580d1458f82671b0ef77cf6a4",
      "name": "GRID M60-2A",
      "parentUuid": "90c171f07b21452b87b6d5ee58f4d687",
      "hostUuid": "b440c9393fc644cc8394d789ea1e18e1",
      "mdevSpecUuid": "91b07312092741f18a382942a92f1373",
      "type": "GPU_Video_Controller",
      "state": "Enabled",
      "status": "Active",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
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
uuidStringUUID of the resource, uniquely identifies the resource3.5.0
nameStringResource name3.5.0
descriptionStringResource description3.5.0
parentUuidStringPhysical PCI device UUID3.5.0
hostUuidStringHost UUID3.5.0
vmInstanceUuidStringVirtual Machine UUID3.5.0
mdevSpecUuidStringMDEV device spec UUID3.5.0
createDateTimestampCreate date3.5.0
lastOpDateTimestampLast update date3.5.0
typeMdevDeviceTypeSee type3.5.0
stateMdevDeviceStateSee state3.5.0
statusMdevDeviceStatusSee status3.5.0

type

NameTypeDescriptionStarting Version
GPU_Video_ControllerMdevDeviceTypeGPU video controller3.5.0

state

NameTypeDescriptionStarting Version
EnabledMdevDeviceStateEnabled3.5.0
DisabledMdevDeviceStateDisabled3.5.0

status

NameTypeDescriptionStarting Version
ActiveMdevDeviceStatusReady3.5.0
AttachedMdevDeviceStatusAttached3.5.0

SDK Examples

Java SDK

QueryMdevDeviceAction action = new QueryMdevDeviceAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryMdevDeviceAction.Result res = action.call();

Python SDK

QueryMdevDeviceAction action = QueryMdevDeviceAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryMdevDeviceAction.Result res = action.call()