Update PCI Device Spec

PUT/zstack/v1/pci-device-specs/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/actions

Parameter 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

  • Enabled
  • Disabled

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"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error3.5.0
inventoryPciDeviceSpecInventorySee inventory3.5.0

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. SYS.1000, HOST.10013.5.0
descriptionStringBrief description of the error3.5.0
detailsStringDetailed error information3.5.0
elaborationStringReserved field, defaults to null3.5.0
opaqueLinkedHashMapReserved field, defaults to null3.5.0
causeErrorCodeRoot cause, the source error that caused the current error, null if no original error3.5.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource3.5.0
nameStringResource name3.5.0
descriptionStringResource description3.5.0
vendorIdStringVendor ID3.5.0
deviceIdStringDevice ID3.5.0
subvendorIdStringSub-vendor ID3.5.0
subdeviceIdStringSub-device ID3.5.0
ramSizeStringGPU memory capacity3.5.0
maxPartNumIntegerMaximum partition number3.5.0
isVirtualBooleanWhether it is a virtual device3.5.0
romVersionStringFirmware version3.5.0
romMd5sumStringFirmware MD53.5.0
createDateTimestampCreate date3.5.0
lastOpDateTimestampLast update date3.5.0
typePciDeviceTypeSee type3.5.0
statePciDeviceSpecStateSee state3.5.0

type

NameTypeDescriptionStarting Version
GPU_Video_ControllerPciDeviceTypeGPU video controller2.1
GPU_Audio_ControllerPciDeviceTypeGPU audio controller2.1
GPU_3D_ControllerPciDeviceTypeGPU 3D controller2.1
Moxa_DevicePciDeviceTypeMOXA card2.1
GenericPciDeviceTypeGeneric device2.1

state

NameTypeDescriptionStarting Version
EnabledPciDeviceSpecStateEnabled3.5.0
DisabledPciDeviceSpecStateDisabled3.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()