Package org.jclouds.ec2.compute.strategy

Examples of org.jclouds.ec2.compute.strategy.ReviseParsedImage$NoopReviseParsedImage


    }

    @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;

        rpi.reviseParsedImage(from, builder, family, osBuilder);
        OperatingSystem os = osBuilder.build();
        assertEquals(os.getFamily(), OsFamily.WINDOWS);
        assertEquals(os.getVersion(), "2008");
        assertEquals(builder.build().getVersion(), "2012.01.12");
    }
View Full Code Here


      }

      /* But if attachment size is > 0, then the attachment could be in any state.
         * So we need to check if the status is DETACHED (return true) or not (return false).
         */
      Attachment lastAttachment = getLast(volume.getAttachments());
      logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
              Attachment.Status.DETACHED, lastAttachment.getStatus());
      return lastAttachment.getStatus() == Attachment.Status.DETACHED;
   }
View Full Code Here

      Volume volume = Iterables.getOnlyElement(client.describeVolumesInRegion(attachment
               .getRegion(), attachment.getVolumeId()));
      if (volume.getAttachments().size() == 0) {
         return false;
      }
      Attachment lastAttachment = Sets.newTreeSet(volume.getAttachments()).last();
      logger.trace("%s: looking for status %s: currently: %s", lastAttachment,
               Attachment.Status.ATTACHED, lastAttachment.getStatus());
      return lastAttachment.getStatus() == Attachment.Status.ATTACHED;
   }
View Full Code Here

            IOException {
      Invokable<?, ?> method = method(InstanceAsyncClient.class, "setBlockDeviceMappingForInstanceInRegion", String.class,
               String.class, Map.class);

      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("/dev/sda1", new BlockDevice("vol-test1", true));
      GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "1", mapping));

      request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request);

      assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
View Full Code Here

         IOException {
      Invokable<?, ?> method = method(AWSInstanceAsyncClient.class, "setBlockDeviceMappingForInstanceInRegion", String.class,
            String.class, Map.class);

      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("/dev/sda1", new BlockDevice("vol-test1", true));
      GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "1", mapping));

      request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request);

      assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
View Full Code Here

      return this;
   }

   public EC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName, String snapshotId,
         @Nullable Integer sizeInGib, boolean deleteOnTermination) {
      blockDeviceMappings.add(new MapEBSSnapshotToDevice(deviceName, snapshotId, sizeInGib, deleteOnTermination));
      return this;
   }
View Full Code Here

      blockDeviceMappings.add(new MapNewVolumeToDevice(deviceName, sizeInGib, deleteOnTermination));
      return this;
   }

   public EC2TemplateOptions mapEphemeralDeviceToDeviceName(String deviceName, String virtualName) {
      blockDeviceMappings.add(new MapEphemeralDeviceToDevice(deviceName, virtualName));
      return this;
   }
View Full Code Here

      blockDeviceMappings.add(new MapEBSSnapshotToDevice(deviceName, snapshotId, sizeInGib, deleteOnTermination));
      return this;
   }

   public EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination) {
      blockDeviceMappings.add(new MapNewVolumeToDevice(deviceName, sizeInGib, deleteOnTermination));
      return this;
   }
View Full Code Here

      blockDeviceMappings.add(new MapEphemeralDeviceToDevice(deviceName, virtualName));
      return this;
   }

   public EC2TemplateOptions unmapDeviceNamed(String deviceName) {
      blockDeviceMappings.add(new UnmapDeviceNamed(deviceName));
      return this;
   }
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

TOP

Related Classes of org.jclouds.ec2.compute.strategy.ReviseParsedImage$NoopReviseParsedImage

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.