The result of describing Amazon Machine Images (AMIs).
189190191192193194195196197198199200201202
final DescribeImagesRequest request = new DescribeImagesRequest(); request.setImageIds(imageIds); while (true) { final DescribeImagesResult result = amazonClient .describeImages(request); final List<Image> imageList = result.getImages(); final Image image; if (isTimeoutPending(timeStart)) { image = newImageWithStatus(State.UNKNOWN.value, "timeout",
525354555657585960616263646566
if (null == imageId) { return Optional.absent(); } DescribeImagesResult result = ec2Client.describeImages(new DescribeImagesRequest(). withImageIds(imageId)); if (result.getImages().isEmpty()) { return Optional.absent(); } return Optional.fromNullable(result.getImages().get(0)); }
515253545556575859606162636465
} @Override public Optional<Image> get() { DescribeImagesResult result = ec2Client.describeImages(getRequest()); Map<String, Image> imageMap = new HashMap<String, Image>(); for (Image image : result.getImages()) { imageMap.put(image.getImageLocation(), image); } if (imageMap.isEmpty())
166167168169170171172173174175176177178179180181
{ while (true) { log.info("Sleeping for " + sleep.get() + " ms"); Thread.sleep(sleep.get()); DescribeImagesResult describeImagesResult = ec2Client.describeImages(describeImagesRequest); if (describeImagesResult.getImages().isEmpty()) { return Optional.absent(); } Image image = describeImagesResult.getImages().get(0); String state = image.getState(); log.info("Image state = " + state); if ("pending".equals(state)) { continue;
535455565758596061626364656667
} @Override public Optional<Image> get() { DescribeImagesResult result = ec2Client.describeImages(getRequest()); Map<String, Image> imageMap = new HashMap<String, Image>(); for (Image image : result.getImages()) { String imageLocation = StringUtils.substringAfterLast(image.getImageLocation(), "/"); if (StringUtils.isBlank(imageLocation)) { imageLocation = image.getImageLocation();
167168169170171172173174175176177178179180181182
324325326327328329330331332333334335336337
try { final DescribeImagesRequest request = new DescribeImagesRequest(); request.setImageIds(wrapList(imageId)); final DescribeImagesResult result = amazonClient .describeImages(request); final List<Image> imageList = result.getImages(); switch (imageList.size()) { case 0: logger.info("image find : missing imageId=" + imageId); break;
438439440441442443444445446447448449450451
} final DescribeImagesRequest request = new DescribeImagesRequest(); request.setFilters(filterList); final DescribeImagesResult result = amazonClient .describeImages(request); final List<Image> resultImages = result.getImages(); final List<Image> imageList = new ArrayList<Image>(); final Pattern pattern = Pattern.compile(imageRegex);
560561562563564565566567568569570571572573
final DescribeImagesRequest request = new DescribeImagesRequest(); request.setImageIds(imageIdList); while (true) { final DescribeImagesResult result = amazonClient .describeImages(request); final List<Image> imageList = result.getImages(); final Image image; if (isTimeoutPending(timeStart)) { image = newImageWithStatus(ImageState.UNKNOWN.value, "timeout",
589590591592593594595596597598599
AmazonEC2 ec2Client = ec2Client(); DescribeImagesRequest request = new DescribeImagesRequest(); if (imageIds != null) { request.setImageIds(Arrays.asList(imageIds)); } DescribeImagesResult result = ec2Client.describeImages(request); List<Image> images = result.getImages(); LOGGER.info(String.format("Got %d AMIs in region %s.", images.size(), region)); return images; }