Forum Discussion
Looking for guidance with the Python SDK
F5 Python SDK is an assortment of convenient modules for Python users for accessing the iControl REST. And iControl REST is a wrapper for tmsh. So, for available options and usage, read the tmsh help.
For example, tm.util.qkview is for the /mgmt/tm/util/qkview iControl REST endpoint, and it is for tmsh run util qkview. You can find the list of options from tmsh help util qkview.
One of the options is -f for specifing the name of the qkview file. The following tmsh command creates a qkview file /var/tmp/sat1234
tmsh run util qkview -f sat1234
This iControl REST call (using curl) does the same:
curl -sku : https:///mgmt/tm/util/qkview \
-X POST -H "Content-type: application/json" \
-d '{"command":"run", "utilCmdArgs":"-f sat1234"}'
And finally, the equivalent python sdk code.
from f5.bigip import ManagementRoot
mgmt = ManagementRoot('', '', '')
bash = mgmt.tm.util.qkview.exec_cmd('run', utilCmdArgs='-f sat1234')
See the Commands section of iControl REST User Guide Version 13.1, pp. 57-65, for the tmsh commands that do not directly correspond to the HTTP methods (such as run).
To get a list of commands under tm.util (/mgmt/tm/util in iControl REST), type TAB in tmsh: e.g.,
root@(ltm1311)(cfg-sync Standalone)(Active)(/Common)(tmos) run util [TAB]
Components:
admdb fips-card-sync ping ssh-keyswap unix-ls
bash fips-util ping6 ssldump unix-mv
ccmode gencert platform_check sys-icheck unix-rm
clientssl-ciphers get-ccn-dossier platform_diag tcpdump updatecheck
diadb get-dossier qkview telnet vconsole
dig ihealth racoonctl test-monitor verify-encryption
dnat imish scp tracepath zebos
domain-tool ipsecalgdb serverssl-ciphers tracepath6
establish-adfs-trust lsndb sftp traceroute
finalize-custom-ami netstat sipdb traceroute6
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
