get-update-state 接口
获取当前固件版本信息和升级状态,仅管理员有权限。
请求方式
GET http://ip/mwapi?method=get-update-state
| 参数 | 
说明 | 
| method | 
方法名称:get-update-state | 
返回数据
idle 状态时的返回值
{
  "status": 0,
  "state": "idle",
  "cur-ver": "1.1.72"
}
updating 状态时的返回值
{
  "status": 0,
  "state": "updating",
  "cur-ver": "1.1.72",
  "update-to-ver": "1.1.72",
  "num-steps": 4,
  "step-id": 2,
  "step-name": "Erasing image",
  "step-percent": 28
}
failed 状态时的返回值
{
  "status": 0,
  "state": "failed",
  "cur-ver": "1.1.72",
  "error-status": 16
}
| 属性 | 
说明 | 
| status | 
返回状态。0:数据获取成功,返回其它值请参考 API 状态码。 | 
| state | 
更新状态,有效值:idle、updating、completed、failed。 | 
| cur-ver | 
当前固件版本号。 | 
| update-to-ver | 
最新固件版本号。 | 
| num-steps | 
固件更新步骤总数,仅在 updating 状态下存在。 | 
| step-id | 
正在更新步骤编号,仅在 updating 状态下存在。 | 
| step-name | 
正在更新步骤名称,仅在 updating 状态下存在。 | 
| step-percent | 
当前更新进度,仅在 updating 状态下存在。 | 
| error-status | 
错误状态码,仅在 failed 状态下存在。 |