Forum Discussion
How to read cert via F5 SDK in python ?
Hi All,
I am new to F5 iControl and iControlREST, but interested to do some auto work via iControlREST. I have a problem when try to read a existing ssl cert info by using F5 SDK. the code I wrote is: mgmt = ManagementRoot(ip, username, password) cert_a = mgmt.tm.sys.file.Ssl_Certs(a.crt) --but it says file has no attribute"Ssl_Certs" Can someone help, what is the right method to do similar as "tmsh list sys file ssl-cert a.crt" thanks.
- Satoshi_Toyosa1Ret. Employee
F5 Python SDK is just a wrapper for iControl REST. Have you tested using a bare iControl REST call? e.g.,
curl -sku : https:///mgmt/tm/sys/file/ssl-cert/default.crt | python -m json.tool
- Satoshi_Toyosa1Ret. Employee
Python version here. Use lower cases for Ssl_Certs (ssl_certs)
!/usr/bin/python from f5.bigip import ManagementRoot mgmt = ManagementRoot('192.168.184.40', 'admin', 'admin') cert = mgmt.tm.sys.file.ssl_certs.get_collection() for c in cert: print('--- {}'.format(c.raw['name'])) for d in c.__dict__: print(' {}: {}'.format(d, c.raw[d]))
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