Forum Discussion
Powershell: Invoke-RESTmethod on /mgmt/tm/sys/ucs (403) Forbidden error
There are a couple nuances with downloading files. First, the /sys/global-settings has a file whitelist attribute that must have your folder location listed. Then, you have to actually have a restjavad worker attached to that location. AFAIK, there are only a few locations you can upload/download from with iControl REST:
Description | Method | URI | Path |
ASM | POST | /mgmt/tm/asm/file-transfer/uploads/ | ?? |
ASM | GET | /mgmt/tm/asm/file-transfer/downloads/ | ?? |
image | POST | /mgmt/cm/autodeploy/software-image-uploads/ | /shared/images/ |
image/files | GET | /mgmt/cm/autodeploy/software-image-downloads/ | /shared/images/ |
qkview | GET | /mgmt/shared/file-transfer/qkview-downloads/ | /var/tmp/ |
ucs | GET | /mgmt/shared/file-transfer/ucs-downloads/ | /var/local/ucs/ |
files | POST | /mgmt/shared/file-transfer/uploads/ | /var/config/rest/downloads/ |
I updated my Demystifying iControl REST article on transferring files with this expanded table.
thanks JRahm. I wanted to download UCS files which look to reside in /var/local/ucs/* so I should have been all good to go, but when I downloaded a UCS it was only 1MB. Then I read in an F5 doc that the iControl REST API is limited to 1MB downloads.
Re-reading the F5 Python SDK I see they managed to build a little loop that gets the file size and somehow manages to download it in little 1MB chunks. But, according to one of the "issues" posted in Github, it's incredibly slow. So, I've decided to just give up on scripting this with Powershell.
I can create a UCS archive via Powershell, and I can list the current ones, but it looks like downloading is a no go. Save for doing something like SCP or something.
- JRahmMar 02, 2022Admin
yeah, you have to track the content-range header and grab chunks at a time. That's what we do with the python sdks. we have download/upload methods that manage that for us.
- KeyClackerMar 02, 2022Altocumulus
that's what I was seeing looking through the SDK on github. While I can kind of make sense of it, I don't know Invoke-RestMethod and the Content-Range header well enough to begin to tackle this.
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