Generate SR-IOV Virtualized PCI Devices
Headers
Authorization: OAuth the-session-uuidBody
{
"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/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| pciDeviceUuid | String | url | PCI UUID | 3.5.0 | |
| virtPartNum | Integer | body(inside the generateSriovPciDevices structure) | Partition number | 3.5.0 | |
| systemTags (Optional) | List | body | System tags | 3.5.0 | |
| userTags (Optional) | List | body | User 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()