com.atlassian.aws
Interface AWSAccount


public interface AWSAccount


Method Summary
 com.atlassian.fugue.Pair<String,String> associateVpcAddress(String instanceId, Collection<String> excludedAddresses)
           
 void attachVolume(String volumeId, String instanceId, String device, boolean deleteOnTermination)
           
 void cancelSpotInstanceRequests(String... spotInstanceRequestIds)
           
 void createTag(String resourceId, String key, String value)
           
 String createVolume(String ebsSnapshotId, String availabilityZone)
           
 void deleteVolume(String volumeId)
          Delete the volume with the given id.
 List<com.amazonaws.services.ec2.model.Address> describeAddresses(String... domains)
           
 com.amazonaws.services.ec2.model.Image describeImage(String imageId)
           
 List<com.amazonaws.services.ec2.model.Image> describeImages(String... imageIds)
           
 Collection<com.amazonaws.services.ec2.model.Instance> describeInstances(String... instanceIds)
           
 Collection<com.amazonaws.services.ec2.model.SpotInstanceRequest> describePendingSpotInstanceRequests(String... spotInstanceRequestId)
          Returns a recently retrieved snapshot of pending ('open') spot instance requests optionally limiting them to the supplied list.
 Iterable<com.amazonaws.services.ec2.model.SecurityGroup> describeSecurityGroups()
           
 Collection<com.amazonaws.services.ec2.model.SpotInstanceRequest> describeSpotInstanceRequests(String... spotInstanceRequestIds)
           
 Collection<com.amazonaws.services.ec2.model.Subnet> describeSubnets(String... subnetIds)
          Returns VPC subnets currently defined in EC2.
 Collection<com.amazonaws.services.ec2.model.Volume> describeVolumes()
          Returns the list of all ebs volumes on this account.
 Map<com.amazonaws.services.ec2.model.Vpc,Collection<com.amazonaws.services.ec2.model.Subnet>> describeVpcs()
           
 void ensureInboundTrafficIsAllowed(com.amazonaws.services.ec2.model.SecurityGroup group, Protocol protocol, String cidrIpRange, int port)
           
 com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.AccountAttribute> getAccountAttributes()
           
 String getAccountValidationError()
          Checks whether the credentials encapsulated by this object are valid.
 Collection<com.amazonaws.services.ec2.model.Instance> getAllInstances()
          Returns the list of all instances on this account that are currently up.
 com.amazonaws.services.ec2.AmazonEC2Async getAmazonEc2()
           
 com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.AvailabilityZone> getAvailabilityZones()
          Returns a list of availability zones and their status.
 com.amazonaws.services.ec2.AmazonEC2AsyncClient getAwsClient()
          Deprecated. since 5.9 use getAmazonEc2() instead
 String getConsoleOutput(String instanceId)
          Returns the console logs returned from EC2.
 com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.KeyPairInfo> getEC2KeyPairDescriptions()
           
 String getPassword(String keyFilePath, String instanceIds)
          Retrieves the generated password for instance.
 AwsSupportConstants.Region getRegion()
           
 SpotPrices getSpotPrices()
           
 SubnetCache getSubnetCache()
           
 RemoteEC2Instance newEC2Instance(InstanceLaunchConfiguration instanceLaunchConfiguration, EC2InstanceListener listener)
          Place an order for a new EC2 instance.
 com.amazonaws.services.ec2.model.KeyPair newEC2KeyPair(String name)
           
 com.amazonaws.services.ec2.model.SecurityGroup newSecurityGroup(String name, String description, VpcId vpcId)
           
 void releaseAddresses(String... allocationIds)
           
 void setMaximumEbsVolumeStatusAgeSeconds(int maximumStatusAgeSeconds)
           
 void setMaximumInstanceStatusAgeSeconds(int maximumStatusAgeSeconds)
           
 void setMaximumSpotRequestStatusAgeSeconds(int maximumStatusAgeSeconds)
           
 void shutdownInstance(String instanceId)
          Shutdown the elastic instance with the given id.
 

