Managing ifiles using iControl REST API can be challenging. When an administrator need to manage those objects without getting access to the Web UI, it can be better to have a tool able to sync files from the local repository of the computer to the BIG-IP device.
How to use this snippet:
I often use the ifile feature to provide customized web content to users targeting my web applications through a BIG-IP device. I already had a request to import 1000+ files to the F5 BIG-IP in order to build a complete web framework full of .css, .js and .html file extensions.
Uploading those files one by one is really time-consuming and boring. That's why we have developed a small piece of code that automatically watch a folder and create, modify or delete ifiles accordingly.
Managing ifiles using Curl tool
When an administrator decides to manually upload few files to the BIG-IP device using iControl REST API, he has to execute several consecutive commands.
Uploading a file to the BIG-IP
You need to calculate the size of the file you want to upload:
du -b testfile.txt
Then, you can upload the file to the BIG-IP device:
Automatically synchronize a local folder with your BIG-IP
If you already had the request to deal with thousand of files to upload as ifiles in a BIG-IP device, you may know that managing this kind of request using Postman or a shell script based on wget or curl commands is a nightmare. This is the reason why f5-auto-uploader tool came alive.
f5-auto-uploader creates, modify or deletes ifiles automatically based on watched directories. All changes are enclosed in a transaction.
Downloading f5-auto-uploader binary file
You can download the binary file directly from the github project :
You can define multiple directories to watch at the same time. Every action made on a file in one of those repositories is automatically synchronized with the BIG-IP device. It is possible to exclude specific files using a wildcard path. The example above get rid of hidden files in a Linux OS.
You can define either Basic or Token based authentication. If you prefer using the Basic authentication method, you can change the configuration file as defined below :