M48 API 开发文档
tip
点击如下链接,可直接进行api调用 https://s.apifox.cn/1ad43eac-ee78-4bb3-b532-67818f536b14
API的鉴权
- HTTP Authentication, scheme: bearer
-
API Key (Access-Id)
- Parameter Name: Access-Id, in: header.
-
API Key (Access-Secret)
- Parameter Name: Access-Secret, in: header.
MYT BMC
GET 获取设备类型
GET /type
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1766982723799,
"data": {
"type": "m48"
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | object | true | none | none | |
| »» type | string | true | none | none |
GET 健康监测
GET /health
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1766570264287,
"data": null
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
MYT BMC/通用接口/用户接口
POST 用户登录
POST /user/login
Body 请求参数
{
"username": "admin",
"password": "123456"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 是 | none |
返回示例
{
"code": 200,
"msg": "success",
"time": 1766569105100,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsImV4cCI6MTc2NjY1NTUwNSwibmJmIjoxNzY2NTY5MTA1LCJpYXQiOjE3NjY1NjkxMDV9.J9Z9Vm1uk3a89OfrcUpPbvFwv0IEj6QXXQ7VwgxscQ4"
}
}
{
"code": 400,
"msg": "账号或密码错误",
"time": 1765954691054,
"data": null
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | object¦null | true | none | none | |
| »» token | string | true | none | none |
POST 修改密码
POST /user/change_password
Body 请求参数
{
"password": "mytyyds",
"old_password": "123456"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 是 | none |
返回示例
200 Response
{
"code": 400,
"msg": "账号或密码错误",
"time": 1765954691054,
"data": null
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | object¦null | true | none | none | |
| »» token | string | true | none | none |
POST 绑定设备
POST /user/bind_device
Body 请求参数
{
"username": "123456",
"password": "123456",
"token": "",
"device_ids": []
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 是 | none |
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
MYT BMC/通用接口/系统接口
GET 获取系统信息
GET /system/info
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1766988369667,
"data": {
"version_code": "1.0.0",
"start_time": "2025-12-29T14:06:08.526928+08:00",
"config": {
"ip_addr": "192.168.88.238",
"mac_addr": "00:e0:4c:2c:87:40",
"disk_use": "145.15 GB",
"disk_size": "228.27 GB",
"system_config": {
"access_id": "kbusdaja79GTtOB6",
"access_secret": "nkInxCs8UJeF47A6IwZzIvJowxQOPZnD",
"fan_speed": "20"
}
}
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | object¦null | true | none | none | |
| »» version_code | string | true | none | BMC版本号 | none |
| »» start_time | string | true | none | 启动时间 | none |
| »» config | object | true | none | none | |
| »»» fan_speed | integer | true | none | 风扇转速 | 1-64 |
| »»» access_id | string | true | none | API AK | none |
| »»» access_secret | string | true | none | API SK | none |
| »»» ip_addr | string | true | none | 内网地址 | none |
| »»» mac_addr | string | true | none | MAC地址 | none |
| »»» disk_use | string | true | none | 磁盘使用 | none |
| »»» disk_size | string | true | none | 磁盘大小 | none |
POST 设置主机名
POST /system/hostname
Body 请求参数
{
"name": "MYT-M48"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 是 | none |
| » hostname | body | string | 是 | none |
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1767510207789,
"data": null
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | null | true | none | none |
POST 设置系统参数
POST /system/config
Body 请求参数
{
"name": "key",
"value": "value"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 是 | none |
| » hostname | body | string | 是 | none |
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1767510207789,
"data": null
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | null | true | none | none |
GET 重置API KEY
GET /system/reset_ak
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1766569329323,
"data": {
"access_id": "kbusdaja79GTtOB6",
"access_secret": "nkInxCs8UJeF47A6IwZzIvJowxQOPZnD"
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » time | integer | true | none | none | |
| » data | object | true | none | none | |
| »» access_id | string | true | none | API AK | none |
| »» access_secret | string | true | none | API SK | none |
GET 获取BMC资源使用统计
GET /system/usage
返回示例
200 Response
{
"code": 200,
"msg": "success",
"time": 1767506464516,
"data": {
"cpu_physical_cores": 8,
"cpu_usage": 7.819794584520004,
"network_up": 6180.460634049932,
"network_down": 6180.460634049932,
"disk_use": "21.34 GB",
"disk_size": "21.36 GB",
"mem_total": 16654901248,
"mem_free": 6694809600,
"swap_memory_total": 0,
"swap_memory_free": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 |
|---|