/* * 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.CopyImageRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#copyImage(CopyImageRequest) CopyImage operation}. *
* Initiates the copy of an AMI from the specified source region to the * current region. You specify the destination region by using its * endpoint when making the request. *
** For more information, see * Copying AMIs * in the Amazon Elastic Compute Cloud User Guide . *
* * @see com.amazonaws.services.ec2.AmazonEC2#copyImage(CopyImageRequest) */ public class CopyImageRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequestKmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*/
private Boolean encrypted;
/**
* The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*/
private String kmsKeyId;
/**
* The name of the region that contains the AMI to copy.
*
* @return The name of the region that contains the AMI to copy.
*/
public String getSourceRegion() {
return sourceRegion;
}
/**
* The name of the region that contains the AMI to copy.
*
* @param sourceRegion The name of the region that contains the AMI to copy.
*/
public void setSourceRegion(String sourceRegion) {
this.sourceRegion = sourceRegion;
}
/**
* The name of the region that contains the AMI to copy.
* * Returns a reference to this object so that method calls can be chained together. * * @param sourceRegion The name of the region that contains the AMI to copy. * * @return A reference to this updated object so that method calls can be chained * together. */ public CopyImageRequest withSourceRegion(String sourceRegion) { this.sourceRegion = sourceRegion; return this; } /** * The ID of the AMI to copy. * * @return The ID of the AMI to copy. */ public String getSourceImageId() { return sourceImageId; } /** * The ID of the AMI to copy. * * @param sourceImageId The ID of the AMI to copy. */ public void setSourceImageId(String sourceImageId) { this.sourceImageId = sourceImageId; } /** * The ID of the AMI to copy. *
* Returns a reference to this object so that method calls can be chained together. * * @param sourceImageId The ID of the AMI to copy. * * @return A reference to this updated object so that method calls can be chained * together. */ public CopyImageRequest withSourceImageId(String sourceImageId) { this.sourceImageId = sourceImageId; return this; } /** * The name of the new AMI in the destination region. * * @return The name of the new AMI in the destination region. */ public String getName() { return name; } /** * The name of the new AMI in the destination region. * * @param name The name of the new AMI in the destination region. */ public void setName(String name) { this.name = name; } /** * The name of the new AMI in the destination region. *
* Returns a reference to this object so that method calls can be chained together. * * @param name The name of the new AMI in the destination region. * * @return A reference to this updated object so that method calls can be chained * together. */ public CopyImageRequest withName(String name) { this.name = name; return this; } /** * A description for the new AMI in the destination region. * * @return A description for the new AMI in the destination region. */ public String getDescription() { return description; } /** * A description for the new AMI in the destination region. * * @param description A description for the new AMI in the destination region. */ public void setDescription(String description) { this.description = description; } /** * A description for the new AMI in the destination region. *
* Returns a reference to this object so that method calls can be chained together. * * @param description A description for the new AMI in the destination region. * * @return A reference to this updated object so that method calls can be chained * together. */ public CopyImageRequest withDescription(String description) { this.description = description; return this; } /** * Unique, case-sensitive identifier you provide to ensure idempotency of * the request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide. * * @return Unique, case-sensitive identifier you provide to ensure idempotency of * the request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide. */ public String getClientToken() { return clientToken; } /** * Unique, case-sensitive identifier you provide to ensure idempotency of * the request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide. * * @param clientToken Unique, case-sensitive identifier you provide to ensure idempotency of * the request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** * Unique, case-sensitive identifier you provide to ensure idempotency of * the request. For more information, see How * to Ensure Idempotency in the Amazon Elastic Compute Cloud User * Guide. *
* Returns a reference to this object so that method calls can be chained together.
*
* @param clientToken Unique, case-sensitive identifier you provide to ensure idempotency of
* the request. For more information, see How
* to Ensure Idempotency in the Amazon Elastic Compute Cloud User
* Guide.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CopyImageRequest withClientToken(String clientToken) {
this.clientToken = clientToken;
return this;
}
/**
* Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
* @return Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*/
public Boolean isEncrypted() {
return encrypted;
}
/**
* Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
* @param encrypted Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*/
public void setEncrypted(Boolean encrypted) {
this.encrypted = encrypted;
}
/**
* Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param encrypted Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CopyImageRequest withEncrypted(Boolean encrypted) {
this.encrypted = encrypted;
return this;
}
/**
* Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*
* @return Specifies whether the destination snapshots of the copied image should
* be encrypted. The default CMK for EBS is used unless a non-default AWS
* Key Management Service (AWS KMS) CMK is specified with
* KmsKeyId
. For more information, see Amazon
* EBS Encryption in the Amazon Elastic Compute Cloud User
* Guide.
*/
public Boolean getEncrypted() {
return encrypted;
}
/**
* The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*
* @return The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*/
public String getKmsKeyId() {
return kmsKeyId;
}
/**
* The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*
* @param kmsKeyId The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
* The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param kmsKeyId The full ARN of the AWS Key Management Service (AWS KMS) CMK to use
* when encrypting the snapshots of an image during a copy operation.
* This parameter is only required if you want to use a non-default CMK;
* if this parameter is not specified, the default CMK for EBS is used.
* The ARN contains the arn:aws:kms
namespace, followed by
* the region of the CMK, the AWS account ID of the CMK owner, the
* key
namespace, and then the CMK ID. For example,
* arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
* The specified CMK must exist in the region that the snapshot is being
* copied to. If a KmsKeyId
is specified, the
* Encrypted
flag must also be set.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public CopyImageRequest withKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
/**
* This method is intended for internal use only.
* Returns the marshaled request configured with additional parameters to
* enable operation dry-run.
*/
@Override
public Request