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

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


    @Test
    public void testOldWindowsName() throws Exception {

        ReviseParsedImage rpi = new AWSEC2ReviseParsedImage(osVersionMap);

        Image from = newImage("amazon", "Windows-2008R2-SP1-English-Base-2012.01.12");
        OperatingSystem.Builder osBuilder = OperatingSystem.builder().description("test");
        ImageBuilder builder = new ImageBuilder().id("1").operatingSystem(osBuilder.build()).status(
                 org.jclouds.compute.domain.Image.Status.AVAILABLE).description("test");
        OsFamily family = OsFamily.WINDOWS;
View Full Code Here


        String rootDeviceName = "";
        Map<String, Image.EbsBlockDevice> ebsBlockDevices = ImmutableMap.of();
        Map<String, String> tags = ImmutableMap.of();
        VirtualizationType virtualizationType = VirtualizationType.HVM;
        Hypervisor hypervisor = Hypervisor.XEN;
      Image from = new Image(region, architecture, imageName, description, imageId, imageOwnerId + "/" + imageName,
            imageOwnerId, imageState, "available", imageType, isPublic, productCodes, kernelId, platform, ramdiskId,
            rootDeviceType, rootDeviceName, ebsBlockDevices, tags, virtualizationType, hypervisor);
        return from;
    }
View Full Code Here

      HttpResponse filterResponse = HttpResponse.builder().statusCode(200)
              .payload(payloadFromResourceWithContentType("/describe_images.xml", "text/xml")).build();

      EC2Api apiWhenExist = requestsSendResponses(describeRegionsRequest, describeRegionsResponse, filter, filterResponse);

      Image image = getOnlyElement(apiWhenExist.getAMIApi().get().describeImagesInRegionWithFilter("us-east-1",
              ImmutableMultimap.<String, String>builder()
                      .put("owner-id", "206029621532")
                      .build()));

      assertEquals(image.getId(), "ami-be3adfd7");
   }
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.describeImagesInRegionWithFilter(regionId,
View Full Code Here

         } else if (!inTagSet && !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, tags, virtualizationType, hypervisor));
            } catch (NullPointerException e) {
               logger.warn(e, "malformed image: %s", imageId);
            }
View Full Code Here

    @Test
    public void testNewWindowsName() throws Exception {

        ReviseParsedImage rpi = new AWSEC2ReviseParsedImage(osVersionMap);

        Image from = newImage("amazon", "Windows_Server-2008-R2_SP1-English-64Bit-Base-2012.03.13");
        OperatingSystem.Builder osBuilder = OperatingSystem.builder().description("test");
      ImageBuilder builder = new ImageBuilder().id("1").operatingSystem(osBuilder.build()).status(
               org.jclouds.compute.domain.Image.Status.AVAILABLE).description("test");
        OsFamily family = OsFamily.WINDOWS;
View Full Code Here

    @Test
    public void testOldWindowsName() throws Exception {

        ReviseParsedImage rpi = new AWSEC2ReviseParsedImage(osVersionMap);

        Image from = newImage("amazon", "Windows-2008R2-SP1-English-Base-2012.01.12");
        OperatingSystem.Builder osBuilder = OperatingSystem.builder().description("test");
        ImageBuilder builder = new ImageBuilder().id("1").operatingSystem(osBuilder.build()).status(
                 org.jclouds.compute.domain.Image.Status.AVAILABLE).description("test");
        OsFamily family = OsFamily.WINDOWS;
View Full Code Here

        RootDeviceType rootDeviceType = RootDeviceType.EBS;
        String rootDeviceName = "";
        Map<String, Image.EbsBlockDevice> ebsBlockDevices = ImmutableMap.of();
        VirtualizationType virtualizationType = VirtualizationType.HVM;
        Hypervisor hypervisor = Hypervisor.XEN;
        Image from = new Image(region, architecture, imageName, description, imageId, imageOwnerId + "/" + imageName, imageOwnerId, imageState, "available", imageType, isPublic, productCodes, kernelId, platform, ramdiskId, rootDeviceType, rootDeviceName, ebsBlockDevices, virtualizationType, hypervisor);
        return from;
    }
View Full Code Here

*/
@Test(groups = "unit", testName = "DescribeImagesResponseHandlerTest")
public class DescribeImagesResponseHandlerTest {

   public void testUNIX() {
      Set<Image> contents = ImmutableSet.of(new Image("us-east-1", Architecture.I386, null, null, "ami-be3adfd7",
               "ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml", "206029621532", ImageState.AVAILABLE, "available",
               ImageType.MACHINE, false, Sets.<String> newHashSet("9961934F"), "aki-4438dd2d", null, "ari-4538dd2c",
               RootDeviceType.INSTANCE_STORE, null, ImmutableMap.<String, EbsBlockDevice> of(),
               VirtualizationType.PARAVIRTUAL, Hypervisor.XEN));

View Full Code Here

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

   public void testWindows() {
      Set<Image> contents = ImmutableSet.of(new Image("us-east-1", Architecture.X86_64, null, null, "ami-02eb086b",
               "aws-solutions-amis/SqlSvrStd2003r2-x86_64-Win_SFWBasic5.1-v1.0.manifest.xml", "771350841976",
               ImageState.AVAILABLE, "available", ImageType.MACHINE, true, Sets.<String> newHashSet("5771E9A6"), null, "windows",
               null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap.<String, EbsBlockDevice> of(),
               VirtualizationType.PARAVIRTUAL, Hypervisor.XEN));
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.