Package com.amazonaws.services.ec2.model

Examples of com.amazonaws.services.ec2.model.ImportKeyPairRequest

@see com.amazonaws.services.ec2.AmazonEC2#importKeyPair(ImportKeyPairRequest)

            }
        }
    }

    private void importPoolPublicKeyPair(AmazonEC2 client, String keyName, String publicKey) {
        ImportKeyPairResult result = client.importKeyPair(new ImportKeyPairRequest()
            .withKeyName(keyName).withPublicKeyMaterial(publicKey));
        LOG.info("<< Created remote key with fingerprint {}", result.getKeyFingerprint());
    }
View Full Code Here


public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
    public void beforeRequest(Request<?> request) {
        AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
        if (originalRequest instanceof ImportKeyPairRequest) {
            ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
            String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
            String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
            request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
        }

        // Request -> Query string marshalling for RequestSpotInstancesRequest is a little tricky since
View Full Code Here

            Random rnd = new Random();
            String keyPairName = CLOUDBREAK_KEY_NAME + "-" + rnd.nextInt(SUFFIX_RND);
            for (Regions regions : Regions.values()) {
                if (!Regions.CN_NORTH_1.equals(regions) && !Regions.GovCloud.equals(regions)) {
                    AmazonEC2Client client = awsStackUtil.createEC2Client(regions, awsCredential);
                    ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(keyPairName, awsCredential.getPublicKey());
                    client.importKeyPair(importKeyPairRequest);
                }
            }
            awsCredential.setKeyPairName(keyPairName);
        } catch (Exception e) {
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
    public void beforeRequest(Request<?> request) {
        AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
        if (originalRequest instanceof ImportKeyPairRequest) {
            ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
            String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
            String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
            request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
        }

        // Request -> Query string marshalling for RequestSpotInstancesRequest is a little tricky since
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
  public void beforeRequest(Request<?> request) {
      AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
      if (originalRequest instanceof ImportKeyPairRequest) {
        ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
        String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
        String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
        request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
      }

      // Request -> Query string marshalling for RequestSpotInstancesRequest is a little tricky since
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
  public void beforeRequest(Request<?> request) {
      AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
      if (originalRequest instanceof ImportKeyPairRequest) {
        ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
        String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
        String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
        request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
      }
    }
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
  public void beforeRequest(Request<?> request) {
      AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
      if (originalRequest instanceof ImportKeyPairRequest) {
        ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
        String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
        String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
        request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
      }
    }
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
  public void beforeRequest(Request<?> request) {
      AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
      if (originalRequest instanceof ImportKeyPairRequest) {
        ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
        String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
        String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
        request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
      }

      // Request -> Query string marshalling for RequestSpotInstancesRequest is a little tricky since
View Full Code Here

public class EC2RequestHandler extends AbstractRequestHandler {
    @Override
    public void beforeRequest(Request<?> request) {
        AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
        if (originalRequest instanceof ImportKeyPairRequest) {
            ImportKeyPairRequest importKeyPairRequest = (ImportKeyPairRequest)originalRequest;
            String publicKeyMaterial = importKeyPairRequest.getPublicKeyMaterial();
            String encodedKeyMaterial = new String(Base64.encodeBase64(publicKeyMaterial.getBytes()));
            request.addParameter("PublicKeyMaterial", encodedKeyMaterial);
        }

        // Request -> Query string marshalling for RequestSpotInstancesRequest is a little tricky since
View Full Code Here

            }
        }
    }

    private void importPoolPublicKeyPair(AmazonEC2 client, String keyName, String publicKey) {
        ImportKeyPairResult result = client.importKeyPair(new ImportKeyPairRequest()
            .withKeyName(keyName).withPublicKeyMaterial(publicKey));
        LOG.info("<< Created remote key with fingerprint {}", result.getKeyFingerprint());
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.ec2.model.ImportKeyPairRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.