Path: API › 系统管理

`POST /system`

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

## Request body

_Required._

- `action342.request_time` (string, required) — Unix 时间戳。
- `action342.request_token` (string, required) — 按 API 概览生成的签名。
- `action342.action` (string, required) — 具体操作名称。
  - one of `"GetDiskInfo"`

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "GetDiskInfo"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/system" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=GetDiskInfo"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
[
  {
    "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"
  }
]
```

- `action342.response.default.path` (string, optional) — 挂载路径，如 `/`、`/www`
- `action342.response.default.size` (string, optional) — `[总大小, 已用, 可用, 使用率%, 已用(inode), 剩余]`
- `action342.response.default.filesystem` (string, optional) — 设备名，如 `/dev/sda1`
- `action342.response.default.type` (string, optional) — 文件系统类型，如 `ext4`、`xfs`
- `action342.response.default.inodes` (string, optional) — `[总inode数, 已用, 剩余, 使用率%]`
- `action342.response.default.byte_size` (string, optional) — `[总字节, 已用字节, 剩余字节]`
- `action342.response.default.d_size` (string, optional) — 物理磁盘大小，云环境可能为 `None`


## GetDiskInfo

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

- **路由**：`POST /system`
- **action**：`GetDiskInfo`

## 输入参数

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

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `GetDiskInfo` |

## 输出参数

返回磁盘分区数组，每项包含：

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| path | String | 挂载路径，如 `/`、`/www` |
| size | Array\[String\] | `[总大小, 已用, 可用, 使用率%, 已用(inode), 剩余]` |
| filesystem | String | 设备名，如 `/dev/sda1` |
| type | String | 文件系统类型，如 `ext4`、`xfs` |
| inodes | Array\[String\] | `[总inode数, 已用, 剩余, 使用率%]` |
| byte_size | Array\[Integer\] | `[总字节, 已用字节, 剩余字节]` |
| d_size | String | 物理磁盘大小，云环境可能为 `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
```

### 响应

```json
[{
    "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"
}]
```

