Skip to main content
The NBI provides endpoints for uploading firmware images and configuration files into GenieACS. Files are stored in MongoDB GridFS and served to CPE devices by the genieacs-fs file server during download operations.
To trigger a firmware upgrade or config file download on a device, upload the file here first, then use the download task to instruct the device to fetch it.

Upload a file

PUT /files/<file_name>
Uploads a new file or overwrites an existing file with the same name.
file_name
string
required
The name to store the file under. This is also the name used when referencing the file in a download task.
Request body: Raw binary file content. Request headers (optional metadata):
HeaderDescription
fileTypeFile type string. See common values below.
ouiOUI of the target device model.
productClassProduct class of the target device.
versionFirmware version string (for firmware images).
Response: 201 Created on success. Example — upload a firmware image:
curl -i 'http://localhost:7557/files/new_firmware_v1.0.bin' \
-X PUT \
--data-binary @"./new_firmware_v1.0.bin" \
--header "fileType: 1 Firmware Upgrade Image" \
--header "oui: 123456" \
--header "productClass: ABC" \
--header "version: 1.0"

Delete a file

DELETE /files/<file_name>
Deletes a previously uploaded file.
file_name
string
required
The name of the file to delete.
curl -i 'http://localhost:7557/files/new_firmware_v1.0.bin' -X DELETE
Response: 200 OK on success. 404 Not Found if the file does not exist.

List all files

GET /files/
Returns all uploaded files as a JSON array.
curl 'http://localhost:7557/files/'

Find files by query

GET /files/?query=<query>
Finds files matching a MongoDB-style query against the GridFS files collection. Find a file by name:
curl 'http://localhost:7557/files/?query=%7B%22filename%22%3A%22new_firmware_v1.0.bin%22%7D'

Common file types

The fileType header value follows the TR-069 specification for file type codes:
ValueDescription
1 Firmware Upgrade ImageDevice firmware binary.
2 Web ContentWeb UI content.
3 Vendor Configuration FileVendor-specific configuration.
4 Tone FileTone/audio file.
5 Ringer FileRinger/audio file.

File metadata

Each file stored in GridFS includes a metadata object with the fields provided during upload:
filename
string
The file name as provided in the URL path.
metadata.fileType
string
The TR-069 file type string.
metadata.oui
string
The device OUI this file is intended for.
metadata.productClass
string
The product class this file is intended for.
metadata.version
string
Firmware version string (for firmware images).