Package org.jclouds.abiquo.domain.enterprise

Examples of org.jclouds.abiquo.domain.enterprise.Enterprise


   @Override
   public NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String tag,
         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()));

      // Get the zone where the template will be deployed
      VirtualDatacenter vdc = cloudService.getVirtualDatacenter(Integer.valueOf(template.getHardware().getLocation()
            .getId()));
View Full Code Here


            }));
   }

   @Override
   public Iterable<VirtualMachineTemplate> listImages() {
      Enterprise enterprise = adminService.getCurrentEnterprise();
      return enterprise.listTemplates();
   }
View Full Code Here

      return enterprise.listTemplates();
   }

   @Override
   public VirtualMachineTemplate getImage(final String id) {
      Enterprise enterprise = adminService.getCurrentEnterprise();
      return enterprise.findTemplate(VirtualMachineTemplatePredicates.id(Integer.valueOf(id)));
   }
View Full Code Here

   }

   protected NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String name,
         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()));

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

            }));
   }

   @Override
   public Iterable<VirtualMachineTemplate> listImages() {
      Enterprise enterprise = adminService.getCurrentEnterprise();
      return enterprise.listTemplates();
   }
View Full Code Here

         TemplateOptions options) {

      if (!options.getNetworks().isEmpty()) {
         ImmutableList.Builder<Ip<?, ?>> ips = ImmutableList.<Ip<?, ?>> builder();

         Enterprise enterprise = adminService.getCurrentEnterprise();
         Iterable<ExternalNetwork> externalNetworks = enterprise.listExternalNetworks(datacenter);

         for (String networkId : options.getNetworks()) {
            Network<? extends Ip<?, ?>> network = template.getVirtualDatacenter().getPrivateNetwork(
                  Ints.tryParse(networkId));
View Full Code Here

      assertEquals(virtualDatacenters.get(0).getName(), virtualDatacenters.get(1).getName());
      repeated.delete();
   }

   public void testCreateFromEnterprise() {
      Enterprise enterprise = env.enterpriseAdminContext.getAdministrationService().getCurrentUser().getEnterprise();
      assertNotNull(enterprise);

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

      Datacenter datacenter = datacenters.get(0);
View Full Code Here

   }

   public void testCreateFromVirtualDatacenter() {
      HypervisorType hypervisor = env.virtualDatacenter.getHypervisorType();

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

      Datacenter datacenter = env.virtualDatacenter.getDatacenter();
      assertNotNull(datacenter);
View Full Code Here

      assertEquals(vm.getState(), VirtualMachineState.NOT_ALLOCATED);
   }

   @Test(dependsOnMethods = "testUndeployVirtualMachine")
   public void testDeployFailsWhenHardLimitsAreExceeded() {
      Enterprise ent = view.getAdministrationService().getCurrentEnterprise();

      if (vdc.getCpuCountHardLimit() != 0) {
         vm.setCpu(vdc.getCpuCountHardLimit() + 1);
      } else if (ent.getCpuCountHardLimit() != 0) {
         vm.setCpu(ent.getCpuCountHardLimit() + 1);
      }

      VirtualMachineTask task = vm.update();
      assertNull(task);
View Full Code Here

      assertFalse(env.machine.isReserved());

      env.machine.reserveFor(env.enterprise);
      assertTrue(env.machine.isReserved());

      Enterprise owner = env.machine.getOwnerEnterprise();
      assertNotNull(owner);
      assertEquals(owner.getId(), env.enterprise.getId());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.abiquo.domain.enterprise.Enterprise

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.