com.amazonaws.services.ec2.model
Class RunInstancesRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.RunInstancesRequest

public class RunInstancesRequest
extends AmazonWebServiceRequest

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.

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.

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

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.


Constructor Summary
RunInstancesRequest()
           
 
Method Summary
 List<BlockDeviceMapping> getBlockDeviceMappings()
           
 Boolean getDisableApiTermination()
          Specifies whether the instance can be terminated using the APIs.
 String getImageId()
          Unique ID of a machine image, returned by a call to DescribeImages.
 String getInstanceInitiatedShutdownBehavior()
          Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.
 String getInstanceType()
          Specifies the instance type for the launched instances.
 String getKernelId()
          The ID of the kernel with which to launch the instance.
 String getKeyName()
          The name of the key pair.
 Integer getMaxCount()
          Maximum number of instances to launch.
 Integer getMinCount()
          Minimum number of instances to launch.
 Boolean getMonitoring()
          Enables monitoring for the instance.
 Placement getPlacement()
          Specifies the placement constraints (Availability Zones) for launching the instances.
 String getRamdiskId()
          The ID of the RAM disk with which to launch the instance.
 List<String> getSecurityGroups()
          The names of the security groups into which the instances will be launched.
 String getSubnetId()
          Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
 String getUserData()
          Specifies additional information to make available to the instance(s).
 Boolean isDisableApiTermination()
          Specifies whether the instance can be terminated using the APIs.
 Boolean isMonitoring()
          Enables monitoring for the instance.
 void setBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
           
 void setDisableApiTermination(Boolean disableApiTermination)
          Specifies whether the instance can be terminated using the APIs.
 void setImageId(String imageId)
          Unique ID of a machine image, returned by a call to DescribeImages.
 void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
          Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.
 void setInstanceType(String instanceType)
          Specifies the instance type for the launched instances.
 void setKernelId(String kernelId)
          The ID of the kernel with which to launch the instance.
 void setKeyName(String keyName)
          The name of the key pair.
 void setMaxCount(Integer maxCount)
          Maximum number of instances to launch.
 void setMinCount(Integer minCount)
          Minimum number of instances to launch.
 void setMonitoring(Boolean monitoring)
          Enables monitoring for the instance.
 void setPlacement(Placement placement)
          Specifies the placement constraints (Availability Zones) for launching the instances.
 void setRamdiskId(String ramdiskId)
          The ID of the RAM disk with which to launch the instance.
 void setSecurityGroups(Collection<String> securityGroups)
          The names of the security groups into which the instances will be launched.
 void setSubnetId(String subnetId)
          Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
 void setUserData(String userData)
          Specifies additional information to make available to the instance(s).
 String toString()
           
 RunInstancesRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
           Returns a reference to this object so that method calls can be chained together.
 RunInstancesRequest withBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
           Returns a reference to this object so that method calls can be chained together.
 RunInstancesRequest withDisableApiTermination(Boolean disableApiTermination)
          Specifies whether the instance can be terminated using the APIs.
 RunInstancesRequest withImageId(String imageId)
          Unique ID of a machine image, returned by a call to DescribeImages.
 RunInstancesRequest withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
          Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.
 RunInstancesRequest withInstanceType(String instanceType)
          Specifies the instance type for the launched instances.
 RunInstancesRequest withKernelId(String kernelId)
          The ID of the kernel with which to launch the instance.
 RunInstancesRequest withKeyName(String keyName)
          The name of the key pair.
 RunInstancesRequest withMaxCount(Integer maxCount)
          Maximum number of instances to launch.
 RunInstancesRequest withMinCount(Integer minCount)
          Minimum number of instances to launch.
 RunInstancesRequest withMonitoring(Boolean monitoring)
          Enables monitoring for the instance.
 RunInstancesRequest withPlacement(Placement placement)
          Specifies the placement constraints (Availability Zones) for launching the instances.
 RunInstancesRequest withRamdiskId(String ramdiskId)
          The ID of the RAM disk with which to launch the instance.
 RunInstancesRequest withSecurityGroups(Collection<String> securityGroups)
          The names of the security groups into which the instances will be launched.
 RunInstancesRequest withSecurityGroups(String... securityGroups)
          The names of the security groups into which the instances will be launched.
 RunInstancesRequest withSubnetId(String subnetId)
          Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
 RunInstancesRequest withUserData(String userData)
          Specifies additional information to make available to the instance(s).
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunInstancesRequest

