Forum Discussion
MarkM_63051
Nov 29, 2011Nimbostratus
delete_pool not working
Hello,
I am attempting to create and delete a pool programatically. I had no problem with the create method but the delete_pool method does not seem to do anything. I can check the F5 GUI an...
MarkM_63051
Nov 30, 2011Nimbostratus
I believe the pool name is getting passed in properly because if I try to delete a pool that does not exist, then I get an error stating that.
iControl.LocalLBPoolBindingStub lblpool =
(iControl.LocalLBPoolBindingStub) new iControl.LocalLBPoolLocator
().getLocalLBPoolPort(new java.net.URL(endpoint));
lblpool.setTimeout(IDLE_TIMEOUT);
String poolName =
ActionRequestUtils.resolveStringParam(anActionRequest, "poolName");
// The following line is how you create an empty pool without members.
iControl.CommonIPPortDefinition[][] member =
new iControl.CommonIPPortDefinition[1][0];
iControl.LocalLBLBMethod lb_method =
iControl.LocalLBLBMethod.LB_METHOD_ROUND_ROBIN;
iControl.LocalLBLBMethod[] lbMethods =
new iControl.LocalLBLBMethod[]{lb_method};
if (create) {
lblpool.create(new String[]{poolName}, lbMethods, member);
// Now set a default monitor association
iControl.LocalLBMonitorRule monitorRule = new iControl.LocalLBMonitorRule();
monitorRule.setMonitor_templates(new String[]{"gateway_icmp"});
// monitorRule.setQuorum(quorum);
monitorRule.setType(LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE);
iControl.LocalLBPoolMonitorAssociation monitorAssociation = new
iControl.LocalLBPoolMonitorAssociation(); monitorAssociation.setPool_name
(poolName);
monitorAssociation.setMonitor_rule(monitorRule);
iControl.LocalLBPoolMonitorAssociation[] monitorAssociations = new
iControl.LocalLBPoolMonitorAssociation[]{monitorAssociation};
lblpool.set_monitor_association(monitorAssociations);
} else
lblpool.delete_pool(new String[]{poolName});
}
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