Examples of MachineDto


Examples of com.abiquo.server.core.infrastructure.MachineDto

    *      MachineResource-RetrieveaMachine </a>
    * @return Unmanaged rack with the given id or <code>null</code> if it does
    *         not exist.
    */
   public Machine getMachine(final Integer id) {
      MachineDto machine = context.getApi().getInfrastructureApi().getMachine(target, id);
      return wrap(context, Machine.class, machine);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

      rack.setNrsq(80);
      return rack;
   }

   public static MachineDto machinePost() {
      MachineDto machine = new MachineDto();
      machine.setName("Kamehameha");
      machine.setVirtualCpuCores(3);
      machine.setDescription("A hawaian machine");
      machine.setVirtualRamInMb(512);
      return machine;
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

   }

   @Test(expectedExceptions = NullPointerException.class)
   public void testInvalidId() {
      Function<Object, String> parser = new ParseMachineId();
      parser.apply(new MachineDto());
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

   }

   public void testValidId() {
      Function<Object, String> parser = new ParseMachineId();

      MachineDto machine = new MachineDto();
      machine.setId(5);
      assertEquals(parser.apply(machine), "5");
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

   public void testGetValue() {
      AppendMachineIdToPath binder = new AppendMachineIdToPath(new ParseMachineId());
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();

      MachineDto machine = new MachineDto();
      machine.setId(5);
      assertEquals(binder.getValue(request, machine), "5");
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

   public void testUpdate() {
      env.machine.setName("API Machine");
      env.machine.update();

      // Recover the updated machine
      MachineDto updated = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
      assertEquals(updated.getName(), "API Machine");
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

   public void testCheck() {
      MachineState state = env.machine.check();

      // Recover the machine with same state that has been returned
      MachineDto machine = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
      assertEquals(machine.getState(), state);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

      String pass = Config.get("abiquo.hypervisor.pass");

      MachineState state = env.datacenter.checkMachineState(ip, type, user, pass);

      // Recover the same machine and compare states
      MachineDto machine = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
      assertEquals(machine.getState(), state);
   }
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

         this.rack = rack;
         return this;
      }

      public Machine build() {
         MachineDto dto = new MachineDto();
         dto.setName(name);
         dto.setDescription(description);
         dto.setVirtualRamInMb(virtualRamInMb);
         dto.setVirtualRamUsedInMb(virtualRamUsedInMb);
         dto.setVirtualCpuCores(virtualCpuCores);
         dto.setVirtualCpusUsed(virtualCpusUsed);
         if (port != null) {
            dto.setPort(port);
         }
         dto.setIp(ip);
         dto.setIpService(ipService);
         dto.setType(type);
         dto.setUser(user);
         dto.setPassword(password);
         dto.setIpmiIP(ipmiIp);
         dto.setIpmiPassword(ipmiPassword);
         if (ipmiPort != null) {
            dto.setIpmiPort(ipmiPort);
         }
         dto.setIpmiUser(ipmiUser);
         dto.setState(state);

         DatastoresDto datastoresDto = new DatastoresDto();
         datastoresDto.getCollection().addAll(copyOf(unwrap(datastores)));
         dto.setDatastores(datastoresDto);

         NetworkInterfacesDto networkInterfacesDto = new NetworkInterfacesDto();
         networkInterfacesDto.getCollection().addAll(copyOf(unwrap(networkInterfaces)));
         dto.setNetworkInterfaces(networkInterfacesDto);

         Machine machine = new Machine(context, dto);
         machine.rack = rack;

         return machine;
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.MachineDto

    *      MachineResource-RetrieveaMachine </a>
    * @return Unmanaged rack with the given id or <code>null</code> if it does
    *         not exist.
    */
   public Machine getMachine(final Integer id) {
      MachineDto machine = context.getApi().getInfrastructureApi().getMachine(target, id);
      return wrap(context, Machine.class, machine);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.