F5Networks / bigsuds

Python library for F5 Networks iControl API
MIT License
32 stars 17 forks source link

How to upload/import SSL Key/Certificate in BIG-IP? #6

Closed tlian closed 7 years ago

tlian commented 7 years ago

Almost all of the methods were not working other than get_version()

b.Management.KeyCertificate.get_version() 'BIG-IP_v11.5.3' b.Management.KeyCertificate.get_key_list_v2() Traceback (most recent call last): File "", line 1, in File "bigsuds.py", line 463, in wrapped_method result = method(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/suds/client.py", line 542, in call return client.invoke(args, kwargs) File "/usr/local/lib/python2.7/site-packages/suds/client.py", line 602, in invoke result = self.send(soapenv) File "/usr/local/lib/python2.7/site-packages/suds/client.py", line 649, in send result = self.failed(binding, e) File "/usr/local/lib/python2.7/site-packages/suds/client.py", line 702, in failed r, p = binding.get_fault(reply) File "/usr/local/lib/python2.7/site-packages/suds/bindings/binding.py", line 265, in get_fault raise WebFault(p, faultroot) bigsuds.ServerError: Server raised fault: 'Could not find element by name: mode'

caphrim007 commented 7 years ago

@tlian according to the SOAP docs here

https://devcentral.f5.com/wiki/iControl.Management__KeyCertificate__get_key_list_v2.ashx

you need to provide a mode.

https://devcentral.f5.com/wiki/iControl.Management__KeyCertificate__ManagementModeType.ashx

So, as an example,

import bigsuds

api = bigsuds.BIGIP(hostname='localhost', username='admin', password='admin', verify=False)
ok = api.Management.KeyCertificate.get_key_list_v2(mode='MANAGEMENT_MODE_DEFAULT')
print(ok)
caphrim007 commented 7 years ago

closing due to lack of activity