Describe all available AMIs within aws-mock.

@return a list of AMIs
519940
public static List<Image> describeAllImages() {
        // pass any credentials as aws-mock does not authenticate them at all
        AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
        AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);

        // the mock endpoint for ec2 which runs on your computer
        String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/";
        amazonEC2Client.setEndpoint(ec2Endpoint);

        // describe all AMIs in aws-mock.
        DescribeImagesResult result = amazonEC2Client.describeImages();

        return result.getImages();
    }
493661
def list_amis(distro)
      amis = Hash.new
      Ubuntu.release(distro).amis.each do |ami|
        amis[build_type(ami.region, ami.arch, ami.root_store, ami.virtualization_type)] = ami.name
      end
      amis
    end
385741
public java.util.List<String> getElasticGpuIds() {
        if (elasticGpuIds == null) {
            elasticGpuIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return elasticGpuIds;
    }
789633
public List<String> buckets() {
        List<String> ret = new ArrayList<>();
        AmazonS3 s3 = getClient();
        List<Bucket> buckets = s3.listBuckets();
        for (Bucket b : buckets)
            ret.add(b.getName());
        return ret;
    }

    /**
     * Iterate over individual buckets.
     * Returns input streams to each object.
     * It is your responsibility to close the input streams
     * @param bucket the bucket to iterate over
     * @return an iterator over the objects in an s3 bucket
     */
    public Iterator<InputStream> iterateBucket(String bucket) {
        return new BucketIterator(bucket, this);
    }

    /**
     * Iterator style one list at a time
     * @param list the list to get the next batch for
     * @return the next batch of objects or null if
     * none are left
     */
    public ObjectListing nextList(ObjectListing list) {
        AmazonS3 s3 = getClient();
        if (list.isTruncated())
            return s3.listNextBatchOfObjects(list);
        return null;
    }

    /**
     * Simple way of retrieving the listings for a bucket
     * @param bucket the bucket to retrieve listings for
     * @return the object listing for this bucket
     */
    public ObjectListing listObjects(String bucket) {
        AmazonS3 s3 = getClient();
        ObjectListing list = s3.listObjects(bucket);
        return list;
    }

    /**
     * Paginates through a bucket's keys invoking the listener 
     * at each key
     * @param bucket the bucket to iterate
     * @param listener the listener
     */
    public void paginate(String bucket, BucketKeyListener listener) {
        AmazonS3 s3 = getClient();
        ObjectListing list = s3.listObjects(bucket);
        for (S3ObjectSummary summary : list.getObjectSummaries()) {
            if (listener != null)
                listener.onKey(s3, bucket, summary.getKey());
        }

        while (list.isTruncated()) {
            list = s3.listNextBatchOfObjects(list);
            for (S3ObjectSummary summary : list.getObjectSummaries()) {
                if (listener != null)
                    listener.onKey(s3, bucket, summary.getKey());
            }
        }


    }


    /**
     * Returns an input stream for the given bucket and key
     * @param bucket the bucket to retrieve from
     * @param key the key of the objec  t
     * @return an input stream to the object
     */
    public InputStream objectForKey(String bucket, String key) {
        AmazonS3 s3 = getClient();
        S3Object obj = s3.getObject(bucket, key);
        InputStream is = obj.getObjectContent();
        return is;
    }


    public void download(String bucket, String key, File to) throws IOException {
        AmazonS3 s3 = getClient();
        S3Object obj = s3.getObject(bucket, key);
        InputStream is = obj.getObjectContent();
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(to));
        IOUtils.copy(is, bos);
        bos.close();
        is.close();
        obj.close();
    }

    public void download(String bucket, String key, OutputStream to) throws IOException {
        AmazonS3 s3 = getClient();
        S3Object obj = s3.getObject(bucket, key);
        InputStream is = obj.getObjectContent();
        BufferedOutputStream bos = new BufferedOutputStream(to);

        IOUtils.copy(is, bos);
        bos.close();
        is.close();
        obj.close();
    }

    public MultipleFileDownload downloadFolder(String bucketName, String keyPrefix, File folderPath) {
        TransferManager transfer = new TransferManager(getClient());
        return transfer.downloadDirectory(bucketName, keyPrefix, folderPath);
    }


}
407711
public java.util.List<HostOffering> getOfferingSet() {
        if (offeringSet == null) {
            offeringSet = new com.amazonaws.internal.SdkInternalList<HostOffering>();
        }
        return offeringSet;
    }
