Package com.amazonaws.services.ec2.model

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


            ec2.describeKeyPairs(describeKeyPairsRequest.withKeyNames(keyPairName));

            /* If key exists and new key is created, delete old key and replace
             * with new one. Else, do nothing */
            if (newKey) {
                DeleteKeyPairRequest deleteKeyPairRequest = new DeleteKeyPairRequest(keyPairName);
                ec2.deleteKeyPair(deleteKeyPairRequest);
                ImportKeyPairRequest importKeyPairRequest = new ImportKeyPairRequest(keyPairName, encodedPublicKey);
                ec2.importKeyPair(importKeyPairRequest);
            }

View Full Code Here


    {
        if (builtKeyPair)
        {
            log.info("Deleting key pair \"" + name + "\"");

            ec2Client.deleteKeyPair(new DeleteKeyPairRequest().
                    withKeyName(name));

            try
            {
                File file = new File(filename);
View Full Code Here

            .withPublicKeyMaterial(getResourceAsString("/org/apache/provisionr/test/id_rsa_test.pub")));
    }

    @Override
    public void tearDown() throws Exception {
        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(KEYPAIR_NAME));
        super.tearDown();
    }
View Full Code Here

    private final String KEYPAIR_NAME = KeyPairs.formatNameFromBusinessKey(BUSINESS_KEY);

    @Override
    public void tearDown() throws Exception {
        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(KEYPAIR_NAME));
        super.tearDown();
    }
View Full Code Here

        } catch (AmazonServiceException e) {
            if (e.getErrorCode().equals(ErrorCodes.DUPLICATE_KEYPAIR)) {
                LOG.info("<< Duplicate key pair found. Re-importing from pool description");

                client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
                importPoolPublicKeyPair(client, keyName, publicKey);
            }
        }
    }
View Full Code Here

    @Override
    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
        String keyName = KeyPairs.formatNameFromBusinessKey(execution.getProcessBusinessKey());

        LOG.info(">> Deleting key pair {}", keyName);
        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
    }
View Full Code Here

        delete((ResultCapture<Void>)null);
    }

    @Override
    public void delete(ResultCapture<Void> extractor) {
        DeleteKeyPairRequest request = new DeleteKeyPairRequest();
        delete(request, extractor);
    }
View Full Code Here

    @Override
    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
        String keyName = KeyPairs.formatNameFromBusinessKey(execution.getProcessBusinessKey());

        LOG.info(">> Deleting key pair {}", keyName);
        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
    }
View Full Code Here

        } catch (AmazonServiceException e) {
            if (e.getErrorCode().equals(ErrorCodes.DUPLICATE_KEYPAIR)) {
                LOG.info("<< Duplicate key pair found. Re-importing from pool description");

                client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
                importPoolPublicKeyPair(client, keyName, publicKey);
            }
        }
    }
View Full Code Here

            .withPublicKeyMaterial(getResourceAsString("keys/test.pub")));
    }

    @Override
    public void tearDown() throws Exception {
        client.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(KEYPAIR_NAME));
        super.tearDown();
    }
View Full Code Here

TOP

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

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.