跳到主要内容
版本:latest

GetDiskInfo

获取服务器磁盘分区信息。自动过滤 /boot/dev/shm/proc、Docker overlay、snap 等非核心分区。

  • 路由POST /system
  • actionGetDiskInfo

输入参数

除公共参数外无需额外参数。

参数名称必选类型描述
actionString固定值 GetDiskInfo

输出参数

返回磁盘分区数组,每项包含:

参数名称类型描述
pathString挂载路径,如 //www
sizeArray[String][总大小, 已用, 可用, 使用率%, 已用(inode), 剩余]
filesystemString设备名,如 /dev/sda1
typeString文件系统类型,如 ext4xfs
inodesArray[String][总inode数, 已用, 剩余, 使用率%]
byte_sizeArray[Integer][总字节, 已用字节, 剩余字节]
d_sizeString物理磁盘大小,云环境可能为 None

示例

请求

POST /system HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetDiskInfo

响应

[{
"path": "/",
"size": ["19.5 GB", "4.8 GB", "13.8 GB", "26.00%", "859.4 MB", "4.8"],
"filesystem": "/dev/sda1",
"type": "ext4",
"inodes": [1302528, 107216, 1195312, "8.23 %"],
"byte_size": [20922114048, 5204590592, 14816325632],
"d_size": "None"
}]