Forum Discussion

Prasad_81758's avatar
Icon for Nimbostratus rankNimbostratus
Feb 10, 2011

How 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:



LocalLBPoolMemberMemberMonitorAssociation[][] ma = poolMember.get_monitor_association(pn);


LocalLBPoolMemberMemberMonitorAssociation[][] newma = new LocalLBPoolMemberMemberMonitorAssociation[1][hostList.size()];


for (int j = 0; j < ma.length; j++)




for (int k = 0; k < ma[j].length; k++)




LocalLBMonitorIPPort ipp = new LocalLBMonitorIPPort();


ipp = (ma[j][k].getMember()); LocalLBMonitorRule mr = new LocalLBMonitorRule();


String[] mt = {"tcp"}; //Also tried iControl.LocalLBMonitorTemplateType.TTYPE_TCP.getValue()






newma[j][k] = new LocalLBPoolMemberMemberMonitorAssociation(); newma[j][k].setMember(ipp); newma[j][k].setMonitor_rule(mr);






poolMember.set_monitor_association(pn, newma);



Thanks for your help.