Package com.abiquo.server.core.cloud

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


      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


    *      > 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

    *      > 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

                  .payload(
                        payloadFromResourceWithContentType("/payloads/publicips-available-lastpage.xml",
                              normalize(PublicIpsDto.MEDIA_TYPE))) //
                  .build());

      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
      vdc.addLink(new RESTLink("topurchase", "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));

      PagedIterable<PublicIpDto> publicIps = api.listAvailablePublicIps(vdc);
      List<PublicIpDto> ips = publicIps.concat().toList();

      assertEquals(ips.size(), 4);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/publicips-available-lastpage.xml",
                              normalize(PublicIpsDto.MEDIA_TYPE))) //
                  .build());

      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
      vdc.addLink(new RESTLink("topurchase", "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));

      IpOptions options = IpOptions.builder().startWith(3).build();
      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listAvailablePublicIps(vdc, options);

      assertEquals(ips.size(), 2);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/publicips-purchased-lastpage.xml",
                              normalize(PublicIpsDto.MEDIA_TYPE))) //
                  .build());

      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
      vdc.addLink(new RESTLink("purchased", "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));

      PagedIterable<PublicIpDto> publicIps = api.listPurchasedPublicIps(vdc);
      List<PublicIpDto> ips = publicIps.concat().toList();

      assertEquals(ips.size(), 4);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/publicips-purchased-lastpage.xml",
                              normalize(PublicIpsDto.MEDIA_TYPE))) //
                  .build());

      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
      vdc.addLink(new RESTLink("purchased", "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));

      IpOptions options = IpOptions.builder().startWith(3).build();
      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listPurchasedPublicIps(vdc, options);

      assertEquals(ips.size(), 2);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/available-templates-lastpage.xml",
                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
                  .build());

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

      PagedIterable<VirtualMachineTemplateDto> templates = api.listAvailableTemplates(vdc);
      List<VirtualMachineTemplateDto> all = templates.concat().toList();

      assertEquals(all.size(), 2);
View Full Code Here

                  .payload(
                        payloadFromResourceWithContentType("/payloads/available-templates-lastpage.xml",
                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
                  .build());

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

      VirtualMachineTemplateOptions options = VirtualMachineTemplateOptions.builder().startWith(1).build();
      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> templates = api
            .listAvailableTemplates(vdc, options);
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.