Examples of DescribeKeyPairsResult


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

   *
   * @return list of keypairs
   */
  public static List<String> loadKeypairs(){
    List<String> resultList = new ArrayList<String>();
    DescribeKeyPairsResult results = getEC2Client().describeKeyPairs();
    for (KeyPairInfo key : results.getKeyPairs()) {
      resultList.add(key.getKeyName());
    }
    return resultList;
  }
View Full Code Here

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

     *
     * @return list of keypairs
     */
    public static List<String> loadKeypairs() {
        List<String> resultList = new ArrayList<String>();
        DescribeKeyPairsResult results = getEC2Client().describeKeyPairs();
        for (KeyPairInfo key : results.getKeyPairs()) {
            resultList.add(key.getKeyName());
        }
        return resultList;
    }
View Full Code Here

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

     *
     * @return list of keypairs
     */
    public static List<String> loadKeypairs() {
        List<String> resultList = new ArrayList<String>();
        DescribeKeyPairsResult results = getEC2Client().describeKeyPairs();
        for (KeyPairInfo key : results.getKeyPairs()) {
            resultList.add(key.getKeyName());
        }
        return resultList;
    }
View Full Code Here

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

    }

    public void assertKeyNotFound(String keyName) {
        final DescribeKeyPairsRequest request = new DescribeKeyPairsRequest().withKeyNames(keyName);
        try {
            DescribeKeyPairsResult result = client.describeKeyPairs(request);
            fail("Found key " + result.getKeyPairs().get(0));

        } catch (AmazonServiceException e) {
            assertThat(e.getErrorCode()).isEqualTo(ErrorCodes.KEYPAIR_NOT_FOUND);
        }
    }
View Full Code Here

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

        assertKeyPairWasImportedAsExpected();
    }

    private void assertKeyPairWasImportedAsExpected() {
        final DescribeKeyPairsRequest request = new DescribeKeyPairsRequest().withKeyNames(KEYPAIR_NAME);
        DescribeKeyPairsResult result = client.describeKeyPairs(request);

        assertThat(result.getKeyPairs()).hasSize(1);
        assertThat(result.getKeyPairs().get(0).getKeyFingerprint()).isEqualTo(TEST_KEY_FINGERPRINT);
    }
View Full Code Here

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

    }

    public void assertKeyNotFound(String keyName) {
        final DescribeKeyPairsRequest request = new DescribeKeyPairsRequest().withKeyNames(keyName);
        try {
            DescribeKeyPairsResult result = client.describeKeyPairs(request);
            fail("Found key " + result.getKeyPairs().get(0));

        } catch (AmazonServiceException e) {
            assertThat(e.getErrorCode()).isEqualTo(ErrorCodes.KEYPAIR_NOT_FOUND);
        }
    }
View Full Code Here

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

        assertKeyPairWasImportedAsExpected();
    }

    private void assertKeyPairWasImportedAsExpected() {
        final DescribeKeyPairsRequest request = new DescribeKeyPairsRequest().withKeyNames(KEYPAIR_NAME);
        DescribeKeyPairsResult result = client.describeKeyPairs(request);

        assertThat(result.getKeyPairs()).hasSize(1);
        assertThat(result.getKeyPairs().get(0).getKeyFingerprint()).isEqualTo(TEST_KEY_FINGERPRINT);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.