public RunInstancesRequest()
Method Detail

getImageId

public String getImageId()
Unique ID of a machine image, returned by a call to DescribeImages.

Returns:
Unique ID of a machine image, returned by a call to DescribeImages.

setImageId

public void setImageId(String imageId)
Unique ID of a machine image, returned by a call to DescribeImages.

Parameters:
imageId - Unique ID of a machine image, returned by a call to DescribeImages.

withImageId

public RunInstancesRequest withImageId(String imageId)
Unique ID of a machine image, returned by a call to DescribeImages.

Returns a reference to this object so that method calls can be chained together.

Parameters:
imageId - Unique ID of a machine image, returned by a call to DescribeImages.
Returns:
A reference to this updated object so that method calls can be chained together.

getMinCount

public Integer getMinCount()
Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.

Returns:
Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.

setMinCount

public void setMinCount(Integer minCount)
Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.

Parameters:
minCount - Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.

withMinCount

public RunInstancesRequest withMinCount(Integer minCount)
Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.

Returns a reference to this object so that method calls can be chained together.

Parameters:
minCount - Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.
Returns:
A reference to this updated object so that method calls can be chained together.

getMaxCount

public Integer getMaxCount()
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.

Between 1 and the maximum number allowed for your account (default: 20).

Returns:
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.

Between 1 and the maximum number allowed for your account (default: 20).


setMaxCount

