Package org.jclouds.cloudsigma.domain

Examples of org.jclouds.cloudsigma.domain.Server


   @Test(dependsOnMethods = "testSetDriveData")
   public void testCreateAndDestroyStaticIP() throws Exception {
      StaticIPInfo ip = client.createStaticIP();
      StaticIPInfo ip2 = client.createStaticIP();
      Server server = null;
      try {
         ip = client.getStaticIPInfo(ip.getAddress());
         assertNotNull(ip);
         Logger.getAnonymousLogger().info("preparing drive");
         prepareDrive();

         Server serverRequest = Servers.smallWithStaticIP(prefix, drive.getUuid(), vncPassword, ip.getAddress())
               .build();

         Logger.getAnonymousLogger().info("starting server");
         server = client.createServer(serverRequest);
         assertEquals(server.getNics().get(0).getDhcp(), ip.getAddress());
View Full Code Here


   @Test(dependsOnMethods = "testCreateAndDestroyStaticIP")
   public void testCreateAndStartServer() throws Exception {
      Logger.getAnonymousLogger().info("preparing drive");
      prepareDrive();

      Server serverRequest = Servers.small(prefix, drive.getUuid(), vncPassword).build();

      Logger.getAnonymousLogger().info("starting server");
      server = client.createServer(serverRequest);
      client.startServer(server.getUuid());
      server = client.getServerInfo(server.getUuid());
      checkStartedServer();

      Server newInfo = client.getServerInfo(server.getUuid());
      checkServerMatchesGet(newInfo);

   }
View Full Code Here

      if (!success) {
         client.destroyDrive(drive.getUuid());
         throw new IllegalStateException("could not image drive in time!");
      }

      Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
            .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();

      logger.debug(">> creating server");
      ServerInfo from = client.createServer(toCreate);
      logger.debug("<< created server(%s)", from.getUuid());
View Full Code Here

      if (!success) {
         client.destroyDrive(drive.getUuid());
         throw new IllegalStateException("could not image drive in time!");
      }

      Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
            .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();

      logger.debug(">> creating server");
      ServerInfo from = client.createServer(toCreate);
      logger.debug("<< created server(%s)", from.getUuid());
View Full Code Here

      this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
   }
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
      checkArgument(payload instanceof Server, "this binder is only valid for Server!");
      Server create = Server.class.cast(payload);
      Map<String, String> map = createServerRequestToMap.apply(create);
      request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(map)));
      request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
      return request;
   }
View Full Code Here

   @Test(dependsOnMethods = "testSetDriveData")
   public void testCreateAndDestroyStaticIP() throws Exception {
      StaticIPInfo ip = client.createStaticIP();
      StaticIPInfo ip2 = client.createStaticIP();
      Server server = null;
      try {
         ip = client.getStaticIPInfo(ip.getAddress());
         assertNotNull(ip);
         Logger.getAnonymousLogger().info("preparing drive");
         prepareDrive();

         Server serverRequest = Servers.smallWithStaticIP(prefix, drive.getUuid(), vncPassword, ip.getAddress())
               .build();

         Logger.getAnonymousLogger().info("starting server");
         server = client.createServer(serverRequest);
         assertEquals(server.getNics().get(0).getDhcp(), ip.getAddress());
View Full Code Here

   @Test(dependsOnMethods = "testCreateAndDestroyStaticIP")
   public void testCreateAndStartServer() throws Exception {
      Logger.getAnonymousLogger().info("preparing drive");
      prepareDrive();

      Server serverRequest = Servers.small(prefix, drive.getUuid(), vncPassword).build();

      Logger.getAnonymousLogger().info("starting server");
      server = client.createServer(serverRequest);
      client.startServer(server.getUuid());
      server = client.getServerInfo(server.getUuid());
      checkStartedServer();

      Server newInfo = client.getServerInfo(server.getUuid());
      checkServerMatchesGet(newInfo);

   }
View Full Code Here

      if (!success) {
         client.destroyDrive(drive.getUuid());
         throw new IllegalStateException("could not image drive in time!");
      }

      Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
            .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();

      logger.debug(">> creating server");
      ServerInfo from = client.createServer(toCreate);
      logger.debug("<< created server(%s)", from.getUuid());
View Full Code Here

      this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
   }
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
      checkArgument(payload instanceof Server, "this binder is only valid for Server!");
      Server create = Server.class.cast(payload);
      Map<String, String> map = createServerRequestToMap.apply(create);
      request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(map)));
      request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
      return request;
   }
View Full Code Here

   @Test(dependsOnMethods = "testSetDriveData")
   public void testCreateAndDestroyStaticIP() throws Exception {
      StaticIPInfo ip = client.createStaticIP();
      StaticIPInfo ip2 = client.createStaticIP();
      Server server = null;
      try {
         ip = client.getStaticIPInfo(ip.getAddress());
         assertNotNull(ip);
         Logger.getAnonymousLogger().info("preparing drive");
         prepareDrive();

         Server serverRequest = Servers.smallWithStaticIP(prefix, drive.getUuid(), vncPassword, ip.getAddress())
               .build();

         Logger.getAnonymousLogger().info("starting server");
         server = client.createServer(serverRequest);
         assertEquals(server.getNics().get(0).getDhcp(), ip.getAddress());
View Full Code Here

TOP

Related Classes of org.jclouds.cloudsigma.domain.Server

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.