Package com.abiquo.model.rest

Examples of com.abiquo.model.rest.RESTLink


   }

   public static VirtualApplianceDto virtualAppliancePut() {
      VirtualApplianceDto virtualAppliance = virtualAppliancePost();
      virtualAppliance.setId(1);
      virtualAppliance.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
      virtualAppliance.addLink(new RESTLink("deploy",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/deploy"));
      virtualAppliance.addLink(new RESTLink("edit",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1"));
      virtualAppliance.addLink(new RESTLink("state",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/state"));
      virtualAppliance.addLink(new RESTLink("undeploy",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/undeploy"));
      virtualAppliance.addLink(new RESTLink("virtualmachines",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines"));
      virtualAppliance.addLink(new RESTLink("price",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/price"));
      return virtualAppliance;
   }
View Full Code Here


   }

   public static VirtualMachineDto virtualMachinePut() {
      VirtualMachineDto virtualMachine = virtualMachinePost();
      virtualMachine.setId(1);
      virtualMachine.addLink(new RESTLink("deploy",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy"));
      virtualMachine.addLink(new RESTLink("disks",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks"));
      virtualMachine.addLink(new RESTLink("edit",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1"));
      virtualMachine.addLink(new RESTLink("state",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state"));
      virtualMachine.addLink(new RESTLink("reset",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset"));
      virtualMachine.addLink(new RESTLink("tasks",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks"));
      virtualMachine.addLink(new RESTLink("undeploy",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy"));
      virtualMachine.addLink(new RESTLink("persistent",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent"));
      virtualMachine.addLink(new RESTLink("virtualappliance",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1"));
      virtualMachine.addLink(new RESTLink("virtualmachinetemplate",
            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
      virtualMachine.addLink(new RESTLink("nics",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics"));
      virtualMachine.addLink(new RESTLink("volumes",
            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes"));
      virtualMachine
            .addLink(new RESTLink("configurations",
                  "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations"));
      virtualMachine.setCpu(1);
      virtualMachine.setRam(1);
      virtualMachine.setHdInBytes(20l);
      return virtualMachine;
View Full Code Here

   public static VolumeManagementDto volumePost() {
      VolumeManagementDto volume = new VolumeManagementDto();
      volume.setName("Volume");
      volume.setSizeInMB(1024);
      volume.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
      return volume;
   }
View Full Code Here

      volume.setId(1);
      volume.setState(VolumeState.DETACHED.name());

      volume.getLinks().clear();

      RESTLink mappings = new RESTLink("action",
            "http://localhost/api/cloud/virtualdatacenters/1/volumes/1/action/initiatormappings");
      mappings.setTitle("initiator mappings");
      volume.addLink(mappings);
      volume.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/volumes/1"));
      volume.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
      volume.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
      return volume;
   }
View Full Code Here

      template.setCpuRequired(1);
      template.setRamRequired(128);
      template.setCpuRequired(27262976);
      template.setCreationUser("SYSTEM");
      template.setIconUrl("http://ww1.prweb.com/prfiles/2010/08/02/2823234/gI_0_HakunaLogoMedium.jpg");
      template.addLink(new RESTLink("icon", "http://localhost/api/config/icons/1"));
      template.addLink(new RESTLink("category", "http://localhost/api/config/categories/1"));

      return template;

   }
View Full Code Here

   public static TierDto cloudTierPut() {
      TierDto tier = new TierDto();
      tier.setId(1);
      tier.setEnabled(true);
      tier.setName("Tier");
      tier.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
      return tier;
   }
View Full Code Here

      return disk;
   }

   public static DiskManagementDto hardDiskPut() {
      DiskManagementDto disk = hardDiskPost();
      disk.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/disks/1"));
      disk.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
      return disk;
   }
View Full Code Here

    * @return The virtual machine this volume is attached to, or null if it is
    * not attached.
    */
   public VirtualMachine getVirtualMachine() {
      checkState(ATTACHED == VolumeState.valueOf(target.getState()), "Volume is not attached to a VM");
      RESTLink vmLink = checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_MACHINE),
            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.VIRTUAL_MACHINE);
      vmLink.setType(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE);
      HttpResponse response = context.getApi().get(vmLink);

      ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto> parser = context.utils().injector()
            .getInstance(Key.get(new TypeLiteral<ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto>>(){}));
      return wrap(context, VirtualMachine.class, parser.apply(response));
View Full Code Here

   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
      checkArgument(checkNotNull(input, "input") instanceof VolumeManagementDto,
            "this binder is only valid for VolumeManagementDto objects");

      VolumeManagementDto volume = (VolumeManagementDto) input;
      RESTLink editLink = checkNotNull(volume.getEditLink(), "VolumeManagementDto must have an edit link");

      return editLink.getHref() + "/action/move";
   }
View Full Code Here

         dto.setName(name);
         dto.setDescription(description);
         dto.setSizeInMB(sizeInMb);
         dto.setState(DEFAULT_STATE.name());

         RESTLink link = tier.unwrap().searchLink("self");
         checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
         dto.addLink(new RESTLink("tier", link.getHref()));

         Volume volume = new Volume(context, dto);
         volume.virtualDatacenter = virtualDatacenter;
         volume.tier = tier;
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.