Forum Discussion
Ethan_Erchinger
Nimbostratus
Apr 04, 2006Using Python and SOAPpy with iControl
Hello,
I'm definetly a newby when it comes to SOAP, and using SOAPpy. I can call simple functions in the LocalLB/Class wsdl, like get_address_class_list(). But when trying to call somethin...
Mark_Atkinson_5
May 25, 2006Historic F5 Account
You can use the following patch against SOAPBuilder.py to allow SOAPpy to serialize arrays of arrays...
--- SOAPBuilder.py 2005-02-21 12:24:13.000000000 -0800
+++ /tmp/SOAPBuilder.py 2006-03-31 13:53:49.000000000 -0800
@@ -496,7 +496,10 @@
elemsname = tag
for i in data:
- self.dump(i, elemsname, not same_type, ns_map)
+ if type(i) == type([]):
+ self.dump(i,'item')
+ else:
+ self.dump(i, elemsname, not same_type, ns_map)
if typed: self.out.append('\n' % tag)Then you can succesfully use SOAPpy 100% of iControl (haven't found a call that didn't work yet):
url = '%%s://%s:%s@%s/iControl/iControlPortal.cgi' % (admin,passwd,bigip)
ProxyBuilder = lambda x: SOAPProxy(url % 'https', namespace='urn:iControl:' + x)
sysinfo = ProxyBuilder('System/SystemInfo')
ver = sysinfo.get_version()
print "version: %s" % ver
pool = ProxyBuilder('LocalLB/Pool')
try:
pool.create(pool_names = ['test_pool'],
lb_methods = ['LB_METHOD_ROUND_ROBIN'],
members = [[{'address':'172.16.17.1','port':'80'}]])
except faultType, (ErrorFrom, ErrorMessage): faultType is defined by SOAPpy
if ErrorMessage.find("already exists") > 0:
print "pool test_pool already exists..."
else:
print "unhandled exception:", ErrorMessage
raiseHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
