Examples of LaunchSpecification


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

public class BindLaunchSpecificationToFormParamsTest {
   BindLaunchSpecificationToFormParams binder = new BindLaunchSpecificationToFormParams();

   @Test
   public void testApplyWithBlockDeviceMappings() throws UnknownHostException {
      LaunchSpecification spec = LaunchSpecification.builder().instanceType(InstanceType.T1_MICRO).imageId("ami-123")
            .mapNewVolumeToDevice("/dev/sda1", 120, true).build();

      assertEquals(binder.apply(spec), ImmutableMap.of("LaunchSpecification.InstanceType", "t1.micro",
            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.BlockDeviceMapping.1.DeviceName",
            "/dev/sda1", "LaunchSpecification.BlockDeviceMapping.1.Ebs.VolumeSize", "120",
View Full Code Here

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

            "LaunchSpecification.BlockDeviceMapping.1.Ebs.DeleteOnTermination", "true"));
   }

   @Test
   public void testApplyWithUserData() throws UnknownHostException {
      LaunchSpecification spec = LaunchSpecification.builder().instanceType(InstanceType.T1_MICRO).imageId("ami-123")
            .userData("hello".getBytes()).build();

      assertEquals(binder.apply(spec), ImmutableMap.of("LaunchSpecification.InstanceType", "t1.micro",
            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.UserData",
            base64().encode("hello".getBytes(UTF_8))));
View Full Code Here

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

            base64().encode("hello".getBytes(UTF_8))));
   }

   @Test
   public void testApplyWithSecurityId() throws UnknownHostException {
      LaunchSpecification spec = LaunchSpecification.builder().instanceType(InstanceType.T1_MICRO).imageId("ami-123")
            .securityGroupId("sid-foo").build();

      assertEquals(binder.apply(spec), ImmutableMap.of("LaunchSpecification.InstanceType", "t1.micro",
            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.SecurityGroupId.1", "sid-foo"));
   }
View Full Code Here

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

            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.SecurityGroupId.1", "sid-foo"));
   }

   @Test
   public void testApplyWithSubnetId() throws UnknownHostException {
      LaunchSpecification spec = LaunchSpecification.builder().instanceType(InstanceType.T1_MICRO).imageId("ami-123")
            .subnetId("subnet-xyz").build();

      assertEquals(binder.apply(spec), ImmutableMap.of("LaunchSpecification.InstanceType", "t1.micro",
            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.SubnetId", "subnet-xyz"));
   }
View Full Code Here

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

            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.SubnetId", "subnet-xyz"));
   }

   @Test
   public void testApplyWithIAMInstanceProfileArn() {
      LaunchSpecification spec = LaunchSpecification.builder()
            .instanceType(InstanceType.T1_MICRO)
            .imageId("ami-123")
            .iamInstanceProfileArn("arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver")
            .build();
View Full Code Here

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

            "arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver"));
   }

   @Test
   public void testApplyWithIAMInstanceProfileName() {
      LaunchSpecification spec = LaunchSpecification.builder().instanceType(InstanceType.T1_MICRO).imageId("ami-123")
            .iamInstanceProfileName("Webserver").build();

      assertEquals(binder.apply(spec), ImmutableMap.of("LaunchSpecification.InstanceType", "t1.micro",
            "LaunchSpecification.ImageId", "ami-123", "LaunchSpecification.IamInstanceProfile.Name", "Webserver"));
   }
View Full Code Here

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

      builder.instanceId(request.getId());
      builder.instanceState(InstanceState.PENDING);
      builder.rawState(request.getRawState());
      builder.region(request.getRegion());
      builder.tags(request.getTags());
      LaunchSpecification spec = request.getLaunchSpecification();
      builder.availabilityZone(spec.getAvailabilityZone());
      // TODO convert
      // builder.devices(spec.getBlockDeviceMappings());
      builder.groupNames(spec.getSecurityGroupNames());
      builder.imageId(spec.getImageId());
      builder.instanceType(spec.getInstanceType());
      builder.kernelId(spec.getKernelId());
      builder.keyName(spec.getKeyName());
      builder.ramdiskId(spec.getRamdiskId());
      builder.monitoringState(Boolean.TRUE.equals(spec.isMonitoringEnabled()) ? MonitoringState.PENDING
               : MonitoringState.DISABLED);
      //TODO: determine the exact hypervisor
      builder.hypervisor(Hypervisor.XEN);
      return builder.build();
   }
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.