Update PCI Device Spec
Headers
Authorization: OAuth the-session-uuidBody
{
"updatePciDeviceSpec": {
"name": "MSI_GTX1060",
"description": "NVIDIA Corporation, GP106 [GeForce GTX 1060 6GB], a1, VGA compatible controller",
"romContent": "*BASE64 ENCODED ROM CONTENT*",
"romVersion": "86.06.0E.00.29",
"abandonSpecRom": false,
"state": "Enabled"
},
"systemTags": [],
"userTags": []
}systemTags and userTags fields can be omitted in the above example. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updatePciDeviceSpec":{"name":"MSI_GTX1060","description":"NVIDIA Corporation, GP106 [GeForce GTX 1060 6GB], a1, VGA compatible controller","romContent":"*BASE64 ENCODED ROM CONTENT*","romVersion":"86.06.0E.00.29","abandonSpecRom":false,"state":"Enabled"}}' http://localhost:8080/zstack/v1/pci-device-specs/78ba2350be1e451597c2d42f778d0241/actionsParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
uuid | String | url | UUID of the resource, uniquely identifies the resource |
| 3.5.0 |
name (Optional) | String | body(inside the updatePciDeviceSpec structure) | Resource name |
| 3.5.0 |
description (Optional) | String | body(inside the updatePciDeviceSpec structure) | Resource description |
| 3.5.0 |
romContent (Optional) | String | body(inside the updatePciDeviceSpec structure) | BASE64 encoded firmware content |
| 3.5.0 |
romVersion (Optional) | String | body(inside the updatePciDeviceSpec structure) | Firmware version |
| 3.5.0 |
abandonSpecRom (Optional) | boolean | body(inside the updatePciDeviceSpec structure) | Delete existing firmware |
| 3.5.0 |
state (Optional) | String | body(inside the updatePciDeviceSpec structure) | PCI device spec state |
| 3.5.0 |
systemTags (Optional) | List | body | System tags |
| 3.5.0 |
userTags (Optional) | List | body | User tags |
| 3.5.0 |
API Response
Response Example
{
"inventory": {
"uuid": "304bc9b4af93442fb666bef79e84243a",
"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 |
| inventory | PciDeviceSpecInventory | See inventory | 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 |
inventory
| 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
UpdatePciDeviceSpecAction action = new UpdatePciDeviceSpecAction();
action.uuid = "2e9160ddd31245dca87eee7d7d2a2ac8";
action.name = "MSI_GTX1060";
action.description = "NVIDIA Corporation, GP106 [GeForce GTX 1060 6GB], a1, VGA compatible controller";
action.romContent = "*BASE64 ENCODED ROM CONTENT*";
action.romVersion = "86.06.0E.00.29";
action.abandonSpecRom = false;
action.state = "Enabled";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdatePciDeviceSpecAction.Result res = action.call();Python SDK
UpdatePciDeviceSpecAction action = UpdatePciDeviceSpecAction()
action.uuid = "2589cc1b20294e0b85d75f652f7dcf77"
action.name = "MSI_GTX1060"
action.description = "NVIDIA Corporation, GP106 [GeForce GTX 1060 6GB], a1, VGA compatible controller"
action.romContent = "*BASE64 ENCODED ROM CONTENT*"
action.romVersion = "86.06.0E.00.29"
action.abandonSpecRom = false
action.state = "Enabled"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdatePciDeviceSpecAction.Result res = action.call()