public void setMaxCount(Integer 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.

Between 1 and the maximum number allowed for your account (default: 20).

Parameters:
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.

Between 1 and the maximum number allowed for your account (default: 20).


withMaxCount

public RunInstancesRequest withMaxCount(Integer 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.

Between 1 and the maximum number allowed for your account (default: 20).

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.

Between 1 and the maximum number allowed for your account (default: 20).

Returns:
A reference to this updated object so that method calls can be chained together.

getKeyName

public String getKeyName()
The name of the key pair.

Returns:
The name of the key pair.

setKeyName

public void setKeyName(String keyName)
The name of the key pair.

Parameters:
keyName - The name of the key pair.

withKeyName

public RunInstancesRequest withKeyName(String keyName)
The name of the key pair.

Returns a reference to this object so that method calls can be chained together.

Parameters:
keyName - The name of the key pair.
Returns:
A reference to this updated object so that method calls can be chained together.

getSecurityGroups

public List<String> getSecurityGroups()
The names of the security groups into which the instances will be launched.

Returns:
The names of the security groups into which the instances will be launched.

setSecurityGroups

public void setSecurityGroups(Collection<String> securityGroups)
The names of the security groups into which the instances will be launched.

Parameters:
securityGroups - The names of the security groups into which the instances will be launched.

withSecurityGroups

public RunInstancesRequest withSecurityGroups(String... securityGroups)
The names of the security groups into which the instances will be launched.

Returns a reference to this object so that method calls can be chained together.

Parameters:
securityGroups - The names of the security groups into which the instances will be launched.
Returns:
A reference to this updated object so that method calls can be chained together.

withSecurityGroups

public RunInstancesRequest withSecurityGroups(Collection<String> securityGroups)
The names of the security groups into which the instances will be launched.

Returns a reference to this object so that method calls can be chained together.

Parameters:
securityGroups - The names of the security groups into which the instances will be launched.
Returns:
A reference to this updated object so that method calls can be chained together.

getUserData

public String getUserData()
Specifies additional information to make available to the instance(s).

Returns:
Specifies additional information to make available to the instance(s).

setUserData

public void setUserData(String userData)
Specifies additional information to make available to the instance(s).

Parameters:
userData - Specifies additional information to make available to the instance(s).

withUserData

public RunInstancesRequest withUserData(String userData)
Specifies additional information to make available to the instance(s).

Returns a reference to this object so that method calls can be chained together.

Parameters:
userData - Specifies additional information to make available to the instance(s).
Returns:
A reference to this updated object so that method calls can be chained together.

getInstanceType

public String getInstanceType()
Specifies the instance type for the launched instances.

Constraints:
Allowed Values: m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge

Returns:
Specifies the instance type for the launched instances.
See Also:
InstanceType

setInstanceType

public void setInstanceType(String instanceType)
Specifies the instance type for the launched instances.

Constraints:
Allowed Values: m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge

Parameters:
instanceType - Specifies the instance type for the launched instances.
See Also:
InstanceType

withInstanceType

public RunInstancesRequest withInstanceType(String instanceType)
Specifies the instance type for the launched instances.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge

Parameters:
instanceType - Specifies the instance type for the launched instances.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
InstanceType

getPlacement

public Placement getPlacement()
Specifies the placement constraints (Availability Zones) for launching the instances.

Returns:
Specifies the placement constraints (Availability Zones) for launching the instances.

setPlacement

public void setPlacement(Placement placement)
Specifies the placement constraints (Availability Zones) for launching the instances.

Parameters:
placement - Specifies the placement constraints (Availability Zones) for launching the instances.

withPlacement

public RunInstancesRequest withPlacement(Placement placement)
Specifies the placement constraints (Availability Zones) for launching the instances.

Returns a reference to this object so that method calls can be chained together.

Parameters:
placement - Specifies the placement constraints (Availability Zones) for launching the instances.
Returns:
A reference to this updated object so that method calls can be chained together.

getKernelId

public String getKernelId()
The ID of the kernel with which to launch the instance.

Returns:
The ID of the kernel with which to launch the instance.

setKernelId

public void setKernelId(String kernelId)
The ID of the kernel with which to launch the instance.

Parameters:
kernelId - The ID of the kernel with which to launch the instance.

withKernelId

public RunInstancesRequest withKernelId(String kernelId)
The ID of the kernel with which to launch the instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
kernelId - The ID of the kernel with which to launch the instance.
Returns:
A reference to this updated object so that method calls can be chained together.

getRamdiskId

public String getRamdiskId()
The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.

Returns:
The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.

setRamdiskId

public void setRamdiskId(String ramdiskId)
The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.

Parameters:
ramdiskId - The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.

withRamdiskId

public RunInstancesRequest withRamdiskId(String ramdiskId)
The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ramdiskId - The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.
Returns:
A reference to this updated object so that method calls can be chained together.

getBlockDeviceMappings

public List<BlockDeviceMapping> getBlockDeviceMappings()
Returns:

setBlockDeviceMappings

public void setBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
Parameters:
blockDeviceMappings -

withBlockDeviceMappings

public RunInstancesRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings -
Returns:
A reference to this updated object so that method calls can be chained together.

withBlockDeviceMappings

public RunInstancesRequest withBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings -
Returns:
A reference to this updated object so that method calls can be chained together.

isMonitoring

public Boolean isMonitoring()
Enables monitoring for the instance.

Returns:
Enables monitoring for the instance.

setMonitoring

public void setMonitoring(Boolean monitoring)
Enables monitoring for the instance.

Parameters:
monitoring - Enables monitoring for the instance.

withMonitoring

public RunInstancesRequest withMonitoring(Boolean monitoring)
Enables monitoring for the instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
monitoring - Enables monitoring for the instance.
Returns:
A reference to this updated object so that method calls can be chained together.

getMonitoring

public Boolean getMonitoring()
Enables monitoring for the instance.

Returns:
Enables monitoring for the instance.

getSubnetId

public String getSubnetId()
Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.

Returns:
Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.

setSubnetId

public void setSubnetId(String subnetId)
Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.

Parameters:
subnetId - Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.

withSubnetId

public RunInstancesRequest withSubnetId(String subnetId)
Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.

Returns a reference to this object so that method calls can be chained together.

Parameters:
subnetId - Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.
Returns:
A reference to this updated object so that method calls can be chained together.

isDisableApiTermination

public Boolean isDisableApiTermination()
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

Returns:
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

setDisableApiTermination

public void setDisableApiTermination(Boolean disableApiTermination)
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

Parameters:
disableApiTermination - Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

withDisableApiTermination

public RunInstancesRequest withDisableApiTermination(Boolean disableApiTermination)
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
disableApiTermination - Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.
Returns:
A reference to this updated object so that method calls can be chained together.

getDisableApiTermination

public Boolean getDisableApiTermination()
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

Returns:
Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.

getInstanceInitiatedShutdownBehavior

public String getInstanceInitiatedShutdownBehavior()
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

Returns:
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

setInstanceInitiatedShutdownBehavior

public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

Parameters:
instanceInitiatedShutdownBehavior - Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

withInstanceInitiatedShutdownBehavior

public RunInstancesRequest withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceInitiatedShutdownBehavior - Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.