Query PCI Device Spec
GET zstack/v1/pci-device-specs/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
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=148eb0059a193de59e5278395c36baa7curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/pci-device-specs/f5caf15dfb98366cbf87d41aa01385b9Queryable Fields
Run the CLI command tool, enter QueryPciDeviceSpec and press Tab to view all queryable fields and cross-resource names.
API Response
Response Example
{
"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"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. See error | 3.5.0 |
| inventories | List | See inventories | 3.5.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code, a globally unique identifier of the error, e.g. SYS.1000, HOST.1001 | 3.5.0 |
| description | String | Brief description of the error | 3.5.0 |
| details | String | Detailed error information | 3.5.0 |
| elaboration | String | Reserved field, defaults to null | 3.5.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 3.5.0 |
| cause | ErrorCode | Root cause, the source error that caused the current error, null if no original error | 3.5.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource, uniquely identifies the resource | 3.5.0 |
| name | String | Resource name | 3.5.0 |
| description | String | Resource description | 3.5.0 |
| vendorId | String | Vendor ID | 3.5.0 |
| deviceId | String | Device ID | 3.5.0 |
| subvendorId | String | Sub-vendor ID | 3.5.0 |
| subdeviceId | String | Sub-device ID | 3.5.0 |
| ramSize | String | GPU memory capacity | 3.5.0 |
| maxPartNum | Integer | Maximum partition number | 3.5.0 |
| isVirtual | Boolean | Whether it is a virtual device | 3.5.0 |
| romVersion | String | Firmware version | 3.5.0 |
| romMd5sum | String | Firmware MD5 | 3.5.0 |
| createDate | Timestamp | Create date | 3.5.0 |
| lastOpDate | Timestamp | Last update date | 3.5.0 |
| type | PciDeviceType | See type | 3.5.0 |
| state | PciDeviceSpecState | See state | 3.5.0 |
type
| Name | Type | Description | Starting Version |
|---|---|---|---|
| GPU_Video_Controller | PciDeviceType | GPU video controller | 2.1 |
| GPU_Audio_Controller | PciDeviceType | GPU audio controller | 2.1 |
| GPU_3D_Controller | PciDeviceType | GPU 3D controller | 2.1 |
| Moxa_Device | PciDeviceType | MOXA card | 2.1 |
| Generic | PciDeviceType | Generic device | 2.1 |
state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Enabled | PciDeviceSpecState | Enabled | 3.5.0 |
| Disabled | PciDeviceSpecState | Disabled | 3.5.0 |
SDK Examples
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()