Forum Discussion
verlocs_96134
Apr 03, 2012Nimbostratus
SNATPool create_v2 Translation Address argument
What I'm using: pycontrol on python 2.6
What I'm talking to: bigip v11
When I attempt to call the create_v2 command for SNATPool, I am providing an array of string for the snatpool name...
Todd_Cromwell_9
Apr 04, 2012Nimbostratus
As I said I do not use pyControl 2.x - I think 1.x is easier to use, because it doesn't ever require the typefactory thing (though it doesn't handle exceptions as well as 2.x). I haven't got a chance to test this yet (as a person I want to ask about it is not present), but apparently what is needed to do the nested arrays in 2.x is something like the following. Are you using the typefactory thing? If you aren't, perhaps that is your problem. Perhaps if you are trying to do it as I posted above for 1.x, your code may happen to work for StringSeqSeq because maybe that is a special case which I think might be allowed for strings where one can then avoid the typefactory thing (aided by: an IPAddress is really just a string as far as the wsdl goes). As I said, for pyControl 1.x, this is much easier because you can nest things with [[]] to your heart's content with no troubles.
ictl = pyc.BIGIP(hostname=”1.2.3.4”, username=”admin”, password=”admin”, fromurl=True, wsdls=[“LocalLB.SNATPool”, …])
tas = ictl.LocalLB.SNATPool.typefactory.create(“Common.IPAddressSequenceSequence”)
arr1 = ictl.LocalLB.SNATPool.typefactory.create(“Common.IPAddressSequence”)
arr1.item = [“a”, “b”, “c”]
arr2 = ictl.LocalLB.SNATPool.typefactory.create(“Common.IPAddressSequence”)
arr2.item = [“d”, “e”, “f”]
tas.item = [arr1, arr2] this is apparently like [[a, b, c], [d, e, f]] in pyControl 1.x
ictl.LocalLB.SNATPool.create_v2([“sp1”, ”sp2”], tas)
As I said, this may or may not be quite right but something like that is apparently needed. In any case the logging described above will help tell what iControl is seeing internally.
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