Package org.jclouds.cloudsigma.domain

Examples of org.jclouds.cloudsigma.domain.StaticIPInfo


      }
   }

   @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());
         client.stopServer(server.getUuid());
         server = client.setServerConfiguration(server.getUuid(), Servers.changeIP(server, ip2.getAddress()));
         assertEquals(server.getNics().get(0).getDhcp(), ip2.getAddress());
      } finally {
         if (server != null) {
            client.destroyServer(server.getUuid());
            client.destroyDrive(drive.getUuid());
         }
         client.destroyStaticIP(ip.getAddress());
         client.destroyStaticIP(ip2.getAddress());
      }
   }
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());
         client.stopServer(server.getUuid());
         server = client.setServerConfiguration(server.getUuid(), Servers.changeIP(server, ip2.getAddress()));
         assertEquals(server.getNics().get(0).getDhcp(), ip2.getAddress());
      } finally {
         if (server != null) {
            client.destroyServer(server.getUuid());
            client.destroyDrive(drive.getUuid());
         }
         client.destroyStaticIP(ip.getAddress());
         client.destroyStaticIP(ip2.getAddress());
      }
   }
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());
         client.stopServer(server.getUuid());
         server = client.setServerConfiguration(server.getUuid(), Servers.changeIP(server, ip2.getAddress()));
         assertEquals(server.getNics().get(0).getDhcp(), ip2.getAddress());
      } finally {
         if (server != null) {
            client.destroyServer(server.getUuid());
            client.destroyDrive(drive.getUuid());
         }
         client.destroyStaticIP(ip.getAddress());
         client.destroyStaticIP(ip2.getAddress());
      }
   }
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());
         client.stopServer(server.getUuid());
         server = client.setServerConfiguration(server.getUuid(), Servers.changeIP(server, ip2.getAddress()));
         assertEquals(server.getNics().get(0).getDhcp(), ip2.getAddress());
      } finally {
         if (server != null) {
            client.destroyServer(server.getUuid());
            client.destroyDrive(drive.getUuid());
         }
         client.destroyStaticIP(ip.getAddress());
         client.destroyStaticIP(ip2.getAddress());
      }
   }
View Full Code Here

TOP

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

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.