Examples of ImageApi


Examples of org.jclouds.googlecomputeengine.features.ImageApi

              .addHeader("Authorization", "Bearer " + TOKEN).build();

      HttpResponse operationResponse = HttpResponse.builder().statusCode(200)
              .payload(payloadFromResource("/image_list_single_page.json")).build();

      ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
              TOKEN_RESPONSE, list, operationResponse).getImageApiForProject("myproject");

      PagedIterable<Image> images = imageApi.list();

      // expect one page
      assertSame(images.size(), 1);
      // with three images
      assertSame(images.concat().size(), 3);
View Full Code Here

Examples of org.jclouds.googlecomputeengine.features.ImageApi

      HttpResponse list3Response = HttpResponse.builder().statusCode(200)
              .payload(payloadFromResource("/image_list_single_page.json")).build();


      ImageApi imageApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
              TOKEN_RESPONSE, list1, list1response, list2, list2Response, list3, list3Response)
              .getImageApiForProject("myproject");

      PagedIterable<Image> images = imageApi.list(new ListOptions.Builder().maxResults(3));

      int imageCounter = 0;
      for (IterableWithMarker<Image> page : images) {
         for (Image image : page) {
            imageCounter++;
View Full Code Here

Examples of org.jclouds.googlecomputeengine.features.ImageApi

      HttpResponse list3Response = HttpResponse.builder().statusCode(200)
              .payload(payloadFromResource("/image_list_single_page.json")).build();


      ImageApi imageApi = orderedRequestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
              TOKEN_RESPONSE, list1, list1response, list2, list2Response, list3, list3Response)
              .getImageApiForProject("myproject");

      PagedIterable<Image> images = imageApi.list(new ListOptions.Builder().maxResults(3));

      int imageCounter = 0;
      for (IterableWithMarker<Image> page : images) {
         for (Image image : page) {
            imageCounter++;
View Full Code Here

Examples of org.jclouds.googlecomputeengine.features.ImageApi

              .addHeader("Authorization", "Bearer " + TOKEN).build();

      HttpResponse operationResponse = HttpResponse.builder().statusCode(200)
              .payload(payloadFromResource("/image_list_single_page.json")).build();

      ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE),
              TOKEN_RESPONSE, list, operationResponse).getImageApiForProject("myproject");

      PagedIterable<Image> images = imageApi.list();

      // expect one page
      assertSame(images.size(), 1);
      // with three images
      assertSame(images.concat().size(), 3);
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<ImageDetails>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<ImageDetails>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<ImageDetails> apply(Object input) {
               return IterableWithMarker.class.cast(imageApi.listInDetail(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "listInDetail()";
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Image>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<Image>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Image> apply(Object input) {
               return IterableWithMarker.class.cast(imageApi.list(marker(input.toString())));
            }

            @Override
            public String toString() {
               return "list()";
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<ImageDetails>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<ImageDetails>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<ImageDetails> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               Collection<String> markers = paginationOptions.buildQueryParameters().get("marker");

               if (!markers.isEmpty()) {
                  return IterableWithMarker.class.cast(imageApi.listInDetail(marker(getOnlyElement(markers))));
               }
               else {
                  return IterableWithMarkers.EMPTY;
               }                
            }
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Image>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<Image>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Image> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               Collection<String> markers = paginationOptions.buildQueryParameters().get("marker");

               if (!markers.isEmpty()) {
                  return IterableWithMarker.class.cast(imageApi.listInDetail(marker(getOnlyElement(markers))));
               }
               else {
                  return IterableWithMarkers.EMPTY;
               }
            }
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<ImageDetails>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<ImageDetails>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<ImageDetails> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               Collection<String> markers = paginationOptions.buildQueryParameters().get("marker");

               if (!markers.isEmpty()) {
                  return IterableWithMarker.class.cast(imageApi.listInDetail(marker(getOnlyElement(markers))));
               }
               else {
                  return IterableWithMarkers.EMPTY;
               }                
            }
View Full Code Here

Examples of org.jclouds.openstack.glance.v1_0.features.ImageApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Image>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.isPresent() ? arg0.get().toString() : null;
         final ImageApi imageApi = api.getImageApiForZone(zone);
         return new Function<Object, IterableWithMarker<Image>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Image> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               Collection<String> markers = paginationOptions.buildQueryParameters().get("marker");

               if (!markers.isEmpty()) {
                  return IterableWithMarker.class.cast(imageApi.listInDetail(marker(getOnlyElement(markers))));
               }
               else {
                  return IterableWithMarkers.EMPTY;
               }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.