Upgrade firmware
1. API Description
This API is used to upgrade firmware. During the upgrade process, you can get firmware version and upgrade status.
Request mode: POST [ip]/api/upgrade/update
| Administrator Rights | Logged-in | 
|---|---|
| Yes | Yes | 
2. Input Parameters
| Name | Required | Type | Description | 
|---|---|---|---|
| is-online | Yes | Boolean | Whether it is online upgrade.  true: Yes; false: No, it is manual upgrade.  | 
| mode | Yes | Int | The upgrade mode  0: Auto  | 
| timeout | Yes | Int | Upgrade fails with timeout (upgrade progress keeps unchanged), in seconds | 
3. Output Parameters
| Name | Type | Description | 
|---|---|---|
| status | Int | Status code | 
| code | String | Status description | 
4. Example
Upgrading firmware.
Input Example
{
  "is-online": false,
  "mode": 0,
  "timeout": 120
}
Output Example
{
    "status": 0,
    "code": "Success"
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Status | Definition | Description | 
|---|---|---|
| 7 | MW_STATUS_INVALID_ARG | Missing required parameters | 
| 11 | MW_STATUS_DEVICE_BUSY | Upgrading | 
| 16 | MW_STATUS_NOT_EXIST | The file does not exist |