跳转到主要内容
存储管理/数据存储相关接口/本地存储相关接口
GETLocal Storage Related Interfaces起始版本 4.3.0同步需要认证

获取主机磁盘信息

获取主机磁盘信息

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

查询参数

请求参数

查询参数

  • usernameString必填

    主机名

  • passwordString

    主机密码

  • sshPortInteger必填

    主机端口

  • hostNameString必填

    主机IP

  • excludedTypesList

    指定排除的磁盘类型

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • successboolean必填

    操作是否成功。

  • blockDevicesBlockDevices必填

    详情参考blockDevices

    • unusedBlockDevicesList必填

      详情参考unusedBlockDevices

      • nameString必填

        硬盘设备名字

      • typeString必填

        磁盘类型

      • sizelong必填

        磁盘容量

      • usedlong必填

        磁盘已使用容量

      • availablelong必填

        磁盘可使用容量

      • physicalSectorlong必填

        物理扇区大小

      • logicalSectorlong必填

        逻辑扇区大小

      • mountPointString必填

        挂载点

      • partitionTableString必填

        分区表类型

      • fsTypeString必填

        文件系统类型

      • serialNumberString必填

        序列号

      • modelString必填

        型号

      • mediaTypeString必填

        介质类型

      • usedRatioString必填

        使用率

      • smartPassedBoolean必填

        获取磁盘smart状态

      • smartMessageString必填

        获取磁盘smart状态失败时输出信息

      • multipathboolean必填

        是否为多路径设备;true 表示该磁盘自身为 multipath 设备或为 multipath 底层路径盘

      • childrenList必填

        详情参考children

    • usedBlockDevicesList必填

      详情参考usedBlockDevices

      • nameString必填

        硬盘设备名字

      • typeString必填

        磁盘类型

      • sizelong必填

        磁盘容量

      • usedlong必填

        磁盘已使用容量

      • availablelong必填

        磁盘可使用容量

      • physicalSectorlong必填

        物理扇区大小

      • logicalSectorlong必填

        逻辑扇区大小

      • mountPointString必填

        挂载点

      • partitionTableString必填

        分区表类型

      • fsTypeString必填

        文件系统类型

      • serialNumberString必填

        序列号

      • modelString必填

        型号

      • mediaTypeString必填

        介质类型

      • usedRatioString必填

        使用率

      • smartPassedBoolean必填

        获取磁盘smart状态

      • smartMessageString必填

        获取磁盘smart状态失败时输出信息

      • multipathboolean必填

        是否为多路径设备;true 表示该磁盘自身为 multipath 设备或为 multipath 底层路径盘

      • childrenList必填

        详情参考children

  • errorErrorCode必填

    错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

请求地址

GET/zstack/v1/host/get-block-devices

/zstack/v1/host/get-block-devices

操作 ID

GetPhysicalMachineBlockDevices

永久链接

请求示例

curl -X GET 'http://{host}/zstack/v1/host/get-block-devices?username=<username>&password=<password>&sshPort=1&hostName=<hostName>&excludedTypes=<excludedTypes>&systemTags=<systemTags>&userTags=<userTags>' -H 'Authorization: OAuth {sessionUuid}'

响应示例

200
{ "blockDevices": { "unusedBlockDevices": [ { "name": "/dev/vdb", "type": "disk", "size": 322122547200, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "partitionTable": "msdos", "usedRatio": 0, "multipath": false }, { "name": "/dev/vdc", "type": "disk", "size": 429496729600, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "partitionTable": "unknown", "usedRatio": 0, "multipath": false } ], "usedBlockDevices": [ { "name": "/dev/vda", "type": "disk", "size": 429496729600, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "children": [ { "name": "/dev/vda1", "type": "part", "size": 1073741824, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "mountPoint": "/boot", "partitionTable": "unknown", "usedRatio": 0, "multipath": false }, { "name": "/dev/vda2", "type": "part", "size": 428421939200, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "children": [ { "name": "/dev/mapper/zstack-root", "type": "lvm", "size": 419950493696, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "mountPoint": "/", "partitionTable": "unknown", "usedRatio": 0, "multipath": false }, { "name": "/dev/mapper/zstack-swap", "type": "lvm", "size": 8468299776, "used": 0, "available": 0, "physicalSector": 512, "logicalSector": 512, "mountPoint": "[SWAP]", "partitionTable": "unknown", "usedRatio": 0, "multipath": false } ], "partitionTable": "unknown", "usedRatio": 0, "multipath": false } ], "partitionTable": "unknown", "usedRatio": 0, "multipath": false } ] } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史