Package org.jclouds.ec2.domain

Examples of org.jclouds.ec2.domain.BlockDevice


               .privateIpAddress("10.212.81.7")
               .ipAddress("174.129.173.155")
               .securityGroupIdToNames(ImmutableMap.<String, String> of("sg-ef052b86", "jclouds#zkclustertest"))
               .rootDeviceType(RootDeviceType.EBS)
               .rootDeviceName("/dev/sda1")
               .device("/dev/sda1", new BlockDevice("vol-5829fc32", Attachment.Status.ATTACHED, dateService.iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
               .virtualizationType("paravirtual")
               .tag("Name", "foo")
               .tag("Empty", "")
               .hypervisor(Hypervisor.XEN)
               .build(),//
               new AWSRunningInstance.Builder()
                        .region(defaultRegion)
                        .instanceId("i-931444f2")
                        .imageId("ami-63be790a")
                        .instanceState(InstanceState.RUNNING)
                        .rawState("running")
                        .privateDnsName("ip-10-212-185-8.ec2.internal")
                        .dnsName("ec2-50-19-207-248.compute-1.amazonaws.com")
                        .keyName("jclouds#zkclustertest#23")
                        .amiLaunchIndex("0")
                        .instanceType("t1.micro")
                        .launchTime(dateService.iso8601DateParse("2011-08-16T13:40:50.000Z"))
                        .availabilityZone("us-east-1c")
                        .kernelId("aki-427d952b")
                        .monitoringState(MonitoringState.DISABLED)
                        .privateIpAddress("10.212.185.8")
                        .ipAddress("50.19.207.248")
                        .securityGroupIdToNames(ImmutableMap.<String, String>of("sg-ef052b86", "jclouds#zkclustertest"))
                        .rootDeviceType(RootDeviceType.EBS)
                        .rootDeviceName("/dev/sda1")
                        .device("/dev/sda1", new BlockDevice("vol-5029fc3a", Attachment.Status.ATTACHED, dateService.iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
                        .virtualizationType("paravirtual")
                        .hypervisor(Hypervisor.XEN)
                        .build());

      assertEquals(
View Full Code Here


                        .tag("Empty", "")
                        .rootDeviceType(RootDeviceType.EBS)
                        .rootDeviceName("/dev/sda1")
                        .device(
                              "/dev/sda1",
                              new BlockDevice("vol-5829fc32", Attachment.Status.ATTACHED, dateService
                                    .iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
                        .hypervisor(Hypervisor.XEN)
                        .virtualizationType("paravirtual").build())
               .instance(AWSRunningInstance.builder()
                        .region(defaultRegion)
                        .instanceId("i-931444f2")
                        .imageId("ami-63be790a")
                        .instanceState(InstanceState.RUNNING)
                        .rawState("running")
                        .privateDnsName("ip-10-212-185-8.ec2.internal")
                        .dnsName("ec2-50-19-207-248.compute-1.amazonaws.com")
                        .keyName("jclouds#zkclustertest#us-east-1#23")
                        .amiLaunchIndex("0")
                        .instanceType("t1.micro")
                        .launchTime(dateService.iso8601DateParse("2011-08-16T13:40:50.000Z"))
                        .availabilityZone("us-east-1c")
                        .kernelId("aki-427d952b")
                        .monitoringState(MonitoringState.DISABLED)
                        .privateIpAddress("10.212.185.8")
                        .ipAddress("50.19.207.248")
                        .securityGroupIdToNames(
                              ImmutableMap.<String, String> of("sg-ef052b86", "jclouds#zkclustertest#us-east-1"))
                        .rootDeviceType(RootDeviceType.EBS)
                        .rootDeviceName("/dev/sda1")
                        .device(
                              "/dev/sda1",
                              new BlockDevice("vol-5029fc3a", Attachment.Status.ATTACHED, dateService
                                    .iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
                        .hypervisor(Hypervisor.XEN)
                        .virtualizationType("paravirtual")
                        .iamInstanceProfileArn("arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver")
                        .iamInstanceProfileId("AIPAD5ARO2C5EXAMPLE3G")
View Full Code Here

         IOException {
      Invokable<?, ?> method = method(AWSInstanceApi.class, "setBlockDeviceMappingForInstanceInRegion", String.class,
            String.class, Map.class);

      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("/dev/sda1", new BlockDevice("vol-test1", true));
      GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "1", mapping));

      request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request);

      assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
View Full Code Here

     
      assertEquals(response.size(), 3);

      Reservation<? extends RunningInstance> target = Iterables.get(response, 2);
      RunningInstance runningInstance = Iterables.getOnlyElement(target);
      BlockDevice bd = Iterables.getOnlyElement(runningInstance.getEbsBlockDevices().values());
     
      // this is a '-' in the nova_ec2_describe_instances.xml
      assertNull(bd.getAttachTime());

      // double-check the other fields
      assertFalse(bd.isDeleteOnTermination());
      assertEquals(bd.getVolumeId(), "1");
   }
View Full Code Here

        
         assertTrue(runningTester.apply(instance), instanceId + "didn't achieve the state running!");

         instance = getOnlyElement(concat(ec2Api.getInstanceApi().get().describeInstancesInRegion(regionId,
               instanceId)));
         BlockDevice device = instance.getEbsBlockDevices().get("/dev/sda1");
         assertNotNull(device, "device: /dev/sda1 not present on: " + instance);
         Snapshot snapshot = ec2Api.getElasticBlockStoreApi().get().createSnapshotInRegion(regionId,
               device.getVolumeId());
         snapshotsToDelete.add(snapshot.getId());
         return snapshot;
      } finally {
         if (instanceId != null)
            ec2Api.getInstanceApi().get().terminateInstancesInRegion(regionId, instanceId);
View Full Code Here

      } else if (qName.equals("status")) {
         attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim());
      } else if (qName.equals("attachTime")) {
         attachTime = dateCodec.toDate(currentText.toString().trim());
      } else if (qName.equals("item")) {
         ebsBlockDevices.put(deviceName, new BlockDevice(volumeId, attachmentStatus, attachTime, deleteOnTermination));
          this.volumeId = null;
          this.deviceName = null;
          this.deleteOnTermination = true;
          this.attachmentStatus = null;
          this.attachTime = null;
View Full Code Here

      } else if (equalsOrSuffix(qName, "attachTime")) {
         attachTime = dateCodec.toDate(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "deleteOnTermination")) {
         deleteOnTermination = Boolean.parseBoolean(currentText.toString().trim());
      } else if (equalsOrSuffix(qName, "ebs")) {
         builder.device(deviceName, new BlockDevice(volumeId, attachmentStatus, attachTime, deleteOnTermination));
         this.deviceName = null;
         this.volumeId = null;
         this.attachmentStatus = null;
         this.attachTime = null;
         this.deleteOnTermination = true;
View Full Code Here

      } else if (equalsOrSuffix(qName, "attachTime")) {
         attachTime = dateCodec.toDate(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "deleteOnTermination")) {
         deleteOnTermination = Boolean.parseBoolean(currentText.toString().trim());
      } else if (equalsOrSuffix(qName, "ebs")) {
         builder.device(deviceName, new BlockDevice(volumeId, attachmentStatus, attachTime, deleteOnTermination));
         this.deviceName = null;
         this.volumeId = null;
         this.attachmentStatus = null;
         this.attachTime = null;
         this.deleteOnTermination = true;
View Full Code Here

         IOException {
      Invokable<?, ?> method = method(AWSInstanceAsyncClient.class, "setBlockDeviceMappingForInstanceInRegion", String.class,
            String.class, Map.class);

      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("/dev/sda1", new BlockDevice("vol-test1", true));
      GeneratedHttpRequest request = processor.createRequest(method, Lists.<Object> newArrayList(null, "1", mapping));

      request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request);

      assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
View Full Code Here

                        .tag("Empty", "")
                        .rootDeviceType(RootDeviceType.EBS)
                        .rootDeviceName("/dev/sda1")
                        .device(
                              "/dev/sda1",
                              new BlockDevice("vol-5829fc32", Attachment.Status.ATTACHED, dateService
                                    .iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
                        .hypervisor(Hypervisor.XEN)
                        .virtualizationType("paravirtual").build())
               .instance(AWSRunningInstance.builder()
                        .region(defaultRegion)
                        .instanceId("i-931444f2")
                        .imageId("ami-63be790a")
                        .instanceState(InstanceState.RUNNING)
                        .rawState("running")
                        .privateDnsName("ip-10-212-185-8.ec2.internal")
                        .dnsName("ec2-50-19-207-248.compute-1.amazonaws.com")
                        .keyName("jclouds#zkclustertest#us-east-1#23")
                        .amiLaunchIndex("0")
                        .instanceType("t1.micro")
                        .launchTime(dateService.iso8601DateParse("2011-08-16T13:40:50.000Z"))
                        .availabilityZone("us-east-1c")
                        .kernelId("aki-427d952b")
                        .monitoringState(MonitoringState.DISABLED)
                        .privateIpAddress("10.212.185.8")
                        .ipAddress("50.19.207.248")
                        .securityGroupIdToNames(
                              ImmutableMap.<String, String> of("sg-ef052b86", "jclouds#zkclustertest#us-east-1"))
                        .rootDeviceType(RootDeviceType.EBS)
                        .rootDeviceName("/dev/sda1")
                        .device(
                              "/dev/sda1",
                              new BlockDevice("vol-5029fc3a", Attachment.Status.ATTACHED, dateService
                                    .iso8601DateParse("2011-08-16T13:41:19.000Z"), true))
                        .hypervisor(Hypervisor.XEN)
                        .virtualizationType("paravirtual")
                        .iamInstanceProfileArn("arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver")
                        .iamInstanceProfileId("AIPAD5ARO2C5EXAMPLE3G")
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.domain.BlockDevice

Copyright © 2018 www.massapicom. 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.