Package org.jclouds.openstack.glance.v1_0.domain

Examples of org.jclouds.openstack.glance.v1_0.domain.Image$ConcreteBuilder


      assertEquals(get(result, 0).getImageState(), ImageState.AVAILABLE);
      assertEquals(get(result, 0).getRawState(), "available");
   }

   public void testEBS() {
      Set<Image> contents = ImmutableSet.of(new Image("us-east-1", Architecture.I386, "websrv_2009-12-10",
               "Web Server AMI", "ami-246f8d4d", "706093390852/websrv_2009-12-10", "706093390852",
               ImageState.AVAILABLE, "available", ImageType.MACHINE, true, Sets.<String> newHashSet(), null, "windows", null,
               RootDeviceType.EBS, "/dev/sda1", ImmutableMap.<String, EbsBlockDevice> of("/dev/sda1",
                        new EbsBlockDevice("snap-d01272b9", 30, true), "xvdf", new EbsBlockDevice("snap-d31272ba", 250,
                                 false)), VirtualizationType.HVM, Hypervisor.XEN));
View Full Code Here


      assertEquals(get(result, 0).getImageState(), ImageState.AVAILABLE);
      assertEquals(get(result, 0).getRawState(), "available");
   }
  
   public void testDiabloWithIncorrectDisplayNameField() {
      Set<Image> contents = ImmutableSet.of(new Image("us-east-1", Architecture.X86_64, "CentOS 6.2 Server 64-bit 20120125", "", "ami-0000054e",
               "local (CentOS 6.2 Server 64-bit 20120125)", "", ImageState.AVAILABLE, "available",
               ImageType.MACHINE, true, Sets.<String> newHashSet(), "aki-0000054c", null, "ari-0000054d",
               RootDeviceType.INSTANCE_STORE, "/dev/sda1", ImmutableMap.<String, EbsBlockDevice> of(),
               VirtualizationType.PARAVIRTUAL, Hypervisor.XEN));
     
View Full Code Here

            withDescription("EBS Ubuntu Hardy"));

      System.out.printf("%d: %s awaiting snapshot to complete%n", System.currentTimeMillis(), snapshot.getId());

      assert snapshotTester.apply(snapshot);
      Image image = Iterables.getOnlyElement(client.getAMIServices().describeImagesInRegion(snapshot.getRegion(),
            imageIds(IMAGE_ID)));
      String description = image.getDescription() == null ? "jclouds" : image.getDescription();

      System.out.printf("%d: %s creating ami from snapshot%n", System.currentTimeMillis(), snapshot.getId());

      String amiId = client.getAMIServices().registerUnixImageBackedByEbsInRegion(
            snapshot.getRegion(),
            "ebsboot-" + image.getId(),
            snapshot.getId(),
            withKernelId(image.getKernelId()).withRamdisk(image.getRamdiskId()).withDescription(description)
                  .asArchitecture(Architecture.I386));
      try {
         ebsImage = Iterables.getOnlyElement(client.getAMIServices().describeImagesInRegion(snapshot.getRegion(),
               imageIds(amiId)));
      } catch (AWSResponseException e) {
View Full Code Here

      // Register a new image...
      ebsBackedImageId = client.registerUnixImageBackedByEbsInRegion(regionId, ebsBackedImageName, snapshot.getId(),
            addNewBlockDevice("/dev/sda2", "myvirtual", 1).withDescription("adrian"));
      imagesToDeregister.add(ebsBackedImageId);
      final Image ebsBackedImage = getOnlyElement(client.describeImagesInRegion(regionId, imageIds(ebsBackedImageId)));
      assertEquals(ebsBackedImage.getName(), ebsBackedImageName);
      assertEquals(ebsBackedImage.getImageType(), ImageType.MACHINE);
      assertEquals(ebsBackedImage.getRootDeviceType(), RootDeviceType.EBS);
      assertEquals(ebsBackedImage.getRootDeviceName(), "/dev/sda1");
      assertEquals(ebsBackedImage.getDescription(), "adrian");
      assertEquals(
            ebsBackedImage.getEbsBlockDevices().entrySet(),
            ImmutableMap.of("/dev/sda1", new Image.EbsBlockDevice(snapshot.getId(), snapshot.getVolumeSize(), true),
                  "/dev/sda2", new Image.EbsBlockDevice(null, 1, false)).entrySet());

      // List of images after - should be one larger than before
      int after = client.describeImagesInRegion(regionId).size();
View Full Code Here

      checkNotNull(id, "id");
      String[] parts = AWSUtils.parseHandle(id);
      String region = parts[0];
      String instanceId = parts[1];
      try {
         Image image = getImageInRegion(region, instanceId);
         return imageToImage.apply(image);
      } catch (NoSuchElementException e) {
         return null;
      }
   }
