Package org.jclouds.cloudsigma.domain

Examples of org.jclouds.cloudsigma.domain.ServerInfo


   @Test(dependsOnMethods = "testLifeCycle")
   public void testSetServerConfiguration() throws Exception {
      client.stopServer(server.getUuid());
      assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.STOPPED);

      ServerInfo server2 = client.setServerConfiguration(
            server.getUuid(),
            Server.Builder.fromServer(server).name("rediculous")
                  .use(ImmutableSet.of("networking", "security", "gateway")).build());

      assertNotNull(server2.getUuid(), server.getUuid());
      assertEquals(server2.getName(), "rediculous");
      checkUse(server2);
      server = server2;
   }
View Full Code Here


      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());
      logger.debug(">> starting server(%s)", from.getUuid());
      client.startServer(from.getUuid());
      return new NodeAndInitialCredentials<ServerInfo>(from, from.getUuid(), LoginCredentials.builder()
            .password(defaultVncPassword).authenticateSudo(true).build());
   }
View Full Code Here

      return client.getDriveInfo(id);
   }
  
   @Override
   public void destroyNode(String id) {
      ServerInfo server = getNode(id);
      if (server != null) {
         client.stopServer(id);
         client.destroyServer(id);
         for (Device dev : server.getDevices().values())
            client.destroyDrive(dev.getDriveUuid());
      }
   }
View Full Code Here

                  CloudSigmaApiMetadata.CONTEXT_TOKEN).getApi());

         // Note: I wanted to use node.getHardware().getVolumes() but there is no
         // way to go from a Volume to a DriveInfo

         ServerInfo serverInfo = api.getServerInfo(node.getId());
         Device rootDevice = get(serverInfo.getDevices().values(), 0);
         DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
         assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));

      } finally {
         client.destroyNodesMatching(inGroup(group));
View Full Code Here

      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());
      logger.debug(">> starting server(%s)", from.getUuid());
      client.startServer(from.getUuid());
      return new NodeAndInitialCredentials<ServerInfo>(from, from.getUuid(), LoginCredentials.builder()
            .password(defaultVncPassword).authenticateSudo(true).build());
   }
View Full Code Here

      return client.getDriveInfo(id);
   }
  
   @Override
   public void destroyNode(String id) {
      ServerInfo server = getNode(id);
      if (server != null) {
         client.stopServer(id);
         client.destroyServer(id);
         for (Device dev : server.getDevices().values())
            client.destroyDrive(dev.getDriveUuid());
      }
   }
View Full Code Here

         CloudSigmaApi api = client.getContext().unwrapApi(CloudSigmaApi.class);

         // Note: I wanted to use node.getHardware().getVolumes() but there is no
         // way to go from a Volume to a DriveInfo

         ServerInfo serverInfo = api.getServerInfo(node.getId());
         Device rootDevice = get(serverInfo.getDevices().values(), 0);
         DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
         assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));

      } finally {
         client.destroyNodesMatching(inGroup(group));
View Full Code Here

   @Test(dependsOnMethods = "testLifeCycle")
   public void testSetServerConfiguration() throws Exception {
      client.stopServer(server.getUuid());
      assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.STOPPED);

      ServerInfo server2 = client.setServerConfiguration(
            server.getUuid(),
            Server.Builder.fromServer(server).name("rediculous")
                  .use(ImmutableSet.of("networking", "security", "gateway")).build());

      assertNotNull(server2.getUuid(), server.getUuid());
      assertEquals(server2.getName(), "rediculous");
      checkUse(server2);
      server = server2;
   }
View Full Code Here

   public void testEmptyMapReturnsNull() {
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null);
   }

   public void testBasics() {
      ServerInfo expects = new ServerInfo.Builder().name("foo").uuid("hello").vnc(new VNC("auto", null, false))
            .cpu(1000).mem(2048).metrics(new ServerMetrics.Builder().build()).build();
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "server", "hello", "vnc:ip", "auto", "cpu",
            "1000", "mem", "2048")), expects);
   }
View Full Code Here

   public void testEmptyMapReturnsNull() {
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null);
   }

   public void testBasics() {
      ServerInfo expects = new ServerInfo.Builder().name("foo").uuid("hello").vnc(new VNC("auto", null, false))
            .cpu(1000).mem(2048).metrics(new ServerMetrics.Builder().build()).build();
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "server", "hello", "vnc:ip", "auto", "cpu",
            "1000", "mem", "2048")), expects);
   }
View Full Code Here

TOP

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

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.