29-May-2023 23:49
Hello community,
was anyone able to utilize the F5-FILE-DOWNLOAD API to download a file from a device running F5OS ?
I am aware about the F5-UTILS-FILE-TRANSFER API which works as expected but my intention is to download something from the device locally, not to export a file to a remote server.
I am adding below 2 examples.
$ curl -k -su user -X POST https://myhost.com:8888/restconf/data/f5-utils-file-transfer:file/f5-file-download:download-file/ -H 'Accept: application/yang-data+json' -H 'Content-Type: application/yang-data+json' -d '{
"f5-file-download:file-name": "myfile",
"f5-file-download:file-path": "configs/"
}'
Enter host password for user 'user':
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "malformed-message",
"error-path": "/f5-utils-file-transfer:file/f5-file-download:download-file",
"error-message": "unknown element: file-name in /f5-utils-file-transfer:file/f5-file-download:download-file/f5-file-download:file-name"
}
]
}
}
~$ curl -k -su user -X POST https://myhost.com:8888/restconf/data/f5-utils-file-transfer:file/f5-file-download:download-file/f5-... -H 'Accept: application/yang-data+json' -H 'Content-Type: application/yang-data+json' -d '{
"f5-file-download:file-name": "myfile",
"f5-file-download:file-path": "configs/"
}'
Enter host password for user 'user':
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
Solved! Go to Solution.
04-Aug-2023 06:09
Thanks for your input.
I had already read your article, it was very helpful just that I had to use scp so I was having problems with the api. But now that they published the new ansible module https://clouddocs.f5.com/products/orchestration/ansible/devel/f5os/modules_3_0/f5os_config_backup_mo... it works fine.
01-Jun-2023 12:03
Hey @Sakis_Dim - that sounds really frustrating, and I'm seeing if I can find you some help. It might take a little while, so in the mean time, hopefully someone from the community can drop an answer here. If it is urgent, please open a ticket with F5 Support.
01-Jun-2023 12:16
Hey Leslie,
Thanks for your message
I posted here while I was waiting reply from support to see if somone from the community faced similar issue. Yesterday I got a reply that this can be used for download other files, like logs but not config files. Honestly even that didn't work when I tested it but anyway I am looking for another alternative now.
Regards,
Sakis
07-Jun-2023 17:51
@Sakis_Dim - did Support ever reply? Were you able to find an alternative?
30-Jun-2023 01:05
You can seee my article https://community.f5.com/t5/codeshare/f5-velos-rseries-f5os-code-for-automating-config-backup-with-t... if it helps.
04-Aug-2023 06:09
Thanks for your input.
I had already read your article, it was very helpful just that I had to use scp so I was having problems with the api. But now that they published the new ansible module https://clouddocs.f5.com/products/orchestration/ansible/devel/f5os/modules_3_0/f5os_config_backup_mo... it works fine.