com.amazonaws.services.ec2.model.CopySnapshotRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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.CopySnapshotRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CopySnapshotRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest {
/**
*
* A description for the EBS snapshot.
*
*/
private String description;
/**
*
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when
* copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the
* destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or
* within the same Outpost.
*
*
* For more information, see Copy snapshots
* from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*
*/
private String destinationOutpostArn;
/**
*
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation. This
* parameter is only valid for specifying the destination Region in a PresignedUrl
parameter, where it
* is required.
*
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
*
*/
private String destinationRegion;
/**
*
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using
* this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this
* parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information,
* see Amazon EBS encryption in
* the Amazon EBS User Guide.
*
*/
private Boolean encrypted;
/**
*
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key
* for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be true
.
*
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that
* is not valid, the action can appear to complete, but eventually fails.
*
*/
private String kmsKeyId;
/**
*
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This
* parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
action, and
* include the SourceRegion
, SourceSnapshotId
, and DestinationRegion
* parameters. The PresignedUrl
must be signed using Amazon Web Services Signature Version 4. Because
* EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is
* described in
* Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3
* API Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*
*/
private String presignedUrl;
/**
*
* The ID of the Region that contains the snapshot to be copied.
*
*/
private String sourceRegion;
/**
*
* The ID of the EBS snapshot to copy.
*
*/
private String sourceSnapshotId;
/**
*
* The tags to apply to the new snapshot.
*
*/
private com.amazonaws.internal.SdkInternalList tagSpecifications;
/**
*
* A description for the EBS snapshot.
*
*
* @param description
* A description for the EBS snapshot.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description for the EBS snapshot.
*
*
* @return A description for the EBS snapshot.
*/
public String getDescription() {
return this.description;
}
/**
*
* A description for the EBS snapshot.
*
*
* @param description
* A description for the EBS snapshot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when
* copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the
* destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or
* within the same Outpost.
*
*
* For more information, see Copy snapshots
* from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*
*
* @param destinationOutpostArn
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter
* when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the
* Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one
* Outpost to another, or within the same Outpost.
*
* For more information, see Copy
* snapshots from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*/
public void setDestinationOutpostArn(String destinationOutpostArn) {
this.destinationOutpostArn = destinationOutpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when
* copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the
* destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or
* within the same Outpost.
*
*
* For more information, see Copy snapshots
* from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*
*
* @return The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter
* when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the
* Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one
* Outpost to another, or within the same Outpost.
*
* For more information, see Copy
* snapshots from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*/
public String getDestinationOutpostArn() {
return this.destinationOutpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter when
* copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the Region for the
* destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one Outpost to another, or
* within the same Outpost.
*
*
* For more information, see Copy snapshots
* from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
*
*
* @param destinationOutpostArn
* The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot. Only specify this parameter
* when copying a snapshot from an Amazon Web Services Region to an Outpost. The snapshot must be in the
* Region for the destination Outpost. You cannot copy a snapshot from an Outpost to a Region, from one
* Outpost to another, or within the same Outpost.
*
* For more information, see Copy
* snapshots from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withDestinationOutpostArn(String destinationOutpostArn) {
setDestinationOutpostArn(destinationOutpostArn);
return this;
}
/**
*
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation. This
* parameter is only valid for specifying the destination Region in a PresignedUrl
parameter, where it
* is required.
*
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
*
*
* @param destinationRegion
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation.
* This parameter is only valid for specifying the destination Region in a PresignedUrl
* parameter, where it is required.
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
*/
public void setDestinationRegion(String destinationRegion) {
this.destinationRegion = destinationRegion;
}
/**
*
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation. This
* parameter is only valid for specifying the destination Region in a PresignedUrl
parameter, where it
* is required.
*
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
*
*
* @return The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation.
* This parameter is only valid for specifying the destination Region in a PresignedUrl
* parameter, where it is required.
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the
* --region
parameter or the default Region in your Amazon Web Services configuration file.
*/
public String getDestinationRegion() {
return this.destinationRegion;
}
/**
*
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation. This
* parameter is only valid for specifying the destination Region in a PresignedUrl
parameter, where it
* is required.
*
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
*
*
* @param destinationRegion
* The destination Region to use in the PresignedUrl
parameter of a snapshot copy operation.
* This parameter is only valid for specifying the destination Region in a PresignedUrl
* parameter, where it is required.
*
* The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example,
* ec2.us-east-1.amazonaws.com
). With the CLI, this is specified using the --region
* parameter or the default Region in your Amazon Web Services configuration file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withDestinationRegion(String destinationRegion) {
setDestinationRegion(destinationRegion);
return this;
}
/**
*
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using
* this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this
* parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information,
* see Amazon EBS encryption in
* the Amazon EBS User Guide.
*
*
* @param encrypted
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption
* using this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit
* this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more
* information, see Amazon EBS
* encryption in the Amazon EBS User Guide.
*/
public void setEncrypted(Boolean encrypted) {
this.encrypted = encrypted;
}
/**
*
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using
* this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this
* parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information,
* see Amazon EBS encryption in
* the Amazon EBS User Guide.
*
*
* @return To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption
* using this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit
* this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more
* information, see Amazon
* EBS encryption in the Amazon EBS User Guide.
*/
public Boolean getEncrypted() {
return this.encrypted;
}
/**
*
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using
* this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this
* parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information,
* see Amazon EBS encryption in
* the Amazon EBS User Guide.
*
*
* @param encrypted
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption
* using this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit
* this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more
* information, see Amazon EBS
* encryption in the Amazon EBS User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withEncrypted(Boolean encrypted) {
setEncrypted(encrypted);
return this;
}
/**
*
* To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using
* this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit this
* parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information,
* see Amazon EBS encryption in
* the Amazon EBS User Guide.
*
*
* @return To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption
* using this parameter. Otherwise, omit this parameter. Encrypted snapshots are encrypted, even if you omit
* this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more
* information, see Amazon
* EBS encryption in the Amazon EBS User Guide.
*/
public Boolean isEncrypted() {
return this.encrypted;
}
/**
*
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key
* for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be true
.
*
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that
* is not valid, the action can appear to complete, but eventually fails.
*
*
* @param kmsKeyId
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your
* KMS key for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be
* true
.
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or
* ARN that is not valid, the action can appear to complete, but eventually fails.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key
* for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be true
.
*
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that
* is not valid, the action can appear to complete, but eventually fails.
*
*
* @return The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your
* KMS key for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be
* true
.
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or
* ARN that is not valid, the action can appear to complete, but eventually fails.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key
* for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be true
.
*
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that
* is not valid, the action can appear to complete, but eventually fails.
*
*
* @param kmsKeyId
* The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your
* KMS key for Amazon EBS is used. If KmsKeyId
is specified, the encrypted state must be
* true
.
*
* You can specify the KMS key using any of the following:
*
*
* -
*
* Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Key alias. For example, alias/ExampleAlias.
*
*
* -
*
* Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
*
*
* -
*
* Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
*
*
*
*
* Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or
* ARN that is not valid, the action can appear to complete, but eventually fails.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This
* parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
action, and
* include the SourceRegion
, SourceSnapshotId
, and DestinationRegion
* parameters. The PresignedUrl
must be signed using Amazon Web Services Signature Version 4. Because
* EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is
* described in
* Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3
* API Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*
*
* @param presignedUrl
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed
* URL. This parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
* action, and include the SourceRegion
, SourceSnapshotId
, and
* DestinationRegion
parameters. The PresignedUrl
must be signed using Amazon Web
* Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for
* this parameter uses the same logic that is described in Authenticating
* Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3 API
* Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*/
public void setPresignedUrl(String presignedUrl) {
this.presignedUrl = presignedUrl;
}
/**
*
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This
* parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
action, and
* include the SourceRegion
, SourceSnapshotId
, and DestinationRegion
* parameters. The PresignedUrl
must be signed using Amazon Web Services Signature Version 4. Because
* EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is
* described in
* Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3
* API Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*
*
* @return When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed
* URL. This parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
* action, and include the SourceRegion
, SourceSnapshotId
, and
* DestinationRegion
parameters. The PresignedUrl
must be signed using Amazon Web
* Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for
* this parameter uses the same logic that is described in Authenticating
* Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3 API
* Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*/
public String getPresignedUrl() {
return this.presignedUrl;
}
/**
*
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This
* parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
action, and
* include the SourceRegion
, SourceSnapshotId
, and DestinationRegion
* parameters. The PresignedUrl
must be signed using Amazon Web Services Signature Version 4. Because
* EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is
* described in
* Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3
* API Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
*
*
* @param presignedUrl
* When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed
* URL. This parameter is optional for unencrypted snapshots. For more information, see Query requests.
*
* The PresignedUrl
should use the snapshot source endpoint, the CopySnapshot
* action, and include the SourceRegion
, SourceSnapshotId
, and
* DestinationRegion
parameters. The PresignedUrl
must be signed using Amazon Web
* Services Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for
* this parameter uses the same logic that is described in Authenticating
* Requests: Using Query Parameters (Amazon Web Services Signature Version 4) in the Amazon S3 API
* Reference. An invalid or improperly signed PresignedUrl
will cause the copy operation to
* fail asynchronously, and the snapshot will move to an error
state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withPresignedUrl(String presignedUrl) {
setPresignedUrl(presignedUrl);
return this;
}
/**
*
* The ID of the Region that contains the snapshot to be copied.
*
*
* @param sourceRegion
* The ID of the Region that contains the snapshot to be copied.
*/
public void setSourceRegion(String sourceRegion) {
this.sourceRegion = sourceRegion;
}
/**
*
* The ID of the Region that contains the snapshot to be copied.
*
*
* @return The ID of the Region that contains the snapshot to be copied.
*/
public String getSourceRegion() {
return this.sourceRegion;
}
/**
*
* The ID of the Region that contains the snapshot to be copied.
*
*
* @param sourceRegion
* The ID of the Region that contains the snapshot to be copied.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withSourceRegion(String sourceRegion) {
setSourceRegion(sourceRegion);
return this;
}
/**
*
* The ID of the EBS snapshot to copy.
*
*
* @param sourceSnapshotId
* The ID of the EBS snapshot to copy.
*/
public void setSourceSnapshotId(String sourceSnapshotId) {
this.sourceSnapshotId = sourceSnapshotId;
}
/**
*
* The ID of the EBS snapshot to copy.
*
*
* @return The ID of the EBS snapshot to copy.
*/
public String getSourceSnapshotId() {
return this.sourceSnapshotId;
}
/**
*
* The ID of the EBS snapshot to copy.
*
*
* @param sourceSnapshotId
* The ID of the EBS snapshot to copy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withSourceSnapshotId(String sourceSnapshotId) {
setSourceSnapshotId(sourceSnapshotId);
return this;
}
/**
*
* The tags to apply to the new snapshot.
*
*
* @return The tags to apply to the new snapshot.
*/
public java.util.List getTagSpecifications() {
if (tagSpecifications == null) {
tagSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return tagSpecifications;
}
/**
*
* The tags to apply to the new snapshot.
*
*
* @param tagSpecifications
* The tags to apply to the new snapshot.
*/
public void setTagSpecifications(java.util.Collection tagSpecifications) {
if (tagSpecifications == null) {
this.tagSpecifications = null;
return;
}
this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(tagSpecifications);
}
/**
*
* The tags to apply to the new snapshot.
*
*
* 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.
*
*
* @param tagSpecifications
* The tags to apply to the new snapshot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withTagSpecifications(TagSpecification... tagSpecifications) {
if (this.tagSpecifications == null) {
setTagSpecifications(new com.amazonaws.internal.SdkInternalList(tagSpecifications.length));
}
for (TagSpecification ele : tagSpecifications) {
this.tagSpecifications.add(ele);
}
return this;
}
/**
*
* The tags to apply to the new snapshot.
*
*
* @param tagSpecifications
* The tags to apply to the new snapshot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopySnapshotRequest withTagSpecifications(java.util.Collection tagSpecifications) {
setTagSpecifications(tagSpecifications);
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 getDryRunRequest() {
Request request = new CopySnapshotRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getDestinationOutpostArn() != null)
sb.append("DestinationOutpostArn: ").append(getDestinationOutpostArn()).append(",");
if (getDestinationRegion() != null)
sb.append("DestinationRegion: ").append(getDestinationRegion()).append(",");
if (getEncrypted() != null)
sb.append("Encrypted: ").append(getEncrypted()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getPresignedUrl() != null)
sb.append("PresignedUrl: ").append("***Sensitive Data Redacted***").append(",");
if (getSourceRegion() != null)
sb.append("SourceRegion: ").append(getSourceRegion()).append(",");
if (getSourceSnapshotId() != null)
sb.append("SourceSnapshotId: ").append(getSourceSnapshotId()).append(",");
if (getTagSpecifications() != null)
sb.append("TagSpecifications: ").append(getTagSpecifications());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CopySnapshotRequest == false)
return false;
CopySnapshotRequest other = (CopySnapshotRequest) obj;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDestinationOutpostArn() == null ^ this.getDestinationOutpostArn() == null)
return false;
if (other.getDestinationOutpostArn() != null && other.getDestinationOutpostArn().equals(this.getDestinationOutpostArn()) == false)
return false;
if (other.getDestinationRegion() == null ^ this.getDestinationRegion() == null)
return false;
if (other.getDestinationRegion() != null && other.getDestinationRegion().equals(this.getDestinationRegion()) == false)
return false;
if (other.getEncrypted() == null ^ this.getEncrypted() == null)
return false;
if (other.getEncrypted() != null && other.getEncrypted().equals(this.getEncrypted()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getPresignedUrl() == null ^ this.getPresignedUrl() == null)
return false;
if (other.getPresignedUrl() != null && other.getPresignedUrl().equals(this.getPresignedUrl()) == false)
return false;
if (other.getSourceRegion() == null ^ this.getSourceRegion() == null)
return false;
if (other.getSourceRegion() != null && other.getSourceRegion().equals(this.getSourceRegion()) == false)
return false;
if (other.getSourceSnapshotId() == null ^ this.getSourceSnapshotId() == null)
return false;
if (other.getSourceSnapshotId() != null && other.getSourceSnapshotId().equals(this.getSourceSnapshotId()) == false)
return false;
if (other.getTagSpecifications() == null ^ this.getTagSpecifications() == null)
return false;
if (other.getTagSpecifications() != null && other.getTagSpecifications().equals(this.getTagSpecifications()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDestinationOutpostArn() == null) ? 0 : getDestinationOutpostArn().hashCode());
hashCode = prime * hashCode + ((getDestinationRegion() == null) ? 0 : getDestinationRegion().hashCode());
hashCode = prime * hashCode + ((getEncrypted() == null) ? 0 : getEncrypted().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getPresignedUrl() == null) ? 0 : getPresignedUrl().hashCode());
hashCode = prime * hashCode + ((getSourceRegion() == null) ? 0 : getSourceRegion().hashCode());
hashCode = prime * hashCode + ((getSourceSnapshotId() == null) ? 0 : getSourceSnapshotId().hashCode());
hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode());
return hashCode;
}
@Override
public CopySnapshotRequest clone() {
return (CopySnapshotRequest) super.clone();
}
}