Guest User

Untitled

a guest
Nov 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. NetworkConnectionSection net = vm.getNetworkConnectionSection();
  2. Builder builder = net.toBuilder();
  3. builder.connections(Iterables.transform(net.getConnections(),
  4. new Function<NetworkConnection, NetworkConnection>() {
  5.  
  6. @Override
  7. public NetworkConnection apply(NetworkConnection arg0) {
  8. return arg0.toBuilder().connected(true).ipAddressAllocationMode(ipAddressAllocationMode).build();
  9. }
  10.  
  11. }));
  12. return client.getVmClient().updateNetworkConnectionOfVm(builder.build(), vm.getHref());
Add Comment
Please, Sign In to add comment