File Operations¶
ibcli implements the WAPI three-step fileop protocol for both uploads and downloads.
Download protocol (three steps)¶
POST fileop?_function=<function>with parameters → receives{"url": "...", "token": "..."}GET <url>withContent-Type: application/force-downloadheader → streams the file body viaiter_content(chunked, suitable for large files)POST fileop?_function=downloadcompletewith{"token": "..."}→ signals completion
The 415 fix - verified on real NIOS grid
Step 2 requires the Content-Type: application/force-download header on the GET request. Without it, NIOS returns
HTTP 415 Unsupported Media Type. This is a known undocumented NIOS behaviour, handled by stream_download in
src/ibcli/fileop.py. The fix was confirmed working against a real NIOS grid at 192.0.2.40 (WAPI v2.14) on
2026-04-17. See Troubleshooting for the full
debugging story.
Upload protocol (three steps)¶
POST fileop?_function=uploadinit→ receives{"url": "...", "token": "..."}POST <url>with multipart file content → streams the filePOST fileop?_function=<function>with{"token": "..."}→ invokes the actual operation
Download commands¶
download database¶
Download a full database backup.
Syntax:
WAPI: fileop?_function=getgriddata with type=BACKUP
Real-grid verified
download database is the only ibcli command that has been tested against a live NIOS grid. All other commands
are mocked-only at this time.
download csv¶
Download object data as CSV.
Syntax:
WAPI: fileop?_function=csv_export
download log_files¶
Download system log files.
Syntax:
WAPI: fileop?_function=get_log_files
download lease_history¶
Download the DHCP lease history database.
Syntax:
WAPI: fileop?_function=getleasehistoryfiles
download support_bundle¶
Download a support bundle (diagnostic package).
Syntax:
WAPI: fileop?_function=get_support_bundle
download support_bundle /tmp/support.tgz
download support_bundle /tmp/member2-support.tgz member=192.168.1.6
download merge_log¶
Download the grid merge log.
Syntax:
WAPI: fileop?_function=get_log_files with log_type=MERGE
download expert_dhcp_conf¶
Download the expert DHCP configuration file.
Syntax:
WAPI: fileop?_function=getmemberdata with type=DHCP_CONFIG_FILE
download dhcp_conf¶
Download the DHCP configuration file.
Syntax:
WAPI: fileop?_function=getmemberdata with type=DHCP_CONFIG
Upload commands¶
upload database¶
Upload and restore a database backup.
Syntax:
WAPI: fileop?_function=restoredatabase with keep_grid_ip=YES
Warning
Database restore is disruptive. The grid will restart services and may briefly go offline. Confirm with your team before running this command.
upload csv¶
Upload a CSV file for bulk import.
Syntax:
WAPI: fileop?_function=csv_import
Without object, defaults to action=INSERT. With object, uses action=CUSTOM.
upload leases¶
Upload a DHCP leases file.
Syntax:
WAPI: fileop?_function=setleasehistoryfiles
upload expert_dhcp_conf¶
Upload an expert DHCP configuration file.
Syntax:
WAPI: fileop?_function=setmemberdata with type=DHCP_CONFIG_FILE
download csv_errors¶
Download the error log from a failed or partial CSV import.
Syntax:
WAPI: fileop?_function=csv_error_log with import_id=<task_id>
download csv_errors /tmp/import-errors.csv csv_import_task/ZG5z...
Downloaded /tmp/import-errors.csv
The <task_id> is the _ref returned by upload csv or found via show csv task. See CSV for the full
import lifecycle.
URL host rewriting¶
If NIOS returns a file download URL whose hostname differs from the grid master (e.g., an internal IP vs. the VIP), ibcli rewrites the URL to use the host it connected to. This ensures the session's TLS and cookie state are applied correctly.
Related commands¶
- Certificates - download/upload certificates via the same fileop protocol.
- CSV - CSV import workflow and error log download.