Example usage for com.amazonaws.services.ec2.model CreateKeyPairResult CreateKeyPairResult

List of usage examples for com.amazonaws.services.ec2.model CreateKeyPairResult CreateKeyPairResult

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model CreateKeyPairResult CreateKeyPairResult.

Prototype

CreateKeyPairResult

Source Link

Usage

From source file:jp.primecloud.auto.aws.typica.EucaEc2Client.java

License:Open Source License

@Override
public CreateKeyPairResult createKeyPair(CreateKeyPairRequest createKeyPairRequest) {
    try {//from  ww  w .  ja v  a 2s.  c  o  m
        com.xerox.amazonws.ec2.KeyPairInfo info = jec2.createKeyPair(createKeyPairRequest.getKeyName());
        KeyPair keyPair = new KeyPairConverter().convert(info);
        return new CreateKeyPairResult().withKeyPair(keyPair);
    } catch (EC2Exception e) {
        throw new AmazonClientException(e);
    }
}