Forum Discussion
Ben_Chase_15007
Nimbostratus
Aug 13, 2009Configsync status using pycontrol
Just playing around here for now, but when invoking this source:
if __name__ == "__main__":
import pycontrol.pyControl as pc
import getpass
host = '10.1.1.1'
uname = 'admin'
upass = 'admin'
b = pc.BIGIP(
hostname = host,
username = uname,
password = upass,
wsdl_files = ['Management.DBVariable']
)
qval = "Configsync.State"
s = b.Management_DBVariable.query(qval)
to get the configsync status on a machine, I get an error that makes me believe I'm passing the wrong data type. Any thoughts?
>>>
Loading WSDL: Management.DBVariable.wsdl
Traceback (most recent call last):
File "C:\Py25 Files\getconfigsyncstatus.py", line 17, in
s = b.Management_DBVariable.query(qval)
File "C:\Python25\lib\site-packages\zsi-2.1_a1-py2.5.egg\ZSI\ServiceProxy.py", line 324, in __call__
return self.parent()._call(self.__name__, self.soapheaders)(*args, **kwargs)
File "C:\Python25\lib\site-packages\zsi-2.1_a1-py2.5.egg\ZSI\ServiceProxy.py", line 204, in call_closure
raise TypeError, 'Not supporting SOAPENC:Arrays or XSD:List'
TypeError: Not supporting SOAPENC:Arrays or XSD:List
>>>
- L4L7_53191
Nimbostratus
You're close! This is (most are, actually) a keyword argument, so you'll just need to add that. To help figure this type of thing out, print the special variable, _h, for any method inside of pyControl:In [3]: print b.Management_DBVariable.query._h InParams Count: 1 variables: Common.StringSequence OutParams Count: 1 return: Management.DBVariable.VariableNameValueSequence In [4]: b.Management_DBVariable.query(variables = ['ConfigSync.State']) Out[4]: {'return': [{'name': 'ConfigSync.State', 'value': '-1 - uninitialized or disabled config state'}]}
- Ben_Chase_15007
Nimbostratus
Great - Thanks!
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