Method Detail

getAccountValidationError

@Nullable
String getAccountValidationError()
                                 throws AWSException

Checks whether the credentials encapsulated by this object are valid.

Returns:
null if the credentials are valid; String with error message otherwise.
Throws:
AWSException - if a problem prevents the validity of the credentials from being determined.

newEC2Instance

@NotNull
RemoteEC2Instance newEC2Instance(InstanceLaunchConfiguration instanceLaunchConfiguration,
                                         EC2InstanceListener listener)

Place an order for a new EC2 instance.

Parameters:
image - The EC2 image from which the instance should be booted.
keyName - The name of the public key to be supplied to the instance, or null if none should be supplied.
securityGroupIds - A list of the security groups of which the instance should be a member.
userData - An object that is to be serialised and passed to the instance as its user data.
instanceType - The instance type.
availabilityZone - The name of the availability zone to use, or null to use an arbitrary zone.
timeoutSeconds - The time allowed for the instance to enter the running state.
listener - A listener that receives notifications of instance events.
Returns:
An object representing the EC2 instance.

describeSecurityGroups

@NotNull
Iterable<com.amazonaws.services.ec2.model.SecurityGroup> describeSecurityGroups()
                                                                                throws AWSException
Throws:
AWSException

newSecurityGroup

@NotNull
com.amazonaws.services.ec2.model.SecurityGroup newSecurityGroup(@NotNull
                                                                        String name,
                                                                        @NotNull
                                                                        String description,
                                                                        @Nullable
                                                                        VpcId vpcId)
                                                                throws AWSException
Throws:
AWSException

ensureInboundTrafficIsAllowed

void ensureInboundTrafficIsAllowed(com.amazonaws.services.ec2.model.SecurityGroup group,
                                   Protocol protocol,
                                   String cidrIpRange,
                                   int port)

getEC2KeyPairDescriptions

@NotNull
com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.KeyPairInfo> getEC2KeyPairDescriptions()
                                                                                                                      throws AWSException
Throws:
AWSException

newEC2KeyPair

@NotNull
com.amazonaws.services.ec2.model.KeyPair newEC2KeyPair(String name)
                                                       throws AWSException
Throws:
AWSException

getAvailabilityZones

@NotNull
com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.AvailabilityZone> getAvailabilityZones()
                                                                                                                      throws AWSException
Returns a list of availability zones and their status. Simple delegation of Jec2.describeAvailabilityZones(List)

Returns:
A map of zones and their availability keyed by zone name.
Throws:
AWSException - When there's an error querying EC2 service

getConsoleOutput

@Nullable
String getConsoleOutput(String instanceId)
Returns the console logs returned from EC2. Note that logs are not returned until sometime after the agent starts

Parameters:
instanceId -
Returns:
null if the console is empty or an error occurred while retrieving it.

getAllInstances

@NotNull
Collection<com.amazonaws.services.ec2.model.Instance> getAllInstances()
                                                                      throws AWSException
Returns the list of all instances on this account that are currently up.

Returns:
the list of all instances on this account that are currently up.
Throws:
AWSException

describePendingSpotInstanceRequests

@NotNull
Collection<com.amazonaws.services.ec2.model.SpotInstanceRequest> describePendingSpotInstanceRequests(String... spotInstanceRequestId)
Returns a recently retrieved snapshot of pending ('open') spot instance requests optionally limiting them to the supplied list.

Returns:
the list of all pending spot instance requests on this account.

describeInstances

Collection<com.amazonaws.services.ec2.model.Instance> describeInstances(String... instanceIds)
Returns:
a recently retrieved list of instances on this account. Does not return terminated instances.

getPassword

@Nullable
String getPassword(@NotNull
                            String keyFilePath,
                            @NotNull
                            String instanceIds)
Retrieves the generated password for instance.

Returns:
null for instances without password randomisation or for instances on which the password hasn't been generated yet. Otherwise returns the password to the Administrator account.

