Package com.abiquo.model.rest

Examples of com.abiquo.model.rest.RESTLink


    *      "http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+Resource"
    *      > http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+
    *      Resource</a>
    */
   public VirtualMachineTemplate getVirtualMachineTemplate() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_MACHINE_TEMPLATE),
            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.VIRTUAL_MACHINE_TEMPLATE);

      HttpResponse response = context.getApi().get(link);

      ParseXMLWithJAXB<VirtualMachineTemplateDto> parser = new ParseXMLWithJAXB<VirtualMachineTemplateDto>(
View Full Code Here


      DatacenterRepositoryDto dcRepository = new DatacenterRepositoryDto();
      dcRepository.setName("Datacenter Repo");
      dcRepository.setRepositoryCapacityMb(0);
      dcRepository.setRepositoryLocation("10.60.1.104:/volume1/nfs-devel");
      dcRepository.setRepositoryRemainingMb(0);
      dcRepository.addLink(new RESTLink("applianceManagerRepositoryUri", "http://localhost/am/erepos/1"));
      dcRepository.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      dcRepository.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1/datacenterrepositories/1"));
      dcRepository.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
      dcRepository.addLink(new RESTLink("refresh",
            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/actions/refresh"));
      dcRepository.addLink(new RESTLink("virtualmachinetemplates",
            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates"));

      return dcRepository;
   }
View Full Code Here

   public static VirtualMachineTemplateDto virtualMachineTemplatePut() {
      VirtualMachineTemplateDto template = new VirtualMachineTemplateDto();
      template.setName("Template");
      template.setId(1);
      template.setDescription("Description");
      template.addLink(new RESTLink("edit",
            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
      template.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
      template.addLink(new RESTLink("conversions", "http://localhost/api/admin/enterprises/1"
            + "/datacenterrepositories/1/virtualmachinetemplates/1/conversions"));
      template.addLink(new RESTLink("tasks", "http://localhost/api/admin/enterprises/1"
            + "/datacenterrepositories/1/virtualmachinetemplates/1/tasks"));
      template.addLink(new RESTLink("diskfile", "http://somewhere.com/file.vmdk"));
      template.setDiskFormatType("RAW");
      template.setOsType(OSType.MACOS);
      template.setLoginUser("myuser");
      template.setLoginPassword("mypass");
      template.setState(VMTemplateState.DONE);
View Full Code Here

      buffer.append(link("/admin/enterprises/1", "enterprise"));
      buffer.append(link("/admin/enterprises/1" + "/datacenterrepositories/1/virtualmachinetemplates/1/conversions",
            "conversions"));

      buffer.append(link("/admin/enterprises/1" + "/datacenterrepositories/1/virtualmachinetemplates/1/tasks", "tasks"));
      buffer.append(link(new RESTLink("diskfile", "http://somewhere.com/file.vmdk")));
      buffer.append("<id>1</id>");
      buffer.append("<name>Template</name>");
      buffer.append("<description>Description</description>");
      buffer.append("<diskFormatType>RAW</diskFormatType>");
      buffer.append("<osType>MACOS</osType>");
View Full Code Here

   public static VirtualMachineTemplatePersistentDto persistentData() {
      VirtualMachineTemplatePersistentDto dto = new VirtualMachineTemplatePersistentDto();
      dto.setPersistentTemplateName("New persistent template name");
      dto.setPersistentVolumeName("New persistent volume name");
      dto.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
      dto.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
      dto.addLink(new RESTLink("virtualmachinetemplate",
            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
      return dto;
   }
View Full Code Here

      conversion.setSourcePath("source/path.vmkd");
      conversion.setTargetFormat(DiskFormatType.RAW);
      conversion.setTargetPath("target/path.raw");
      conversion.setTargetSizeInBytes(1000000l);
      conversion
            .addLink(new RESTLink("edit",
                  "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW"));
      conversion
            .addLink(new RESTLink("tasks",
                  "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW/tasks"));

      return conversion;
   }
View Full Code Here

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

      AbstractIpDto ip = (AbstractIpDto) input;
      RESTLink selfLink = checkNotNull(ip.searchLink("self"), "AbstractIpDto must have an self link");

      LinksDto refs = new LinksDto();
      refs.addLink(new RESTLink(selfLink.getTitle(), selfLink.getHref()));

      return super.bindToRequest(request, refs);
   }
View Full Code Here

   }

   public static CategoryDto categoryPut() {
      CategoryDto category = categoryPost();
      category.setId(1);
      category.addLink(new RESTLink("edit", "http://localhost/api/config/categories/1"));
      return category;
   }
View Full Code Here

         dto.setDefaultNetwork(defaultNetwork);
         dto.setUnmanaged(true);
         dto.setType(NetworkType.UNMANAGED);

         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
         dto.getLinks().add(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));

         UnmanagedNetwork network = new UnmanagedNetwork(context, dto);
         network.datacenter = datacenter;
         network.enterprise = enterprise;
View Full Code Here

   }

   public static LicenseDto licensePut() {
      LicenseDto license = licensePost();
      license.setId(1);
      license.addLink(new RESTLink("edit", "http://localhost/api/config/licenses/1"));

      return license;
   }
View Full Code Here

TOP

Related Classes of com.abiquo.model.rest.RESTLink

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.