Package org.jclouds.abiquo.domain.infrastructure

Examples of org.jclouds.abiquo.domain.infrastructure.Datacenter


         final String name, final Template template) {
      AbiquoTemplateOptions options = template.getOptions().as(AbiquoTemplateOptions.class);
      Enterprise enterprise = adminService.getCurrentEnterprise();

      // 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()));
View Full Code Here


         final VirtualApplianceCachingTemplate template) {
      AbiquoTemplateOptions options = template.getOptions().as(AbiquoTemplateOptions.class);
      Enterprise enterprise = adminService.getCurrentEnterprise();

      // 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()));
View Full Code Here

*/
@Test(groups = "api", testName = "VirtualMachineTemplateLiveApiTest")
public class VirtualMachineTemplateLiveApiTest extends BaseAbiquoApiLiveApiTest {

   public void testGetParent() {
      Datacenter datacenter = env.virtualMachine.getTemplate().getDatacenter();
      assertNotNull(datacenter);
      assertEquals(datacenter.getId(), env.datacenter.getId());
   }
View Full Code Here

      List<Datacenter> datacenters = newArrayList(enterprise.listAllowedDatacenters());
      assertNotNull(datacenters);
      assertTrue(size(datacenters) > 0);

      Datacenter datacenter = datacenters.get(0);

      List<HypervisorType> hypervisors = newArrayList(datacenter.listAvailableHypervisors());
      assertNotNull(datacenters);
      assertTrue(size(datacenters) > 0);

      HypervisorType hypervisor = hypervisors.get(0);
View Full Code Here

      HypervisorType hypervisor = env.virtualDatacenter.getHypervisorType();

      Enterprise enterprise = env.user.getEnterprise();
      assertNotNull(enterprise);

      Datacenter datacenter = env.virtualDatacenter.getDatacenter();
      assertNotNull(datacenter);

      PrivateNetwork network = PrivateNetwork.builder(env.plainUserContext.getApiContext()).name("DefaultNetwork")
            .gateway("192.168.1.1").address("192.168.1.0").mask(24).build();
View Full Code Here

      builder.ids(template.getId().toString());
      builder.name(template.getName());
      builder.description(template.getDescription());

      // Location information
      Datacenter region = regionMap.get().get(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER));
      builder.location(datacenterToLocation.apply(region));

      // Only conversions have a status
      builder.status(Status.AVAILABLE);
      builder.backendStatus(Status.AVAILABLE.name()); // Abiquo images do not
View Full Code Here

   @SuppressWarnings("unchecked")
   public void testDatacenterToLocation() {
      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
      DatacenterToLocation function = new DatacenterToLocation();

      Datacenter datacenter = Datacenter.builder(context).name("dc").location("New York").build();
      datacenter.unwrap().setId(5);
      Location location = function.apply(datacenter);

      assertEquals(location.getId(), "5");
      assertEquals(location.getScope(), LocationScope.REGION);
   }
View Full Code Here

      builder.description(vdc.getName());
      builder.metadata(ImmutableMap.<String, Object> of());
      builder.scope(LocationScope.ZONE);
      builder.iso3166Codes(ImmutableSet.<String> of());

      Datacenter parent = regionMap.get().get(vdc.unwrap().getIdFromLink(ParentLinkName.DATACENTER));
      builder.parent(datacenterToLocation.apply(parent));

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

      // Build the transport object with the available information to avoid
      // making an unnecessary call to the target API (we only need the id of
      // the datacenter, and it is present in the link).
      DatacenterDto datacenterDto = new DatacenterDto();
      datacenterDto.setId(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER_REPOSITORY));
      Datacenter datacenter = wrap(context, Datacenter.class, datacenterDto);

      Iterable<VirtualDatacenter> vdcs = filter(cloudService.listVirtualDatacenters(),
            VirtualDatacenterPredicates.datacenter(datacenter));

      return filter(vdcs, new Predicate<VirtualDatacenter>() {
View Full Code Here

      // Build the transport object with the available information to avoid
      // making an unnecessary call to the target API (we only need the id of
      // the datacenter, and it is present in the link).
      DatacenterDto datacenterDto = new DatacenterDto();
      datacenterDto.setId(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER_REPOSITORY));
      Datacenter datacenter = wrap(context, Datacenter.class, datacenterDto);

      Iterable<VirtualDatacenter> vdcs = filter(cloudService.listVirtualDatacenters(),
            VirtualDatacenterPredicates.datacenter(datacenter));

      return filter(vdcs, compatibleWithTemplateOrConversions(template));
View Full Code Here

TOP

Related Classes of org.jclouds.abiquo.domain.infrastructure.Datacenter

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.