Forum Discussion
Vladimir_Budilo
Nimbostratus
Jan 06, 2010GTM Load Balancing using iControl & iControlIntermediary
Hello All!
I am currently working on a web-based application to manage GTM.
I've downloaded the iControl java code (as well as the iControl Wrapper jar), and see that the architecture centers around LTM, not GTM.
So, for example, the following code will print out all of the pool names defined for the LTM (stored in the bigip.conf file, and not the wide-ip.conf file that I need):
import iControlIntermediary.LBPool;
..........
LBPool lbPool = new LBPool(USERNAME, PASSWORD, ADDRESS);
String poolArray[] = lbPool.getList();
for (String poolName : poolArray) {
System.out.println("PoolName: " + poolName);
}
Is there an API that deals with GTM management?
What I'm trying to do is create the functionality that will allow for switching between members of a specific GTM pool .
Any help would be appreciated!!
Thanks!
Vladimir
- That is true for the intermediary library. Try downloading the standalone iControl Library for Java on the iControl Assembly labs project. This contains all the core iControl interfaces (GTM included).
- Vladimir_Budilo
Nimbostratus
Hello again!/** * 1. Retrieves the WideIP * 2. Gets the WideIP's pool name (There could be * more than one pool, but that's improbable here * 3. Retrieves the pool * member information for this one particular pool * 4. Checks whether the * pool member is enabled/disabled * * @param aInterfaces * @param aWideIp * @param aPoolMember * @return * @throws RemoteException * @throws Exception */ public static boolean isPoolMemberEnabled(Interfaces aInterfaces, String aWideIp, String aPoolMember) throws RemoteException, Exception { String poolName = null; GlobalLBWideIPBindingStub wideIpStub = aInterfaces.getGlobalLBWideIP(); String wideIpArr[] = { aWideIp }; // Need to make this into an array /* * Check to see if the WideIp is enabled or disabled If the WideIp is * disabled we can't check the status of the farm, so an exception is * thrown. */ CommonEnabledState enabled[] = wideIpStub.get_enabled_state(wideIpArr); if (!CommonEnabledState._STATE_ENABLED.equals(enabled[0].getValue())) { throw new Exception( "The WideIp " + aWideIp + " is not enabled. Cannot check the status of the pool members"); } // Get an array of wide ips, specifically the one in question GlobalLBWideIPWideIPPool wideIpPools[][] = wideIpStub .get_wideip_pool(wideIpArr); // Get the wideip pool object GlobalLBWideIPWideIPPool wideIpPool = wideIpPools[0][0]; // Get the pool name in question poolName = wideIpPool.getPool_name(); System.out.println("Pool Name: " + poolName); String poolNameArr[] = { poolName }; // Need to make this into an array GlobalLBPoolMemberBindingStub poolMemberStub = aInterfaces .getGlobalLBPoolMember(); // I need to pass it in to the get_enabled_state() method CommonIPPortDefinition testPoolMember[][] = new CommonIPPortDefinition[1][1]; CommonIPPortDefinition pMember1 = new CommonIPPortDefinition(aPoolMember, 443); testPoolMember[0][0] = pMember1; GlobalLBPoolMemberMemberEnabledState[][] poolMembers = poolMemberStub .get_enabled_state(poolNameArr, testPoolMember); CommonEnabledState state = poolMembers[0][0].getState(); System.out.println("state value: " + state.getValue()); return CommonEnabledState._STATE_ENABLED.equals(state.getValue()); }
- Great post, thanks for passing this along. I'll go ahead and add this to the iControl CodeShare. One question though:
- Vladimir_Budilo
Nimbostratus
I copied and pasted the older version of the method, sorry. The one you see there now is the updated one.
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