View Full Code Here

         } else if (!inProductCodes) {
            try {
               String region = getRequest() != null ? AWSUtils.findRegionInArgsOrNull(getRequest()) : null;
               if (region == null)
                  region = defaultRegion.get();
               contents.add(new Image(region, architecture, this.name, description, imageId, imageLocation,
                        imageOwnerId, imageState, rawState, imageType, isPublic, productCodes, kernelId, platform,
                        ramdiskId, rootDeviceType, rootDeviceName, ebsBlockDevices, virtualizationType, hypervisor));
            } catch (NullPointerException e) {
               logger.warn(e, "malformed image: %s", imageId);
            }
View Full Code Here

            withDescription("EBS Ubuntu Hardy"));

      System.out.printf("%d: %s awaiting snapshot to complete%n", System.currentTimeMillis(), snapshot.getId());

      assert snapshotTester.apply(snapshot);
      Image image = Iterables.getOnlyElement(client.getAMIApi().get().describeImagesInRegion(snapshot.getRegion(),
            imageIds(IMAGE_ID)));
      String description = image.getDescription() == null ? "jclouds" : image.getDescription();

      System.out.printf("%d: %s creating ami from snapshot%n", System.currentTimeMillis(), snapshot.getId());

      String amiId = client.getAMIApi().get().registerUnixImageBackedByEbsInRegion(
            snapshot.getRegion(),
            "ebsboot-" + image.getId(),
            snapshot.getId(),
            withKernelId(image.getKernelId()).withRamdisk(image.getRamdiskId()).withDescription(description)
                  .asArchitecture(Architecture.I386));
      try {
         ebsImage = Iterables.getOnlyElement(client.getAMIApi().get().describeImagesInRegion(snapshot.getRegion(),
               imageIds(amiId)));
      } catch (AWSResponseException e) {
View Full Code Here

      checkNotNull(id, "id");
      String[] parts = AWSUtils.parseHandle(id);
      String region = parts[0];
      String instanceId = parts[1];
      try {
         Image image = getImageInRegion(region, instanceId);
         return imageToImage.apply(image);
      } catch (NoSuchElementException e) {
         return null;
      }
   }
View Full Code Here

            withDescription("EBS Ubuntu Hardy"));

      System.out.printf("%d: %s awaiting snapshot to complete%n", System.currentTimeMillis(), snapshot.getId());

      assert snapshotTester.apply(snapshot);
      Image image = Iterables.getOnlyElement(client.getAMIApi().get().describeImagesInRegion(snapshot.getRegion(),
            imageIds(IMAGE_ID)));
      String description = image.getDescription() == null ? "jclouds" : image.getDescription();

      System.out.printf("%d: %s creating ami from snapshot%n", System.currentTimeMillis(), snapshot.getId());

      String amiId = client.getAMIApi().get().registerUnixImageBackedByEbsInRegion(
            snapshot.getRegion(),
            "ebsboot-" + image.getId(),
            snapshot.getId(),
            withKernelId(image.getKernelId()).withRamdisk(image.getRamdiskId()).withDescription(description)
                  .asArchitecture(Architecture.I386));
      try {
         ebsImage = Iterables.getOnlyElement(client.getAMIApi().get().describeImagesInRegion(snapshot.getRegion(),
               imageIds(amiId)));
      } catch (AWSResponseException e) {
View Full Code Here

      // Register a new image...
      ebsBackedImageId = client.registerUnixImageBackedByEbsInRegion(regionId, ebsBackedImageName, snapshot.getId(),
              newBlockDeviceOption());
      imagesToDeregister.add(ebsBackedImageId);
      final Image ebsBackedImage = getOnlyElement(client.describeImagesInRegion(regionId, imageIds(ebsBackedImageId)));
      assertEquals(ebsBackedImage.getName(), ebsBackedImageName);
      assertEquals(ebsBackedImage.getImageType(), ImageType.MACHINE);
      assertEquals(ebsBackedImage.getRootDeviceType(), RootDeviceType.EBS);
      assertEquals(ebsBackedImage.getRootDeviceName(), "/dev/sda1");
      assertEquals(ebsBackedImage.getDescription(), "adrian");
      assertEquals(
            ebsBackedImage.getEbsBlockDevices().entrySet(),
            ImmutableMap.of("/dev/sda1", new Image.EbsBlockDevice(snapshot.getId(), snapshot.getVolumeSize(), true, null, null, false),
                  "/dev/sda2", newBlockDeviceInfo()).entrySet());

      int describeCount = 0;
      int after = 0;
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.glance.v1_0.domain.Image$ConcreteBuilder

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.