Forum Discussion
Aditya_01_13899
Nimbostratus
Dec 23, 2013Unable to Set Health Monitor on a Pool using iControl Java
I am able to create a pool using the iControl java api. However, I am not able to set any health monitors on the pool. Here is thecode: I want to do it only for one node right now
LocalLBMonito...
Aditya_01_13899
Nimbostratus
Dec 23, 2013Ok so I found the answer to my own question 🙂
Here is the sample code if anyone wants to use it
iControl.LocalLBPoolBindingStub stub = _interfaces.getLocalLBPool();
String[] monitors = new String[1];
monitors[0] = "http";
iControl.LocalLBMonitorRule rule = new iControl.LocalLBMonitorRule();
rule.setQuorum(0L);
rule.setType(iControl.LocalLBMonitorRuleType.MONITOR_RULE_TYPE_AND_LIST);
rule.setMonitor_templates(monitors);
iControl.LocalLBPoolMonitorAssociation[] monitor_associations = new iControl.LocalLBPoolMonitorAssociation[1];
monitor_associations[0] = new iControl.LocalLBPoolMonitorAssociation();
monitor_associations[0].setMonitor_rule(rule);
monitor_associations[0].setPool_name("TestPool");
stub.set_monitor_association(monitor_associations);
Hope no one falls into the same pit that I fell into 🙂
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