获取设备基本信息

1.接口描述

接口说明:获取设备基本信息,包括CPU、内存、上电时间等。

请求方式:POST [ip]/api/system/info

管理员权限 登录认证

2.输入参数

3.输出参数

参数名称 类型 描述
status Int 状态码
device-name String 设备名称
usbc-name String USB-C 连接名称,即设备通过 USB OUT 接口连接到电脑后,在电脑上显示的名称
uptime Int 开机时长,单位:s
cpu CPUInfo CPU信息
mem MemInfo 内存信息
datetime DateTimeInfo 日期和时间信息
auto-reboot AutoRebootInfo 自动重启信息
CPUInfo
参数名称 类型 描述
total Int CPU 总时间
idle Int CPU 空闲时间
usage Int CPU 使用率 x 100
MemInfo
参数名称 类型 描述
total Int 系统总内存,单位:KB
avail Int 系统可用内存,单位:KB
DateTimeInfo
参数名称 类型 描述
cur-time String 系统时间,格式:yyyy-MM-dd HH:mm:ss
zonename String 时区名称
ntp-enable Boolean 是否启用自动设置时间
true:是;false:否
ntp-server1 String NTP服务器1
ntp-server2 String NTP服务器2
AutoRebootInfo
参数名称 类型 描述
enable Boolean 是否启用自动重启
true:是;false:否
hour Int 自动重启时间,时
min Int 自动重启时间,分
week [Array] 每周重复
1:星期一; 2:星期二; 3:星期三; 4:星期四; 5:星期五; 6:星期六; 7:星期天

4.示例

获取设备基本信息。

输入示例
None
输出示例
{
    "device-name": "USBFUSION",
    "usbc-name": "USB Fusion USB-C",
    "uptime": 5640,
    "cpu": {
        "total": 1084415,
        "idle": 815485,
        "usage": 2620
    },
    "mem": {
        "total": 8069584,
        "avail": 6201548
    },
    "datetime": {
        "cur-time": "2024-04-11 09:44:45",
        "zonename": "Asia/Shanghai",
        "ntp-enable": true,
        "ntp-server1": "0.pool.ntp.org",
        "ntp-server2": "1.pool.ntp.org"
    },
    "auto-reboot": {
        "enable": true,
        "hour": 0,
        "min": 0,
        "week": [
            1,
            6
        ]
    },
    "status": 0
}

5.错误码

无接口业务逻辑相关的错误码,其他错误码详见 公共错误码

与“”相关结果约

    找不到与“”相关的结果