Document navigation

GPU Device Operations

QueryGpuDevice

API Request

URLs
GET zstack/v1/gpu-device/gpu-devices
GET zstack/v1/gpu-device/gpu-devices/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/gpu-device/gpu-devices?
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/gpu-device/gpu-devices/36fd4a643a173c36a45bfa3a1761c567

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryGpuDevice, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {}
  ]
}
Name Type Description Starting Version
success boolean 5.1.8
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 5.1.8
inventories List See inventories. 5.1.8
#error
名字 类型 描述 起始版本
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 5.1.8
description String The detailed description of the resource. 5.1.8
details String The details about the error. 5.1.8
elaboration String The reserved field. Default value: null. 5.1.8
opaque LinkedHashMap The reserved field. Default value: null. 5.1.8
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 5.1.8
#inventories
Name Type Description Starting Version
serialNumber String The serial number. 5.1.8
memory String The GPU memory. 5.1.8
power String The GPU power consumption. 5.1.8
uuid String The resource UUID. 5.1.8
name String The resource name. 5.1.8
description String The resource description. 5.1.8
hostUuid String The host UUID. 5.1.8
parentUuid String 5.1.8
vmInstanceUuid String The VM instance UUID. 5.1.8
pciSpecUuid String 5.1.8
vendorId String 5.1.8
vendor String 5.1.8
deviceId String 5.1.8
device String 5.1.8
subvendorId String 5.1.8
subdeviceId String 5.1.8
pciDeviceAddress String 5.1.8
iommuGroup String 5.1.8
createDate Timestamp The creation date. 5.1.8
lastOpDate Timestamp The last operation date. 5.1.8
type PciDeviceType See type. 5.1.8
state PciDeviceState See state. 5.1.8
status PciDeviceStatus See status. 5.1.8
virtStatus PciDeviceVirtStatus See virStatus. 5.1.8
chooser PciDeviceChooser See chooser. 5.1.8
metaData PciDeviceMetaData See metaData. 5.1.8
matchedPciDeviceOfferingRef List See matchedPciDeviceOfferingRef. 5.1.8
mdevSpecRefs List See mdevSpecRefs. 5.1.8
#type
Name Type Description Starting Version
GPU_Video_Controller PciDeviceType The GPU video controller. 5.1.8
GPU_Audio_Controller PciDeviceType The GPU audio controller. 5.1.8
GPU_3D_Controller PciDeviceType The GPU 3D controller. 5.1.8
Moxa_Device PciDeviceType The MOXA device. 5.1.8
Generic PciDeviceType The generic devices. 5.1.8
#state
Name Type Description Starting Version
Enabled PciDeviceState The device is enabled. 5.1.8
Disabled PciDeviceState The device is disabled. 5.1.8
#status
Name Type Description Starting Version
Active PciDeviceStatus The device is active. 5.1.8
Attached PciDeviceStatus The device is attached. 5.1.8
System PciDeviceStatus The system. 5.1.8
#virStatus
Name Type Description Starting Version
UNVIRTUALIZABLE PciDeviceVirtStatus The device is unvirtualizable. 5.1.8
SRIOV_VIRTUALIZABLE PciDeviceVirtStatus The device supports the SRIOV virtualization. 5.1.8
VFIO_MDEV_VIRTUALIZABLE PciDeviceVirtStatus The device supports the VFIO_MDEV virtualization. 5.1.8
SRIOV_VIRTUALIZED PciDeviceVirtStatus The device is virtualized through the SRIOV method. 5.1.8
VFIO_MDEV_VIRTUALIZED PciDeviceVirtStatus The device is virtualized through the VFIO_MDEV method. 5.1.8
SRIOV_VIRTUAL PciDeviceVirtStatus The device that is generated through the SRIOV virtualization. 5.1.8
UNKNOWN PciDeviceVirtStatus Unknown. 5.1.8
#chooser
Name Type Description Starting Version
None PciDeviceChooser 5.1.8
Device PciDeviceChooser 5.1.8
Spec PciDeviceChooser 5.1.8
#metaData
Name Type Description Starting Version
metaData String 5.1.8
metaDataEntries List See metaDataEntries. 5.1.8
#metaDataEntries
Name Type Description Starting Version
key String The key. 5.1.8
value String The value. 5.1.8
op PciDeviceMetaDataOperator See op. 5.1.8
#op
Name Type Description Starting Version
Equal PciDeviceMetaDataOperator Equal. 5.1.8
Unequal PciDeviceMetaDataOperator Unequal. 5.1.8
#matchedPciDeviceOfferingRef
Name Type Description Starting Version
pciDeviceUuid String 5.1.8
pciDeviceOfferingUuid String 5.1.8
#mdevSpecRefs
Name Type Description Starting Version
pciDeviceUuid String The PCI device UUID. 5.1.8
mdevSpecUuid String The MDEV device offering UUID. 5.1.8
effective Boolean Whether the MDEV offering is used for the PCI device virtualization. 5.1.8
createDate Timestamp The creation date. 5.1.8
lastOpDate Timestamp The last operation date. 5.1.8

SDK Sample

Java SDK
QueryGpuDeviceAction action = new QueryGpuDeviceAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryGpuDeviceAction.Result res = action.call();
Python SDK
QueryGpuDeviceAction action = QueryGpuDeviceAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryGpuDeviceAction.Result res = action.call()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center