use of org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode in project legacy-jclouds-examples by jclouds.
the class UpdateNodes method updateNodesInLoadBalancer.
private void updateNodesInLoadBalancer(Set<Node> nodes, LoadBalancer loadBalancer) throws TimeoutException {
System.out.println("Update Nodes");
NodeApi nodeApi = clb.getNodeApiForZoneAndLoadBalancer(Constants.ZONE, loadBalancer.getId());
UpdateNode updateNode = UpdateNode.builder().condition(Node.Condition.ENABLED).weight(20).build();
for (Node node : nodes) {
nodeApi.update(node.getId(), updateNode);
System.out.println(" " + node.getId() + " " + updateNode);
}
// /jclouds-example/rackspace/src/main/java/org/jclouds/examples/rackspace/Logging.java
if (!LoadBalancerPredicates.awaitAvailable(lbApi).apply(loadBalancer)) {
throw new TimeoutException("Timeout on loadBalancer: " + loadBalancer);
}
}
Aggregations