Forum Discussion
Powershell: Invoke-RESTmethod on /mgmt/tm/sys/ucs (403) Forbidden error
Did you try to make the same POST request with a different UCS name ?
Maybe there is already an existing one on your box with the same name, in that case you request could be blocked to avoid to override it.
- xuwenMar 01, 2022Cumulonimbus
use datetime to rename format ucs filename and make it not be the same
from datetime import datetime
'/var/local/ucs/test_{}.ucs'.format(datetime.now().strftime('%Y-%m-%d')) - KeyClackerMar 01, 2022Altocumulus
I have not tried another account as this is my account, but I could potentially create an account just for this. However, my account is an admin, and it does let me authenticate via the API to do a GET request and get a list of the UCS archives already on the appliance, for which there is one. And there is no name collision. This is from F5's documentation:
<POST> /mgmt/tm/sys/ucs -d '{"command":"save","name":"/var/local/ucs/test_ucs.ucs"}'
However, in another document somewhere else they only provide the filename with no full path, and no file extension. I've tried all of those combos with the same result.
- SamCoMar 01, 2022Cirrus
Maybe I have not been clear enough : the credential are fine, I mean the filename :
You have a 403 for "/var/local/ucs/test_ucs.ucs", have you tried "/var/local/ucs/test_ucs_XXX.ucs" ?
Cheers,
Sam
- KeyClackerMar 01, 2022Altocumulus
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.
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