Query VM Instance and PCI Device Spec Mapping

GET/zstack/v1/vm-instances/{vmInstanceUuid}/pci-device-specs
GET zstack/v1/vm-instances/{vmInstanceUuid}/pci-device-specs/{pciSpecUuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/{vmInstanceUuid}/pci-device-specs?q=vmInstanceUuid=e58abf7fd2d0332bb18ba348195be863
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/{vmInstanceUuid}/pci-device-specs/{pciSpecUuid}?q=vmInstanceUuid=34ff56e0fd1e3cd789a30d66fd4bf3aa

Queryable Fields

Run the CLI command tool, enter QueryVmInstancePciDeviceSpecRef and press Tab to view all queryable fields and cross-resource names.

API Response

Response Example

{
  "inventories": [
    {
      "vmInstanceUuid": "bf5c475cc0954616adacebb9b2b2a9e2",
      "pciSpecUuid": "260464ce341043588f0cc30dde70ed42",
      "pciDeviceNumber": 1,
      "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
inventoriesListSee inventories3.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

inventories

NameTypeDescriptionStarting Version
vmInstanceUuidStringVirtual Machine UUID3.5.0
pciSpecUuidStringPCI device spec UUID3.5.0
pciDeviceNumberIntegerNumber of PCI devices matching the device spec to attach to the VM, defaults to 13.5.0
createDateTimestampCreate date3.5.0
lastOpDateTimestampLast update date3.5.0

SDK Examples

Java SDK

QueryVmInstancePciDeviceSpecRefAction action = new QueryVmInstancePciDeviceSpecRefAction();
action.conditions = asList("vmInstanceUuid=67c3ebbb1c683373a52310b218164181");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmInstancePciDeviceSpecRefAction.Result res = action.call();

Python SDK

QueryVmInstancePciDeviceSpecRefAction action = QueryVmInstancePciDeviceSpecRefAction()
action.conditions = ["vmInstanceUuid=aef75bdacefd33349d9f15eb0f96fe89"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmInstancePciDeviceSpecRefAction.Result res = action.call()