Get Available MDEV 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/mdev-device-specs/candidates?vmInstanceUuid=319897b485313c7a96b0af986b91baea&types=GPU_Video_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 | VM Instance UUID | 3.5.0 | |
| vmInstanceUuids (Optional) | List | query | VM Instance 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": "b6051f3e98c143d1bee891ff69f8fad4",
"name": "GRID_M60-2A",
"specification": "{Max Resolution=1920*1080, GRID License=GRID-Virtual-Apps,3.0, Instance Number=4, Display Heads=4, Vendor=NVIDIA, Frame Rate Limit=60FPS, Name=GRID_M60-2A, RAM=2048MB}",
"type": "GPU_Video_Controller",
"state": "Enabled",
"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, 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 |
| specification | String | Specification details | 3.5.0 |
| createDate | Timestamp | Create date | 3.5.0 |
| lastOpDate | Timestamp | Last modified date | 3.5.0 |
| type | MdevDeviceType | See type | 3.5.0 |
| state | MdevDeviceSpecState | See state | 3.5.0 |
type
| Name | Type | Description | Starting Version |
|---|---|---|---|
| GPU_Video_Controller | MdevDeviceType | GPU video controller | 3.5.0 |
state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Enabled | MdevDeviceSpecState | Enabled | 3.5.0 |
| Disabled | MdevDeviceSpecState | Disabled | 3.5.0 |
SDK Examples
Java SDK
GetMdevDeviceSpecCandidatesAction action = new GetMdevDeviceSpecCandidatesAction();
action.vmInstanceUuid = "319897b485313c7a96b0af986b91baea";
action.types = asList("GPU_Video_Controller");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetMdevDeviceSpecCandidatesAction.Result res = action.call();Python SDK
GetMdevDeviceSpecCandidatesAction action = GetMdevDeviceSpecCandidatesAction()
action.vmInstanceUuid = "319897b485313c7a96b0af986b91baea"
action.types = [GPU_Video_Controller]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetMdevDeviceSpecCandidatesAction.Result res = action.call()