Package org.jclouds.ec2.options
Class RunInstancesOptions
- java.lang.Object
-
- org.jclouds.http.options.BaseHttpRequestOptions
-
- org.jclouds.ec2.options.internal.BaseEC2RequestOptions
-
- org.jclouds.ec2.options.RunInstancesOptions
-
- All Implemented Interfaces:
HttpRequestOptions
- Direct Known Subclasses:
AWSRunInstancesOptions
public class RunInstancesOptions extends BaseEC2RequestOptions
Contains options supported in the Form API for the RunInstances operation.Usage
The recommended way to instantiate a RunInstancesOptions object is to statically import RunInstancesOptions.Builder.* and invoke a static creation method followed by an instance mutator (if needed):import static org.jclouds.aws.ec2.options.RunInstancesOptions.Builder.* EC2Api connection = // get connection Future
instances = connection.runInstances(executableBy("123125").imageIds(1000, 1004));
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RunInstancesOptions.Builder
-
Field Summary
Fields Modifier and Type Field Description static RunInstancesOptions
NONE
-
Fields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, pathSuffix, payload, queryParameters
-
-
Constructor Summary
Constructors Constructor Description RunInstancesOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RunInstancesOptions
asType(String type)
Specifies the instance type.RunInstancesOptions
withBlockDeviceMappings(Set<? extends BlockDeviceMapping> mappings)
Specifies the Block Device Mapping for the instanceRunInstancesOptions
withClientToken(String clientToken)
Specifies the optional ClientToken field, which triggers idempotent RunInstances calls.RunInstancesOptions
withKernelId(String kernelId)
The ID of the kernel with which to launch the instance.RunInstancesOptions
withKeyName(String keyName)
The name of the key pair.RunInstancesOptions
withRamdisk(String ramDiskId)
The ID of the RAM disk with which to launch the instance.RunInstancesOptions
withSecurityGroup(String securityGroup)
Attaches a single security group.RunInstancesOptions
withSecurityGroups(Iterable<String> securityGroups)
Attach multiple security groupsRunInstancesOptions
withSecurityGroups(String... securityGroups)
Attach multiple security groupsRunInstancesOptions
withUserData(byte[] unencodedData)
Unencoded data-
Methods inherited from class org.jclouds.ec2.options.internal.BaseEC2RequestOptions
getFormValuesWithKeysPrefixedBy, indexFormValuesWithPrefix, indexFormValuesWithPrefix, toString
-
Methods inherited from class org.jclouds.http.options.BaseHttpRequestOptions
buildFormParameters, buildPathSuffix, buildQueryParameters, buildRequestHeaders, buildStringPayload, equals, getFirstFormOrNull, getFirstHeaderOrNull, getFirstQueryOrNull, hashCode, replaceHeader
-
-
-
-
Field Detail
-
NONE
public static final RunInstancesOptions NONE
-
-
Method Detail
-
withKeyName
public RunInstancesOptions withKeyName(String keyName)
The name of the key pair.
-
withSecurityGroups
public RunInstancesOptions withSecurityGroups(String... securityGroups)
Attach multiple security groups
-
withSecurityGroups
public RunInstancesOptions withSecurityGroups(Iterable<String> securityGroups)
Attach multiple security groups
-
withSecurityGroup
public RunInstancesOptions withSecurityGroup(String securityGroup)
Attaches a single security group. Multiple calls to this method won't add more groups.- Parameters:
securityGroup
- name of an existing security group
-
withUserData
public RunInstancesOptions withUserData(byte[] unencodedData)
Unencoded data
-
asType
public RunInstancesOptions asType(String type)
Specifies the instance type. default small;
-
withKernelId
public RunInstancesOptions withKernelId(String kernelId)
The ID of the kernel with which to launch the instance.
-
withRamdisk
public RunInstancesOptions withRamdisk(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.
-
withBlockDeviceMappings
public RunInstancesOptions withBlockDeviceMappings(Set<? extends BlockDeviceMapping> mappings)
Specifies the Block Device Mapping for the instance
-
withClientToken
public RunInstancesOptions withClientToken(String clientToken)
Specifies the optional ClientToken field, which triggers idempotent RunInstances calls. See here for more details.
-
-