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
LocalLBMonitorRule mr = new LocalLBMonitorRule();
String[] mt = {"tcp"};
mr.setMonitor_templates(mt);
mr.setType(LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE);
obj[0][0].setMonitor_rule(mr);
_interfaces.getLocalLBPoolMember().set_monitor_association(new String[]{_name},obj);
Can someone please let me know what the issue could be?
1 Reply
- Aditya_01_13899
Nimbostratus
Ok 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