Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.NodeMetadataBuilder.privateAddresses()


         addressesBuilder.add(instance.getPrivateIpAddress());

      Set<String> addresses = addressesBuilder.build();

      builder.publicAddresses(filter(addresses, not(IsPrivateIPAddress.INSTANCE)));
      builder.privateAddresses(filter(addresses, IsPrivateIPAddress.INSTANCE));
      builder.hardware(parseHardware(instance));
      Location location = getLocationForAvailabilityZoneOrRegion(instance);
      builder.location(location);
      builder.imageId(instance.getRegion() + "/" + instance.getImageId());
View Full Code Here


         if (Throwables2.getFirstThrowableOfType(e, ResourceNotFoundException.class) == null) {
            Throwables.propagateIfPossible(e.getCause());
            throw e;
         }
      }
      return builder.privateAddresses(privateAddresses).publicAddresses(publicAddresses).build();
   }
}
View Full Code Here

      builder.hardware(new HardwareBuilder().ids(from.getUuid()).hypervisor("kvm")
            .processors(ImmutableList.of(new Processor(1, from.getCpu()))).ram(from.getMem())
            .volumes(Iterables.transform(from.getDevices().values(), deviceToVolume)).build());
      builder.status(serverStatusToNodeStatus.get(from.getStatus()));
      builder.publicAddresses(ImmutableSet.<String> of(from.getVnc().getIp()));
      builder.privateAddresses(ImmutableSet.<String> of());
      return builder.build();
   }

   @Singleton
   public static final class DeviceToVolume implements Function<Device, Volume> {
View Full Code Here

      builder.operatingSystem(toComputeOs(from, null));
      builder.hardware(hardwareForVApp.apply(from));
      builder.status(vAppStatusToNodeStatus.get(from.getStatus()));
      Set<String> addresses = getIpsFromVApp(from);
      builder.publicAddresses(filter(addresses, not(IsPrivateIPAddress.INSTANCE)));
      builder.privateAddresses(filter(addresses, IsPrivateIPAddress.INSTANCE));

      // normally, we don't affect the credential store when reading vApps.
      // However, login user, etc, is actually in the metadata, so lets see
      Credentials fromApi = getCredentialsFrom(from);
      if (fromApi != null && !credentialStore.containsKey("node#" + from.getHref().toASCIIString()))
View Full Code Here

      builder.hardware(new HardwareBuilder().ids(from.getUuid()).hypervisor("kvm")
            .processors(ImmutableList.of(new Processor(1, from.getCpu()))).ram(from.getMem())
            .volumes(Iterables.transform(from.getDevices().values(), deviceToVolume)).build());
      builder.status(serverStatusToNodeStatus.get(from.getStatus()));
      builder.publicAddresses(ImmutableSet.<String> of(from.getNics().get(0).getDhcp()));
      builder.privateAddresses(ImmutableSet.<String> of());
      return builder.build();
   }

   @Singleton
   public static final class DeviceToVolume implements Function<Device, Volume> {
View Full Code Here

      builder.hardware(findHardwareForServerOrNull(serverInZone));
      builder.status(toPortableNodeStatus.get(from.getStatus()));
      builder.publicAddresses(filter(
            transform(filter(from.getAddresses().values(), Predicates.not(isPrivateAddress)),
                  AddressToStringTransformationFunction.INSTANCE), isInet4Address));
      builder.privateAddresses(filter(
            transform(filter(from.getAddresses().values(), isPrivateAddress), AddressToStringTransformationFunction.INSTANCE), isInet4Address));
     
      for (Link link: from.getLinks()) {
         if (link.getRelation().equals(Link.Relation.SELF)) {
            builder.uri(link.getHref());
View Full Code Here

      builder.imageId(from.getImageId() + "");
      builder.operatingSystem(parseOperatingSystem(from));
      builder.hardware(parseHardware(from));
      builder.status(serverToNodeStatus.get(from.getStatus()));
      builder.publicAddresses(from.getAddresses().getPublicAddresses());
      builder.privateAddresses(from.getAddresses().getPrivateAddresses());
      return builder.build();
   }

   protected Hardware parseHardware(Server from) {
      try {
View Full Code Here

      if (input.getIp() != null) {
         builder.publicAddresses(ImmutableSet.of(input.getIp()));
      }
      if (input.getPrivateIp() != null) {
         builder.privateAddresses(ImmutableSet.of(input.getPrivateIp()));
      }

      // DigitalOcean does not provide a way to get the credentials.
      // Try to return them from the credential store
      Credentials credentials = credentialStore.get("node#" + input.getId());
View Full Code Here

      builder.hardware(new HardwareBuilder().ids(from.getUuid()).hypervisor("kvm")
            .processors(ImmutableList.of(new Processor(1, from.getCpu()))).ram(from.getMem())
            .volumes(Iterables.transform(from.getDevices().values(), deviceToVolume)).build());
      builder.status(serverStatusToNodeStatus.get(from.getStatus()));
      builder.publicAddresses(ImmutableSet.<String> of(from.getVnc().getIp()));
      builder.privateAddresses(ImmutableSet.<String> of());
      return builder.build();
   }

   @Singleton
   public static final class DeviceToVolume implements Function<Device, Volume> {
View Full Code Here

         if (Throwables2.getFirstThrowableOfType(e, ResourceNotFoundException.class) == null) {
            Throwables.propagateIfPossible(e.getCause());
            throw e;
         }
      }
      return builder.privateAddresses(privateAddresses).publicAddresses(publicAddresses).build();
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.