com.amazonaws.services.ec2.model
Class CreateImageRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.CreateImageRequest
All Implemented Interfaces:
DryRunSupportedRequest<CreateImageRequest>, java.io.Serializable

public class CreateImageRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<CreateImageRequest>

Container for the parameters to the CreateImage operation.

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

For more information, see Creating Amazon EBS-Backed Linux AMIs in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.createImage(CreateImageRequest), Serialized Form

Constructor Summary
CreateImageRequest()
          Default constructor for a new CreateImageRequest object.
CreateImageRequest(java.lang.String instanceId, java.lang.String name)
          Constructs a new CreateImageRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.List<BlockDeviceMapping> getBlockDeviceMappings()
          Information about one or more block device mappings.
 java.lang.String getDescription()
          A description for the new image.
 Request<CreateImageRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getInstanceId()
          The ID of the instance.
 java.lang.String getName()
          A name for the new image.
 java.lang.Boolean getNoReboot()
          By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance.
 int hashCode()
           
 java.lang.Boolean isNoReboot()
          By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance.
 void setBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
          Information about one or more block device mappings.
 void setDescription(java.lang.String description)
          A description for the new image.
 void setInstanceId(java.lang.String instanceId)
          The ID of the instance.
 void setName(java.lang.String name)
          A name for the new image.
 void setNoReboot(java.lang.Boolean noReboot)
          By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateImageRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
          Information about one or more block device mappings.
 CreateImageRequest withBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
          Information about one or more block device mappings.
 CreateImageRequest withDescription(java.lang.String description)
          A description for the new image.
 CreateImageRequest withInstanceId(java.lang.String instanceId)
          The ID of the instance.
 CreateImageRequest withName(java.lang.String name)
          A name for the new image.
 CreateImageRequest withNoReboot(java.lang.Boolean noReboot)
          By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateImageRequest

public CreateImageRequest()
Default constructor for a new CreateImageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


CreateImageRequest

public CreateImageRequest(java.lang.String instanceId,
                          java.lang.String name)
Constructs a new CreateImageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
instanceId - The ID of the instance.
name - A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)

Method Detail

getInstanceId

public java.lang.String getInstanceId()
The ID of the instance.

Returns:
The ID of the instance.

setInstanceId

public void setInstanceId(java.lang.String instanceId)
The ID of the instance.

Parameters:
instanceId - The ID of the instance.

withInstanceId

public CreateImageRequest withInstanceId(java.lang.String instanceId)
The ID of the instance.

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

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

getName

public java.lang.String getName()
A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)

Returns:
A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)


setName

public void setName(java.lang.String name)
A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)

Parameters:
name - A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)


withName

public CreateImageRequest withName(java.lang.String name)
A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)

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

Parameters:
name - A name for the new image.

Constraints: 3-128 alphanumeric characters, parenthesis (()), periods (.), slashes (/), dashes (-), or underscores(_)

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

getDescription

public java.lang.String getDescription()
A description for the new image.

Returns:
A description for the new image.

setDescription

public void setDescription(java.lang.String description)
A description for the new image.

Parameters:
description - A description for the new image.

withDescription

public CreateImageRequest withDescription(java.lang.String description)
A description for the new image.

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

Parameters:
description - A description for the new image.
Returns:
A reference to this updated object so that method calls can be chained together.

isNoReboot

public java.lang.Boolean isNoReboot()
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

Returns:
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

setNoReboot

public void setNoReboot(java.lang.Boolean noReboot)
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

Parameters:
noReboot - By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

withNoReboot

public CreateImageRequest withNoReboot(java.lang.Boolean noReboot)
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

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

Parameters:
noReboot - By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.
Returns:
A reference to this updated object so that method calls can be chained together.

getNoReboot

public java.lang.Boolean getNoReboot()
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

Returns:
By default, this parameter is set to false, which means Amazon EC2 attempts to shut down the instance cleanly before image creation and then reboots the instance. When the parameter is set to true, Amazon EC2 doesn't shut down the instance before creating the image. When this option is used, file system integrity on the created image can't be guaranteed.

getBlockDeviceMappings

public java.util.List<BlockDeviceMapping> getBlockDeviceMappings()
Information about one or more block device mappings.

Returns:
Information about one or more block device mappings.

setBlockDeviceMappings

public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
Information about one or more block device mappings.

Parameters:
blockDeviceMappings - Information about one or more block device mappings.

withBlockDeviceMappings

public CreateImageRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
Information about one or more block device mappings.

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

Parameters:
blockDeviceMappings - Information about one or more block device mappings.
Returns:
A reference to this updated object so that method calls can be chained together.

withBlockDeviceMappings

public CreateImageRequest withBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
Information about one or more block device mappings.

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

Parameters:
blockDeviceMappings - Information about one or more block device mappings.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<CreateImageRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<CreateImageRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


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