Examples of ids()


Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

   @Override
   public Hardware apply(ServerType from) {
      checkNotNull(from, "ServerType");
      HardwareBuilder builder = new HardwareBuilder();

      builder.ids(from.getId());
      builder.name(from.getName());
      builder.ram((int) (1000d * Double.valueOf(from.getMemory().getSize())));
      builder.processor(cpuToProcessor.apply(from.getCpu()));
      builder.supportsImage(Predicates.<Image> alwaysTrue());
      // all servers are 64bit. The OS however may be 32 bit.
View Full Code Here

Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

public class VMSpecToHardware implements Function<VMSpec, Hardware> {

   @Override
   public Hardware apply(VMSpec from) {
      HardwareBuilder builder = new HardwareBuilder();
      builder.ids(from.toString());
      for (int i = 0; i < from.getProcessorCount(); i++)
         builder.processor(new Processor(1, 3.0));
      builder.ram(from.getMemoryInGig() * 1024);
      builder.volume(new VolumeBuilder().type(Volume.Type.LOCAL).device(from.getBootDeviceName()).size(
               new Float(from.getBootDiskSize())).bootDevice(true).durable(true).build());
View Full Code Here

Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

      String vmNameWithoutPrefix = vm.getName().replace(VirtualBoxConstants.VIRTUALBOX_IMAGE_PREFIX, "");
     
      IGuestOSType guestOSType = virtualBoxManager.get().getVBox().getGuestOSType(osTypeId);
      Boolean is64Bit = guestOSType.getIs64Bit();
      HardwareBuilder hardwareBuilder = new HardwareBuilder();
      hardwareBuilder.ids(vmNameWithoutPrefix);
      hardwareBuilder.is64Bit(is64Bit);
      hardwareBuilder.supportsImage(ImagePredicates.idEquals(vmNameWithoutPrefix));
      hardwareBuilder.hypervisor("VirtualBox");
      return hardwareBuilder.build();
   }
View Full Code Here

Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

      if (vdc != null) {
         builder.location(findLocationForResource.apply(vdc));
      } else {
         // otherwise, it could be in a public catalog, which is not assigned to a VDC
      }
      builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage(
               ImagePredicates.idEquals(from.getHref().toASCIIString()));
      builder.hypervisor("VMware");
      return builder.build();

   }
View Full Code Here

Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

     
      VirtualHardwareSection hardware = findVirtualHardwareSectionForVm.apply(from);
      HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems());
      builder.location(findLocationForResource.apply(Iterables.find(checkNotNull(from, "from").getLinks(),
            LinkPredicates.typeEquals(VCloudDirectorMediaType.VDC))));
      builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage(
               ImagePredicates.idEquals(from.getHref().toASCIIString()));
      builder.hypervisor("VMware");
      return builder.build();
   }
}
View Full Code Here

Examples of org.jclouds.compute.domain.HardwareBuilder.ids()

public class VmSpecificationToHardware implements Function<VmSpecification, Hardware> {

   @Override
   public Hardware apply(VmSpecification from) {
      HardwareBuilder builder = new HardwareBuilder();
      builder.ids(from.getAlias());
      builder.name(from.getAlias());
      builder.processors(ImmutableList.of(new Processor(1, 1.0)));
      builder.ram(from.getMaxPhysicalMemory());
      // builder.volumes(ImmutableList.<Volume> of(new VolumeImpl(from.disk, true, false)));
      return builder.build();
View Full Code Here

Examples of org.jclouds.compute.domain.ImageBuilder.ids()

public class CIMOperatingSystemToImage implements Function<CIMOperatingSystem, Image> {

   @Override
   public Image apply(CIMOperatingSystem from) {
      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getOsType().getCode() + "");
      builder.name(from.getName());
      builder.description(from.getDescription());
      builder.operatingSystem(from);
      builder.status(Status.AVAILABLE);
      return builder.build();
View Full Code Here

Examples of org.jclouds.compute.domain.ImageBuilder.ids()

   @Override
   public Image apply(DataSet from) {

      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getUuid() + "");
      builder.name(from.getUrn());
      builder.description(from.getUrn());
      builder.status(Image.Status.AVAILABLE);

      OsFamily family;
View Full Code Here

Examples of org.jclouds.compute.domain.ImageBuilder.ids()

   public Image apply(VAppTemplate from) {
      checkNotNull(from, "VAppTemplate");
      Envelope ovf = templateToEnvelope.apply(from);

      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getHref().toASCIIString());
      builder.uri(from.getHref());
      builder.name(from.getName());
      Link vdc = Iterables.find(checkNotNull(from, "from").getLinks(), LinkPredicates.typeEquals(VCloudDirectorMediaType.VDC));
      if (vdc != null) {
         builder.location(findLocationForResource.apply(vdc));
View Full Code Here

Examples of org.jclouds.compute.domain.ImageBuilder.ids()

      this.imageToOs = imageToOs;
   }
  
   public Image apply(org.jclouds.cloudservers.domain.Image from) {
      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getId() + "");
      builder.name(from.getName());
      builder.description(from.getName());
      builder.version(from.getUpdated().getTime() + "");
      builder.operatingSystem(imageToOs.apply(from));
      builder.status(toPortableImageStatus.get(from.getStatus()));
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.