Examples of importKeyPairInRegion()


Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

    ComputeServiceContext context = iaasInfo.getComputeService()
        .getContext();
   
    AWSKeyPairApi keyPairApi = context.unwrapApi(AWSEC2Api.class).getKeyPairApiForRegion(region).get();

    KeyPair keyPair = keyPairApi.importKeyPairInRegion(region, keyPairName, publicKey);
   
    if (keyPair != null) {

      iaasInfo.getTemplate().getOptions().as(AWSEC2TemplateOptions.class)
          .keyPair(keyPair.getKeyName());
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andReturn(pair);

      replay(client);
      replay(keyApi);

      ImportOrReturnExistingKeypair parser = new ImportOrReturnExistingKeypair(client);
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.of(pair));

      replay(client);
      replay(keyApi);
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of());
      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of(pair));
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of());
      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of(pair));

      replay(client);
      replay(keyApi);
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andReturn(pair);

      replay(client);
      replay(keyApi);

      ImportOrReturnExistingKeypair parser = new ImportOrReturnExistingKeypair(client);
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.of(pair));

      replay(client);
      replay(keyApi);
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      AWSEC2Api client = createMock(AWSEC2Api.class);
      AWSKeyPairApi keyApi = createMock(AWSKeyPairApi.class);

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of());
      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of(pair));
View Full Code Here

Examples of org.jclouds.aws.ec2.features.AWSKeyPairApi.importKeyPairInRegion()

      expect(client.getKeyPairApi()).andReturn((Optional) Optional.of(keyApi)).atLeastOnce();

      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of());
      expect(keyApi.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andThrow(
               new IllegalStateException());
      expect(keyApi.describeKeyPairsInRegion("region", "jclouds#group")).andReturn(ImmutableSet.<KeyPair> of(pair));

      replay(client);
      replay(keyApi);
View Full Code Here

Examples of org.jclouds.aws.ec2.services.AWSKeyPairClient.importKeyPairInRegion()

      AWSEC2Client client = createMock(AWSEC2Client.class);
      AWSKeyPairClient keyClient = createMock(AWSKeyPairClient.class);

      expect(client.getKeyPairServices()).andReturn(keyClient).atLeastOnce();

      expect(keyClient.importKeyPairInRegion("region", "jclouds#group", PUBLIC_KEY)).andReturn(pair);

      replay(client);
      replay(keyClient);

      ImportOrReturnExistingKeypair parser = new ImportOrReturnExistingKeypair(client);
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.