Examples of RegionNameAndPublicKeyMaterial


Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

      // we specify we have a public key we want to use for authentication
      expect(options.getPublicKey()).andReturn("ssh-rsa").times(2);
      expect(options.getLoginPrivateKey()).andReturn(CREDENTIALS.getPrivateKey()).atLeastOnce();

      // Here, we import the keypair and place it into the cache
      expect(strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, "ssh-rsa")))
            .andReturn(KEYPAIR);
      expect(options.dontAuthorizePublicKey()).andReturn(options);
      expect(strategy.credentialsMap.put(new RegionAndName(region, group), KEYPAIR)).andReturn(null);
      expect(options.getRunScript()).andReturn(Statements.exec("echo foo"));
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

            LoginCredentials.builder().user("foo").privateKey(CREDENTIALS.credential).build());
      KeyPair keyPair = new KeyPair(region, group, "//TODO", null, null);

      // setup expectations
      expect(
            strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group,
                  CREDENTIALS.credential))).andReturn(keyPair);
      expect(
            strategy.credentialsMap.put(new RegionAndName(region, group),
                  keyPair.toBuilder().keyMaterial(CREDENTIALS.credential).build())).andReturn(null);
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

      CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions strategy = setupStrategy();

      KeyPair keyPair = new KeyPair(region, "jclouds#" + group, "fingerprint", null, null);

      // setup expectations
      expect(strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, "ssh-rsa")))
            .andReturn(keyPair);
      expect(strategy.credentialsMap.put(new RegionAndName(region, group), keyPair)).andReturn(null);

      // replay mocks
      replayStrategy(strategy);
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

    AWSEC2Client ec2Client = context.unwrap(AWSEC2ApiMetadata.CONTEXT_TOKEN).getApi();

    ImportOrReturnExistingKeypair importer = new ImportOrReturnExistingKeypair(
        ec2Client);

    RegionNameAndPublicKeyMaterial regionNameAndKey = new RegionNameAndPublicKeyMaterial(
        region, keyPairName, publicKey);
    KeyPair keyPair = importer.apply(regionNameAndKey);

    if (keyPair != null) {
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

   @Override
   public String createNewKeyPairUnlessUserSpecifiedOtherwise(String region, String group, TemplateOptions options) {
      RegionAndName key = new RegionAndName(region, group);
      KeyPair pair;
      if (and(hasPublicKeyMaterial, or(doesntNeedSshAfterImportingPublicKey, hasLoginCredential)).apply(options)) {
         pair = importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, options.getPublicKey()));
         options.dontAuthorizePublicKey();
         if (hasLoginCredential.apply(options))
            pair = pair.toBuilder().keyMaterial(options.getLoginPrivateKey()).build();
         credentialsMap.put(key, pair);
      } else {
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

            LoginCredentials.builder().user("foo").privateKey(CREDENTIALS.credential).build());
      KeyPair keyPair = new KeyPair(region, group, "//TODO", null, null);

      // setup expectations
      expect(
            strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group,
                  CREDENTIALS.credential))).andReturn(keyPair);
      expect(
            strategy.credentialsMap.put(new RegionAndName(region, group),
                  keyPair.toBuilder().keyMaterial(CREDENTIALS.credential).build())).andReturn(null);
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

      CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions strategy = setupStrategy();

      KeyPair keyPair = new KeyPair(region, "jclouds#" + group, "fingerprint", null, null);

      // setup expectations
      expect(strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, "ssh-rsa")))
            .andReturn(keyPair);
      expect(strategy.credentialsMap.put(new RegionAndName(region, group), keyPair)).andReturn(null);

      // replay mocks
      replayStrategy(strategy);
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

      // we specify we have a public key we want to use for authentication
      expect(options.getPublicKey()).andReturn("ssh-rsa").times(2);
      expect(options.getLoginPrivateKey()).andReturn(CREDENTIALS.getPrivateKey()).atLeastOnce();

      // Here, we import the keypair and place it into the cache
      expect(strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, "ssh-rsa")))
            .andReturn(KEYPAIR);
      expect(options.dontAuthorizePublicKey()).andReturn(options);
      expect(strategy.credentialsMap.put(new RegionAndName(region, group), KEYPAIR)).andReturn(null);
      expect(options.getRunScript()).andReturn(Statements.exec("echo foo"));
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

      // we specify we have a public key we want to use for authentication
      expect(options.getPublicKey()).andReturn("ssh-rsa").times(2);
      expect(options.getLoginPrivateKey()).andReturn(CREDENTIALS.getPrivateKey()).atLeastOnce();

      // Here, we import the keypair and place it into the cache
      expect(strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group, "ssh-rsa")))
            .andReturn(KEYPAIR);
      expect(options.dontAuthorizePublicKey()).andReturn(options);
      expect(strategy.credentialsMap.put(new RegionAndName(region, group), KEYPAIR)).andReturn(null);
      expect(options.getRunScript()).andReturn(Statements.exec("echo foo"));
View Full Code Here

Examples of org.jclouds.aws.ec2.domain.RegionNameAndPublicKeyMaterial

            LoginCredentials.builder().user("foo").privateKey(CREDENTIALS.credential).build());
      KeyPair keyPair = new KeyPair(region, group, "//TODO", null, null);

      // setup expectations
      expect(
            strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group,
                  CREDENTIALS.credential))).andReturn(keyPair);
      expect(
            strategy.credentialsMap.put(new RegionAndName(region, group),
                  keyPair.toBuilder().keyMaterial(CREDENTIALS.credential).build())).andReturn(null);
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.