com.amazonaws.services.ec2.model
Class CreateKeyPairRequest

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

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

Container for the parameters to the CreateKeyPair operation.

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per region.

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

See Also:
AmazonEC2.createKeyPair(CreateKeyPairRequest), Serialized Form

Constructor Summary
CreateKeyPairRequest()
          Default constructor for a new CreateKeyPairRequest object.
CreateKeyPairRequest(java.lang.String keyName)
          Constructs a new CreateKeyPairRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Request<CreateKeyPairRequest> getDryRunRequest()
          This method is intended for internal use only.
 java.lang.String getKeyName()
          A unique name for the key pair.
 int hashCode()
           
 void setKeyName(java.lang.String keyName)
          A unique name for the key pair.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 CreateKeyPairRequest withKeyName(java.lang.String keyName)
          A unique name for the key pair.
 
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

CreateKeyPairRequest

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


CreateKeyPairRequest

public CreateKeyPairRequest(java.lang.String keyName)
Constructs a new CreateKeyPairRequest 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.
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 CreateKeyPairRequest 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.

getDryRunRequest

public Request<CreateKeyPairRequest> 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<CreateKeyPairRequest>

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.