Examples of MachineDto


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

    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
    *      DatacenterResource- Retrieveremotemachineinformation</a>
    */
   public Machine discoverSingleMachine(final String ip, final HypervisorType hypervisorType, final String user,
         final String password, final int port) {
      MachineDto dto = context
            .getApi()
            .getInfrastructureApi()
            .discoverSingleMachine(target, ip, hypervisorType, user, password,
                  MachineOptions.builder().port(port).build());

      // Credentials are not returned by the API
      dto.setUser(user);
      dto.setPassword(password);

      return wrap(context, Machine.class, dto);
   }
View Full Code Here

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

            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector"));
      return remoteService;
   }

   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

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

      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

            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector"));
      return remoteService;
   }

   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

Examples of org.libreplan.ws.resources.api.MachineDTO

        ResourceDTO resourceDTO) {

        if (resource instanceof Machine && resourceDTO instanceof MachineDTO) {

            Machine machine = (Machine) resource;
            MachineDTO machineDTO = (MachineDTO) resourceDTO;

            machine.updateUnvalidated(
                StringUtils.trim(machineDTO.name),
                StringUtils.trim(machineDTO.description));
View Full Code Here

Examples of org.libreplan.ws.resources.api.MachineDTO

        return new WorkerDTO(worker.getCode(), worker.getFirstName(), worker
                .getSurname(), worker.getNif());
    }

    private static MachineDTO toDTO(Machine machine) {
        return new MachineDTO(machine.getCode(), machine.getName(), machine
                .getDescription());
    }
View Full Code Here

Examples of org.libreplan.ws.resources.api.MachineDTO

    @Test
    @Transactional
    public void testAddResourcesWithBasicContraintViolations() {

        /* Create resource DTOs. */
        MachineDTO m1 = new MachineDTO("name", "desc");
        MachineDTO m2 = new MachineDTO(" ", null, ""); // Missing code and name
                                                      // (description is
                                                      // optional).

        WorkerDTO w1 = new WorkerDTO(getUniqueName(), "w1-surname", "w1-nif");
        WorkerDTO w2 = new WorkerDTO(null, "", null, ""); // Missing code, first
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.