Package org.jclouds.ec2.compute.functions

Examples of org.jclouds.ec2.compute.functions.WindowsLoginCredentialsFromEncryptedData.apply()


      Image image = createNiceMock(Image.class);
      Set<? extends org.jclouds.ec2.domain.Image> images = ImmutableSet.<org.jclouds.ec2.domain.Image> of(ec2Image);

      expect(caller.getAMIApi()).andReturn((Optional) Optional.of(client)).atLeastOnce();
      expect(client.describeImagesInRegion("region", imageIds("ami"))).andReturn(Set.class.cast(images));
      expect(parser.apply(ec2Image)).andThrow(new ResourceNotFoundException());

      replay(caller);
      replay(image);
      replay(parser);
      replay(client);
View Full Code Here


      Image image = createNiceMock(Image.class);
      Set<? extends org.jclouds.ec2.domain.Image> images = ImmutableSet.<org.jclouds.ec2.domain.Image> of(ec2Image);

      expect(caller.getAMIApi()).andReturn((Optional) Optional.of(client)).atLeastOnce();
      expect(client.describeImagesInRegion("region", imageIds("ami"))).andReturn(Set.class.cast(images));
      expect(parser.apply(ec2Image)).andThrow(new NoSuchElementException());

      replay(caller);
      replay(image);
      replay(parser);
      replay(client);
View Full Code Here

                      .tenantIdGroupNamePair("ownerId", "sg-123456")
                      .build());
     
      client.createSecurityGroupInRegion("region", "group", "group");
      expect(group.getOwnerId()).andReturn("ownerId");
      expect(groupIdFromName.apply("region/group")).andReturn("sg-123456");
      client.authorizeSecurityGroupIngressInRegion("region", "sg-123456", permissions.build());
      expect(client.describeSecurityGroupsInRegion("region", "group")).andReturn(Set.class.cast(groups));


      replay(client);
View Full Code Here

                      .tenantIdGroupNamePair("ownerId", "sg-123456")
                      .build());
     
      client.createSecurityGroupInRegion("region", "group", "group");
      expect(group.getOwnerId()).andReturn("ownerId");
      expect(groupIdFromName.apply("region/group")).andReturn("sg-123456");
      client.authorizeSecurityGroupIngressInRegion("region", "sg-123456", permissions.build());
      expect(client.describeSecurityGroupsInRegion("region", "group")).andReturn(Set.class.cast(groups));


      replay(client);
View Full Code Here

      // Now we can get the password data, decrypt it, and get a LoginCredentials instance
      PasswordDataAndPrivateKey dataAndKey = new PasswordDataAndPrivateKey(
         ec2Client.getWindowsServices().getPasswordDataInRegion(region, node.getProviderId()),
         node.getCredentials().getPrivateKey());
      WindowsLoginCredentialsFromEncryptedData f = context.getUtils().getInjector().getInstance(WindowsLoginCredentialsFromEncryptedData.class);
      LoginCredentials credentials = f.apply(dataAndKey);

      // Send to the log the details you need to log in to the instance with RDP
      String publicIp = Iterables.getFirst(node.getPublicAddresses(), null);
      logger.info("IP address: %s", publicIp);
      logger.info("Login name: %s", credentials.getUser());
View Full Code Here

      // Now we can get the password data, decrypt it, and get a LoginCredentials instance
      PasswordDataAndPrivateKey dataAndKey = new PasswordDataAndPrivateKey(
         ec2Client.getWindowsServices().getPasswordDataInRegion(region, node.getProviderId()),
         node.getCredentials().getPrivateKey());
      WindowsLoginCredentialsFromEncryptedData f = context.getUtils().getInjector().getInstance(WindowsLoginCredentialsFromEncryptedData.class);
      LoginCredentials credentials = f.apply(dataAndKey);

      // Send to the log the details you need to log in to the instance with RDP
      String publicIp = Iterables.getFirst(node.getPublicAddresses(), null);
      logger.info("IP address: %s", publicIp);
      logger.info("Login name: %s", credentials.getUser());
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.