@Override public Tuple<String, Iterable<Image>> listImages(String project, Map<Option, ?> options) { try { ImageList imageList = compute .images() .list(project) .setFilter(Option.FILTER.getString(options)) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) .setFields(Option.FIELDS.getString(options)) .execute(); Iterable<Image> images = imageList.getItems(); return Tuple.of(imageList.getNextPageToken(), images); } catch (IOException ex) { throw translate(ex); } }
@Override public void onSuccess(ImageList imageList, HttpHeaders responseHeaders) throws IOException { // No need to look through these images if the requested image family was already found. if (!foundSourceImageFamilyHolder[0]) { if (imageList.getItems() != null) { foundSourceImageFamilyHolder[0] = imageList .getItems() .stream() .filter(image -> sourceImageFamily.equals(image.getFamily())) .findFirst() .isPresent(); } } } };
@Override public void onSuccess(ImageList imageList, HttpHeaders responseHeaders) throws IOException { // No need to look through these images if the requested image was already found. if (!foundSourceImageHolder[0]) { if (imageList.getItems() != null) { foundSourceImageHolder[0] = imageList .getItems() .stream() .filter(image -> image.getName().equals(sourceImage)) .findFirst() .isPresent(); } } } };
@Override public void onSuccess(ImageList imageList, HttpHeaders responseHeaders) throws IOException { // No need to look through these images if the requested image was already found. if (!foundSourceImageHolder[0]) { if (imageList.getItems() != null) { foundSourceImageHolder[0] = imageList .getItems() .stream() .filter(image -> image.getName().equals(sourceImage)) .findFirst() .isPresent(); } } } };
@Override public Tuple<String, Iterable<Image>> listImages(String project, Map<Option, ?> options) { try { ImageList imageList = compute.images() .list(project) .setFilter(Option.FILTER.getString(options)) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) .setFields(Option.FIELDS.getString(options)) .execute(); Iterable<Image> images = imageList.getItems(); return Tuple.of(imageList.getNextPageToken(), images); } catch (IOException ex) { throw translate(ex); } }
@Override public void onSuccess(ImageList imageList, HttpHeaders responseHeaders) throws IOException { // No need to look through these images if the requested image family was already found. if (!foundSourceImageFamilyHolder[0]) { if (imageList.getItems() != null) { foundSourceImageFamilyHolder[0] = imageList .getItems() .stream() .filter(image -> sourceImageFamily.equals(image.getFamily())) .findFirst() .isPresent(); } } } };