I have the following code setup that fetches nodes instance for multiple nodes that are co-existing for our Jenkins setup:
Object nodes = Jenkins.getInstance().getLabel(label).getNodes()
for (int i = 0; i < nodes.size(); i++) {
Object computer = nodes[i].getComputer()
String nodeName = nodes[i].getNodeName()
}
Now inside the for loop I have computer and nodename available. But I need to know the IP address of each of these nodes. I am pretty new to groovy and Jenkins, so wanted to know if there is a method that I can call to directly get the IP address inside the for loop above.