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, - 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)? - 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: - 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. - 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.
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