diff --git a/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java b/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java index 817aa5d11c..ea68f4d391 100644 --- a/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java +++ b/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeClient.java @@ -109,6 +109,24 @@ public class TerremarkVCloudComputeClient { return Iterables.getLast(vApp.getNetworkToAddresses().values()); } + public Set getPublicAddresses(String id) { + TerremarkVApp vApp = tmClient.getVApp(id); + Set ipAddresses = Sets.newHashSet(); + SERVICE: for (InternetService service : tmClient.getAllInternetServicesInVDC(vApp.getVDC() + .getId())) { + for (Node node : tmClient.getNodes(service.getId())) + { + if (vApp.getNetworkToAddresses().containsValue(node.getIpAddress())) + { + ipAddresses.add(service.getPublicIpAddress().getAddress()); + } + } + } + return ipAddresses; + } + + + public void reboot(String id) { TerremarkVApp vApp = tmClient.getVApp(id); logger.debug(">> rebooting vApp(%s)", vApp.getId());