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.