upload bash script to f5 via API

Hi, I’m using v11.6.x of F5 BIG-IP (LTM). Is there a way to use curl in order to upload shell script that will be later on used to create external monitor? Such upload can be done via System->File Management->External Monitor Program File List but how about curl or python?

I’m not interested in scp at the moment as my ansible roles are failing due to some missing requirements on LTM side. The idea is to know how to perform this upload with comon tools and then automate process with ansible.

Hi, I am sending sample curl used for uploading and updating external file.

curl -sk -u user:passwd https:///mgmt/tm/sys/file/data-group -H ‘Content-Type: application/json’ -X POST -d ‘{“name”:“file_name”,“separator”:“;”,“source-path”:“file:/var/tmp/file_name”,“type”:“string”}’

curl -sk -u username:passwd https:///mgmt/tm/sys/file/data-group/file_name -H ‘Content-Type: application/json’ -X PUT -d ‘{“source-path”:“file:/var/tmp/file_name”}’

This article is also very helpful; https://devcentral.f5.com/articles/icontrol-rest-101-getting-started