/* * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.ec2.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.CreateImageRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#createImage(CreateImageRequest) 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 com.amazonaws.services.ec2.AmazonEC2#createImage(CreateImageRequest) */ public class CreateImageRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequestConstraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*/
private String name;
/**
* A description for the new image.
*/
private String description;
/**
* By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*/
private Boolean noReboot;
/**
* Information about one or more block device mappings.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag Constraints: 3-128
* alphanumeric characters, parentheses (()), square brackets ([]),
* spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('),
* at-signs (@), or underscores(_)
*/
public CreateImageRequest(String instanceId, String name) {
setInstanceId(instanceId);
setName(name);
}
/**
* The ID of the instance.
*
* @return The ID of the instance.
*/
public String getInstanceId() {
return instanceId;
}
/**
* The ID of the instance.
*
* @param instanceId The ID of the instance.
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
* The ID of the instance.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param instanceId The ID of the instance.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withInstanceId(String instanceId) {
this.instanceId = instanceId;
return this;
}
/**
* A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*
* @return A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*/
public String getName() {
return name;
}
/**
* A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*
* @param name A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*/
public void setName(String name) {
this.name = name;
}
/**
* A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param name A name for the new image. Constraints: 3-128 alphanumeric
* characters, parentheses (()), square brackets ([]), spaces ( ),
* periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@),
* or underscores(_)
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withName(String name) {
this.name = name;
return this;
}
/**
* A description for the new image.
*
* @return A description for the new image.
*/
public String getDescription() {
return description;
}
/**
* A description for the new image.
*
* @param description A description for the new image.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* A description for the new image.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param description A description for the new image.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withDescription(String description) {
this.description = description;
return this;
}
/**
* By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*
* @return By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*/
public Boolean isNoReboot() {
return noReboot;
}
/**
* By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*
* @param noReboot By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*/
public void setNoReboot(Boolean noReboot) {
this.noReboot = noReboot;
}
/**
* By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*
* @param noReboot By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withNoReboot(Boolean noReboot) {
this.noReboot = noReboot;
return this;
}
/**
* By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*
* @return By default, Amazon EC2 attempts to shut down and reboot the instance
* before creating the image. If the 'No Reboot' option is set, 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.
*/
public Boolean getNoReboot() {
return noReboot;
}
/**
* Information about one or more block device mappings.
*
* @return Information about one or more block device mappings.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param blockDeviceMappings Information about one or more block device mappings.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
if (getBlockDeviceMappings() == null) setBlockDeviceMappings(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param blockDeviceMappings Information about one or more block device mappings.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CreateImageRequest withBlockDeviceMappings(java.util.Collection