/*
* Copyright 2018-2023 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 javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateImageRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateImageRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest
* The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or
* snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.
*
* A description for the new image.
*
* The ID of the instance.
*
* A name for the new image.
*
* Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.),
* slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)
*
* Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of
* the following values:
*
*
*
* Default:
* The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.
*
* To tag the AMI, the value for
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the
* instance, the value for
* If you specify other values for
* To tag an AMI or snapshot after it has been created, see CreateTags.
*
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are created.
* Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.
* false
- The instance is rebooted before creating the image. This ensures that all buffered data and
* data in memory is written to the volumes before the snapshots are created.
* false
*
*
* ResourceType
must be image
.
* ResourceType
must be snapshot
. The same tag is applied to all
* of the snapshots that are created.
* ResourceType
, the request fails.
*
* 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 block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or * snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. *
* * @return The block device mappings. This parameter cannot be used to modify the encryption status of existing * volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. */ public java.util.List* The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or * snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. *
* * @param blockDeviceMappings * The block device mappings. This parameter cannot be used to modify the encryption status of existing * volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. */ public void setBlockDeviceMappings(java.util.Collection* The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or * snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setBlockDeviceMappings(java.util.Collection)} or {@link #withBlockDeviceMappings(java.util.Collection)} * if you want to override the existing values. *
* * @param blockDeviceMappings * The block device mappings. This parameter cannot be used to modify the encryption status of existing * volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) { if (this.blockDeviceMappings == null) { setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList* The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or * snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. *
* * @param blockDeviceMappings * The block device mappings. This parameter cannot be used to modify the encryption status of existing * volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRequest withBlockDeviceMappings(java.util.Collection* 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. *
* * @return A description for the new image. */ public String getDescription() { return this.description; } /** ** A description for the new image. *
* * @param description * A description for the new image. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRequest withDescription(String description) { setDescription(description); return this; } /** ** 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. *
* * @return The ID of the instance. */ public String getInstanceId() { return this.instanceId; } /** ** The ID of the instance. *
* * @param instanceId * The ID of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRequest withInstanceId(String instanceId) { setInstanceId(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(_) *
* * @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(_) *
* * @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 this.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(_) * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRequest withName(String name) { setName(name); return this; } /** *
* Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of * the following values: *
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are created.
* Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered data and
* data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are
* created. Buffered data and data in memory that has not yet been written to the volumes is not included in
* the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered
* data and data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*/
public void setNoReboot(Boolean noReboot) {
this.noReboot = noReboot;
}
/**
*
* Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of * the following values: *
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are created.
* Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered data and
* data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are
* created. Buffered data and data in memory that has not yet been written to the volumes is not included in
* the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered
* data and data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*/
public Boolean getNoReboot() {
return this.noReboot;
}
/**
*
* Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of * the following values: *
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are created.
* Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered data and
* data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are
* created. Buffered data and data in memory that has not yet been written to the volumes is not included in
* the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered
* data and data in memory is written to the volumes before the snapshots are created.
*
* Default: false
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateImageRequest withNoReboot(Boolean noReboot) {
setNoReboot(noReboot);
return this;
}
/**
*
* Indicates whether or not the instance should be automatically rebooted before creating the image. Specify one of * the following values: *
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are created.
* Buffered data and data in memory that has not yet been written to the volumes is not included in the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered data and
* data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*
* true
- The instance is not rebooted before creating the image. This creates crash-consistent
* snapshots that include only the data that has been written to the volumes at the time the snapshots are
* created. Buffered data and data in memory that has not yet been written to the volumes is not included in
* the snapshots.
*
* false
- The instance is rebooted before creating the image. This ensures that all buffered
* data and data in memory is written to the volumes before the snapshots are created.
*
* Default: false
*/
public Boolean isNoReboot() {
return this.noReboot;
}
/**
*
* The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both. *
*
* To tag the AMI, the value for ResourceType
must be image
.
*
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the
* instance, the value for ResourceType
must be snapshot
. The same tag is applied to all
* of the snapshots that are created.
*
* If you specify other values for ResourceType
, the request fails.
*
* To tag an AMI or snapshot after it has been created, see CreateTags. *
* * @return The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both. *
* To tag the AMI, the value for ResourceType
must be image
.
*
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are
* attached to the instance, the value for ResourceType
must be snapshot
. The same
* tag is applied to all of the snapshots that are created.
*
* If you specify other values for ResourceType
, the request fails.
*
* To tag an AMI or snapshot after it has been created, see CreateTags.
*/
public java.util.List
* The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.
*
* To tag the AMI, the value for
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the
* instance, the value for
* If you specify other values for
* To tag an AMI or snapshot after it has been created, see CreateTags.
*
*
* ResourceType
must be image
.
* ResourceType
must be snapshot
. The same tag is applied to all
* of the snapshots that are created.
* ResourceType
, the request fails.
*
* To tag the AMI, the value for ResourceType
must be image
.
*
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached
* to the instance, the value for ResourceType
must be snapshot
. The same tag is
* applied to all of the snapshots that are created.
*
* If you specify other values for ResourceType
, the request fails.
*
* To tag an AMI or snapshot after it has been created, see CreateTags.
*/
public void setTagSpecifications(java.util.Collection
* The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.
*
* To tag the AMI, the value for
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the
* instance, the value for
* If you specify other values for
* To tag an AMI or snapshot after it has been created, see CreateTags.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if
* you want to override the existing values.
*
*
* ResourceType
must be image
.
* ResourceType
must be snapshot
. The same tag is applied to all
* of the snapshots that are created.
* ResourceType
, the request fails.
*
* To tag the AMI, the value for ResourceType
must be image
.
*
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached
* to the instance, the value for ResourceType
must be snapshot
. The same tag is
* applied to all of the snapshots that are created.
*
* If you specify other values for ResourceType
, the request fails.
*
* To tag an AMI or snapshot after it has been created, see CreateTags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateImageRequest withTagSpecifications(TagSpecification... tagSpecifications) {
if (this.tagSpecifications == null) {
setTagSpecifications(new com.amazonaws.internal.SdkInternalList
* The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.
*
* To tag the AMI, the value for
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the
* instance, the value for
* If you specify other values for
* To tag an AMI or snapshot after it has been created, see CreateTags.
*
*
* ResourceType
must be image
.
* ResourceType
must be snapshot
. The same tag is applied to all
* of the snapshots that are created.
* ResourceType
, the request fails.
*
* To tag the AMI, the value for ResourceType
must be image
.
*
* To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached
* to the instance, the value for ResourceType
must be snapshot
. The same tag is
* applied to all of the snapshots that are created.
*
* If you specify other values for ResourceType
, the request fails.
*
* To tag an AMI or snapshot after it has been created, see CreateTags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateImageRequest withTagSpecifications(java.util.Collection