Package org.jclouds.ec2.options

Examples of org.jclouds.ec2.options.DescribeImagesOptions


      }
   }

   public Iterable<Entry<String, DescribeImagesOptions>> getDescribeQueriesForOwnersInRegions(Set<String> regions,
         String[] amiOwners) {
      DescribeImagesOptions options = getOptionsForOwners(amiOwners);
      Builder<String, DescribeImagesOptions> builder = ImmutableMap.builder();
      for (String region : regions)
         builder.put(region, options);
      return builder.build().entrySet();
   }


         builder.put(region, options);
      return builder.build().entrySet();
   }

   public DescribeImagesOptions getOptionsForOwners(String... amiOwners) {
      DescribeImagesOptions options;
      if (amiOwners.length == 1 && amiOwners[0].equals("*"))
         options = new DescribeImagesOptions();
      else
         options = ownedBy(amiOwners);
      return options;
   }

      String[] parts = AWSUtils.parseHandle(imageId);
      String region = parts[0];
      String imageId = parts[1];
      EC2ImageParser parser = view.utils().injector().getInstance(EC2ImageParser.class);
      return transform(
                       client.getAMIApi().get().describeImagesInRegion(region, new DescribeImagesOptions().imageIds(imageId)),
            parser);
   }

      String[] parts = AWSUtils.parseHandle(imageId);
      String region = parts[0];
      String imageId = parts[1];
      EC2ImageParser parser = view.utils().injector().getInstance(EC2ImageParser.class);
      return transform(
            client.getAMIServices().describeImagesInRegion(region, new DescribeImagesOptions().imageIds(imageId)),
            parser);
   }

      }
   }

   public Iterable<Entry<String, DescribeImagesOptions>> getDescribeQueriesForOwnersInRegions(Set<String> regions,
         String[] amiOwners) {
      DescribeImagesOptions options = getOptionsForOwners(amiOwners);
      Builder<String, DescribeImagesOptions> builder = ImmutableMap.builder();
      for (String region : regions)
         builder.put(region, options);
      return builder.build().entrySet();
   }

         builder.put(region, options);
      return builder.build().entrySet();
   }

   public DescribeImagesOptions getOptionsForOwners(String... amiOwners) {
      DescribeImagesOptions options;
      if (amiOwners.length == 1 && amiOwners[0].equals("*"))
         options = new DescribeImagesOptions();
      else
         options = ownedBy(amiOwners);
      return options;
   }

      String[] parts = AWSUtils.parseHandle(imageId);
      String region = parts[0];
      String imageId = parts[1];
      EC2ImageParser parser = view.utils().injector().getInstance(EC2ImageParser.class);
      return transform(
                       client.getAMIApi().get().describeImagesInRegion(region, new DescribeImagesOptions().imageIds(imageId)),
            parser);
   }

      }
   }

   public Iterable<Entry<String, DescribeImagesOptions>> getDescribeQueriesForOwnersInRegions(Set<String> regions,
         String[] amiOwners) {
      DescribeImagesOptions options = getOptionsForOwners(amiOwners);
      Builder<String, DescribeImagesOptions> builder = ImmutableMap.builder();
      for (String region : regions)
         builder.put(region, options);
      return builder.build().entrySet();
   }

         builder.put(region, options);
      return builder.build().entrySet();
   }

   public DescribeImagesOptions getOptionsForOwners(String... amiOwners) {
      DescribeImagesOptions options;
      if (amiOwners.length == 1 && amiOwners[0].equals("*"))
         options = new DescribeImagesOptions();
      else
         options = ownedBy(amiOwners);
      return options;
   }

   public void testRegisterImageBackedByEBSOptions() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(AWSAMIAsyncClient.class, "registerUnixImageBackedByEbsInRegion", String.class,
               String.class, String.class, RegisterImageBackedByEbsOptions[].class);
      GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "imageName", "snapshotId",
               new RegisterImageBackedByEbsOptions().withDescription("description").addBlockDeviceFromSnapshot(
                        "/dev/device", null, "snapshot").addNewBlockDevice("/dev/newdevice", "newblock", 100)));

      request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request);
     
      assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");

TOP

Related Classes of org.jclouds.ec2.options.DescribeImagesOptions

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.