|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jw.cloud42.core.service.Cloud42Functions
de.jw.cloud42.core.service.Cloud42BaseFunctions
public class Cloud42BaseFunctions
Basic functions such as listing AMIs and starting an instance.
| Field Summary |
|---|
| Fields inherited from class de.jw.cloud42.core.service.Cloud42Functions |
|---|
ec2 |
| Constructor Summary | |
|---|---|
Cloud42BaseFunctions()
|
|
| Method Summary | |
|---|---|
boolean |
addPermission(java.lang.String groupname,
java.lang.String protocol,
int portFrom,
int portTo,
java.lang.String cidrIp)
Add incoming permissions to a group by opening the given ports. |
boolean |
addPermission(java.lang.String groupname,
java.lang.String secGroupName,
java.lang.String secGroupOwnerId)
Adds a permission associated to an group/owner. |
com.xerox.amazonws.ec2.KeyPairInfo |
createKeypair(java.lang.String name)
Create a keypair. |
boolean |
createSecurityGroup(java.lang.String name,
java.lang.String description)
Create a security group that can be assigned to an instance. |
boolean |
deleteKeypair(java.lang.String name)
Delete a keypair. |
boolean |
deleteSecurityGroup(java.lang.String name)
Delete a security group. |
boolean |
deregisterImage(java.lang.String imageId)
Deregister an AMI Image. |
Instance |
describeInstance(java.lang.String instanceId)
Get or refresh current information on a running instance identified by its Id. |
com.xerox.amazonws.ec2.KeyPairInfo |
describeKeypair(java.lang.String name)
Gets the properties of a specific keypair. |
com.xerox.amazonws.ec2.GroupDescription |
describeSecurityGroup(java.lang.String name)
Gets the properties of a specific security group. |
com.xerox.amazonws.ec2.ConsoleOutput |
getConsoleOutput(java.lang.String instanceId)
Get console ouput for a particular instance. |
com.xerox.amazonws.ec2.AvailabilityZone[] |
listAvailabilityZones()
Lists available Availability zones. |
com.xerox.amazonws.ec2.ImageDescription[] |
listImages(boolean all)
Lists available EC2 AMIs that you could start an instance of. |
Instance[] |
listInstances()
List all instances. |
com.xerox.amazonws.ec2.KeyPairInfo[] |
listKeypairs()
List available keypairs. |
com.xerox.amazonws.ec2.RegionInfo[] |
listRegions()
List the AWS Regions. |
com.xerox.amazonws.ec2.GroupDescription[] |
listSecurityGroups()
List all available Security groups. |
void |
rebootInstance(java.lang.String instanceId)
Reboot a given instance. |
java.lang.String |
registerImage(java.lang.String location)
Register a new AMI from a bucket on S3 |
boolean |
removePermission(java.lang.String groupname,
java.lang.String protocol,
int portFrom,
int portTo,
java.lang.String cidrIp)
Revokes permissions that were added using addPermission(). |
boolean |
removePermission(java.lang.String groupname,
java.lang.String secGroupName,
java.lang.String secGroupOwnerId)
Revokes a permission associated to an group/owner. |
com.xerox.amazonws.ec2.ReservationDescription |
runInstance(java.lang.String imageId,
java.lang.String[] groups,
java.lang.String keyName,
byte[] userData,
com.xerox.amazonws.ec2.InstanceType instanceType,
int count,
java.lang.String availabilityZone,
java.lang.String kernelId,
java.lang.String ramdiskId)
Starts an instance with the given parameters. |
Instance[] |
runInstanceBlocking(java.lang.String imageId,
java.lang.String[] groups,
java.lang.String keyName,
byte[] userData,
com.xerox.amazonws.ec2.InstanceType instanceType,
int count,
java.lang.String availabilityZone,
java.lang.String kernelId,
java.lang.String ramdiskId)
Blocking start of an instance with the given parameters. |
com.xerox.amazonws.ec2.TerminatingInstanceDescription[] |
stopAllInstances()
Stop all existing instances. |
com.xerox.amazonws.ec2.TerminatingInstanceDescription |
stopInstance(java.lang.String instanceId)
Stop a specific AMI instance. |
| Methods inherited from class de.jw.cloud42.core.service.Cloud42Functions |
|---|
getCredentials, getRegionUrl, setCredentials, setRegionUrl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Cloud42BaseFunctions()
| Method Detail |
|---|
public com.xerox.amazonws.ec2.RegionInfo[] listRegions()
public com.xerox.amazonws.ec2.ImageDescription[] listImages(boolean all)
all - set to true to display all public AMIs, set to false to list
only your own AMIs.
public com.xerox.amazonws.ec2.ReservationDescription runInstance(java.lang.String imageId,
java.lang.String[] groups,
java.lang.String keyName,
byte[] userData,
com.xerox.amazonws.ec2.InstanceType instanceType,
int count,
java.lang.String availabilityZone,
java.lang.String kernelId,
java.lang.String ramdiskId)
imageId - AMI-Id of the instance to start.groups - List of groups.keyName - Name of the keypair to use.userData - User data for this instance (see
http://docs.amazonwebservices.com/AWSEC2/2008-05-05/DeveloperGuide/index.html?AESDG-chapter-instancedata.html).instanceType - EC2 Type of the instancecount - number of instances to launchavailabilityZone - Availability zone for instance.kernelId - KernelId to use. May be empty.ramdiskId - RamdiskId to use. May be empty.
public Instance[] runInstanceBlocking(java.lang.String imageId,
java.lang.String[] groups,
java.lang.String keyName,
byte[] userData,
com.xerox.amazonws.ec2.InstanceType instanceType,
int count,
java.lang.String availabilityZone,
java.lang.String kernelId,
java.lang.String ramdiskId)
imageId - AMI-Id of the instance to start.groups - List of groups.keyName - Name of the keypair to use.instanceType - EC2 Type of the instancecount - number of instances to start with in ReservationDescription
public Instance describeInstance(java.lang.String instanceId)
instanceId -
public com.xerox.amazonws.ec2.TerminatingInstanceDescription stopInstance(java.lang.String instanceId)
instanceId -
public com.xerox.amazonws.ec2.TerminatingInstanceDescription[] stopAllInstances()
public void rebootInstance(java.lang.String instanceId)
instanceId - public Instance[] listInstances()
public boolean createSecurityGroup(java.lang.String name,
java.lang.String description)
name - description -
public boolean deleteSecurityGroup(java.lang.String name)
name - Name of the group to delete.
*
public com.xerox.amazonws.ec2.GroupDescription[] listSecurityGroups()
public com.xerox.amazonws.ec2.GroupDescription describeSecurityGroup(java.lang.String name)
name - The name of the group.
public boolean addPermission(java.lang.String groupname,
java.lang.String protocol,
int portFrom,
int portTo,
java.lang.String cidrIp)
instance - groupname - name of the group.protocol - e.g. "tcp", "udp", "icmp"portFrom - portTo - cidrIp - CIDR IP range to add (i.e. 0.0.0.0/0)
public boolean addPermission(java.lang.String groupname,
java.lang.String secGroupName,
java.lang.String secGroupOwnerId)
groupname - name of group to modifysecGroupName - name of security group to add accesssecGroupOwnerId - owner of security group
public boolean removePermission(java.lang.String groupname,
java.lang.String protocol,
int portFrom,
int portTo,
java.lang.String cidrIp)
addPermission().
instance - groupname - protocol - portFrom - portTo - cidrIp - CIDR IP range to add (i.e. 0.0.0.0/0)
public boolean removePermission(java.lang.String groupname,
java.lang.String secGroupName,
java.lang.String secGroupOwnerId)
groupname - name of group to modifysecGroupName - name of security group to revoke access fromsecGroupOwnerId - owner of security group to revoke access from
public java.lang.String registerImage(java.lang.String location)
location - the location on S3
public boolean deregisterImage(java.lang.String imageId)
imageId - the ID of the image to deregister.
public com.xerox.amazonws.ec2.KeyPairInfo createKeypair(java.lang.String name)
name - Name of the keypair.
public boolean deleteKeypair(java.lang.String name)
name - Name of the keypair.
public com.xerox.amazonws.ec2.KeyPairInfo[] listKeypairs()
public com.xerox.amazonws.ec2.KeyPairInfo describeKeypair(java.lang.String name)
name - The name of the keypair.
public com.xerox.amazonws.ec2.AvailabilityZone[] listAvailabilityZones()
public com.xerox.amazonws.ec2.ConsoleOutput getConsoleOutput(java.lang.String instanceId)
instanceId - The instanceId of the instance to get the console output from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||