Path: API › 系统管理

`POST /system`

获取 CPU 详细信息。调用 `psutil.cpu_percent(percpu=True, interval=interval)` 采样。

## Request body

_Required._

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

## Example request

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

## 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=GetCpuInfo"
```

## Responses

### default

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

#### Example

```json
[
  12.5,
  2,
  [
    15,
    10
  ],
  "Intel Core Processor (Skylake, IBRS)",
  1,
  1
]
```

- `action341.response.default.0` (number, optional) — 整体 CPU 使用率（%）
- `action341.response.default.1` (integer, optional) — 逻辑核心数
- `action341.response.default.2` (string, optional) — 各核心使用率数组
- `action341.response.default.3` (string, optional) — CPU 型号名称
- `action341.response.default.4` (integer, optional) — 物理核心数
- `action341.response.default.5` (integer, optional) — 物理 CPU 数


## GetCpuInfo

获取 CPU 详细信息。调用 `psutil.cpu_percent(percpu=True, interval=interval)` 采样。

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

## 输入参数

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

> 采样间隔固定为 1 秒，不可通过 API 修改。

## 输出参数

返回数组 `[使用率%, 逻辑核心数, [各核使用率...], CPU名称, 物理核心数, 物理CPU数]`。

| 索引 | 类型 | 描述 |
|------|------|------|
| 0 | Float | 整体 CPU 使用率（%） |
| 1 | Integer | 逻辑核心数 |
| 2 | Array[Float] | 各核心使用率数组 |
| 3 | String | CPU 型号名称 |
| 4 | Integer | 物理核心数 |
| 5 | Integer | 物理 CPU 数 |

## 示例

### 请求

```
POST /system HTTP/1.1
Content-Type: application/x-www-form-urlencoded

request_time=1700000000&request_token=xxx&action=GetCpuInfo
```

### 响应

```json
[12.5, 2, [15.0, 10.0], "Intel Core Processor (Skylake, IBRS)", 1, 1]
```

