Generate SR-IOV Virtualized PCI Devices

PUT/zstack/v1/pci-devices/{pciDeviceUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "generateSriovPciDevices": {
    "virtPartNum": 4
  },
  "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 '{"generateSriovPciDevices":{"virtPartNum":4}}' http://localhost:8080/zstack/v1/pci-devices/ce07829a08273d129f3b9d11cdf830b9/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
pciDeviceUuidStringurlPCI UUID 3.5.0
virtPartNumIntegerbody(inside the generateSriovPciDevices structure)Partition number 3.5.0
systemTags (Optional)ListbodySystem tags 3.5.0
userTags (Optional)ListbodyUser tags 3.5.0

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON contains an error field, for example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

GenerateSriovPciDevicesAction action = new GenerateSriovPciDevicesAction();
action.pciDeviceUuid = "ce07829a08273d129f3b9d11cdf830b9";
action.virtPartNum = 4;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GenerateSriovPciDevicesAction.Result res = action.call();

Python SDK

GenerateSriovPciDevicesAction action = GenerateSriovPciDevicesAction()
action.pciDeviceUuid = "ce07829a08273d129f3b9d11cdf830b9"
action.virtPartNum = 4
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GenerateSriovPciDevicesAction.Result res = action.call()