Create PCI Device Offering

POST/zstack/v1/pci-device/pci-device-offerings

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "test",
    "vendorId": "10de",
    "deviceId": "0e0f"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, the systemTags and userTags fields can be omitted. 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 POST -d '{"params":{"name":"test","vendorId":"10de","deviceId":"0e0f"}}' \
http://localhost:8080/zstack/v1/pci-device/pci-device-offerings

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
name (Optional)Stringbody (contained in the params structure)Resource name 2.1
description (Optional)Stringbody (contained in the params structure)Resource description 2.1
vendorIdStringbody (contained in the params structure)Vendor ID 2.1
deviceIdStringbody (contained in the params structure)Device ID 2.1
subvendorId (Optional)Stringbody (contained in the params structure)Sub-vendor ID 2.1
subdeviceId (Optional)Stringbody (contained in the params structure)Sub-device ID 2.1
ramSize (Optional)Stringbody (contained in the params structure)RAM capacity 3.5.0
resourceUuid (Optional)Stringbody (contained in the params structure)  2.1
systemTags (Optional)Listbody  2.1
userTags (Optional)Listbody  2.1
tagUuids (Optional)Listbody (contained in the params structure)Tag UUID list 3.4.0

API Response

Response Example

{
  "inventory": {
    "type": "GPU_Video",
    "vendorId": "10de",
    "deviceId": "0e0f",
    "subvendorId": "10de",
    "subdeviceId": "118b"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error2.1
inventoryPciDeviceOfferingInventorySee inventory2.1

error

NameTypeDescriptionStarting Version
codeStringError code, a globally unique identifier of the error, e.g. SYS.1000, HOST.10012.1
descriptionStringBrief description of the error2.1
detailsStringDetailed error information2.1
elaborationStringReserved field, defaults to null2.1
opaqueLinkedHashMapReserved field, defaults to null2.1
causeErrorCodeRoot cause, the source error that caused the current error, null if no original error2.1

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifies the resource2.1
nameStringResource name2.1
descriptionStringResource description2.1
vendorIdStringVendor ID2.1
deviceIdStringDevice ID2.1
subvendorIdStringSub-vendor ID2.1
subdeviceIdStringSub-device ID2.1
ramSizeStringGPU memory capacity3.5.0
createDateTimestampCreate date2.1
lastOpDateTimestampLast update date2.1
typePciDeviceOfferingTypeSee type2.1
attachedInstanceOfferingsListSee attachedInstanceOfferings2.1
matchedPciDevicesListSee matchedPciDevices2.1

type

NameTypeDescriptionStarting Version
GPU_VideoPciDeviceOfferingTypeGPU video2.1
GPU_AudioPciDeviceOfferingTypeGPU audio2.1
GenericPciDeviceOfferingTypeGeneric device2.1

attachedInstanceOfferings

NameTypeDescriptionStarting Version
idlong 2.1
instanceOfferingUuidStringCompute offering UUID2.1
pciDeviceOfferingUuidString 2.1
pciDeviceCountInteger 2.1
metadataPciDeviceMetaDataSee metadata2.1

metadata

NameTypeDescriptionStarting Version
metaDataString 2.1
metaDataEntriesListSee metaDataEntries2.1

metaDataEntries

NameTypeDescriptionStarting Version
keyStringKey2.1
valueStringValue2.1
opPciDeviceMetaDataOperatorSee op2.1

op

NameTypeDescriptionStarting Version
EqualPciDeviceMetaDataOperatorEqual2.1
UnequalPciDeviceMetaDataOperatorUnequal2.1

matchedPciDevices

NameTypeDescriptionStarting Version
pciDeviceUuidString 2.1
pciDeviceOfferingUuidString 2.1

SDK Examples

Java SDK

CreatePciDeviceOfferingAction action = new CreatePciDeviceOfferingAction();
action.name = "test";
action.vendorId = "10de";
action.deviceId = "0e0f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreatePciDeviceOfferingAction.Result res = action.call();

Python SDK

CreatePciDeviceOfferingAction action = CreatePciDeviceOfferingAction()
action.name = "test"
action.vendorId = "10de"
action.deviceId = "0e0f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreatePciDeviceOfferingAction.Result res = action.call()