Package com.abiquo.server.core.cloud

Examples of com.abiquo.server.core.cloud.VirtualDatacenterDto


   public void testUpdate() {
      env.virtualDatacenter.setName("Aloha updated");
      env.virtualDatacenter.update();

      // Recover the updated virtual datacenter
      VirtualDatacenterDto updated = env.cloudApi.getVirtualDatacenter(env.virtualDatacenter.getId());

      assertEquals(updated.getName(), "Aloha updated");
   }
View Full Code Here


         this.network = network;
         return this;
      }

      public VirtualDatacenter build() {
         VirtualDatacenterDto dto = new VirtualDatacenterDto();
         dto.setName(name);
         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
         dto.setStorageLimits(storageSoft, storageHard);
         dto.setVlansLimits(vlansSoft, vlansHard);
         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
         dto.setName(name);
         dto.setHypervisorType(hypervisorType);
         dto.setVlan(network.unwrap());

         VirtualDatacenter virtualDatacenter = new VirtualDatacenter(context, dto);
         virtualDatacenter.datacenter = datacenter;
         virtualDatacenter.enterprise = enterprise;
View Full Code Here

    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
    *      Resource# VirtualDatacenterResource-RetrieveaVirtualDatacenter</a>
    */
   public VirtualDatacenter getVirtualDatacenter() {
      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
      virtualDatacenter = wrap(context, VirtualDatacenter.class, dto);
      return virtualDatacenter;
   }
View Full Code Here

      return listVirtualDatacenters.execute(options);
   }

   @Override
   public VirtualDatacenter getVirtualDatacenter(final Integer virtualDatacenterId) {
      VirtualDatacenterDto virtualDatacenter = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
      return wrap(context, VirtualDatacenter.class, virtualDatacenter);
   }
View Full Code Here

* @author Ignasi Barrera
* @author Francesc Montserrat
*/
public class CloudResources {
   public static VirtualDatacenterDto virtualDatacenterPost() {
      VirtualDatacenterDto virtualDatacenter = new VirtualDatacenterDto();
      virtualDatacenter.setName("VDC");
      virtualDatacenter.setHypervisorType(HypervisorType.KVM);
      virtualDatacenter.setVlan(NetworkResources.vlanPost());
      return virtualDatacenter;
   }
View Full Code Here

      virtualMachine.setHdInBytes(20l);
      return virtualMachine;
   }

   public static VirtualDatacenterDto virtualDatacenterPut() {
      VirtualDatacenterDto virtualDatacenter = virtualDatacenterPost();
      virtualDatacenter.setId(1);
      virtualDatacenter.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      virtualDatacenter.addLink(new RESTLink("disks", "http://localhost/api/cloud/virtualdatacenters/1/disks"));
      virtualDatacenter.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
      virtualDatacenter.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1"));
      virtualDatacenter.addLink(new RESTLink("tiers", "http://localhost/api/cloud/virtualdatacenters/1/tiers"));
      virtualDatacenter.addLink(new RESTLink("virtualappliances",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances"));
      virtualDatacenter.addLink(new RESTLink("volumes", "http://localhost/api/cloud/virtualdatacenters/1/volumes"));
      virtualDatacenter.addLink(new RESTLink("privatenetworks",
            "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks"));
      virtualDatacenter.addLink(new RESTLink("defaultnetwork",
            "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1"));
      virtualDatacenter.addLink(new RESTLink("defaultvlan",
            "http://localhost/api/cloud/virtualdatacenters/1/action/defaultvlan"));
      virtualDatacenter.addLink(new RESTLink("topurchase",
            "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));
      virtualDatacenter.addLink(new RESTLink("purchased",
            "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));
      virtualDatacenter.addLink(new RESTLink("templates",
            "http://localhost/api/cloud/virtualdatacenters/1/action/templates"));
      return virtualDatacenter;

   }
View Full Code Here

    *      # VirtualDatacenterResource-Retireveavirtualdatacenter</a>
    * @return The virtual datacenter where this virtual machine is.
    */
   public VirtualDatacenter getVirtualDatacenter() {
      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
      return wrap(context, VirtualDatacenter.class, dto);
   }
View Full Code Here

      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }

   public void testBindSingleVolume() throws IOException {
      VirtualDatacenterDto vdc = CloudResources.virtualDatacenterPut();
      BindVirtualDatacenterRefToPayload binder = new BindVirtualDatacenterRefToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, vdc);
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + vdc.getEditLink().getHref()
            + "\" rel=\"virtualdatacenter\"/></links>"), LinksDto.class);
   }
View Full Code Here

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

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

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

      verify(vdcToLocation);
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.cloud.VirtualDatacenterDto

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.