Forum Discussion
SMetcalfe_87199
Nimbostratus
Sep 07, 2010Java Assembly - Marking down a Node
Hello all,
I've successfully configured Eclipse and iControl assembly . I am able to communicate with the BIG-IP via iControl
Originally I used the iControlIntermediary wrappers, but they did not seem to have the ability to mark down an individual pool member (node), only marking down an entire virtual server which doesn't solve my problem. (I understand the wrappers are of limited functionality and not part of the assembly)
I am attempting to automate some code deployment to webservers, and it requires that I mark the a node down (as you would in the GUI with Disable on the Local Traffic --> Nodes menu). Get a list of Current Connections from the Node properties, and wait for connections to drain before proceeding with the next steps in the program, then finally marking the node back up (Enable)
Right now the F5 represents the only real remaining challenge in getting this all to work.
I can create an iControl interface object and retrieve system information such as uptime and BIG IP version.
I can create a icontrol.LocalLBPoolBindingStub and retrieve pool information.
What I can't seem to figure out is how to mark a specific Node down and up in Java.
There are examples for other language code, but using the Assembly, there's has got to be a relatively easy way to do this fundamental step with the iControl.interfaces object and some method calls.
I don't want to remove nodes from pools, and re-add them. I want to temporarily mark them down, and then mark them back up.
BIG IP OS is BIG-IP 10.2.0 Build 1707.0 Final
I have searched the wiki and forum, and can't seem to piece together a solution here. I am not a developer, so any assistance or example for a struggling layman would be appreciated.
The following is an example of the code I have been using. I have attempted to use NodeAddress stubs, but they don't seem to return an expected value (if they work at all).
import iControl.*;
import java.util.Arrays;
public class rawControl {
public static void main(String[] args) {
try {
iControl.Interfaces interfaces = new iControl.Interfaces();
if(interfaces.initialize("ip of f5", "username", "password")) {
iControl.SystemSystemInfoPortType t = interfaces.getSystemSystemInfo();
// using the interfaces object, get the pool information by assiging a pool object to it
iControl.LocalLBPoolBindingStub pool = interfaces.getLocalLBPool();
System.out.println(Arrays.toString(pool.get_list()));
// attempt to resolve the pool members for a specified pool
String[] pool_list = {"beaterbox-pool"};
//System.out.println(Arrays.toString(pool.get_member(pool_list)));
System.out.println(pool.get_version());
System.out.println((pool.get_active_member_count(pool_list)).toString());
System.out.println(pool.get_member(pool_list));
long uptime = t.get_uptime();
String version = t.get_version();
System.out.println("uptime=" + uptime);
System.out.println();
System.out.println("version=" + version);
}
} catch (Exception e){
System.out.println(e.toString());
}
}
}
Regards,
Shaun.
4 Replies
- Hi Shaun, as you've said, we have several examples on the site that deal with gracefully disabling nodes. I'll be focusing the next few months on some tech tips and samples for Java that do the types of things we've done with PowerShell and Perl in the past. That doesn't help you know, but hopefully we'll have more resources in the future.
- SMetcalfe_87199
Nimbostratus
Thank you for the response Joe. - Shaun, sorry for the delay. Here's a java class that will manage gracefully enabling/disabling servers.
- SMetcalfe_87199
Nimbostratus
Joe,
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