Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 
 
Container for the parameters to the CopySnapshot operation.

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same region or from one region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.

Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted.

NOTE: Copying snapshots that were encrypted with non-default AWS Key Management Service (KMS) master keys is not supported at this time.

For more information, see Copying an Amazon EBS Snapshot in the Amazon Elastic Compute Cloud User Guide .

 
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;

    
A description for the EBS snapshot.
 
     private String description;

    
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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

 
     private String destinationRegion;

    
The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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.

Returns:
The ID of the region that contains the snapshot to be copied.
    public String getSourceRegion() {
        return ;
    }
    
    
The ID of the region that contains the snapshot to be copied.

Parameters:
sourceRegion The ID of the region that contains the snapshot to be copied.
    public void setSourceRegion(String sourceRegion) {
        this. = sourceRegion;
    }
    
    
The ID of the region that contains the snapshot to be copied.

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

Parameters:
sourceRegion The ID of the region that contains the snapshot to be copied.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withSourceRegion(String sourceRegion) {
        this. = sourceRegion;
        return this;
    }

    
The ID of the EBS snapshot to copy.

Returns:
The ID of the EBS snapshot to copy.
    public String getSourceSnapshotId() {
        return ;
    }
    
    
The ID of the EBS snapshot to copy.

Parameters:
sourceSnapshotId The ID of the EBS snapshot to copy.
    public void setSourceSnapshotId(String sourceSnapshotId) {
        this. = sourceSnapshotId;
    }
    
    
The ID of the EBS snapshot to copy.

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

Parameters:
sourceSnapshotId The ID of the EBS snapshot to copy.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withSourceSnapshotId(String sourceSnapshotId) {
        this. = sourceSnapshotId;
        return this;
    }

    
A description for the EBS snapshot.

Returns:
A description for the EBS snapshot.
    public String getDescription() {
        return ;
    }
    
    
A description for the EBS snapshot.

Parameters:
description A description for the EBS snapshot.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description for the EBS snapshot.

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

Parameters:
description A description for the EBS snapshot.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withDescription(String description) {
        this. = description;
        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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

Returns:
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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

    public String getDestinationRegion() {
        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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

Parameters:
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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

    public void setDestinationRegion(String destinationRegion) {
        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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

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

Parameters:
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. <note>

CopySnapshot sends the snapshot copy to the regional endpoint that you send the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, this is specified with the --region parameter or the default region in your AWS configuration file). </note>

Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withDestinationRegion(String destinationRegion) {
        this. = destinationRegion;
        return this;
    }

    
The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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.

Returns:
The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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 ;
    }
    
    
The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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.

Parameters:
presignedUrl The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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;
    }
    
    
The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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.

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

Parameters:
presignedUrl The pre-signed URL that facilitates copying an encrypted snapshot. This parameter is only required when copying an encrypted snapshot with the Amazon EC2 Query API; it is available as an optional parameter in all other cases. 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 AWS 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 by Using Query Parameters (AWS Signature Version 4) in the Amazon Simple Storage Service 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.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CopySnapshotRequest withPresignedUrl(String presignedUrl) {
        this. = presignedUrl;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<CopySnapshotRequestrequest = new CopySnapshotRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSourceRegion() != nullsb.append("SourceRegion: " + getSourceRegion() + ",");
        if (getSourceSnapshotId() != nullsb.append("SourceSnapshotId: " + getSourceSnapshotId() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getDestinationRegion() != nullsb.append("DestinationRegion: " + getDestinationRegion() + ",");
        if (getPresignedUrl() != nullsb.append("PresignedUrl: " + getPresignedUrl() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceRegion() == null) ? 0 : getSourceRegion().hashCode()); 
        hashCode = prime * hashCode + ((getSourceSnapshotId() == null) ? 0 : getSourceSnapshotId().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getDestinationRegion() == null) ? 0 : getDestinationRegion().hashCode()); 
        hashCode = prime * hashCode + ((getPresignedUrl() == null) ? 0 : getPresignedUrl().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CopySnapshotRequest == falsereturn false;
        CopySnapshotRequest other = (CopySnapshotRequest)obj;
        
        if (other.getSourceRegion() == null ^ this.getSourceRegion() == nullreturn false;
        if (other.getSourceRegion() != null && other.getSourceRegion().equals(this.getSourceRegion()) == falsereturn false
        if (other.getSourceSnapshotId() == null ^ this.getSourceSnapshotId() == nullreturn false;
        if (other.getSourceSnapshotId() != null && other.getSourceSnapshotId().equals(this.getSourceSnapshotId()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getDestinationRegion() == null ^ this.getDestinationRegion() == nullreturn false;
        if (other.getDestinationRegion() != null && other.getDestinationRegion().equals(this.getDestinationRegion()) == falsereturn false
        if (other.getPresignedUrl() == null ^ this.getPresignedUrl() == nullreturn false;
        if (other.getPresignedUrl() != null && other.getPresignedUrl().equals(this.getPresignedUrl()) == falsereturn false
        return true;
    }
    
    @Override
    public CopySnapshotRequest clone() {
        
            return (CopySnapshotRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X