Get PCI Device Spec Candidates
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/candidates?clusterUuids=d3305a8348d937ba97d260fb0af0e87d&clusterUuids=4943e8ab691435f98f7d22e3196f36a0&hostUuid=8bcb6475294a3283b5105f36c52c4aa9&vmInstanceUuid=c4bd1f978e843300b8de214567841c3a&types=GPU_Video_Controller&types=GPU_Audio_ControllerParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| clusterUuids (Optional) | List | query | Cluster UUID | 3.5.0 | |
| hostUuid (Optional) | String | query | Host UUID | 3.5.0 | |
| vmInstanceUuid (Optional) | String | query | Virtual Machine UUID | 3.5.0 | |
| vmInstanceUuids (Optional) | List | query | Virtual Machine UUID list | 3.6.1 | |
| types (Optional) | List | query | Device type | 3.5.0 | |
| systemTags (Optional) | List | query | System tags | 3.5.0 | |
| userTags (Optional) | List | query | User tags | 3.5.0 |
API Response
Response Example
{
"inventories": [
{
"uuid": "7ba9feb4d0f445ad9dbff82e0e408fc7",
"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
GetPciDeviceSpecCandidatesAction action = new GetPciDeviceSpecCandidatesAction();
action.clusterUuids = asList("d3305a8348d937ba97d260fb0af0e87d","4943e8ab691435f98f7d22e3196f36a0");
action.hostUuid = "8bcb6475294a3283b5105f36c52c4aa9";
action.vmInstanceUuid = "c4bd1f978e843300b8de214567841c3a";
action.types = asList("GPU_Video_Controller","GPU_Audio_Controller");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetPciDeviceSpecCandidatesAction.Result res = action.call();Python SDK
GetPciDeviceSpecCandidatesAction action = GetPciDeviceSpecCandidatesAction()
action.clusterUuids = [d3305a8348d937ba97d260fb0af0e87d, 4943e8ab691435f98f7d22e3196f36a0]
action.hostUuid = "8bcb6475294a3283b5105f36c52c4aa9"
action.vmInstanceUuid = "c4bd1f978e843300b8de214567841c3a"
action.types = [GPU_Video_Controller, GPU_Audio_Controller]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetPciDeviceSpecCandidatesAction.Result res = action.call()