Forum Discussion
F5OS API for downloading files not working as expected
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-file-download:start-download -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>
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_module.html it works fine.
You can seee my article https://community.f5.com/t5/codeshare/f5-velos-rseries-f5os-code-for-automating-config-backup-with-the/ta-p/305521 if it helps.
- Sakis_DimAltocumulus
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_module.html it works fine. - Leslie_HubertusRet. Employee
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.
- Sakis_Dim2Nimbostratus
Hey Leslie,
Thanks for your messageI 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- Leslie_HubertusRet. Employee
Sakis_Dim - did Support ever reply? Were you able to find an alternative?
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com