com.amazonaws.services.ec2.model
Class ImportKeyPairRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.ec2.model.ImportKeyPairRequest
All Implemented Interfaces:
DryRunSupportedRequest<ImportKeyPairRequest>, java.io.Serializable

public class ImportKeyPairRequest
extends AmazonWebServiceRequest
implements java.io.Serializable, DryRunSupportedRequest<ImportKeyPairRequest>

Container for the parameters to the ImportKeyPair operation.

Imports the public key from an RSA key pair that you created with a third-party tool. Compare this with CreateKeyPair, in which AWS creates the key pair and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, you create the key pair and give AWS just the public key. The private key is never transferred between you and AWS.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

See Also:
AmazonEC2.importKeyPair(ImportKeyPairRequest), Serialized Form

Constructor Summary
ImportKeyPairRequest()
          Default constructor for a new ImportKeyPairRequest object.
ImportKeyPairRequest(java.lang.String keyName, java.lang.String publicKeyMaterial)
          Constructs a new ImportKeyPairRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Request<ImportKeyPairRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getKeyName()
          A unique name for the key pair.
 java.lang.String getPublicKeyMaterial()
          The public key.
 int hashCode()
           
 void setKeyName(java.lang.String keyName)
          A unique name for the key pair.
 void setPublicKeyMaterial(java.lang.String publicKeyMaterial)
          The public key.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 ImportKeyPairRequest withKeyName(java.lang.String keyName)
          A unique name for the key pair.
 ImportKeyPairRequest withPublicKeyMaterial(java.lang.String publicKeyMaterial)
          The public key.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImportKeyPairRequest

public ImportKeyPairRequest()
Default constructor for a new ImportKeyPairRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


ImportKeyPairRequest

public ImportKeyPairRequest(java.lang.String keyName,
                            java.lang.String publicKeyMaterial)
Constructs a new ImportKeyPairRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
keyName - A unique name for the key pair.
publicKeyMaterial - The public key. You must base64 encode the public key material before sending it to AWS.
Method Detail

getKeyName

public java.lang.String getKeyName()
A unique name for the key pair.

Returns:
A unique name for the key pair.

setKeyName

public void setKeyName(java.lang.String keyName)
A unique name for the key pair.

Parameters:
keyName - A unique name for the key pair.

withKeyName

public ImportKeyPairRequest withKeyName(java.lang.String keyName)
A unique name for the key pair.

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

Parameters:
keyName - A unique name for the key pair.
Returns:
A reference to this updated object so that method calls can be chained together.

getPublicKeyMaterial

public java.lang.String getPublicKeyMaterial()
The public key. You must base64 encode the public key material before sending it to AWS.

Returns:
The public key. You must base64 encode the public key material before sending it to AWS.

setPublicKeyMaterial

public void setPublicKeyMaterial(java.lang.String publicKeyMaterial)
The public key. You must base64 encode the public key material before sending it to AWS.

Parameters:
publicKeyMaterial - The public key. You must base64 encode the public key material before sending it to AWS.

withPublicKeyMaterial

public ImportKeyPairRequest withPublicKeyMaterial(java.lang.String publicKeyMaterial)
The public key. You must base64 encode the public key material before sending it to AWS.

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

Parameters:
publicKeyMaterial - The public key. You must base64 encode the public key material before sending it to AWS.
Returns:
A reference to this updated object so that method calls can be chained together.

getDryRunRequest

public Request<ImportKeyPairRequest> getDryRunRequest()
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.

Specified by:
getDryRunRequest in interface DryRunSupportedRequest<ImportKeyPairRequest>

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.