Forum Discussion
JRahm
Oct 12, 2016Admin
From curl, you can do that this way (note the octet/stream content-type)
Get the content length
jrahm@ubuntu:/var/tmp/le/config/certs/rahmen-empire.net$ wc -c cert.csr | awk '{print $1}'
1691
Initiate the Upload
curl -i -sk -u admin:admin -X POST
-H "Expect:"
-H "Content-Type: application/octet-stream"
-H "Content-Range: 0-1690/1691"
--data-binary "@cert.csr"
https://172.16.44.15/mgmt/shared/file-transfer/uploads/cert.csr
or if you wanted to use the f5-common-python sdk, it's pretty simple:
>>> from f5.bigip import ManagementRoot as mr
>>> import requests
>>> requests.packages.urllib3.disable_warnings()
>>> b = mr('172.16.15.201', 'admin', 'admin')
>>> b.shared.file_transfer.uploads.upload_file('/Users/rahm/test.txt')
>>> b.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "cat /var/config/rest/downloads/test.txt"').commandResult
u'hello world\n'