Forum Discussion
lizhuh_55036
Nimbostratus
Jun 25, 2009virtual server set_protocol doesn't work
Hi,
From GUI, when protocol changes, the client profile changes accordingly.
However, if I do it through pyControl, no mattrer how I change the profiles first, set_prot...
L4L7_53191
Nimbostratus
Jun 25, 2009From the SDK you'll see that we've got two arguments to this call:
1) 'virtual_servers' - this tips you off that you'll be passing a list of virtual server names. Anything plural in iControl is generally wrapped in a list. So far so good...
2) 'protocols' - another plural, so another list. But the SDK says that we need to pass in type "ProtocolType", which in this case is simply a specific string value.
Putting it together, this works:
In [5]: b.LocalLB_VirtualServer.set_protocol(virtual_servers = ['virtual_forward_test'], protocols = ['PROTOCOL_UDP'])
I successfully changed a virtual server of *All Protocols to a UDP-only VS (confirmed via the GUI). To set it back, I just passed it 'PROTOCOL_ANY' as defined in the SDK, and it worked.
I hope this helps!
-Matt
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
