org.kuali.maven.ec2
Class EC2Utils

java.lang.Object
  extended by org.kuali.maven.ec2.EC2Utils

public class EC2Utils
extends Object


Method Summary
 com.amazonaws.services.ec2.model.Snapshot createSnapshot(String volumeId, String description, WaitControl wc)
           
 void createTags(com.amazonaws.services.ec2.model.Instance instance, List<com.amazonaws.services.ec2.model.Tag> tags)
           
 com.amazonaws.services.ec2.model.Instance findInstanceFromTag(com.amazonaws.services.ec2.model.Tag tag, boolean failIfNotFound)
           
 List<com.amazonaws.services.ec2.model.Instance> getAllInstances(List<com.amazonaws.services.ec2.model.Reservation> reservations)
           
static com.amazonaws.auth.AWSCredentials getCredentials(String accessKey, String secretKey)
           
protected  com.amazonaws.services.ec2.model.DescribeInstancesRequest getDescribeInstancesRequest(com.amazonaws.services.ec2.model.Tag tag)
           
static com.amazonaws.services.ec2.AmazonEC2Client getEC2Client(String accessKey, String secretKey)
           
 com.amazonaws.services.ec2.model.Instance getEC2Instance(String instanceId)
           
 List<com.amazonaws.services.ec2.model.Instance> getEC2Instances()
           
 List<com.amazonaws.services.ec2.model.Instance> getEC2Instances(List<String> instanceIds)
           
protected  com.amazonaws.services.ec2.model.Filter getFilterFromTag(String tag, String value)
           
 com.amazonaws.services.ec2.model.Image getImage(String imageId)
           
static EC2Utils getInstance(com.amazonaws.auth.AWSCredentials credentials)
           
static EC2Utils getInstance(String accessKey, String secretKey)
           
 com.amazonaws.services.ec2.model.Instance getSingleEC2Instance(com.amazonaws.services.ec2.model.RunInstancesRequest request)
           
 com.amazonaws.services.ec2.model.Snapshot getSnapshot(String snapshotId)
           
 String getTagValue(com.amazonaws.services.ec2.model.Instance i, String tag)
           
static boolean isEmpty(Collection<?> c)
           
 com.amazonaws.services.ec2.model.RegisterImageResult registerImage(com.amazonaws.services.ec2.model.RegisterImageRequest request, WaitControl wc)
           
protected  void sleep(int millis)
           
 void tag(String id, List<com.amazonaws.services.ec2.model.Tag> tags)
          Adds or overwrites tags for the specified resource.
 void tag(String id, String name, String value)
           
 void tag(String id, com.amazonaws.services.ec2.model.Tag tag)
           
 void terminate(String instanceId, WaitControl wc)
           
protected  int validate(List<com.amazonaws.services.ec2.model.Instance> instances, com.amazonaws.services.ec2.model.Tag tag, boolean failIfNotFound)
           
 com.amazonaws.services.ec2.model.Instance wait(com.amazonaws.services.ec2.model.Instance i, WaitControl wc, Properties props)
           
 void waitForState(StateRetriever retriever, WaitControl wc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EC2Utils getInstance(String accessKey,
                                   String secretKey)

getInstance

public static EC2Utils getInstance(com.amazonaws.auth.AWSCredentials credentials)

getImage

public com.amazonaws.services.ec2.model.Image getImage(String imageId)

registerImage

public com.amazonaws.services.ec2.model.RegisterImageResult registerImage(com.amazonaws.services.ec2.model.RegisterImageRequest request,
                                                                          WaitControl wc)

terminate

public void terminate(String instanceId,
                      WaitControl wc)

wait

public com.amazonaws.services.ec2.model.Instance wait(com.amazonaws.services.ec2.model.Instance i,
                                                      WaitControl wc,
                                                      Properties props)

createTags

public void createTags(com.amazonaws.services.ec2.model.Instance instance,
                       List<com.amazonaws.services.ec2.model.Tag> tags)

getSingleEC2Instance

public com.amazonaws.services.ec2.model.Instance getSingleEC2Instance(com.amazonaws.services.ec2.model.RunInstancesRequest request)

getFilterFromTag

protected com.amazonaws.services.ec2.model.Filter getFilterFromTag(String tag,
                                                                   String value)

getDescribeInstancesRequest

protected com.amazonaws.services.ec2.model.DescribeInstancesRequest getDescribeInstancesRequest(com.amazonaws.services.ec2.model.Tag tag)

validate

protected int validate(List<com.amazonaws.services.ec2.model.Instance> instances,
                       com.amazonaws.services.ec2.model.Tag tag,
                       boolean failIfNotFound)

findInstanceFromTag

public com.amazonaws.services.ec2.model.Instance findInstanceFromTag(com.amazonaws.services.ec2.model.Tag tag,
                                                                     boolean failIfNotFound)

getEC2Instances

public List<com.amazonaws.services.ec2.model.Instance> getEC2Instances()

getEC2Instances

public List<com.amazonaws.services.ec2.model.Instance> getEC2Instances(List<String> instanceIds)

createSnapshot

public com.amazonaws.services.ec2.model.Snapshot createSnapshot(String volumeId,
                                                                String description,
                                                                WaitControl wc)

tag

public void tag(String id,
                String name,
                String value)

tag

public void tag(String id,
                com.amazonaws.services.ec2.model.Tag tag)

tag

public void tag(String id,
                List<com.amazonaws.services.ec2.model.Tag> tags)
Adds or overwrites tags for the specified resource. id can be an EC2 instance id, snapshot id, volume id, etc. Each resource can have a maximum of 10 tags. Each tag consists of a key-value pair. Tag keys must be unique per resource.


getCredentials

public static com.amazonaws.auth.AWSCredentials getCredentials(String accessKey,
                                                               String secretKey)

getEC2Client

public static com.amazonaws.services.ec2.AmazonEC2Client getEC2Client(String accessKey,
                                                                      String secretKey)

getTagValue

public String getTagValue(com.amazonaws.services.ec2.model.Instance i,
                          String tag)

waitForState

public void waitForState(StateRetriever retriever,
                         WaitControl wc)

sleep

protected void sleep(int millis)

getAllInstances

public List<com.amazonaws.services.ec2.model.Instance> getAllInstances(List<com.amazonaws.services.ec2.model.Reservation> reservations)

getSnapshot

public com.amazonaws.services.ec2.model.Snapshot getSnapshot(String snapshotId)

getEC2Instance

public com.amazonaws.services.ec2.model.Instance getEC2Instance(String instanceId)

isEmpty

public static final boolean isEmpty(Collection<?> c)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.