org.jclouds.ec2.options
Class RunInstancesOptions

java.lang.Object
  extended by org.jclouds.http.options.BaseHttpRequestOptions
      extended by org.jclouds.ec2.options.internal.BaseEC2RequestOptions
          extended by 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.*

EC2Client connection = // get connection Future instances = connection.runInstances(executableBy("123125").imageIds(1000, 1004));

Author:
Adrian Cole
See Also:

Nested Class Summary
static class RunInstancesOptions.Builder
           
 
Field Summary
static RunInstancesOptions NONE
           
 
Fields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, matrixParameters, pathSuffix, payload, queryParameters
 
Constructor Summary
RunInstancesOptions()
           
 
Method Summary
 RunInstancesOptions asType(String type)
          Specifies the instance type.
 RunInstancesOptions withBlockDeviceMappings(Set<? extends BlockDeviceMapping> mappings)
          Specifies the Block Device Mapping for the instance
 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 groups
 RunInstancesOptions withSecurityGroups(String... securityGroups)
          Attach multiple security groups
 RunInstancesOptions 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, buildMatrixParameters, buildPathSuffix, buildQueryParameters, buildRequestHeaders, buildStringPayload, equals, getFirstFormOrNull, getFirstHeaderOrNull, getFirstMatrixOrNull, getFirstQueryOrNull, hashCode, replaceHeader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final RunInstancesOptions NONE
Constructor Detail

RunInstancesOptions

public RunInstancesOptions()
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 l aunch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to th e Resource Center and search for the kernel ID.


withBlockDeviceMappings

public RunInstancesOptions withBlockDeviceMappings(Set<? extends BlockDeviceMapping> mappings)
Specifies the Block Device Mapping for the instance



Copyright © 2009-2011 jclouds. All Rights Reserved.