Package org.jclouds.abiquo.domain.cloud

Examples of org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate


      // Get the region where the template is available
      Datacenter datacenter = regionMap.get().get(Integer.valueOf(template.getImage().getLocation().getId()));

      // Load the template
      VirtualMachineTemplate virtualMachineTemplate = enterprise.getTemplateInRepository(datacenter,
            Integer.valueOf(template.getImage().getId()));

      Integer overrideCores = options.getOverrideCores();
      Integer overrideRam = options.getOverrideRam();
View Full Code Here


      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setCpuRequired(5);
      dto.setRamRequired(2048);
      dto.addLink(new RESTLink("edit", "http://foo/bar"));
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);

      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));

      verify(vdcToLocation);

      assertEquals(hardware.getProviderId(), template.getId().toString());
      assertEquals(hardware.getId(), template.getId() + "/" + vdc.getId());
      assertEquals(hardware.getName(), template.getName());
      assertEquals(hardware.getUri(), URI.create("http://foo/bar"));

      assertEquals(hardware.getRam(), template.getRamRequired().intValue());
      assertEquals(hardware.getProcessors().size(), 1);
      assertEquals(hardware.getProcessors().get(0).getCores(), (double) template.getCpuRequired());
      assertEquals(hardware.getProcessors().get(0).getSpeed(),
            VirtualMachineTemplateInVirtualDatacenterToHardware.DEFAULT_CORE_SPEED);

      assertEquals(hardware.getVolumes().size(), 1);
      assertEquals(hardware.getVolumes().get(0).getSize(), 50F);
View Full Code Here

      dto.setName("Template");
      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setCpuRequired(5);
      dto.setRamRequired(2048);
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
View Full Code Here

      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
            vdcToLocation);

      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, new VirtualMachineTemplateDto());
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, new VirtualDatacenterDto());

      function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
   }
View Full Code Here

      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setCpuRequired(5);
      dto.setRamRequired(2048);
      dto.addLink(new RESTLink("edit", "http://foo/bar"));
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);

      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));

      verify(vdcToLocation);

      assertEquals(hardware.getProviderId(), template.getId().toString());
      assertEquals(hardware.getId(), template.getId() + "/" + vdc.getId());
      assertEquals(hardware.getName(), template.getName());
      assertEquals(hardware.getUri(), URI.create("http://foo/bar"));

      assertEquals(hardware.getRam(), template.getRamRequired());
      assertEquals(hardware.getProcessors().size(), 1);
      assertEquals(hardware.getProcessors().get(0).getCores(), (double) template.getCpuRequired());
      assertEquals(hardware.getProcessors().get(0).getSpeed(),
            VirtualMachineTemplateInVirtualDatacenterToHardware.DEFAULT_CORE_SPEED);

      assertEquals(hardware.getVolumes().size(), 1);
      assertEquals(hardware.getVolumes().get(0).getSize(), 50F);
View Full Code Here

      dto.setName("Template");
      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setCpuRequired(5);
      dto.setRamRequired(2048);
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
View Full Code Here

      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
            vdcToLocation);

      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, new VirtualMachineTemplateDto());
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, new VirtualDatacenterDto());

      function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
   }
View Full Code Here

      dto.setId(5);
      dto.setName("Template");
      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setRamRequired(2048);
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
View Full Code Here

      dto.setId(5);
      dto.setName("Template");
      dto.setDescription("Template description");
      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
      dto.setCpuRequired(5);
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
View Full Code Here

      dto.setId(5);
      dto.setName("Template");
      dto.setDescription("Template description");
      dto.setCpuRequired(5);
      dto.setRamRequired(2048);
      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);

      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
      vdcDto.setId(6);
      vdcDto.setHypervisorType(HypervisorType.VMX_04);
      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
View Full Code Here

TOP

Related Classes of org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate

Copyright © 2018 www.massapicom. 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.