28117
public Collection<MethodDescriptor<KEY>> getAllServiceDescriptors()
            throws IllegalStateException {
        Preconditions.checkNotNull(serviceDescriptors, "serviceDescriptors cannot be null");
        return serviceDescriptors.values();
    }
1195871
public java.util.List<ApplicationDescription> getApplications() {
        if (applications == null) {
            applications = new com.amazonaws.internal.SdkInternalList<ApplicationDescription>();
        }
        return applications;
    }
181181
public static List<InstanceStateChange> terminateInstances(final List<String> instanceIDs) {
        // pass any credentials as aws-mock does not authenticate them at all
        AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
        AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);

        // the mock endpoint for ec2 which runs on your computer
        String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/";
        amazonEC2Client.setEndpoint(ec2Endpoint);

        // send the terminate request with args as instance IDs
        TerminateInstancesRequest request = new TerminateInstancesRequest();
        request.withInstanceIds(instanceIDs);
        TerminateInstancesResult result = amazonEC2Client.terminateInstances(request);

        return result.getTerminatingInstances();
    }
313603
public static List<InstanceStateChange> startInstances(final List<String> instanceIDs) {
        // pass any credentials as aws-mock does not authenticate them at all
        AWSCredentials credentials = new BasicAWSCredentials("foo", "bar");
        AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials);

        // the mock endpoint for ec2 which runs on your computer
        String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/";
        amazonEC2Client.setEndpoint(ec2Endpoint);

        // send the start request with args as instance IDs to start existing instances
        StartInstancesRequest request = new StartInstancesRequest();
        request.withInstanceIds(instanceIDs);
        StartInstancesResult result = amazonEC2Client.startInstances(request);

        return result.getStartingInstances();
    }
1208288
public java.util.List<EnvironmentInfoDescription> getEnvironmentInfo() {
        if (environmentInfo == null) {
            environmentInfo = new com.amazonaws.internal.SdkInternalList<EnvironmentInfoDescription>();
        }
        return environmentInfo;
    }
901653
public java.util.List<EcsCluster> getEcsClusters() {
        if (ecsClusters == null) {
            ecsClusters = new com.amazonaws.internal.SdkInternalList<EcsCluster>();
        }
        return ecsClusters;
    }
893357
public java.util.List<String> getSetup() {
        if (setup == null) {
            setup = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return setup;
    }
1258525
public java.util.List<Host> getHosts() {
        if (hosts == null) {
            hosts = new com.amazonaws.internal.SdkInternalList<Host>();
        }
        return hosts;
    }
575944
public static DescriptorExtensionList<SCMCheckoutStrategy,SCMCheckoutStrategyDescriptor> all() {
        return Jenkins.getInstance().<SCMCheckoutStrategy,SCMCheckoutStrategyDescriptor>getDescriptorList(SCMCheckoutStrategy.class);
    }
1261538
public Collection<String> listAttributeDescriptions() {
        List<String> list = new ArrayList<String>();
        try {
            MBeanAttributeInfo[] attrs = beanInfo.getAttributes();
            for (MBeanAttributeInfo attr : attrs) {
                list.add(describeAttribute(attr));
            }
        } catch (Exception e) {
            throwException("Could not list attribute descriptions. Reason: ", e);
        }
        return list;
    }
762567
public java.util.List<SourceDetail> getSourceDetails() {
        if (sourceDetails == null) {
            sourceDetails = new com.amazonaws.internal.SdkInternalList<SourceDetail>();
        }
        return sourceDetails;
    }
1322794
public java.util.List<DeploymentInfo> getDeploymentsInfo() {
        if (deploymentsInfo == null) {
            deploymentsInfo = new com.amazonaws.internal.SdkInternalList<DeploymentInfo>();
        }
        return deploymentsInfo;
    }