add-firmware

Use the interface to add the successfully uploaded firmware file to list which you can obtain by using get-all-firmwares, then it can be used to update hosted devices on Cloud.

Only available for users with administrative rights.

To make a firmware file available for device update via Cloud, you need to perform the following 2 steps to prepare.

  1. upload device firmware file(.mwf) by using uploadFirmware.
  2. add the successfully uploaded firmware to available file list by using add-firmware.

Prototype

Protocol HTTP/HTTPS POST
URL ip[:port]/sc_cloud/firmware/add
Data Format Request: Content-Type: application/json
Response: Content-Type: application/json

Request Cookies

Parameter Description
mwcloud-sid A string value that is used to uniquely identify user logged-in.
mwcloud-uid Current logged-in username.
Request Body
Parameter Description
file-path Path of firmware file saved on Cloud. You can obtain the path by using uploadFirmware.

Request Example

POST /sc_cloud/firmware/add HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=utf-8
Content-Length: 40
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;
{
  "file-path": "/data/new-firmware-6.mwf"
}

Response Parameters

Response Header
Parameter Description
Content-Type Value: 'application/json; charset=UTF-8'
Response Body
Parameter Description
result Result code. The options are as follows:
  • 0: success.
  • Other values. For details about the result codes, please refer to API Status.
method add-firmware

Response Example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 36
{
  "method": "add-firmware",
  "result": 1
}

results matching ""

    No results matching ""

    results matching ""

      No results matching ""