public class CreateKeyPairRequest extends AmazonWebServiceRequest implements java.io.Serializable, DryRunSupportedRequest<CreateKeyPairRequest>
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.
The key pair returned to you is available only in the region in which you create it. To create a key pair that is available in all regions, use ImportKeyPair.
For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .
Constructor and Description |
---|
CreateKeyPairRequest()
Default constructor for a new CreateKeyPairRequest object.
|
CreateKeyPairRequest(java.lang.String keyName)
Constructs a new CreateKeyPairRequest object.
|
Modifier and Type | Method and Description |
---|---|
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.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public CreateKeyPairRequest()
public CreateKeyPairRequest(java.lang.String keyName)
keyName
- A unique name for the key pair. Constraints: Up to 255 ASCII characters
public java.lang.String getKeyName()
Constraints: Up to 255 ASCII characters
Constraints: Up to 255 ASCII characters
public void setKeyName(java.lang.String keyName)
Constraints: Up to 255 ASCII characters
keyName
- A unique name for the key pair. Constraints: Up to 255 ASCII characters
public CreateKeyPairRequest withKeyName(java.lang.String keyName)
Constraints: Up to 255 ASCII characters
Returns a reference to this object so that method calls can be chained together.
keyName
- A unique name for the key pair. Constraints: Up to 255 ASCII characters
public Request<CreateKeyPairRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<CreateKeyPairRequest>
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.