Uploading a File

Function

This interface is used to upload files. After files are successfully uploaded, they are stored in the /run/web directory.
  • The .zip file is stored in the /run/web/zip directory.
  • The .crl, .cer, and .crt files are stored in the /run/web/cert directory.
  • The .conf files are stored in the /run/web/conf directory.
  • The .ini file is stored in the /run/web/ini directory.

Syntax

Operation type: POST

URL: https://device_ip/redfish/v1/UpdateService/FirmwareInventory

Request header:

X-Auth-Token: auth_value

Request message body:

{
    "imgfile": imgfile,
    "size": size
}

Request Parameters

Table 1 Request parameters

Parameter

Mandatory/Optional

Parameter Description

Value

imgfile

Mandatory

Name of the file to be uploaded through Form-Data.

The file name must contain 1 to 255 characters, including only uppercase and lowercase letters (a to z and A to Z), digits (0 to 9), and other characters (_.-). In addition, the name cannot contain two consecutive dots (..).

The following file types are supported:
  • zip
  • cer
  • crl
  • crt
  • conf
  • ini

Select a required file type if the key value is imgfile.

size

Optional

Size of the file to be uploaded through Form-Data.

The value is a number. The options are as follows:
  • zip: The file size must be less than 512 MB.
  • cer, crl, crt, and ini: The maximum size is 10 KB.
  • conf: The maximum size is 20 MB.

Usage Guidelines

None

Example

Request:

POST https://10.10.10.10/redfish/v1/UpdateService/FirmwareInventory

Request header:

X-Auth-Token: auth_value 
Request message body:
{
    "imgfile": 4.conf,
    "size": 202
}
Response:
{
    "message": "Upload [4.conf] file successfully.",
    "status": 202
}

Response code: 202

Output Description

Table 2 Operation output description

Field

Type

Description

status

Number

Response code.

message

Character string

Details.