org.jclouds.aws.ec2.services
Interface AWSInstanceClient

All Superinterfaces:
InstanceClient

public interface AWSInstanceClient
extends InstanceClient

Provides access to EC2 via their REST API.

Author:
Adrian Cole

Method Summary
 Set<? extends Reservation<? extends AWSRunningInstance>> describeInstancesInRegion(String region, String... instanceIds)
          Returns information about instances that you own.
 Reservation<? extends AWSRunningInstance> runInstancesInRegion(String region, String nullableAvailabilityZone, String imageId, int minCount, int maxCount, RunInstancesOptions... options)
          Launches a specified number of instances of an AMI for which you have permissions.
 
Methods inherited from interface org.jclouds.ec2.services.InstanceClient
getBlockDeviceMappingForInstanceInRegion, getInstanceInitiatedShutdownBehaviorForInstanceInRegion, getInstanceTypeForInstanceInRegion, getKernelForInstanceInRegion, getRamdiskForInstanceInRegion, getRootDeviceNameForInstanceInRegion, getUserDataForInstanceInRegion, isApiTerminationDisabledForInstanceInRegion, rebootInstancesInRegion, resetKernelForInstanceInRegion, resetRamdiskForInstanceInRegion, setApiTerminationDisabledForInstanceInRegion, setBlockDeviceMappingForInstanceInRegion, setInstanceInitiatedShutdownBehaviorForInstanceInRegion, setInstanceTypeForInstanceInRegion, setKernelForInstanceInRegion, setRamdiskForInstanceInRegion, setUserDataForInstanceInRegion, startInstancesInRegion, stopInstancesInRegion, terminateInstancesInRegion
 

Method Detail

describeInstancesInRegion

Set<? extends Reservation<? extends AWSRunningInstance>> describeInstancesInRegion(@Nullable
                                                                                   String region,
                                                                                   String... instanceIds)
Description copied from interface: InstanceClient
Returns information about instances that you own.

If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an invalid instance ID, a fault is returned. If you specify an instance that you do not own, it will not be included in the returned results.

Recently terminated instances might appear in the returned results.This interval is usually less than one hour.

Specified by:
describeInstancesInRegion in interface InstanceClient
Parameters:
region - Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
See Also:
InstanceClient.runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int, org.jclouds.ec2.options.RunInstancesOptions...), InstanceClient.terminateInstancesInRegion(java.lang.String, java.lang.String...),

runInstancesInRegion

Reservation<? extends AWSRunningInstance> runInstancesInRegion(@Nullable
                                                               String region,
                                                               @Nullable
                                                               String nullableAvailabilityZone,
                                                               String imageId,
                                                               int minCount,
                                                               int maxCount,
                                                               RunInstancesOptions... options)
Description copied from interface: InstanceClient
Launches a specified number of instances of an AMI for which you have permissions.

If Amazon EC2 cannot launch the minimum number AMIs you request, no instances will be launched. If there is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches the minimum number specified for each AMI and allocate the remaining available instances using round robin.

Security Groups

Note: Every instance is launched in a security group (created using the CreateSecurityGroup operation.

Key Pair

You can provide an optional key pair ID for each image in the launch request (created using the CreateKeyPair operation). All instances that are created from images that use this key pair will have access to the associated public key at boot. You can use this key to provide secure access to an instance of an image on a per-instance basis. Amazon EC2 public images use this feature to provide secure access without passwords.

Note: Launching public images without a key pair ID will leave them inaccessible.

The public key material is made available to the instance at boot time by placing it in the openssh_id.pub file on a logical device that is exposed to the instance as /dev/sda2 (the instance store). The format of this file is suitable for use as an entry within ~/.ssh/authorized_keys (the OpenSSH format). This can be done at boot (e.g., as part of rc.local) allowing for secure access without passwords.

User Data

Optional user data can be provided in the launch request. All instances that collectively comprise the launch request have access to this data. For more information, go the Amazon Elastic Compute Cloud Developer Guide.

Product Codes

Note: If any of the AMIs have a product code attached for which the user has not subscribed, the RunInstances call will fail.

Kernel

Important: We strongly recommend using the 2.6.18 Xen stock kernel with High-CPU and High-Memory instances. Although the default Amazon EC2 kernels will work, the new kernels provide greater stability and performance for these instance types. For more information about kernels, go the Amazon Elastic Compute Cloud Developer Guide.

Specified by:
runInstancesInRegion in interface InstanceClient
Parameters:
region - Instances are tied to Availability Zones. However, the instance ID is tied to the Region.
nullableAvailabilityZone - Specifies the placement constraints (Availability Zones) for launching the instances. If null, Amazon will determine the best availability zone to place the instance.
imageId - Unique ID of a machine image, returned by a call to
minCount - Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances a re launched at all. Constraints: Between 1 and the maximum number allowed for your account (default: 20).
maxCount - Maximum number of instances to launch. If the value is more than Amazon EC2 can launch, the largest possible number above minCount will be launched instead. Constraints: Between 1 and the maximum number allowed for your account (default: 20).
See Also:
InstanceClient.describeInstancesInRegion(java.lang.String, java.lang.String...), InstanceClient.terminateInstancesInRegion(java.lang.String, java.lang.String...), #authorizeSecurityGroupIngressInRegion, #revokeSecurityGroupIngressInRegion, #describeSecurityGroupsInRegion, #createSecurityGroupInRegion, #createKeyPairInRegion, , RunInstancesOptions


Copyright © 2009-2011 jclouds. All Rights Reserved.