Package org.jclouds.ec2.domain

Examples of org.jclouds.ec2.domain.BlockDevice


      } 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 (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

      InputStream is = getClass().getResourceAsStream(
               "/describe_image_attribute_blockDeviceMapping.xml");

      DateService dateService = injector.getInstance(DateService.class);
      Map<String, BlockDevice> expected = ImmutableMap.<String, BlockDevice> of("/dev/sda1",
               new BlockDevice("vol-d74b82be", Attachment.Status.ATTACHED, dateService
                        .iso8601DateParse("2010-02-20T18:25:26.000Z"), true), "/dev/sdf",
               new BlockDevice("vol-another", Attachment.Status.DETACHED, dateService
                        .iso8601DateParse("2010-02-20T19:26:26.000Z"), false));

      Map<String, BlockDevice> result = factory.create(
               injector.getInstance(BlockDeviceMappingHandler.class)).parse(is);
View Full Code Here

         // TODO figure out how to validate the ephemeral drive. perhaps with df -k?

         Map<String, BlockDevice> devices = instanceClient.getBlockDeviceMappingForInstanceInRegion(node.getLocation()
                  .getParent().getId(), node.getProviderId());

         BlockDevice device = devices.get("/dev/sdn");
         // check delete on termination
         assertTrue(device.isDeleteOnTermination());

         volume = Iterables.getOnlyElement(ebsClient.describeVolumesInRegion(node.getLocation().getParent().getId(),
                  device.getVolumeId()));
         // check volume size
         assertEquals(volumeSize, volume.getSize());

         device = devices.get("/dev/sdo");
         // check delete on termination
         assertTrue(device.isDeleteOnTermination());

         volume = Iterables.getOnlyElement(ebsClient.describeVolumesInRegion(node.getLocation().getParent().getId(),
                  device.getVolumeId()));
         // check volume size
         assertEquals(volumeSize, volume.getSize());
         // check volume's snapshot id
         assertEquals(snapshot.getId(), volume.getSnapshotId());
View Full Code Here

                        // "placement"
                        .virtualizationType("hvm").privateDnsName("domU-12-31-39-09-CE-53.compute-1.internal")
                        .privateIpAddress("10.210.209.157").ramdiskId("ari-a51cf9cc")
                        .rootDeviceType(RootDeviceType.EBS).rootDeviceName("/dev/sda1").device(
                                 "/dev/sda1",
                                 new BlockDevice("vol-dc6ca8b5", Attachment.Status.ATTACHED, dateService
                                          .iso8601DateParse("2009-12-30T04:06:29.000Z"), true)).build()),
               "993194456877", null, "r-596dd731"));

      Set<Reservation<? extends RunningInstance>> result = parseRunningInstances("/describe_instances_ebs.xml");
View Full Code Here

   BindBlockDeviceMappingToIndexedFormParams binder = injector
         .getInstance(BindBlockDeviceMappingToIndexedFormParams.class);

   public void testMappingOrdersLexicographically() {
      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("apple", new BlockDevice("appleId", true));
      Date date = new Date(999999l);
      mapping.put("cranberry", new BlockDevice("cranberry", Status.ATTACHED, date, false));

      HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost")
            .addFormParam("InstanceId", "i-foo").build();
      request = binder.bindToRequest(request, mapping);
      assertEquals(
View Full Code Here

   private void setBlockDeviceMappingForInstanceInRegion() {
      String volumeId = ebsInstance.getEbsBlockDevices().get("/dev/sda1").getVolumeId();

      Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
      mapping.put("/dev/sda1", new BlockDevice(volumeId, false));
      try {
         client.getInstanceApi().get().setBlockDeviceMappingForInstanceInRegion(null, ebsInstance.getId(), mapping);

         Map<String, BlockDevice> devices = client.getInstanceApi().get().getBlockDeviceMappingForInstanceInRegion(null,
               ebsInstance.getId());
         assertEquals(devices.size(), 1);
         String deviceName = Iterables.getOnlyElement(devices.keySet());
         BlockDevice device = Iterables.getOnlyElement(devices.values());

         assertEquals(device.getVolumeId(), volumeId);
         assertEquals(deviceName, "/dev/sda1");
         assertEquals(device.isDeleteOnTermination(), false);

         System.out.println("OK: setBlockDeviceMappingForInstanceInRegion");
      } catch (Exception e) {
         System.err.println("setBlockDeviceMappingForInstanceInRegion");
View Full Code Here

            IOException {
      Invokable<?, ?> method = method(InstanceApi.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

                                  .securityGroupIdToName("sg-f788299f", "launchpad_sec_group")
                                  .securityGroupIdToName("sg-7e512116", "jclouds#4c858090-f66c-4225-aa57-6fcaa42198ae")
//                                  .architecture("x86_64")
                                  .rootDeviceType(RootDeviceType.EBS)
                                  .rootDeviceName("/dev/sda1")
                                  .device("/dev/sda1", new BlockDevice("vol-b2beb3c9", Attachment.Status.ATTACHING, dateService.iso8601DateParse("2012-09-14T20:01:37.000Z"), true))
                                  .virtualizationType("paravirtual")
                                  .tag("Name", "4c858090-f66c-4225-aa57-6fcaa42198ae-32451248")
                                  .hypervisor(Hypervisor.XEN)
                                  .build()).build());
   }
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

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.