Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.Image


   }

   @Override
   protected Template buildTemplate(TemplateBuilder templateBuilder) {
      Template template = super.buildTemplate(templateBuilder);
      Image image = template.getImage();
      assert image.getDefaultCredentials().identity != null : image;
      assert image.getDefaultCredentials().credential != null : image;
      return template;
   }
View Full Code Here


      logger.info("Creating image from node %s, started with template: %s", node, template);

      ImageTemplate newImageTemplate = imageExtension.get().buildImageTemplateFromNode("test-create-image",
               node.getId());

      Image image = imageExtension.get().createImage(newImageTemplate).get();

      logger.info("Image created: %s", image);

      assertEquals("test-create-image", image.getName());

      imageId = image.getId();

      computeService.destroyNode(node.getId());

      Optional<? extends Image> optImage = getImage();
View Full Code Here

      Optional<? extends Image> optImage = getImage();

      assertTrue(optImage.isPresent());

      Image image = optImage.get();

      assertTrue(imageExtension.get().deleteImage(image.getId()));
   }
View Full Code Here

   }

   @Override
   protected Template buildTemplate(TemplateBuilder templateBuilder) {
      Template template = super.buildTemplate(templateBuilder);
      Image image = template.getImage();
      assert image.getDefaultCredentials() != null && image.getDefaultCredentials().identity != null : image;
      assert image.getDefaultCredentials() != null && image.getDefaultCredentials().credential != null : image;
      return template;
   }
View Full Code Here

      if (from.getDatacenter() != null)
         builder.location(from(locations.get()).firstMatch(
               LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull());
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname()));

      Image image = images.getImage(from);
      if (image != null) {
         builder.imageId(image.getId());
         builder.operatingSystem(image.getOperatingSystem());
      }

      builder.hardware(hardware.getHardware(from));

      builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName()));
View Full Code Here

      {
         ProductItem item = ProductItem.builder()
                                       .description(description)
                                       .prices(ProductItemPrice.builder().id(1234).build())
                                       .build();
         Image i = new ProductItemToImage().apply(item);
         OperatingSystem os = i.getOperatingSystem();
         assertNotNull(os);
         assertNotNull(os.getFamily());
         assertFalse(os.getFamily().equals(OsFamily.UNRECOGNIZED));
         assertNotNull(os.getVersion());
      }
View Full Code Here

   public void testUbuntu() {
         ProductItem item = ProductItem.builder()
                                       .description("Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install (64 bit)")
                                       .prices(ProductItemPrice.builder().id(1234).build())
                                       .build();
         Image i = new ProductItemToImage().apply(item);
         OperatingSystem os = i.getOperatingSystem();
         assertNotNull(os);
         assertEquals(OsFamily.UBUNTU, os.getFamily());
         assertEquals("10.04",os.getVersion());
         assertTrue(os.is64Bit());
   }
View Full Code Here

   public void testUbuntuNoBitCount() {
      ProductItem item = ProductItem.builder()
            .description("Ubuntu Linux 10.04 LTS Lucid Lynx - Minimal Install")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
      assertNotNull(os);
      assertEquals(OsFamily.UBUNTU, os.getFamily());
      assertEquals("10.04",os.getVersion());
      assertFalse(os.is64Bit());
   }
View Full Code Here

   public void testCompletelyUnknown() {
      ProductItem item = ProductItem.builder()
            .description("This fails to match anything!!!")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
      assertNotNull(os);
      assertEquals(OsFamily.UNRECOGNIZED, os.getFamily());
      assertNull(os.getVersion());
      assertFalse(os.is64Bit());
   }
View Full Code Here

   public void test64BitUnknown() {
      ProductItem item = ProductItem.builder()
            .description("This only has the bit-count (64 bit)")
            .prices(ProductItemPrice.builder().id(1234).build())
            .build();
      Image i = new ProductItemToImage().apply(item);
      OperatingSystem os = i.getOperatingSystem();
      assertNotNull(os);
      assertEquals(OsFamily.UNRECOGNIZED, os.getFamily());
      assertNull(os.getVersion());
      assertTrue(os.is64Bit());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.Image

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.