Downloading the Software

Function

Delivers a message for downloading MEF Edge. You need to configure the address, account, and password of a third-party software repository and then download the prepared software to be upgraded from the third-party software repository.

Syntax

Operation type: POST

URL: https://{ip}:{port}/edgemanager/v1/software/edge/download

Request message body:
{
    "serialNumbers": ["2102312NSF10K8000130"],
    "softwareName": "MEFEdge",
    "downloadInfo": {
        "package": "GET https://xxx.tar.gz",
        "signFile": "GET https://xxx.tar.gz.cms",
        "crlFile": "GET https://xxx.tar.gz.crl",
        "userName": "FileTransferAccount",
        "password": [xx,yy,zz,ww]
    }
}

Request Parameters

Table 1 Description

Parameter

Mandatory/Optional

Description

Value

serialNumbers

Mandatory

Device SN

Array with a maximum length of 64 bytes, which can contain lowercase letters, uppercase letters, digits, underscores (_), and hyphens (-). The value cannot start or end with an underscore (_) or hyphen (-). The value contains 1 to 2048 characters.

softwareName

Mandatory

Name of the software to be downloaded

The value must be MEFEdge.

downloadInfo

Mandatory

Download information

File download information of the software repository. The versions of package, signFile, and crlFile in the request must match.

package

Mandatory

Software package

The value is a character string. The URL can contain a maximum of 512 bytes and cannot contain special characters such as "\n!\\|;$<>@` ". The protocol must be HTTPS and the request mode must be GET.

NOTE:
  • If the value contains a domain name, the domain name must be valid and match the regular expression ^[a-zA-Z0-9][a-zA-Z0-9.-]{1,61}[a-zA-Z0-9]$. The value cannot contain only digits or be localhost.
  • If the value contains an IP address, it must be a valid IPv4 address and cannot be a loopback address (127.0.0.1) or the MEF Edge IP address.

signFile

Mandatory

Software package and signature file

The value is a character string. The URL can contain a maximum of 512 bytes and cannot contain special characters such as "\n!\\|;$<>@` ". The protocol must be HTTPS and the request mode must be GET.

NOTE:
  • If the value contains a domain name, the domain name must be valid and match the regular expression ^[a-zA-Z0-9][a-zA-Z0-9.-]{1,61}[a-zA-Z0-9]$. The value cannot contain only digits or be localhost.
  • If the value contains an IP address, it must be a valid IPv4 address and cannot be a loopback address (127.0.0.1) or the MEF Edge IP address.

crlFile

Mandatory

CRL of the software package

The value is a character string. The URL can contain a maximum of 512 bytes and cannot contain special characters such as "\n!\\|;$<>@` ". The protocol must be HTTPS and the request mode must be GET.

NOTE:
  • If the value contains a domain name, the domain name must be valid and match the regular expression ^[a-zA-Z0-9][a-zA-Z0-9.-]{1,61}[a-zA-Z0-9]$. The value cannot contain only digits or be localhost.
  • If the value contains an IP address, it must be a valid IPv4 address and cannot be a loopback address (127.0.0.1) or the MEF Edge IP address.

userName

Mandatory

Account for software download

The value is a string of 6 to 32 characters and can contain only lowercase letters, uppercase letters, and digits.

password

Mandatory

Password for software download

Byte array. The delivered information must contain the password. The array length ranges from 8 to 20.

NOTE:
The password must meet the following requirements; otherwise, security risks may exist.
  • The password must contain at least eight characters.
  • The password must contain at least two types of the following characters:
    • Lowercase letters
    • Uppercase letters
    • Digits
    • Spaces or the following special characters:`~!@#$%^&*()-_=+\|[{}];:'",<.>/?
  • The password must be different from the username.

Usage Example

Request:

POST https://10.10.10.10:30035/edgemanager/v1/software/edge/download
Request body:
{
    "serialNumbers": ["xxxxxxxxx"],
    "softwareName": "MEFEdge",
     "downloadInfo": {
        "package": "GET https://xxx.tar.gz",
        "signFile": "GET https://xxx.tar.gz.cms",
        "crlFile": "GET https://xxx.tar.gz.crl",
        "userName": "FileTransferAccount",
        "password": [xx,yy,zz,ww]
    }
}
Response:
{
    "status": "00000000",
    "msg": "success",
    "data": {
        "failedInfos": {},
        "successIDs": [
            "xxxxxxxxx"
        ]
    }
}

Response status code: 200

Output Description

Table 2 Operation output description

Parameter

Type

Description

status

String

Error code

msg

String

Description

data

Object

-

Table 3 data field description

Parameter

Type

Description

successIDs

String list

IDs that successfully download the software.

failedInfos

Hash table. The key and value are character strings.

key is the IDs that fail to download the software, and value is the failure cause.