Forum Discussion
iControl interaction with the nodes and java
Hi folks -- I appreciate the earlier help with the ssl certs and iControl and now I have a different question. I think I'm missing something conceptually, because it seems as if the examples here, and the APIs have methods that deal with the concepts of nodes as 'pool members' and not individual entities.
Let me back up a sec. What I'm trying to do is be able to automatically toggle one of our test F5's so that network flow only goes to a single member of pools, and isn't load balanced. Since nodes (individual servers) can belong to multiple pools in our environment, I've found it a lot easier to just disable the nodes in the F5 instead of having to navigate to each individual pool and mark the pool member down.
Using an example Joe Pruitt wrote, on this site, I'm able to query and set the availablity of pool members with
iControl.LocalLBPoolMemberMemberObjectStatus iControl.LocalLBPoolMemberMemberMonitorState
But I don't see anything like this in the iControl.LocalLBNodeAddress interface. Is there a java code example anywhere of working with a node directly? Many thanks!
3 Replies
Look in the LocalLB.NodeAddress (or NodeAddressV2) interface for the set_monitor_state() and set_session_enabled_state() methods. With the set_monitor_state() method, you can effectively override the monitors by setting the return values to down. With the set_session_enabled_state() method you can stop new sessions from being load balanced to the specific node address.
-Joe
- boo_radley_1114
Nimbostratus
Thanks Joe -- it took a bit of playing around (didn't realize I needed to import iControl.CommonEnabledState) but once I did it works very well, so I can write a very simple method like:
public void disableNode ( String [] addresses, CommonEnabledState [] states) throws Exception { for (int i = 0; i < addresses.length; i++) { m_interfaces.getLocalLBNodeAddress().set_session_enabled_state(addresses, states); } }- Very nice boo!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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