Query MDEV Device Specs Partitioned from PCI Devices

GET/zstack/v1/mdev-device-specs
GET zstack/v1/mdev-device-specs/{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-device-specs?q=uuid=80e1584c51673827abf32ad7c57fa5ed
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/mdev-device-specs/21accb3c691435f4a453de1566f19a37

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "b127c9ba357a459aa1c3b92eb40e8277",
      "name": "GRID M60-2A",
      "parentUuid": "284f35b038ae4b23847238f995281a64",
      "hostUuid": "c461675365b9439ab5794f86c8652fce",
      "mdevSpecUuid": "891086ddf1d0414c94d2a7adbfec15fe",
      "type": "GPU_Video_Controller",
      "state": "Enabled",
      "status": "Active",
      "chooser": "None",
      "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
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
stateMdevDeviceSpecStateSee state3.5.0
statusMdevDeviceStatusSee status3.5.0
chooserMdevDeviceChooserSee chooser4.1.0

type

NameTypeDescriptionStarting Version
GPU_Video_ControllerMdevDeviceTypeGPU video controller3.5.0

state

NameTypeDescriptionStarting Version
EnabledMdevDeviceSpecStateEnabled3.5.0
DisabledMdevDeviceSpecStateDisabled3.5.0

status

NameTypeDescriptionStarting Version
ActiveMdevDeviceStatusReady3.5.0
AttachedMdevDeviceStatusAttached3.5.0

chooser

NameTypeDescriptionStarting Version
NonePciDeviceChooser 4.2.0
DevicePciDeviceChooser 4.2.0
SpecPciDeviceChooser 4.2.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()