|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xerox.amazonws.common.AWSConnection
com.xerox.amazonws.common.AWSQueryConnection
com.xerox.amazonws.ec2.Jec2
public class Jec2
A Java wrapper for the EC2 web services API
Nested Class Summary | |
---|---|
static class |
Jec2.ImageListAttributeOperationType
Enumerates image list attribute operation types. |
Field Summary |
---|
Fields inherited from class com.xerox.amazonws.common.AWSConnection |
---|
headers |
Constructor Summary | |
---|---|
Jec2(String awsAccessId,
String awsSecretKey)
Initializes the ec2 service with your AWS login information. |
|
Jec2(String awsAccessId,
String awsSecretKey,
boolean isSecure)
Initializes the ec2 service with your AWS login information. |
|
Jec2(String awsAccessId,
String awsSecretKey,
boolean isSecure,
String server)
Initializes the ec2 service with your AWS login information. |
|
Jec2(String awsAccessId,
String awsSecretKey,
boolean isSecure,
String server,
int port)
Initializes the ec2 service with your AWS login information. |
Method Summary | ||
---|---|---|
String |
allocateAddress()
Allocates an address for this account. |
|
void |
associateAddress(String instanceId,
String publicIp)
Associates an address with an instance. |
|
AttachmentInfo |
attachVolume(String volumeId,
String instanceId,
String device)
Attaches an EBS volume to an instance. |
|
void |
authorizeSecurityGroupIngress(String groupName,
String ipProtocol,
int fromPort,
int toPort,
String cidrIp)
Adds incoming permissions to a security group. |
|
void |
authorizeSecurityGroupIngress(String groupName,
String secGroupName,
String secGroupOwnerId)
Adds incoming permissions to a security group. |
|
BundleInstanceInfo |
bundleInstance(String instanceId,
String accessId,
String bucketName,
String prefix,
UploadPolicy policy)
Initiates bundling of an instance running Windows. |
|
BundleInstanceInfo |
cancelBundleInstance(String bundleId)
Cancel a bundling operation. |
|
List<SpotInstanceCancellationResponse> |
cancelSpotInstanceRequests(String... sirIds)
|
|
ProductInstanceInfo |
confirmProductInstance(String instanceId,
String productCode)
Returns true if the productCode is associated with the instance. |
|
String |
createImage(String instanceId,
String name,
String description,
boolean noReboot)
Creates an AMI that uses an EBS root device. |
|
KeyPairInfo |
createKeyPair(String keyName)
Creates a public/private keypair. |
|
void |
createPlacementGroup(String groupName,
String strategy)
Creates a placement group to launch cluster compute instances into. |
|
void |
createSecurityGroup(String name,
String desc)
Creates a security group. |
|
SnapshotInfo |
createSnapshot(String volumeId,
String description)
Creates a snapshot of the EBS Volume. |
|
SpotDatafeedSubscription |
createSpotDatafeedSubscription(String bucket,
String prefix)
This method creates the spot datafeed subscription (for spot usage logs) |
|
VolumeInfo |
createVolume(String size,
String snapshotId,
String zoneName)
Creates an EBS volume either by size, or from a snapshot. |
|
void |
deleteKeyPair(String keyName)
Deletes a public/private keypair. |
|
void |
deletePlacementGroup(String groupName)
Deletes a placement group. |
|
void |
deleteSecurityGroup(String name)
Deletes a security group. |
|
void |
deleteSnapshot(String snapshotId)
Deletes the snapshot. |
|
void |
deleteSpotDatafeedSubscription()
This method deletes the spot datafeed subscription |
|
void |
deleteVolume(String volumeId)
Deletes the EBS volume. |
|
void |
deregisterImage(String imageId)
Deregister the given AMI. |
|
List<AddressInfo> |
describeAddresses(List<String> addresses)
Returns a list of addresses associated with this account. |
|
List<AvailabilityZone> |
describeAvailabilityZones(List<String> zones)
Returns a list of availability zones and their status. |
|
List<BundleInstanceInfo> |
describeBundleTasks(List<String> bundleIds)
Returns a list of current bundling tasks. |
|
List<BundleInstanceInfo> |
describeBundleTasks(String[] bundleIds)
Returns a list of current bundling tasks. |
|
DescribeImageAttributeResult |
describeImageAttribute(String imageId,
ImageAttribute.ImageAttributeType imageAttribute)
Describes an attribute of an AMI. |
|
List<ImageDescription> |
describeImages(List<String> imageIds)
Describe the given AMIs. |
|
List<ImageDescription> |
describeImages(List<String> imageIds,
List<String> owners,
List<String> users)
Describe the AMIs that match the intersection of the criteria supplied |
|
protected List<ImageDescription> |
describeImages(Map<String,String> params)
|
|
List<ImageDescription> |
describeImages(String[] imageIds)
Describe the given AMIs. |
|
List<ImageDescription> |
describeImagesByExecutability(List<String> users)
Describe the AMIs executable by supplied users. |
|
List<ImageDescription> |
describeImagesByOwner(List<String> owners)
Describe the AMIs belonging to the supplied owners. |
|
DescribeInstanceAttributeResult |
describeInstanceAttribute(String instanceId,
String attribute)
Describes an attribute of an instance. |
|
List<ReservationDescription> |
describeInstances(List<String> instanceIds)
Gets a list of running instances. |
|
List<ReservationDescription> |
describeInstances(String[] instanceIds)
Gets a list of running instances. |
|
List<KeyPairInfo> |
describeKeyPairs(List<String> keyIds)
Lists public/private keypairs. |
|
List<KeyPairInfo> |
describeKeyPairs(String[] keyIds)
Lists public/private keypairs. |
|
List<PlacementGroupInfo> |
describePlacementGroups(List<String> groupNames)
This method describes the placement groups. |
|
List<RegionInfo> |
describeRegions(List<String> regions)
Returns a list of regions |
|
List<ReservedInstances> |
describeReservedInstances(List<String> instanceIds)
Returns a list of Reserved Instance offerings that are available for purchase. |
|
List<ProductDescription> |
describeReservedInstancesOfferings(List<String> offeringIds,
InstanceType instanceType,
String availabilityZone,
String productDescription)
Returns a list of Reserved Instance offerings that are available for purchase. |
|
List<GroupDescription> |
describeSecurityGroups(List<String> groupNames)
Gets a list of security groups and their associated permissions. |
|
List<GroupDescription> |
describeSecurityGroups(String[] groupNames)
Gets a list of security groups and their associated permissions. |
|
DescribeSnapshotAttributeResult |
describeSnapshotAttribute(String snapshotId,
String attribute)
Describes an attribute of a snapshot. |
|
List<SnapshotInfo> |
describeSnapshots(List<String> snapshotIds)
Gets a list of EBS snapshots for this account. |
|
List<SnapshotInfo> |
describeSnapshots(List<String> snapshotIds,
String owner,
String restorableBy)
Gets a list of EBS snapshots for this account. |
|
List<SnapshotInfo> |
describeSnapshots(String[] snapshotIds)
Gets a list of EBS snapshots for this account. |
|
SpotDatafeedSubscription |
describeSpotDatafeedSubscription()
This method describes the spot datafeed subscription |
|
List<SpotInstanceRequest> |
describeSpotInstanceRequests()
|
|
List<SpotPriceHistoryItem> |
describeSpotPriceHistory(Calendar start,
Calendar end,
String productDescription,
InstanceType... instanceTypes)
|
|
List<VolumeInfo> |
describeVolumes(List<String> volumeIds)
Gets a list of EBS volumes for this account. |
|
List<VolumeInfo> |
describeVolumes(String[] volumeIds)
Gets a list of EBS volumes for this account. |
|
AttachmentInfo |
detachVolume(String volumeId,
String instanceId,
String device,
boolean force)
Detaches an EBS volume from an instance. |
|
void |
disassociateAddress(String publicIp)
Disassociates an address with an instance. |
|
ConsoleOutput |
getConsoleOutput(String instanceId)
Get an instance's console output. |
|
String |
getPasswordData(String instanceId)
Get a Windows instance's admin password. |
|
protected
|
makeRequestInt(org.apache.http.client.methods.HttpRequestBase method,
String action,
Map<String,String> params,
Class<T> respType)
|
|
void |
modifyImageAttribute(String imageId,
ImageListAttribute attribute,
Jec2.ImageListAttributeOperationType operationType)
Modifies an attribute by the given items with the given operation. |
|
void |
modifyInstanceAttribute(String instanceId,
String attribute,
String value)
Changes one of a variety of settings for a instance. |
|
void |
modifySnapshotAttribute(String snapshotId,
String attribute,
OperationType opType,
String userId,
String userGroup)
Changes permissions settings of a snapshot. |
|
List<MonitoredInstanceInfo> |
monitorInstances(List<String> instanceIds)
This method enables monitoring for some instances |
|
String |
purchaseReservedInstancesOffering(String offeringId,
int instanceCount)
This method purchases a reserved instance offering. |
|
void |
rebootInstances(List<String> instanceIds)
Reboot a selection of running instances. |
|
void |
rebootInstances(String[] instanceIds)
Reboot a selection of running instances. |
|
String |
registerImage(String imageLocation)
Register an S3 based AMI. |
|
String |
registerImage(String name,
String description,
String architecture,
String kernelId,
String ramdiskId,
String rootDeviceName,
List<BlockDeviceMapping> blockDeviceMappings)
Register a snapshot as an EBS backed AMI |
|
protected String |
registerImage(String imageLocation,
String name,
String description,
String architecture,
String kernelId,
String ramdiskId,
String rootDeviceName,
List<BlockDeviceMapping> blockDeviceMappings)
|
|
void |
releaseAddress(String publicIp)
Releases an address |
|
List<SpotInstanceRequest> |
requestSpotInstances(SpotInstanceRequestConfiguration sirc,
LaunchConfiguration lc)
|
|
void |
resetImageAttribute(String imageId,
ImageAttribute.ImageAttributeType imageAttribute)
Resets an attribute on an AMI. |
|
void |
resetInstanceAttribute(String instanceId,
String attribute)
Resets an attribute on an instance. |
|
void |
resetSnapshotAttribute(String snapshotId,
String attribute)
Resets an attribute on a snapshot. |
|
void |
revokeSecurityGroupIngress(String groupName,
String ipProtocol,
int fromPort,
int toPort,
String cidrIp)
Revokes incoming permissions from a security group. |
|
void |
revokeSecurityGroupIngress(String groupName,
String secGroupName,
String secGroupOwnerId)
Revokes incoming permissions from a security group. |
|
ReservationDescription |
runInstances(LaunchConfiguration lc)
Requests reservation of a number of instances. |
|
ReservationDescription |
runInstances(String imageId,
int minCount,
int maxCount,
List<String> groupSet,
String userData,
String keyName)
Requests reservation of a number of instances. |
|
ReservationDescription |
runInstances(String imageId,
int minCount,
int maxCount,
List<String> groupSet,
String userData,
String keyName,
boolean publicAddr)
Requests reservation of a number of instances. |
|
ReservationDescription |
runInstances(String imageId,
int minCount,
int maxCount,
List<String> groupSet,
String userData,
String keyName,
boolean publicAddr,
InstanceType type)
Requests reservation of a number of instances. |
|
ReservationDescription |
runInstances(String imageId,
int minCount,
int maxCount,
List<String> groupSet,
String userData,
String keyName,
boolean publicAddr,
InstanceType type,
String availabilityZone,
String kernelId,
String ramdiskId,
List<BlockDeviceMapping> blockDeviceMappings)
Requests reservation of a number of instances. |
|
ReservationDescription |
runInstances(String imageId,
int minCount,
int maxCount,
List<String> groupSet,
String userData,
String keyName,
InstanceType type)
Requests reservation of a number of instances. |
|
void |
setRegion(RegionInfo region)
Sets the region to use. |
|
void |
setRegionUrl(String regionUrl)
Sets the region Url to use. |
|
List<InstanceStateChangeDescription> |
startInstances(List<String> instanceIds)
Starts a selection of stopped instances. |
|
List<InstanceStateChangeDescription> |
startInstances(String[] instanceIds)
Starts a selection of stopped instances. |
|
List<InstanceStateChangeDescription> |
stopInstances(List<String> instanceIds,
boolean force)
Stops a selection of running instances. |
|
List<InstanceStateChangeDescription> |
stopInstances(String[] instanceIds,
boolean force)
Stops a selection of running instances. |
|
List<InstanceStateChangeDescription> |
terminateInstances(List<String> instanceIds)
Terminates a selection of running instances. |
|
List<InstanceStateChangeDescription> |
terminateInstances(String[] instanceIds)
Terminates a selection of running instances. |
|
List<MonitoredInstanceInfo> |
unmonitorInstances(List<String> instanceIds)
This method disables monitoring for some instances |
Methods inherited from class com.xerox.amazonws.common.AWSQueryConnection |
---|
close, close, getConnectionManagerTimeout, getConnectionTimeout, getHeaders, getHttpClient, getMaxConnections, getMaxRetries, getServerTimeZone, getSoTimeout, getString, httpDate, makeRequest, setConnectionManagerTimeout, setConnectionTimeout, setHttpClient, setMaxConnections, setMaxRetries, setProxyValues, setProxyValues, setProxyValues, setServerTimeZone, setSoTimeout, useSystemProxy |
Methods inherited from class com.xerox.amazonws.common.AWSConnection |
---|
encode, encode, getAlgorithm, getAwsAccessKeyId, getPort, getResourcePrefix, getSecretAccessKey, getServer, getSignatureVersion, getUrl, isSecure, makeURL, setResourcePrefix, setServer, setSignatureVersion, urlencode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Jec2(String awsAccessId, String awsSecretKey)
awsAccessId
- The your user key into AWSawsSecretKey
- The secret string used to generate signatures for authentication.public Jec2(String awsAccessId, String awsSecretKey, boolean isSecure)
awsAccessId
- The your user key into AWSawsSecretKey
- The secret string used to generate signatures for authentication.isSecure
- True if the data should be encrypted on the wire on the way to or from EC2.public Jec2(String awsAccessId, String awsSecretKey, boolean isSecure, String server)
awsAccessId
- The your user key into AWSawsSecretKey
- The secret string used to generate signatures for authentication.isSecure
- True if the data should be encrypted on the wire on the way to or from EC2.server
- Which host to connect to. Usually, this will be ec2.amazonaws.compublic Jec2(String awsAccessId, String awsSecretKey, boolean isSecure, String server, int port)
awsAccessId
- The your user key into AWSawsSecretKey
- The secret string used to generate signatures for authentication.isSecure
- True if the data should be encrypted on the wire on the way to or from EC2.server
- Which host to connect to. Usually, this will be ec2.amazonaws.comport
- Which port to use.Method Detail |
---|
public String createImage(String instanceId, String name, String description, boolean noReboot) throws EC2Exception
instanceId
- An instance's id (ReservationDescription.Instance.instanceId
.name
- a name to associate with the imagedescription
- a descriptive string to attach to the imagenoReboot
- normally false; if set to true, instance is not shutdown first.
NOTE: filesystem integrity isn't guaranteed when noReboot=true
EC2Exception
- wraps checked exceptionspublic String registerImage(String imageLocation) throws EC2Exception
imageLocation
- An AMI path within S3.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic String registerImage(String name, String description, String architecture, String kernelId, String ramdiskId, String rootDeviceName, List<BlockDeviceMapping> blockDeviceMappings) throws EC2Exception
imageLocation
- An AMI path within S3.
EC2Exception
- wraps checked exceptions
TODO: need to return request idprotected String registerImage(String imageLocation, String name, String description, String architecture, String kernelId, String ramdiskId, String rootDeviceName, List<BlockDeviceMapping> blockDeviceMappings) throws EC2Exception
EC2Exception
public void deregisterImage(String imageId) throws EC2Exception
imageId
- An AMI ID as returned by registerImage(String)
.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic List<ImageDescription> describeImages(String[] imageIds) throws EC2Exception
imageIds
- An array of AMI IDs as returned by registerImage(String)
.
ImageDescription
instances describing each AMI ID.
EC2Exception
- wraps checked exceptionspublic List<ImageDescription> describeImages(List<String> imageIds) throws EC2Exception
imageIds
- A list of AMI IDs as returned by registerImage(String)
.
ImageDescription
instances describing each AMI ID.
EC2Exception
- wraps checked exceptionspublic List<ImageDescription> describeImagesByOwner(List<String> owners) throws EC2Exception
owners
- A list of owners.
ImageDescription
instances describing each AMI ID.
EC2Exception
- wraps checked exceptionspublic List<ImageDescription> describeImagesByExecutability(List<String> users) throws EC2Exception
users
- A list of users.
ImageDescription
instances describing each AMI ID.
EC2Exception
- wraps checked exceptionspublic List<ImageDescription> describeImages(List<String> imageIds, List<String> owners, List<String> users) throws EC2Exception
imageIds
- A list of AMI IDs as returned by registerImage(String)
.owners
- A list of owners.users
- A list of users.
ImageDescription
instances describing each AMI ID.
EC2Exception
- wraps checked exceptionsprotected List<ImageDescription> describeImages(Map<String,String> params) throws EC2Exception
EC2Exception
public ReservationDescription runInstances(String imageId, int minCount, int maxCount, List<String> groupSet, String userData, String keyName) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
NOTE: this method defaults to the AWS desired "public" addressing type. NOTE: this method defaults to the small(traditional) instance type.
imageId
- An AMI ID as returned by registerImage(String)
.minCount
- The minimum number of instances to attempt to reserve.maxCount
- The maximum number of instances to attempt to reserve.groupSet
- A (possibly empty) set of security group definitions.userData
- User supplied data that will be made available to the instance(s)
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic ReservationDescription runInstances(String imageId, int minCount, int maxCount, List<String> groupSet, String userData, String keyName, boolean publicAddr) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
NOTE: this method defaults to the small(traditional) instance type.
imageId
- An AMI ID as returned by registerImage(String)
.minCount
- The minimum number of instances to attempt to reserve.maxCount
- The maximum number of instances to attempt to reserve.groupSet
- A (possibly empty) set of security group definitions.userData
- User supplied data that will be made available to the instance(s)publicAddr
- sets addressing mode to public
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic ReservationDescription runInstances(String imageId, int minCount, int maxCount, List<String> groupSet, String userData, String keyName, InstanceType type) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
NOTE: this method defaults to the AWS desired "public" addressing type.
imageId
- An AMI ID as returned by registerImage(String)
.minCount
- The minimum number of instances to attempt to reserve.maxCount
- The maximum number of instances to attempt to reserve.groupSet
- A (possibly empty) set of security group definitions.userData
- User supplied data that will be made available to the instance(s)type
- instance type
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic ReservationDescription runInstances(String imageId, int minCount, int maxCount, List<String> groupSet, String userData, String keyName, boolean publicAddr, InstanceType type) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
imageId
- An AMI ID as returned by registerImage(String)
.minCount
- The minimum number of instances to attempt to reserve.maxCount
- The maximum number of instances to attempt to reserve.groupSet
- A (possibly empty) set of security group definitions.userData
- User supplied data that will be made available to the instance(s)publicAddr
- sets addressing mode to publictype
- instance type
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic ReservationDescription runInstances(String imageId, int minCount, int maxCount, List<String> groupSet, String userData, String keyName, boolean publicAddr, InstanceType type, String availabilityZone, String kernelId, String ramdiskId, List<BlockDeviceMapping> blockDeviceMappings) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
imageId
- An AMI ID as returned by registerImage(String)
.minCount
- The minimum number of instances to attempt to reserve.maxCount
- The maximum number of instances to attempt to reserve.groupSet
- A (possibly empty) set of security group definitions.userData
- User supplied data that will be made available to the instance(s)publicAddr
- sets addressing mode to publictype
- instance typeavailabilityZone
- the zone in which to launch the instance(s)kernelId
- id of the kernel with which to launch the instance(s)ramdiskId
- id of the RAM disk with wich to launch the imstance(s)blockDeviceMappings
- mappings of virtual to device names
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic ReservationDescription runInstances(LaunchConfiguration lc) throws EC2Exception
This will begin launching those instances for which a reservation was successfully obtained.
If less than minCount
instances are available no instances
will be reserved.
lc
- object containing launch configuration
ReservationDescription
describing the instances that
have been reserved.
EC2Exception
- wraps checked exceptionspublic List<InstanceStateChangeDescription> startInstances(String[] instanceIds) throws EC2Exception
instanceIds
- An array of instances (ReservationDescription.Instance.instanceId
.
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptionspublic List<InstanceStateChangeDescription> startInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic List<InstanceStateChangeDescription> stopInstances(String[] instanceIds, boolean force) throws EC2Exception
instanceIds
- An array of instances (ReservationDescription.Instance.instanceId
.force
- forces the instance to stop. bypasses filesystem flush. Use with caution!
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptionspublic List<InstanceStateChangeDescription> stopInstances(List<String> instanceIds, boolean force) throws EC2Exception
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.force
- forces the instance to stop. bypasses filesystem flush. Use with caution!
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic List<InstanceStateChangeDescription> terminateInstances(String[] instanceIds) throws EC2Exception
instanceIds
- An array of instances (ReservationDescription.Instance.instanceId
.
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptionspublic List<InstanceStateChangeDescription> terminateInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.
InstanceStateChangeDescription
instances.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic List<ReservationDescription> describeInstances(String[] instanceIds) throws EC2Exception
If the array of instance IDs is empty then a list of all instances owned by the caller will be returned. Otherwise the list will contain information for the requested instances only.
instanceIds
- An array of instances (ReservationDescription.Instance.instanceId
.
ReservationDescription
instances.
EC2Exception
- wraps checked exceptionspublic List<ReservationDescription> describeInstances(List<String> instanceIds) throws EC2Exception
If the list of instance IDs is empty then a list of all instances owned by the caller will be returned. Otherwise the list will contain information for the requested instances only.
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.
ReservationDescription
instances.
EC2Exception
- wraps checked exceptionspublic void rebootInstances(String[] instanceIds) throws EC2Exception
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic void rebootInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- A list of instances (ReservationDescription.Instance.instanceId
.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic void modifyInstanceAttribute(String instanceId, String attribute, String value) throws EC2Exception
instanceId
- the instance you are addressingattribute
- for now, should be (instanceType|kernel|ramdisk|userData|disableApiTermination|instanceInitatedShutdownBehavior|rootDeviceName|blockDeviceMapping)value
- value of the attribute
EC2Exception
- wraps checked exceptionspublic void resetInstanceAttribute(String instanceId, String attribute) throws EC2Exception
instanceId
- The instance to reset the attribute on.attribute
- The attribute type to reset (kernel|ramdisk).
EC2Exception
- wraps checked exceptionspublic DescribeInstanceAttributeResult describeInstanceAttribute(String instanceId, String attribute) throws EC2Exception
instanceId
- The instance for which the attribute is described.attribute
- The attribute to describe (createVolumePermission).
EC2Exception
- wraps checked exceptionspublic ConsoleOutput getConsoleOutput(String instanceId) throws EC2Exception
instanceId
- An instance's id (ReservationDescription.Instance.instanceId
.
ConsoleOutput
)
EC2Exception
- wraps checked exceptionspublic String getPasswordData(String instanceId) throws EC2Exception
instanceId
- An instance's id (ReservationDescription.Instance.instanceId
.
EC2Exception
- wraps checked exceptionspublic void createSecurityGroup(String name, String desc) throws EC2Exception
name
- The name of the security group.desc
- The description of the security group.
EC2Exception
- wraps checked exceptionspublic void deleteSecurityGroup(String name) throws EC2Exception
name
- The name of the security group.
EC2Exception
- wraps checked exceptionspublic List<GroupDescription> describeSecurityGroups(String[] groupNames) throws EC2Exception
groupNames
- An array of groups to describe.
GroupDescription
.
EC2Exception
- wraps checked exceptionspublic List<GroupDescription> describeSecurityGroups(List<String> groupNames) throws EC2Exception
groupNames
- A list of groups to describe.
GroupDescription
.
EC2Exception
- wraps checked exceptionspublic void authorizeSecurityGroupIngress(String groupName, String secGroupName, String secGroupOwnerId) throws EC2Exception
groupName
- name of group to modifysecGroupName
- name of security group to authorize access tosecGroupOwnerId
- owner of security group to authorize access to
EC2Exception
- wraps checked exceptionspublic void authorizeSecurityGroupIngress(String groupName, String ipProtocol, int fromPort, int toPort, String cidrIp) throws EC2Exception
groupName
- name of group to modifyipProtocol
- protocol to authorize (tcp, udp, icmp)fromPort
- bottom of port range to authorizetoPort
- top of port range to authorizecidrIp
- CIDR IP range to authorize (i.e. 0.0.0.0/0)
EC2Exception
- wraps checked exceptionspublic void revokeSecurityGroupIngress(String groupName, String secGroupName, String secGroupOwnerId) throws EC2Exception
groupName
- name of group to modifysecGroupName
- name of security group to revoke access fromsecGroupOwnerId
- owner of security group to revoke access from
EC2Exception
- wraps checked exceptionspublic void revokeSecurityGroupIngress(String groupName, String ipProtocol, int fromPort, int toPort, String cidrIp) throws EC2Exception
groupName
- name of group to modifyipProtocol
- protocol to revoke (tcp, udp, icmp)fromPort
- bottom of port range to revoketoPort
- top of port range to revokecidrIp
- CIDR IP range to revoke (i.e. 0.0.0.0/0)
EC2Exception
- wraps checked exceptionspublic KeyPairInfo createKeyPair(String keyName) throws EC2Exception
keyName
- Name of the keypair.
KeyPairInfo
).
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic List<KeyPairInfo> describeKeyPairs(String[] keyIds) throws EC2Exception
keyIds
- An array of keypairs.
KeyPairInfo
).
EC2Exception
- wraps checked exceptionspublic List<KeyPairInfo> describeKeyPairs(List<String> keyIds) throws EC2Exception
keyIds
- A list of keypairs.
KeyPairInfo
).
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic void deleteKeyPair(String keyName) throws EC2Exception
keyName
- Name of the keypair.
EC2Exception
- wraps checked exceptions
TODO: need to return request idpublic void modifyImageAttribute(String imageId, ImageListAttribute attribute, Jec2.ImageListAttributeOperationType operationType) throws EC2Exception
imageId
- The ID of the AMI to modify the attributes for.attribute
- The name of the attribute to change.operationType
- The name of the operation to change. May be add or remove.
EC2Exception
- wraps checked exceptionspublic void resetImageAttribute(String imageId, ImageAttribute.ImageAttributeType imageAttribute) throws EC2Exception
imageId
- The AMI to reset the attribute on.imageAttribute
- The attribute type to reset.
EC2Exception
- wraps checked exceptionspublic DescribeImageAttributeResult describeImageAttribute(String imageId, ImageAttribute.ImageAttributeType imageAttribute) throws EC2Exception
imageId
- The AMI for which the attribute is described.imageAttribute
- The attribute type to describe.
EC2Exception
- wraps checked exceptionspublic ProductInstanceInfo confirmProductInstance(String instanceId, String productCode) throws EC2Exception
instanceId
- An instance's id (ReservationDescription.Instance.instanceId
.productCode
- the code for the project you registered with AWS
EC2Exception
- wraps checked exceptionspublic List<AvailabilityZone> describeAvailabilityZones(List<String> zones) throws EC2Exception
zones
- a list of zones to limit the results, or null
EC2Exception
- wraps checked exceptionspublic List<AddressInfo> describeAddresses(List<String> addresses) throws EC2Exception
addresses
- a list of zones to limit the results, or null
EC2Exception
- wraps checked exceptionspublic String allocateAddress() throws EC2Exception
EC2Exception
- wraps checked exceptionspublic void associateAddress(String instanceId, String publicIp) throws EC2Exception
instanceId
- the instancepublicIp
- the ip address to associate
EC2Exception
- wraps checked exceptionspublic void disassociateAddress(String publicIp) throws EC2Exception
publicIp
- the ip address to disassociate
EC2Exception
- wraps checked exceptionspublic void releaseAddress(String publicIp) throws EC2Exception
publicIp
- the ip address to release
EC2Exception
- wraps checked exceptionspublic VolumeInfo createVolume(String size, String snapshotId, String zoneName) throws EC2Exception
size
- the size of the volume in gigabytessnapshotId
- the snapshot from which to create the new volumezoneName
- the availability zone for the new volume
EC2Exception
- wraps checked exceptionspublic void deleteVolume(String volumeId) throws EC2Exception
volumeId
- the id of the volume to be deleted
EC2Exception
- wraps checked exceptionspublic List<VolumeInfo> describeVolumes(String[] volumeIds) throws EC2Exception
If the array of volume IDs is empty then a list of all volumes owned by the caller will be returned. Otherwise the list will contain information for the requested volumes only.
volumeIds
- An array of volumes (VolumeInfo
.
VolumeInfo
volumes.
EC2Exception
- wraps checked exceptionspublic List<VolumeInfo> describeVolumes(List<String> volumeIds) throws EC2Exception
If the list of volume IDs is empty then a list of all volumes owned by the caller will be returned. Otherwise the list will contain information for the requested volumes only.
volumeIds
- A list of volumes (VolumeInfo
.
VolumeInfo
volumes.
EC2Exception
- wraps checked exceptionspublic AttachmentInfo attachVolume(String volumeId, String instanceId, String device) throws EC2Exception
volumeId
- the id of the volumeinstanceId
- the id of the instancedevice
- the device name for the attached volume
EC2Exception
- wraps checked exceptionspublic AttachmentInfo detachVolume(String volumeId, String instanceId, String device, boolean force) throws EC2Exception
volumeId
- the id of the volumeinstanceId
- the id of the instancedevice
- the device name for the attached volumeforce
- if true, forces the detachment, only use if normal detachment fails
EC2Exception
- wraps checked exceptionspublic SnapshotInfo createSnapshot(String volumeId, String description) throws EC2Exception
volumeId
- the id of the volumedescription
- an optional descriptive string (256 chars max)
EC2Exception
- wraps checked exceptionspublic void deleteSnapshot(String snapshotId) throws EC2Exception
snapshotId
- the id of the snapshot
EC2Exception
- wraps checked exceptionspublic List<SnapshotInfo> describeSnapshots(String[] snapshotIds) throws EC2Exception
If the array of snapshot IDs is empty then a list of all snapshots owned by the caller will be returned. Otherwise the list will contain information for the requested snapshots only.
snapshotIds
- An array of snapshots (SnapshotInfo
.
VolumeInfo
volumes.
EC2Exception
- wraps checked exceptionspublic List<SnapshotInfo> describeSnapshots(List<String> snapshotIds) throws EC2Exception
If the list of snapshot IDs is empty then a list of all snapshots owned by the caller will be returned. Otherwise the list will contain information for the requested snapshots only.
snapshotIds
- A list of snapshots (SnapshotInfo
.
VolumeInfo
volumes.
EC2Exception
- wraps checked exceptionspublic List<SnapshotInfo> describeSnapshots(List<String> snapshotIds, String owner, String restorableBy) throws EC2Exception
If the list of snapshot IDs is empty then a list of all snapshots owned by the caller will be returned. Otherwise the list will contain information for the requested snapshots only.
snapshotIds
- A list of snapshots (SnapshotInfo
.owner
- limits results to snapshots owned by this userrestorableBy
- limits results to account that can create volumes from this snapshot
VolumeInfo
volumes.
EC2Exception
- wraps checked exceptionspublic void modifySnapshotAttribute(String snapshotId, String attribute, OperationType opType, String userId, String userGroup) throws EC2Exception
snapshotId
- the snapshot you are addressingattribute
- for now, should be "createVolumePermission"opType
- either add or removeuserId
- optional userId (this or userGroup);userGroup
- optional userGroup (this or userId)
EC2Exception
- wraps checked exceptionspublic void resetSnapshotAttribute(String snapshotId, String attribute) throws EC2Exception
snapshotId
- The snapshot to reset the attribute on.attribute
- The attribute to reset (currently just "createVolumePermission").
EC2Exception
- wraps checked exceptionspublic DescribeSnapshotAttributeResult describeSnapshotAttribute(String snapshotId, String attribute) throws EC2Exception
snapshotId
- The snapshot for which the attribute is described.attribute
- The attribute to describe (createVolumePermission).
EC2Exception
- wraps checked exceptionspublic List<RegionInfo> describeRegions(List<String> regions) throws EC2Exception
regions
- a list of regions to limit the results, or null
EC2Exception
- wraps checked exceptionspublic void setRegion(RegionInfo region)
region
- the region to use, from describeRegions()public void setRegionUrl(String regionUrl)
region
- the region Url to use from RegionInfo.getUrl()public BundleInstanceInfo bundleInstance(String instanceId, String accessId, String bucketName, String prefix, UploadPolicy policy) throws EC2Exception
instanceId
- the Id of the instance to bundleaccessId
- the accessId of the owner of the S3 bucketbucketName
- the name of the S3 bucket in which the AMi will be storedprefix
- the prefix to append to the AMIpolicy
- an UploadPolicy object containing policy parameters
EC2Exception
- wraps checked exceptionspublic BundleInstanceInfo cancelBundleInstance(String bundleId) throws EC2Exception
bundleId
- the Id of the bundle task to cancel
EC2Exception
- wraps checked exceptionspublic List<BundleInstanceInfo> describeBundleTasks(String[] bundleIds) throws EC2Exception
bundleIds
- the Ids of the bundle task to describe
EC2Exception
- wraps checked exceptionspublic List<BundleInstanceInfo> describeBundleTasks(List<String> bundleIds) throws EC2Exception
bundleIds
- the Ids of the bundle task to describe
EC2Exception
- wraps checked exceptionspublic List<ReservedInstances> describeReservedInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- specific reserved instance offering ids to return
EC2Exception
- wraps checked exceptionspublic List<ProductDescription> describeReservedInstancesOfferings(List<String> offeringIds, InstanceType instanceType, String availabilityZone, String productDescription) throws EC2Exception
offeringIds
- specific reserved instance offering ids to returninstanceType
- the type of instance offering to be returnedavailabilityZone
- the availability zone to get offerings forproductDescription
- limit results to those with a matching product description
EC2Exception
- wraps checked exceptionspublic String purchaseReservedInstancesOffering(String offeringId, int instanceCount) throws EC2Exception
offeringId
- the id of the offering to purchaseinstanceCount
- the number of instances to reserve
EC2Exception
- wraps checked exceptionspublic List<MonitoredInstanceInfo> monitorInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- the id of the instances to enable monitoring for
EC2Exception
- wraps checked exceptionspublic List<MonitoredInstanceInfo> unmonitorInstances(List<String> instanceIds) throws EC2Exception
instanceIds
- the id of the instances to disable monitoring for
EC2Exception
- wraps checked exceptionspublic List<SpotPriceHistoryItem> describeSpotPriceHistory(Calendar start, Calendar end, String productDescription, InstanceType... instanceTypes) throws EC2Exception
EC2Exception
public List<SpotInstanceRequest> describeSpotInstanceRequests() throws EC2Exception
EC2Exception
public List<SpotInstanceRequest> requestSpotInstances(SpotInstanceRequestConfiguration sirc, LaunchConfiguration lc) throws EC2Exception
EC2Exception
public List<SpotInstanceCancellationResponse> cancelSpotInstanceRequests(String... sirIds) throws EC2Exception
EC2Exception
public SpotDatafeedSubscription createSpotDatafeedSubscription(String bucket, String prefix) throws EC2Exception
bucket
- the bucket to store the feed inprefix
- the prefix used with the datafeed files
EC2Exception
- wraps checked exceptionspublic SpotDatafeedSubscription describeSpotDatafeedSubscription() throws EC2Exception
EC2Exception
- wraps checked exceptionspublic void deleteSpotDatafeedSubscription() throws EC2Exception
EC2Exception
- wraps checked exceptionspublic void createPlacementGroup(String groupName, String strategy) throws EC2Exception
groupName
- the name of the group you're creatingstrategy
- placement strategy ("cluster")
EC2Exception
- wraps checked exceptionspublic void deletePlacementGroup(String groupName) throws EC2Exception
groupName
- the name of the group you're creating
EC2Exception
- wraps checked exceptionspublic List<PlacementGroupInfo> describePlacementGroups(List<String> groupNames) throws EC2Exception
groupNames
- names of 1 or more groups to get information about, null for all groups
EC2Exception
- wraps checked exceptionsprotected <T> T makeRequestInt(org.apache.http.client.methods.HttpRequestBase method, String action, Map<String,String> params, Class<T> respType) throws EC2Exception
EC2Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |