Package com.abiquo.model.rest

Examples of com.abiquo.model.rest.RESTLink


      SystemPropertyDto property = new SystemPropertyDto();
      property.setId(1);
      property.setDescription("Time interval in seconds");
      property.setValue("10");
      property.setName("api.applibrary.ovfpackagesDownloadingProgressUpdateInterval");
      property.addLink(new RESTLink("edit", "http://localhost/api/config/properties/1"));

      return property;
   }
View Full Code Here


      super(context, target);
   }

   @Override
   public PublicNetwork getNetwork() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.PUBLIC_NETWORK),
            ValidationErrors.MISSING_REQUIRED_LINK + ParentLinkName.PUBLIC_NETWORK);

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

      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
View Full Code Here

   // Domain operations

   @Override
   public ExternalNetwork getNetwork() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.EXTERNAL_NETWORK),
            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.EXTERNAL_NETWORK);

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

      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
View Full Code Here

   // Domain operations

   @Override
   public UnmanagedNetwork getNetwork() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.UNMANAGED_NETWORK),
            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.UNMANAGED_NETWORK);

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

      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
View Full Code Here

    *      http://community.abiquo.com/display/ABI20/User+resource#Userresource
    *      -Createanewuser</a>
    */
   public void save() {
      // set role link
      target.addLink(new RESTLink("role", role.unwrap().getEditLink().getHref()));
      target = context.getApi().getEnterpriseApi().createUser(enterprise.unwrap(), target);
   }
View Full Code Here

   }

   // Parent access

   public Enterprise getEnterprise() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.ENTERPRISE), ValidationErrors.MISSING_REQUIRED_LINK
            + " " + ParentLinkName.ENTERPRISE);

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

      ParseXMLWithJAXB<EnterpriseDto> parser = new ParseXMLWithJAXB<EnterpriseDto>(context.utils().xml(),
View Full Code Here

      enterprise = wrap(context, Enterprise.class, parser.apply(response));
      return enterprise;
   }

   public Datacenter getDatacenter() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.DATACENTER), ValidationErrors.MISSING_REQUIRED_LINK
            + " " + ParentLinkName.DATACENTER);

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

      ParseXMLWithJAXB<DatacenterDto> parser = new ParseXMLWithJAXB<DatacenterDto>(context.utils().xml(),
View Full Code Here

   private void addEnterpriseLink() {
      checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
      checkNotNull(enterprise.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class);

      RESTLink link = enterprise.unwrap().getEditLink();
      checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);

      target.addLink(new RESTLink("enterprise", link.getHref()));
   }
View Full Code Here

         dto.setDefaultNetwork(defaultNetwork == null ? Boolean.FALSE : defaultNetwork);
         dto.setUnmanaged(Boolean.FALSE);
         dto.setType(NetworkType.EXTERNAL);

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

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

         dto.setUuid(uuid);

         // DVD
         if (dvd) {
            DvdManagementDto dvd = new DvdManagementDto();
            RESTLink link = new RESTLink("image", "");
            dvd.addLink(link);
            dto.setDvd(dvd);
         }

         VirtualMachine virtualMachine = new VirtualMachine(context, dto);
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.