}
private void updateNodesInLoadBalancer(Set<Node> nodes, LoadBalancer loadBalancer) throws TimeoutException {
System.out.format("Update Nodes%n");
NodeApi nodeApi = clbApi.getNodeApiForZoneAndLoadBalancer(ZONE, loadBalancer.getId());
UpdateNode updateNode = UpdateNode.builder()
.condition(ENABLED)
.weight(20)
.build();
for (Node node: nodes) {
nodeApi.update(node.getId(), updateNode);
System.out.format(" %s %s%n", node.getId(), updateNode);
}
// Wait for the Load Balancer to become Active before moving on
// If you want to know what's happening during the polling, enable logging. See