Skip to content

Latest commit

 

History

History
112 lines (86 loc) · 2.22 KB

General - Upgrade Firmware.adoc

File metadata and controls

112 lines (86 loc) · 2.22 KB

General - Upgrade Firmware

To upgrade the device firmware send a HTTP POST to /api/edge/upgrade.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=X-CSRF-Token as a multipart/form-data request with the qqfile key containing a valid .tar firmware file.

This method is CSRF protected so also requires a X-CSRF-TOKEN (see Sensitive Requests (CSRF Protection)).

It does not support a HTTP GET.

Request

Request Querystring

Name Type Values Description

header

String

text/html

Unknown hard-coded value.

noraw

Number

1

Unknown hard-coded value.

X-CSRF-TOKEN

String

A 256-bit hexadecimal CSRF token

The Cross-Site Request Forgery (CSRF) token from a cookie set during login.

Request Content

Name Type Values Description

qqfile

String

Firmware file

The firmware update file to flash.

Response

Root

Name Type Values Description

UPGRADE

Object

UPGRADE object

The upgrade result information.

errors (Optional)

Array (String)

Array of errors

An array of the errors that occurred.

success

Boolean

true or false

Whether the API request was successful.

UPGRADE Object

Name Type Values Description

success

String

A boolean encapsulated in a string (e.g. "0" or "1")

Whether the firwmare upgrade request was successful.

Examples

Successful Firmware Upgrade Example

POST /api/edge/upgrade.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=56e73342f1a8938f8741fe1458767f64e33e1a9db2a69a31f06e357d27042f4c Request
-----------------------------1201211059169276340197013685
Content-Disposition: form-data; name="qqfile"; filename="ER-e300.v2.0.9-beta.4.5305682.tar"
Content-Type: application/x-tar

vmlinux.tmp................
POST /api/edge/upgrade.json?header=text%2Fhtml&noraw=1&X-CSRF-TOKEN=56e73342f1a8938f8741fe1458767f64e33e1a9db2a69a31f06e357d27042f4c Response
{"UPGRADE": {"success": "1"}, "success": true}