Package com.abiquo.model.rest

Examples of com.abiquo.model.rest.RESTLink


    *      >
    *      http://community.abiquo.com/display/ABI20/RackResource#RackResource-
    *      RetrieveaRack</a>
    */
   public Rack getRack() {
      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.RACK), ValidationErrors.MISSING_REQUIRED_LINK + " "
            + ParentLinkName.RACK);

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

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


      binder.bindToRequest(request, new Object());
   }

   public void testBindUnmanagedNetworkIpRef() throws IOException {
      VLANNetworkDto network = NetworkResources.unmanagedNetworkPut();
      RESTLink ipsLink = network.searchLink("ips");
      BindUnmanagedIpRefToPayload binder = new BindUnmanagedIpRefToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, network);
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ipsLink.getHref()
            + "\" rel=\"unmanagedip\"/></links>"), LinksDto.class);
   }
View Full Code Here

   }

   public static DatacenterDto datacenterPut() {
      DatacenterDto datacenter = datacenterPost();
      datacenter.setId(1);
      datacenter.addLink(new RESTLink("checkmachinestate",
            "http://localhost/api/admin/datacenters/1/action/checkmachinestate"));
      datacenter.addLink(new RESTLink("checkmachineipmistate",
            "http://localhost/api/admin/datacenters/1/action/checkmachineipmistate"));
      datacenter.addLink(new RESTLink("checkremoteservice",
            "http://localhost/api/admin/datacenters/1/action/checkremoteservice"));
      datacenter.addLink(new RESTLink("devices", "http://localhost/api/admin/datacenters/1/storage/devices"));
      datacenter.addLink(new RESTLink("discovermultiple",
            "http://localhost/api/admin/datacenters/1/action/discovermultiple"));
      datacenter.addLink(new RESTLink("discoversingle",
            "http://localhost/api/admin/datacenters/1/action/discoversingle"));
      datacenter.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1"));
      datacenter.addLink(new RESTLink("getLimits", "http://localhost/api/admin/datacenters/1/action/getLimits"));
      datacenter.addLink(new RESTLink("racks", "http://localhost/api/admin/datacenters/1/racks"));
      datacenter.addLink(new RESTLink("remoteservices", "http://localhost/api/admin/datacenters/1/remoteservices"));
      datacenter.addLink(new RESTLink("tiers", "http://localhost/api/admin/datacenters/1/storage/tiers"));
      datacenter.addLink(new RESTLink("network", "http://localhost/api/admin/datacenters/1/network"));
      datacenter.addLink(new RESTLink("enterprises", "http://localhost/api/admin/datacenters/1/action/enterprises"));
      datacenter.addLink(new RESTLink("hypervisor", "http://localhost/api/admin/datacenters/1/action/hypervisor"));
      datacenter.addLink(new RESTLink("hypervisors", "http://localhost/api/admin/datacenters/1/hypervisors"));
      return datacenter;
   }
View Full Code Here

   }

   public static RackDto rackPut() {
      RackDto rack = rackPost();
      rack.setId(1);
      rack.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      rack.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/racks/1"));
      rack.addLink(new RESTLink("machines", "http://localhost/api/admin/datacenters/1/racks/1/machines"));
      return rack;
   }
View Full Code Here

   public static TierDto tierPut() {
      TierDto tier = new TierDto();
      tier.setId(1);
      tier.setEnabled(true);
      tier.setName("Tier");
      tier.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/storage/tiers/1"));
      tier.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      tier.addLink(new RESTLink("pools", "http://localhost/api/admin/datacenters/1/storage/tiers/1/pools"));

      return tier;
   }
View Full Code Here

   }

   public static StorageDeviceDto storageDevicePut() {
      StorageDeviceDto storageDevice = storageDevicePost();
      storageDevice.setId(1);
      storageDevice.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      storageDevice.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/storage/devices/1"));
      storageDevice.addLink(new RESTLink("pools", "http://localhost/api/admin/datacenters/1/storage/devices/1/pools"));

      return storageDevice;
   }
View Full Code Here

      target = context.getApi().getVirtualMachineTemplateApi().updateVirtualMachineTemplate(target);
   }

   public VirtualMachineTemplateTask makePersistent(final VirtualDatacenter vdc, final Volume volume,
         final String persistentTemplateName) {
      RESTLink storageLink = volume.unwrap().getEditLink();
      storageLink.setRel("volume");
      return makePersistent(vdc, storageLink, persistentTemplateName, null);
   }
View Full Code Here

   }

   public static StoragePoolDto storagePoolPut() {
      StoragePoolDto storagePool = storagePoolPost();
      storagePool.setIdStorage("tururututu");
      storagePool.addLink(new RESTLink("device", "http://localhost/api/admin/datacenters/1/storage/devices/1"));
      storagePool.addLink(new RESTLink("edit",
            "http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu"));

      return storagePool;
   }
View Full Code Here

   }

   public static RemoteServiceDto remoteServicePut() {
      RemoteServiceDto remoteService = remoteServicePost();
      remoteService.setId(1);
      remoteService.addLink(new RESTLink("check",
            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector/action/check"));
      remoteService.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
      remoteService.addLink(new RESTLink("edit",
            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector"));
      return remoteService;
   }
View Full Code Here

   }

   public static MachineDto machinePut() {
      MachineDto machine = machinePost();
      machine.setId(1);
      machine.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/racks/1/machines/1"));
      machine.addLink(new RESTLink("rack", "http://localhost/api/admin/datacenters/1/racks/1"));
      machine.addLink(new RESTLink("checkstate",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkstate"));
      machine.addLink(new RESTLink("checkipmistate",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkipmistate"));
      machine.addLink(new RESTLink("led", "http://localhost/api/admin/datacenters/1/racks/1/machines/1/led"));
      machine.addLink(new RESTLink("ledoff",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/ledoff"));
      machine
            .addLink(new RESTLink("ledon", "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/ledon"));
      machine.addLink(new RESTLink("logicserver",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/logicserver"));
      machine.addLink(new RESTLink("poweroff",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/poweroff"));
      machine.addLink(new RESTLink("poweron",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/poweron"));
      machine.addLink(new RESTLink("virtualmachines",
            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/virtualmachines"));
      machine.setVirtualCpuCores(5);

      return machine;
   }
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.