Path: API › 系统管理

`POST /system`

管理服务器上各类服务的启动、停止、重启和重载。

## Request body

_Required._

- `action350.request_time` (string, required) — Unix 时间戳。
- `action350.request_token` (string, required) — 按 API 概览生成的签名。
- `action350.action` (string, required) — 具体操作名称。
  - one of `"ServiceAdmin"`
- `action350.name` (string, required) — 服务名称
- `action350.type` (string, required) — 操作类型

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "ServiceAdmin",
  "name": "string",
  "type": "string"
}
```

## 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=ServiceAdmin" \
  --data-urlencode "name=<name>" \
  --data-urlencode "type=<type>"
```

## Responses

### default

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

#### Example

```json
{
  "status": true,
  "msg": "执行成功!"
}
```

- `action350.response.default.status` (boolean, optional) — `true` 表示操作成功
- `action350.response.default.msg` (string, optional) — 执行结果描述，如 `执行成功!`


## ServiceAdmin

管理服务器上各类服务的启动、停止、重启和重载。

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

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `ServiceAdmin` |
| name | 是 | String | 服务名称 |
| type | 是 | String | 操作类型 |

### name 取值

| 值 | 服务 |
|----|------|
| `nginx` | Nginx |
| `httpd` / `apache` | Apache |
| `mysqld` | MySQL / MariaDB |
| `pure-ftpd` | Pure-FTPd |
| `redis` | Redis |
| `memcached` | Memcached |
| `phpmyadmin` | phpMyAdmin |
| `openlitespeed` | OpenLiteSpeed |
| `tomcat` | Tomcat |
| `webserver` | 自动识别当前 Web 服务器 |

### type 取值

| 值 | 操作 |
|----|------|
| `start` | 启动 |
| `stop` | 停止 |
| `restart` | 重启 |
| `reload` | 重载配置（不中断服务） |
| `test` | 测试配置文件 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | `true` 表示操作成功 |
| msg | String | 执行结果描述，如 `执行成功!` |

## 示例

### 重启 Nginx

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

request_time=1700000000&request_token=xxx&action=ServiceAdmin&name=nginx&type=restart
```

### 响应

```json
{"status": true, "msg": "执行成功!"}
```

### 启动 MySQL

```
action=ServiceAdmin&name=mysqld&type=start
```