describeImage

com.amazonaws.services.ec2.model.Image describeImage(String imageId)
Returns:
a recently retrieved image

describeImages

List<com.amazonaws.services.ec2.model.Image> describeImages(String... imageIds)
Returns:
a recently retrieved list of images on this account.

describeSpotInstanceRequests

Collection<com.amazonaws.services.ec2.model.SpotInstanceRequest> describeSpotInstanceRequests(String... spotInstanceRequestIds)
Returns:
a recently retrieved list of all spot instance requests on this account.

describeVolumes

@NotNull
Collection<com.amazonaws.services.ec2.model.Volume> describeVolumes()
                                                                    throws AWSException
Returns the list of all ebs volumes on this account.

Returns:
a recently retrieved list of all ebs volumes on this account.
Throws:
AWSException - when there is an error querying EC2 service.

createVolume

String createVolume(@NotNull
                    String ebsSnapshotId,
                    @NotNull
                    String availabilityZone)

attachVolume

void attachVolume(@NotNull
                  String volumeId,
                  @NotNull
                  String instanceId,
                  @NotNull
                  String device,
                  boolean deleteOnTermination)

shutdownInstance

void shutdownInstance(String instanceId)
                      throws AWSException
Shutdown the elastic instance with the given id.

Parameters:
instanceId -
Throws:
AWSException - when there is an error shutting down EC2 instance.

deleteVolume

void deleteVolume(String volumeId)
                  throws AWSException
Delete the volume with the given id.

Parameters:
volumeId -
Throws:
AWSException - when there is an error deleting the volume.

getSpotPrices

@NotNull
SpotPrices getSpotPrices()

getAwsClient

@Deprecated
com.amazonaws.services.ec2.AmazonEC2AsyncClient getAwsClient()
Deprecated. since 5.9 use getAmazonEc2() instead

Returns:

getAmazonEc2

com.amazonaws.services.ec2.AmazonEC2Async getAmazonEc2()

setMaximumEbsVolumeStatusAgeSeconds

void setMaximumEbsVolumeStatusAgeSeconds(int maximumStatusAgeSeconds)

setMaximumInstanceStatusAgeSeconds

void setMaximumInstanceStatusAgeSeconds(int maximumStatusAgeSeconds)

setMaximumSpotRequestStatusAgeSeconds

void setMaximumSpotRequestStatusAgeSeconds(int maximumStatusAgeSeconds)

describeVpcs

@NotNull
Map<com.amazonaws.services.ec2.model.Vpc,Collection<com.amazonaws.services.ec2.model.Subnet>> describeVpcs()
                                                                                                           throws AWSException
Returns:
a map of available VPCs and subnets defined in these VPCs
Throws:
AWSException

describeSubnets

@NotNull
Collection<com.amazonaws.services.ec2.model.Subnet> describeSubnets(String... subnetIds)
Returns VPC subnets currently defined in EC2.

Parameters:
subnetIds - No parameters = all subnets. Otherwise, subnet ids that should be returned.

associateVpcAddress

@NotNull
com.atlassian.fugue.Pair<String,String> associateVpcAddress(@NotNull
                                                                    String instanceId,
                                                                    @Nullable
                                                                    Collection<String> excludedAddresses)

describeAddresses

@NotNull
List<com.amazonaws.services.ec2.model.Address> describeAddresses(String... domains)

releaseAddresses

void releaseAddresses(String... allocationIds)

createTag

void createTag(@NotNull
               String resourceId,
               @NotNull
               String key,
               @NotNull
               String value)

getRegion

AwsSupportConstants.Region getRegion()

cancelSpotInstanceRequests

void cancelSpotInstanceRequests(String... spotInstanceRequestIds)

getAccountAttributes

@NotNull
com.google.common.collect.ImmutableMap<String,com.amazonaws.services.ec2.model.AccountAttribute> getAccountAttributes()

getSubnetCache

SubnetCache getSubnetCache()


Copyright © 2015 Atlassian. All rights reserved.