Forum Discussion
Satoshi_Toyosa1
Jan 17, 2018Employee
I can think of one workaround.
/mgmt/shared/iapp/file-management/
allows you to download a file under the /var/config/rest/iapps/
directory, however, the feature (API) is only available on 13.1.0 or later. For example, to download /var/config/rest/iapps/sat/sat.txt
:
curl https:///mgmt/shared/iapp/file-management/sat/sat.txt
You can use the
/mgmt/tm/util/bash
endpoint and execute cat
command, however, you need to cleanse the response as the file content is JSON formatted: e.g.,
curl https:///mgmt/tm/util/bash \
-X POST -H "Content-Type: application/json" \
-d "{\"command\":\"run\", \"utilCmdArgs\": \"-c 'cat /tmp/sat.txt'\"}"
The response looks like this (The bold part is the file content: 5 lines of text. Note that LF is represented as the literal \n (0x5c 0x6e)):
{"kind":"tm:util:bash:runstate","command":"run","utilCmdArgs":"-c 'cat /tmp/sat.txt'","commandResult":"Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n"}