Package org.jclouds.compute.domain

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


   public NodeMetadata apply(VM from) {
      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getHref().toASCIIString());
      builder.name(from.getName());
      String locationId = Iterables.get(from.getNetworkSection().getNetworks(), 0).getName();
      builder.location(from(locations.get()).firstMatch(LocationPredicates.idEquals(locationId)).orNull());
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getName()));
      try {
         builder.operatingSystem(CIMOperatingSystem.toComputeOs(from.getOperatingSystemSection()));
      } catch (NullPointerException e) {
         // os section was null
View Full Code Here


         builder.credentials(credentialsBuilder.build());

         if (from.getServer() instanceof VServerWithVNICs) {

            VServerWithVNICs server = (VServerWithVNICs) from.getServer();
            builder.location(parseLocation(server));
            List<String> ips = Lists.newArrayList();
            if (server.getVnics() != null && server.getVnics().iterator().next().getPrivateIp() != null) {
               ips.add(server.getVnics().iterator().next().getPrivateIp());
            }
            builder.privateAddresses(ips);
View Full Code Here

            builder.privateAddresses(ips);
         }
      }
      if (from.getTemplate() != null) {
         // when creating a new node
         builder.location(from.getTemplate().getLocation());
      }

      return builder.build();
   }
}
View Full Code Here

   public NodeMetadata apply(VM from) {
      // convert the result object to a jclouds NodeMetadata
      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getUuid() + "");
      builder.name(from.getAlias());
      builder.location(from(locations.get()).firstMatch(LocationPredicates.idEquals(from.getUuid() + "")).orNull());
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getType()));
      builder.imageId(from.getType() + "");
      Image image = from(images.get()).firstMatch(ImagePredicates.idEquals(from.getUuid() + "")).orNull();
      if (image != null)
         builder.operatingSystem(image.getOperatingSystem());
View Full Code Here

      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getHref().toASCIIString());
      builder.uri(from.getHref());
      builder.name(from.getName());
      builder.hostname(from.getName());
      builder.location(findLocationForResourceInVDC.apply(
            Iterables.find(from.getLinks(), LinkPredicates.typeEquals(VCloudDirectorMediaType.VDC))));
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getName()));
      builder.operatingSystem(toComputeOs(from));
      builder.hardware(hardwareForVm.apply(from));
      builder.status(vAppStatusToNodeStatus.get(from.getStatus()));
View Full Code Here

      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.id(machineInDatacenter.slashEncode());
      builder.providerId(from.getId());
      builder.name(from.getName());
      builder.hostname(from.getId());
      builder.location(zone);
      Map<String, String> metadataMap = filterKeys(from.getMetadata(), new Predicate<String>() {

         @Override
         public boolean apply(String input) {
            // TODO make this more efficient
View Full Code Here

      // TODO Set up location properly
      LocationBuilder locationBuilder = new LocationBuilder();
      locationBuilder.description("");
      locationBuilder.id("");
      locationBuilder.scope(LocationScope.HOST);
      nodeMetadataBuilder.location(locationBuilder.build());
      nodeMetadataBuilder.hostname(vm.getName());

      MachineState vmState = vm.getState();
      NodeMetadata.Status nodeState = toPortableNodeStatus.get(vmState);
      if (nodeState == null)
View Full Code Here

      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getId());
      builder.name(from.getName());
      builder.loginPort(from.getLoginPort());
      builder.hostname(from.getHostname());
      builder.location(findLocationWithId(from.getLocationId()));
      builder.group(from.getGroup());
      builder.tags(from.getTags());
      builder.userMetadata(from.getMetadata());
      builder.operatingSystem(OperatingSystem.builder().arch(from.getOsArch()).family(
               OsFamily.fromValue(from.getOsFamily())).description(from.getOsDescription())
View Full Code Here

   @Override
   public NodeMetadata apply(ServerInfo from) {
      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getUuid());
      builder.name(from.getName());
      builder.location(locationSupplier.get());
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getName()));
      builder.tags(from.getTags());
      builder.userMetadata(from.getUserMetadata());
      String imageId = getImageIdFromServer.apply(from);
      if (imageId != null) {
View Full Code Here

      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());

      // extract the operating system from the image
      RegionAndName regionAndName = new RegionAndName(instance.getRegion(), instance.getImageId());
      try {
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.