Forum Discussion
Setting the name of a node with iControl
I am using the iControl JAVA API's and have been able to create a node and assign it into a pool by setting the IP address and port of the node, but I would like to be able to set the name of the node. I have tried searching all the API's and examples and have not found anything to do this.
Does anyone know how to do this?
9 Replies
- snovakov_86258
Nimbostratus
Hello Jeffro21,
I use the Perl iControl API.
I've not used this 'Node' part of the API you speak of, but I did find:
http://devcentral.f5.com/wiki/iControl.LocalLB__NodeAddressV2.ashx
Seems this newer version of iControl:/LocalLB/NodeAddress class completely replaces the older version.
It says its for F5 Big IP version 11.0.0 and higher.
What version of F5 Big IP appliance(s) platform(s) are you targeting?
Can you please indicate if this is indeed what you are using (i.e. iControl:/LocalLB/NodeAddress class) to create your 'Node'?
Seems the newer version uses names to associated IP addresses and ports to, rather than just using IP addresses.
~ snovakov - Jeffro21_47444
Nimbostratus
Hey,I am using V10.2 and I am trying to create a node with the following snippet.
publicvoidcreate()throwsException{validate();String [] containingPoolList = {containingPool.getName()};iControl.CommonIPPortDefinition memDefinition =newiControl.CommonIPPortDefinition(ipAddress,portNumber);iControl.CommonIPPortDefinition [] memDefinitionArr = {memDefinition};iControl.CommonIPPortDefinition [][] memDefinition2DArr = {memDefinitionArr};iConInterfaces.getLocalLBPool().add_member(containingPoolList, memDefinition2DArr);} - snovakov_86258
Nimbostratus
What is this create() method? Is this your code (i.e. are you wrapping Java iControl code into your own 'create()' method)?
What does 'validate()' do?
Are the 'ipAddress' and 'portNumber' declared and initialized somewhere else?
Have you tried discovering *where* in this create() method the code is either blowing-up or erroring-out?
In Perl world, I find logging or print statements to the screen are easiest to use for debugging purposes.
~ snovakov - Jeffro21_47444
Nimbostratus
Yeah the above code actually works and is functional. I was wondering if there is a way to set the name of a node while setting the port and IP. So far I haven't found anything. - mhite_60883
Cirrocumulus
This may be a helpful thread:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/51/aft/2156840/showtab/groupforums/Default.aspx
Technically, when you use create(), it will create the node address object for you if it doesn't exist. Create in itself doesn't let you set a screen_name, description, etc. You'll have to use a different API call to do that from what I can tell... - Jeffro21_47444
Nimbostratus
Do you know what that API call would be? - mhite_60883
Cirrocumulus
I believe if you use http://devcentral.f5.com/wiki/iControl.LocalLB__NodeAddressV2__create.ashx to create the NodeAddress, you can specify a name. To be honest, it's probably better to leave the name as the IP address and just set a description using http://devcentral.f5.com/wiki/iControl.LocalLB__NodeAddressV2__set_description.ashx.
Be aware that setting the port is something that occurs when you associate a node to a pool, not when you create a node.
Also, keep in mind this is how V11 API works. Old behavior is to set a screen name. - Jeffro21_47444
Nimbostratus
Thanks for the help. However, we are on 10.2, is there a way to do this in 10.2? - JRahm
Admin
like mhite indicated, pre-v11 you need to create the node first in the LocalLB::NodeAddress interface, then use the set_screen_name method and pass in the node and name as parameters.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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