查询PCI设备规格

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

可查询字段

运行CLI命令行工具,输入QueryPciDeviceSpec并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "inventories": [
    {
      "uuid": "6a2537202e134f9fa240f0455fc507cc",
      "name": "MSI_GTX1060",
      "description": "NVIDIA Corporation, GP106 [GeForce GTX 1060 6GB], a1, VGA compatible controller",
      "vendorId": "10de",
      "deviceId": "1c03",
      "subvendorId": "1462",
      "subdeviceId": "3283",
      "type": "GPU_Video_Controller",
      "state": "Enabled",
      "romVersion": "86.06.0E.00.28",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
名字类型描述起始版本
successboolean 0.6
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error3.5.0
inventoriesList详情参考inventories3.5.0

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10013.5.0
descriptionString错误的概要描述3.5.0
detailsString错误的详细信息3.5.0
elaborationString保留字段,默认为null3.5.0
opaqueLinkedHashMap保留字段,默认为null3.5.0
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null3.5.0

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源3.5.0
nameString资源名称3.5.0
descriptionString资源的详细描述3.5.0
vendorIdString供应商ID3.5.0
deviceIdString设备ID3.5.0
subvendorIdString子供应商ID3.5.0
subdeviceIdString子设备ID3.5.0
ramSizeString显存容量3.5.0
maxPartNumInteger最大切分数量3.5.0
isVirtualBoolean是否虚拟设备3.5.0
romVersionString固件版本3.5.0
romMd5sumString固件MD53.5.0
createDateTimestamp创建时间3.5.0
lastOpDateTimestamp最后一次修改时间3.5.0
typePciDeviceType详情参考type3.5.0
statePciDeviceSpecState详情参考state3.5.0

type

名字类型描述起始版本
GPU_Video_ControllerPciDeviceTypeGPU显卡控制器2.1
GPU_Audio_ControllerPciDeviceTypeGPU声卡控制器2.1
GPU_3D_ControllerPciDeviceTypeGPU 3D控制器2.1
Moxa_DevicePciDeviceTypeMOXA卡2.1
GenericPciDeviceType一般设备2.1

state

名字类型描述起始版本
EnabledPciDeviceSpecState启用3.5.0
DisabledPciDeviceSpecState停用3.5.0

SDK示例

Java SDK

QueryPciDeviceSpecAction action = new QueryPciDeviceSpecAction();
action.conditions = asList("uuid=96a05dc8dbee32ddb15c63680df63792");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryPciDeviceSpecAction.Result res = action.call();

Python SDK

QueryPciDeviceSpecAction action = QueryPciDeviceSpecAction()
action.conditions = ["uuid=362f676642ba3288bf02c98fcee26d74"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryPciDeviceSpecAction.Result res = action.call()