|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.ec2.model.RunInstancesRequest
public class RunInstancesRequest
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 |
---|
public RunInstancesRequest()
Method Detail |
---|
public String getImageId()
public void setImageId(String imageId)
imageId
- Unique ID of a machine image, returned by a call to DescribeImages.public RunInstancesRequest withImageId(String imageId)
Returns a reference to this object so that method calls can be chained together.
imageId
- Unique ID of a machine image, returned by a call to DescribeImages.
public Integer getMinCount()
public void setMinCount(Integer minCount)
minCount
- Minimum number of instances to launch. If the value is more than
Amazon EC2 can launch, no instances are launched at all.public RunInstancesRequest withMinCount(Integer minCount)
Returns a reference to this object so that method calls can be chained together.
minCount
- Minimum number of instances to launch. If the value is more than
Amazon EC2 can launch, no instances are launched at all.
public Integer getMaxCount()
Between 1 and the maximum number allowed for your account (default: 20).
Between 1 and the maximum number allowed for your account (default: 20).
public void setMaxCount(Integer maxCount)
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. Between 1 and the maximum number allowed for your account (default: 20).
public RunInstancesRequest withMaxCount(Integer maxCount)
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.
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).
public String getKeyName()
public void setKeyName(String keyName)
keyName
- The name of the key pair.public RunInstancesRequest withKeyName(String keyName)
Returns a reference to this object so that method calls can be chained together.
keyName
- The name of the key pair.
public List<String> getSecurityGroups()
public void setSecurityGroups(Collection<String> securityGroups)
securityGroups
- The names of the security groups into which the instances will be
launched.public RunInstancesRequest withSecurityGroups(String... securityGroups)
Returns a reference to this object so that method calls can be chained together.
securityGroups
- The names of the security groups into which the instances will be
launched.
public RunInstancesRequest withSecurityGroups(Collection<String> securityGroups)
Returns a reference to this object so that method calls can be chained together.
securityGroups
- The names of the security groups into which the instances will be
launched.
public String getUserData()
public void setUserData(String userData)
userData
- Specifies additional information to make available to the instance(s).public RunInstancesRequest withUserData(String userData)
Returns a reference to this object so that method calls can be chained together.
userData
- Specifies additional information to make available to the instance(s).
public String getInstanceType()
Constraints:
Allowed Values: m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge
InstanceType
public void setInstanceType(String instanceType)
Constraints:
Allowed Values: m1.small, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.medium, c1.xlarge
instanceType
- Specifies the instance type for the launched instances.InstanceType
public RunInstancesRequest withInstanceType(String instanceType)
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
instanceType
- Specifies the instance type for the launched instances.
InstanceType
public Placement getPlacement()
public void setPlacement(Placement placement)
placement
- Specifies the placement constraints (Availability Zones) for launching
the instances.public RunInstancesRequest withPlacement(Placement placement)
Returns a reference to this object so that method calls can be chained together.
placement
- Specifies the placement constraints (Availability Zones) for launching
the instances.
public String getKernelId()
public void setKernelId(String kernelId)
kernelId
- The ID of the kernel with which to launch the instance.public RunInstancesRequest withKernelId(String kernelId)
Returns a reference to this object so that method calls can be chained together.
kernelId
- The ID of the kernel with which to launch the instance.
public String getRamdiskId()
public void setRamdiskId(String ramdiskId)
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.public RunInstancesRequest withRamdiskId(String ramdiskId)
Returns a reference to this object so that method calls can be chained together.
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.
public List<BlockDeviceMapping> getBlockDeviceMappings()
public void setBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
blockDeviceMappings
- public RunInstancesRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
Returns a reference to this object so that method calls can be chained together.
blockDeviceMappings
-
public RunInstancesRequest withBlockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
Returns a reference to this object so that method calls can be chained together.
blockDeviceMappings
-
public Boolean isMonitoring()
public void setMonitoring(Boolean monitoring)
monitoring
- Enables monitoring for the instance.public RunInstancesRequest withMonitoring(Boolean monitoring)
Returns a reference to this object so that method calls can be chained together.
monitoring
- Enables monitoring for the instance.
public Boolean getMonitoring()
public String getSubnetId()
public void setSubnetId(String subnetId)
subnetId
- Specifies the subnet ID within which to launch the instance(s) for
Amazon Virtual Private Cloud.public RunInstancesRequest withSubnetId(String subnetId)
Returns a reference to this object so that method calls can be chained together.
subnetId
- Specifies the subnet ID within which to launch the instance(s) for
Amazon Virtual Private Cloud.
public Boolean isDisableApiTermination()
public void setDisableApiTermination(Boolean disableApiTermination)
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.public RunInstancesRequest withDisableApiTermination(Boolean disableApiTermination)
Returns a reference to this object so that method calls can be chained together.
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.
public Boolean getDisableApiTermination()
public String getInstanceInitiatedShutdownBehavior()
public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
instanceInitiatedShutdownBehavior
- Specifies whether the instance's Amazon EBS volumes are stopped or
terminated when the instance is shut down.public RunInstancesRequest withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Returns a reference to this object so that method calls can be chained together.
instanceInitiatedShutdownBehavior
- Specifies whether the instance's Amazon EBS volumes are stopped or
terminated when the instance is shut down.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |