Package com.abiquo.server.core.cloud

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


                  .payload(
                        payloadFromResourceWithContentType("/payloads/volumes-lastpage.xml",
                              normalize(VolumesManagementDto.MEDIA_TYPE))) //
                  .build());

      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
      vdc.addLink(new RESTLink("volumes", "http://example.com/api/cloud/virtualdatacenters/1/volumes"));

      VolumeOptions options = VolumeOptions.builder().startWith(1).build();
      PaginatedCollection<VolumeManagementDto, VolumesManagementDto> templates = api.listVolumes(vdc, options);

      assertEquals(templates.size(), 1);
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

   @Override
   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
      checkArgument(checkNotNull(input, "input") instanceof VirtualDatacenterDto,
            "this binder is only valid for VirtualDatacenterDto objects");

      VirtualDatacenterDto vdc = (VirtualDatacenterDto) input;
      RESTLink editLink = checkNotNull(vdc.getEditLink(), "VirtualDatacenterDto must have an edit link");
      LinksDto refs = new LinksDto();
      refs.addLink(new RESTLink("virtualdatacenter", editLink.getHref()));

      return super.bindToRequest(request, refs);
   }
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

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

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

      verify(vdcToLocation);
View Full Code Here

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

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

      verify(vdcToLocation);
View Full Code Here

   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

      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.