ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 监控monitor ### 发布Topic:v1.1/client/<customer_id>/monitor/post | 指令集| 描述 | | --- | --- | | getAppList| 获取软件列表| | getAppStatus| 获取软件状态| | appCommand| 软件操作指令| | appUpdate| 软件升级指令| | appRollBack| 软件回滚指令| | appResetPack| 软件重装指令| | rebootServer| 重启服务器设备| | search| 查询| | getLogs| 获取日志| | runScript| 执行脚本| | 名称 | 类型 | 描述 | | --- | --- | --- | | mid | String | 会话ID | | timestamp| String | 时间戳 | | token| String | 用户token | | command| String | 指令 | | params| Object | 参数 | #### params结构体 | 名称 | 类型 | 描述 | | --- | --- | --- | | netId| String | 网关ID | |其他参数参考下方示例| ``` 获取软件列表 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "getAppList", "params": { "netId": "lygw01010001" } } 获取软件状态 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "getAppStatus", "params": { "netId": "lygw01010001", "app": "smtos" } } 软件操作指令 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "appCommand", "params": { "netId": "lygw01010001", "app": "smtos", "cmd": "start<启动>/stop<停止>/restart<重启>" } } 软件升级指令 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "appUpdate", "params": { "netId": "lygw01010001", "app": "smtos", "url": "http地址", "md5": "md5效验值" } } 软件回滚指令 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "appUpdate", "params": { "netId": "lygw01010001", "app": "smtos" } } 重启服务器设备 { "mid": "3245200221001", "timestamp": 1616586532, "token": "33e1121ae1171781230337b9e88c1aa406572d765dd33b92523bd38a4002de5e", "command": "rebootServer", "params": { "netId": "lygw01010001" } } ``` ### 订阅Topic:v1.1/client/<customer_id>/monitor/reply | 名称 | 类型 | 描述 | | --- | --- | --- | | mid | String | 会话ID | | timestamp| String | 时间戳 | | command| String | 指令 | | code| Number| 状态码 0-成功 1- 失败 | | msg| String | 消息描述 | | result| Object | 参数 | #### result结构体 | 名称 | 类型 | 描述 | | --- | --- | --- | | netId| String | 网关ID | | data| object | 回复数据体 | ``` 获取软件列表 { "mid": "mid1617700406116", "timestamp": 1617700406, "command": "getAppList", "code": 0, "msg": "获取成功", "result": { "netId": "lygw01010001", "data": [{ "app": "oslistener", "version": "1.1.3", "status": "active", "control": 0 }, { "app": "monitor", "version": "1.1.3", "status": "active", "control": 0 }, { "app": "webpanel", "version": "2.9.5", "status": "active", "control": 1 }, { "app": "task", "version": "2.9.5", "status": "active", "control": 0 }, { "app": "smtos", "version": "1.1.6", "status": "death", "control": 1 }, { "app": "media", "version": "1.0.0", "status": "active", "control": 1 }] } } 获取软件状态 { "mid": "3245200221001", "timestamp": 1617701086, "command": "getAppStatus", "code": 0, "msg": "成功", "result": { "netId": "lygw01010001", "data": { "app": "smtos", "status": "death" } } } 软件操作指令 { "mid": "3245200221001", "timestamp": 1617701086, "command": "appCommand", "code": 0, "msg": "操作成功", "result": { "netId": "lygw01010001", "data": { "app": "smtos", "status": "active" //active<运行> death<停止> } } } 软件升级指令 { "mid": "3245200221001", "timestamp": 1617701086, "command": "appUpdate", "code": 0, "msg": "操作成功", "result": { "netId": "lygw01010001", "data": { "app": "smtos", "status": "active" //active<运行> death<停止> } } } 软件回滚指令 { "mid": "3245200221001", "timestamp": 1617701086, "command": "appRollBack", "code": 0, "msg": "操作成功", "result": { "netId": "lygw01010001", "data": { "app": "smtos", "status": "active" //active<运行> death<停止> } } } 重启服务器设备 { "mid": "3245200221001", "timestamp": 1617701086, "command": "appRollBack", "code": 0, "msg": "操作成功", "result": { "netId": "lygw01010001", "data": {} } } ```