Firmware Upgrade

This interface is used to asynchronously return the upgrade progress and result.

Message instance

{
    "header": {
        "msg_id": "741aec66-99b2-4d97-aaf2-63d27f53bbc5",
        "parent_msg_id": "",
        "timestamp": 1550107087319,
        "sync": false
    },
    "route": {
        "source": "EdgeManager",
        "group": "hardware",
        "operation": "update",
        "resource": "websocket/install"
    },
    "content": {
    }
}

Parameter description

The content message is described as follows:

{
    "member_list": [{
        "operator": "install",
        "type": "firmware",
        "install_method": "force | normal",
        "enable_method": "now | delay",
        "name": "firmware",
        "https_server": {
            "image": "GET https://FDAddr:port/fw.zip",
            "user_name": "userName",
            "password": "password"
        },
        "check_type": "sha256",
        "check_code": "xxxxxxxxxxxxx"
    }]
}

Elements are defined as follows:

Level-1 Resource

Level-2 Resource

Level-3 Resource

Description

member_list

-

-

Meaning: installation or upgrade parameter

Type: list

Value: The value ranges from 1 to 256. Currently, only the first element in the list is selected for firmware upgrade.

-

operator

-

Meaning: operation type

Type: string

Value: install

-

type

-

Meaning: installation or upgrade type

Type: string

Value: firmware

-

install_method

-

Meaning: installation type

Type: string

Values:

  • force: forcible upgrade
  • normal: smooth upgrade
  • "" (empty character string): An empty character string is allowed to be passed during firmware upgrade.

-

enable_method

-

Meaning: enabling method

Type: string

Values:

  • now: Upgrade immediately.
  • delay: The upgrade takes effect after a delay. This parameter must be used together with the interface for delaying the upgrade.
  • "" (empty character string): An empty character string is allowed to be passed during firmware upgrade.

-

name

-

Meaning: firmware name

Type: string

Value: a string of 1 to 256 bytes, supporting [a-zA-Z0-9-_.] and excluding two consecutive dots (..).

-

https_server

-

Meaning: file server

Type: dict

-

-

image

Meaning: upgrade file

Type: string

Value: a string of no more than 256 bytes, excluding two consecutive dots (..). It must start with a string of non-whitespace characters and spaces, https, and a character string that does not contain specific characters (@, \n,!,\\, |, ;, &, $, <, >, `, or space).

-

-

user_name

Meaning: user name

Type: string

Value: a string of 1 to 64 bytes, supporting [a-zA-Z0-9-_]

For details about the account for downloading files from the FusionDirector, see the FusionDirector Maintenance Guide.

-

-

password

Meaning: password

Type: string

The length ranges from 8 to 64 bytes. The complexity is ensured by the upper layer.

Password of the account used to download files on FusionDirector. For details, see the FusionDirector Maintenance Guide.

-

check_type

-

Meaning: check code type

Type: string

Value: sha256 (Only sha256 is supported currently.)

-

check_code

-

Meaning: firmware check code

Type: string

Value: an empty string or a string of 64 bytes (check code generated by Sha256sum, in the regular expression pattern '^[0-9a-f]{64}$', for example, 7e642fa557533508b589d7fcaef922b443ff4b5df16b2ad91581bd2b3d7c1fc3)

Result returned

{
    "header":{
        "msg_id":"e1d7ec35-ceac-4648-a581-056f5690d8f9",
        "parent_msg_id": "",
        "timestamp":1652279813323,
        "sync": false
    },
    "route":{
        "source":"hardware",
        "group":"hub",
        "operation":"update",
        "resource":"websocket/upgrade_progress"
    },
    "content":"{"members": [{"operator": "install", "name": "firmware", "version": "NA", "percentage": "100", "result": "success", "reason": ""}]}"
}