Forum Discussion
andy_12_5042
Nimbostratus
Feb 02, 2011create a method parameter for protocol type
Is there a way I can properly do this below? I am trying to allow the protocol type to be defined in the call itself via a method. However, my lack of Python or in depth programming is killing m...
andy_12_5042
Nimbostratus
Feb 02, 2011It would seem I am thinking about this all wrong. So I decided to do this in a better way and just test the paramter string that I use for protocol and based on the comparison I will set it accordingly. So something like this will work fine and I will have each type defined per the icontrol SDK. I am not a big fan of if statements but since python does not appear to have a "case" as in other languages and this is a small amount of comparisons.... it will do.. This gets away from the trying to concatenate a string with a non-string object, which will not work. Anyway it may not be the best way but it seems to work ok so far..
p_type is a parameter to a web service call
proto = v.typefactory.create('Common.ProtocolType')
if p_type == "tcp":
p= proto.PROTOCOL_TCP
vs_def.protocol = p
Help 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