Forum Discussion
KeyClacker
Feb 28, 2022Altocumulus
Powershell: Invoke-RESTmethod on /mgmt/tm/sys/ucs (403) Forbidden error
I'm fairly experienced with Powershell and have used the Invoke-RestMethod cmdlet, and vendor documentation, to automate some things before. I've just inherited management of an HA pair of F5 BIG-IP...
xuwen
Mar 01, 2022Cumulonimbus
i suggest you use f5 python sdk api: f5-sdk
here is the code to save sys ucs file and name its filename "/var/local/ucs/test.ucs":
from f5.bigip import ManagementRoot
mgmt = ManagementRoot("192.168.5.109", 'admin', 'xt32112300')
"""save sys ucs name /var/local/ucs/test.ucs"""
mgmt.tm.sys.ucs.exec_cmd(command='save', name='/var/local/ucs/test.ucs')
"""check system all sys ucs filename"""
for i in mgmt.tm.sys.ucs.load().items:
print(i['apiRawValues']['filename'])
- KeyClackerMar 01, 2022Altocumulus
Appreciate that, but we don't use Python anywhere in our organization. If Python can do it using the same REST API then I would think anything could.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects