예제 #1
0
 @Test
 public void testImages() {
   Set<? extends Image> images = connection.getImageList();
   for (Image image : images) {
     if (image.getId().equalsIgnoreCase("lenny")) {
       assertTrue(true);
       return;
     }
   }
   assertTrue(false, "lenny not found");
 }
 @Override
 public Set<? extends Image> get() {
   final Set<Image> images = Sets.newHashSet();
   logger.debug(">> providing images");
   for (org.jclouds.rimuhosting.miro.domain.Image from : sync.getImageList()) {
     ImageBuilder builder = new ImageBuilder();
     builder.ids(from.getId() + "");
     builder.name(from.getDescription());
     builder.description(from.getDescription());
     builder.operatingSystem(parseOs(from));
     builder.status(Status.AVAILABLE);
     images.add(builder.build());
   }
   logger.debug("<< images(%d)", images.size());
   return images;
 }
예제 #3
0
 public CreateOptions(String name, String password, Image image) {
   this.name = name;
   this.password = password;
   if (image != null) {
     this.imageId = image.getId();
   }
 }
  protected OperatingSystem parseOs(final org.jclouds.rimuhosting.miro.domain.Image from) {
    OsFamily osFamily = null;
    String osName = from.getId();
    String osArch = null;
    String osVersion = null;
    String osDescription = from.getDescription();
    boolean is64Bit = from.getId().indexOf("64") != -1;

    Matcher matcher = RIMU_PATTERN.matcher(osDescription);
    if (matcher.find()) {
      try {
        osFamily = OsFamily.fromValue(matcher.group(1).toLowerCase());
        osVersion = matcher.group(2).toLowerCase();
      } catch (IllegalArgumentException e) {
        logger.debug("<< didn't match os(%s)", osDescription);
      }
    }
    return new OperatingSystem(osFamily, osName, osVersion, osArch, osDescription, is64Bit);
  }