查询Raid物理盘

GET/zstack/v1/storage-devices/local-raid/physical-drives
GET/zstack/v1/storage-devices/local-raid/physical-drives/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/local-raid/physical-drives/75dae76e484537bbaea154d9348f4e15

可查询字段

运行CLI命令行工具,输入QueryLocalRaidPhysicalDrive并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "inventories": [
    {
      "uuid": "ba2fe0dcd360397a92748ea6efe9ffd6",
      "name": "raidPhysical",
      "raidLevel": "raid1",
      "raidControllerUuid": "1022305d664e34329a63f350a2fd1e02",
      "enclosureDeviceId": 252,
      "slotNumber": 1,
      "diskGroup": 0,
      "wwn": "50014ee059f2f491",
      "serialNumber": "V6GLEX2S",
      "deviceModel": "HGST HUS726T4TALA6L4",
      "size": 1000204886016,
      "driveState": "Online, Spun Up",
      "locateStatus": "Disabled",
      "driveType": "SATA",
      "mediaType": "HDD",
      "rotationRate": 7200,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {}
  ]
}
名字类型描述起始版本
successboolean 0.6
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error3.6
inventoriesList详情参考inventories3.6

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源3.6
nameString资源名称3.6
raidLevelStringRaid级别3.6
raidControllerUuidStringRaid控制器Uuid3.6
descriptionString资源的详细描述3.6
enclosureDeviceIdIntegerEnclosure Id3.6
slotNumberInteger槽位号3.6
deviceIdIntegerDevice Id3.6
diskGroupInteger磁盘组 Id3.6
wwnStringWWN3.6
serialNumberString序列号3.6
deviceModelString磁盘规格3.6
sizeLong磁盘大小3.6
driveStateString磁盘状态3.6
driveTypeString接口类型3.6
mediaTypeString介质类型3.6
rotationRateInteger转速3.6
createDateTimestamp创建时间3.6
lastOpDateTimestamp最后一次修改时间3.6
locateStatusLocateStatus详情参考locateStatus3.6

locateStatus

名字类型描述起始版本
EnabledLocateStatus定位灯闪烁3.6
DisabledLocateStatus定位灯关闭3.6

SDK示例

Java SDK

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

Python SDK

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