Examples of DriveInfo


Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testGetDrive() throws Exception {
      for (String driveUUID : client.listStandardDrives()) {
         assert !"".equals(driveUUID);
         DriveInfo drive = client.getDriveInfo(driveUUID);
         assertNotNull(drive);
         assert !drive.getType().equals(DriveType.UNRECOGNIZED) : drive;
         if (drive.getType() == DriveType.DISK && drive.getDriveType().contains("preinstalled"))
            System.out.println(drive.getName());
      }
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testCreateDrive() throws Exception {
      drive = client.createDrive(new CreateDriveRequest.Builder().name(prefix).size(driveSize).build());
      checkCreatedDrive();

      DriveInfo newInfo = client.getDriveInfo(drive.getUuid());
      checkDriveMatchesGet(newInfo);

   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   }

   @Test(dependsOnMethods = "testCreateDrive")
   public void testSetDriveData() throws Exception {

      DriveInfo drive2 = client.setDriveData(
            drive.getUuid(),
            new DriveData.Builder().claimType(ClaimType.SHARED).name("rediculous")
                  .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))
                  .use(ImmutableSet.of("networking", "security", "gateway")).build());

      assertNotNull(drive2.getUuid(), drive.getUuid());
      assertEquals(drive2.getName(), "rediculous");
      assertEquals(drive2.getClaimType(), ClaimType.SHARED);
      assertEquals(drive2.getReaders(), ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"));
      assertEquals(drive2.getUse(), ImmutableSet.of("networking", "security", "gateway"));
      drive = drive2;
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

      drive = client.cloneDrive(imageId, drive.getName(),
            new CloneDriveOptions().size(driveSize).tags("cat:mouse", "monkey:banana"));
      // Block until the async clone operation has completed.
      assert driveNotClaimed.apply(drive) : client.getDriveInfo(drive.getUuid());

      DriveInfo clonedDrive = client.getDriveInfo(drive.getUuid());
      System.err.println("after prepare" + clonedDrive);
      assertEquals(clonedDrive.getTags(), ImmutableSet.of("cat:mouse", "monkey:banana"));
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

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

   public void testBasics() {
      DriveInfo expects = new DriveInfo.Builder().name("foo").size(100l).metrics(new DriveMetrics.Builder().build())
            .build();
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "size", "100")), expects);
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

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

   public void testBasics() {
      DriveInfo expects = new DriveInfo.Builder().name("foo").size(100l).metrics(new DriveMetrics.Builder().build())
            .build();
      assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "size", "100")), expects);
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         CloudSigmaTemplateOptions options = CloudSigmaTemplateOptions.class.cast(template.getOptions());
         affinityType = options.getDiskDriveAffinity();
      }
      logger.debug(">> imaging boot drive source(%s) bytes(%d) affinityType(%s)",
         template.getImage().getId(), bootSize, affinityType);
      DriveInfo drive = client.cloneDrive(template.getImage().getId(), template.getImage().getId(),
         new CloneDriveOptions().size(bootSize).affinity(affinityType));
      boolean success = driveNotClaimed.apply(drive);
      logger.debug("<< image(%s) complete(%s)", drive.getUuid(), success);
      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

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testGetDrive() throws Exception {
      for (String driveUUID : client.listStandardDrives()) {
         assert !"".equals(driveUUID);
         DriveInfo drive = client.getDriveInfo(driveUUID);
         assertNotNull(drive);
         assert !drive.getType().equals(DriveType.UNRECOGNIZED) : drive;
         if (drive.getType() == DriveType.DISK && drive.getDriveType().contains("preinstalled"))
            System.out.println(drive.getName());
      }
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testCreateDrive() throws Exception {
      drive = client.createDrive(new CreateDriveRequest.Builder().name(prefix).size(driveSize).build());
      checkCreatedDrive();

      DriveInfo newInfo = client.getDriveInfo(drive.getUuid());
      checkDriveMatchesGet(newInfo);

   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   }

   @Test(dependsOnMethods = "testCreateDrive")
   public void testSetDriveData() throws Exception {

      DriveInfo drive2 = client.setDriveData(
            drive.getUuid(),
            new DriveData.Builder().claimType(ClaimType.SHARED).name("rediculous")
                  .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))
                  .use(ImmutableSet.of("networking", "security", "gateway")).build());

      assertNotNull(drive2.getUuid(), drive.getUuid());
      assertEquals(drive2.getName(), "rediculous");
      assertEquals(drive2.getClaimType(), ClaimType.SHARED);
      assertEquals(drive2.getReaders(), ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"));
      assertEquals(drive2.getUse(), ImmutableSet.of("networking", "security", "gateway"));
      drive = drive2;
   }
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.