Forum Discussion
Thanks Sam. I have tried that. I've tried:
/var/local/ucs/test_ucs.ucs
/var/local/ucs/test_ucs123.ucs
/var/local/ucs/test_ucs123
test_ucs
test_ucs123
all produce the same error message. I'm currently attempting to combine some methodology from the POSH-LTM-Rest module found here and the code i've been working on already. The documentation doesn't call it out anywhere but I wonder if you have to retrieve an F5 session token before you can do anything using the POST method.
Looking at this article, it looks like people manage to make it with standard credential :
Good luck 😉
- KeyClackerMar 01, 2022Altocumulus
So this is the example syntax that i've been going on (from that thread and documentation):
curl -v -sk -u admin:admin https://10.10.10.10/mgmt/tm/sys/ucs -H "Content-Type: application/json" -X POST -d '{"command":"save","name":"test.ucs"}'
I'm on a Windows box though, and something about that doesn't translate well to Curl.exe. It gets mad about non-json content. So, I spun up a Linux VM really quick and ran that exact syntax and it didn't error out AND it created a test.ucs. Now I just need to understand what's different between that curl request and what i'm doing with Invoke-RestMethod in Powershell, because I'm not seeing it.
- KeyClackerMar 01, 2022Altocumulus
quick update before going in to a meeting.
I changed how i'm generating the $Body variable to just be a here-string with straight up json in it, instead of a hashtable i convert to json, and the request worked.
- KeyClackerMar 01, 2022Altocumulus
omg...it wasn't even that. It was case. Even though Powershell is case insensitive I'm so used to doing camel case everywhere that I did "Command" and "Name" instead of "command" and "name" for my json body.
Now to figure out how to download a ucs....