Query NVMe Target

GET/zstack/v1/storage-devices/nvme/controllers
GET/zstack/v1/storage-devices/nvme
GET/zstack/v1/storage-devices/nvme/controllers/{uuid}

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/storage-devices/nvme/controllers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllers/de0f2549ed0130948f14b00916fbf9a0

Queryable Fields

Run the CLI command tool, enter QueryNvmeTarget and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "40ab069909633d4293c62f44efb26db8",
      "state": "Enabled",
      "nvmeLuns": [
        {
          "nvmeTargetUuid": "40ab069909633d4293c62f44efb26db8",
          "nvmeLunHostRefs": [
            {
              "id": 1,
              "nvmeLunUuid": "5690b46050623763a0335e753c347fa1",
              "hostUuid": "d6f8a7ff0069304080b345c077c3aeb9",
              "createDate": "Nov 14, 2017 10:20:57 PM",
              "lastOpDate": "Nov 14, 2017 10:20:57 PM"
            }
          ],
          "name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
          "uuid": "5690b46050623763a0335e753c347fa1",
          "wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
          "serial": "3d87eca1686c1782",
          "type": "disk",
          "path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
          "size": 5497558138880
        }
      ],
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.6.21
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. For details, see error4.6.21
inventoriesListFor details, see inventories4.6.21

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, for example SYS.1000, HOST.10014.6.21
descriptionStringBrief summary of the error4.6.21
detailsStringDetailed error information4.6.21
elaborationStringReserved field, defaults to null4.6.21
opaqueLinkedHashMapReserved field, defaults to null4.6.21
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null4.6.21

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource4.6.21
nameStringResource name4.6.21
nqnStringNVMe Qualified Name4.6.21
stateStringState4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21
nvmeLunsListFor details, see nvmeLuns4.6.21

nvmeLuns

NameTypeDescriptionStarting Version
nvmeTargetUuidStringNVMe device UUID4.6.21
nameStringResource name4.6.21
uuidStringResource UUID, uniquely identifies the resource4.6.21
wwidStringGlobal unique identifier4.6.21
vendorStringVendor4.6.21
modelStringModel4.6.21
wwnString 4.6.21
serialStringSerial number4.6.21
typeStringType4.6.21
hctlString 4.6.21
pathStringPath4.6.21
stateStringState4.6.21
sizeLongSize4.6.21
multipathDeviceUuidStringMultipath device UUID4.6.21
sourceStringDisk source, NVMe4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21
nvmeLunHostRefsListFor details, see nvmeLunHostRefs4.6.21

nvmeLunHostRefs

NameTypeDescriptionStarting Version
nvmeLunUuidListNVMe disk UUID4.6.21
hostUuidStringHost UUID4.6.21
pathStringDisk path4.6.21
hctlStringDisk HCTL4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21

SDK Examples

Java SDK

QueryNvmeTargetAction action = new QueryNvmeTargetAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeTargetAction.Result res = action.call();

Python SDK

QueryNvmeTargetAction action = QueryNvmeTargetAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeTargetAction.Result res = action.call()