iControl Java classes don't return correct state of GlobalLBVirtualServer
My Java client that uses the Java API receives status=ENABLED for GlobalLBVirtualServers in a distributed application. When I check in the F5 UI, they are DISABLED.
What might be causing this discrepancy?
My code looks like this:
public static void main(String[] args) throws Exception {
String username = "XX";
String password = "YY";
URL url = new URL("https://xx.xx.xx.xx/iControl/iControlPortal.cgi");
System.setProperty("javax.net.ssl.trustStore", System.getProperty("user.home") + "/.keystore");
iControl.XTrustProvider.install();
GlobalLBApplicationBindingStub applicationStub = (GlobalLBApplicationBindingStub) new GlobalLBApplicationLocator().getGlobalLBApplicationPort(url);
applicationStub.setTimeout(60000);
applicationStub.setUsername(username);
applicationStub.setPassword(password);
GlobalLBWideIPBindingStub wideIpStub = (GlobalLBWideIPBindingStub) new GlobalLBWideIPLocator().getGlobalLBWideIPPort(url);
wideIpStub.setTimeout(60000);
wideIpStub.setUsername(username);
wideIpStub.setPassword(password);
GlobalLBPoolBindingStub poolStub = (GlobalLBPoolBindingStub) new GlobalLBPoolLocator().getGlobalLBPoolPort(url);
poolStub.setTimeout(60000);
poolStub.setUsername(username);
poolStub.setPassword(password);
GlobalLBVirtualServerV2BindingStub vsStub = (GlobalLBVirtualServerV2BindingStub) new GlobalLBVirtualServerV2Locator().getGlobalLBVirtualServerV2Port(url);
vsStub.setTimeout(60000);
vsStub.setUsername(username);
vsStub.setPassword(password);
String[] apps = applicationStub.get_list(); // Get all distributed applications.
String[][] wideIpsPerApp = applicationStub.get_wide_ips(apps); // Get array of wide IPs per distributed application.
int i = 0;
for (String[] wideIps : wideIpsPerApp) {
GlobalLBWideIPWideIPPool[][] allPools = wideIpStub.get_wideip_pool(wideIps); // Get array of pools per wide IP.
System.out.println("Distributed app: " + apps[i++]);
int j = 0;
for (GlobalLBWideIPWideIPPool[] appPools : allPools) {
System.out.println("\tWide IP: " + wideIps[j++]);
String[] poolNames = new String[appPools.length];
int k = 0;
for (GlobalLBWideIPWideIPPool appPool : appPools) {
String s = appPool.getPool_name();
System.out.println("\t\tPool: " + s);
poolNames[k++] = s;
}
GlobalLBVirtualServerID[][] allServers = poolStub.get_member_v2(poolNames); // Get array of virtual servers per pool.
for (GlobalLBVirtualServerID[] servers : allServers) {
CommonIPPortDefinition[] ports = vsStub.get_address(servers); // Get server ports.
CommonEnabledState[] states = vsStub.get_enabled_state(servers); // Get server states.
k = 0;
for (CommonIPPortDefinition port : ports) {
System.out.println("\t\t\tServer: ip=" + port.getAddress() + ", state=" + states[k++]);
}
}
}
}
}
Thanks,
Jonathan