Package org.jclouds.openstack.cinder.v1.handlers

Examples of org.jclouds.openstack.cinder.v1.handlers.CinderErrorHandler


      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name(NAME)
            .description("Snapshot of " + volume.getId());

      Snapshot snapshot = snapshotApi.create(volume.getId(), options);

      // Wait for the snapshot to become Available before moving on
      // If you want to know what's happening during the polling, enable logging. See
      // /jclouds-example/rackspace/src/main/java/org/jclouds/examples/rackspace/Logging.java
      if (!SnapshotPredicates.awaitAvailable(snapshotApi).apply(snapshot)) {
View Full Code Here


    */
   public static void main(String[] args) throws IOException {
      DeleteSnapshot deleteSnapshot = new DeleteSnapshot(args[0], args[1]);

      try {
         Snapshot snapshot = deleteSnapshot.getSnapshot();
         deleteSnapshot.deleteSnapshot(snapshot);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
View Full Code Here

         if (status.equals(snapshot.getStatus())) {
            return true;
         }
         else {
            Snapshot snapshotUpdated = snapshotApi.get(snapshot.getId());
            checkNotNull(snapshotUpdated, "Snapshot %s not found.", snapshot.getId());
           
            return status.equals(snapshotUpdated.getStatus());
         }
      }
View Full Code Here

   public void testListSnapshots() {
      Set<? extends Snapshot> snapshots = snapshotApi.list().toSet();
      assertNotNull(snapshots);
      boolean foundIt = false;
      for (Snapshot snap : snapshots) {
         Snapshot details = snapshotApi.get(snap.getId());
         if (Objects.equal(snap.getVolumeId(), testVolume.getId())) {
            foundIt = true;
         }
         assertNotNull(details);
         assertEquals(details.getId(), snap.getId());
         assertEquals(details.getVolumeId(), snap.getVolumeId());
      }
      assertTrue(foundIt, "Failed to find the snapshot we previously created in listSnapshots() response");
   }
View Full Code Here

   public void testListSnapshotsInDetail() {
      Set<? extends Snapshot> snapshots = snapshotApi.listInDetail().toSet();
      assertNotNull(snapshots);
      boolean foundIt = false;
      for (Snapshot snap : snapshots) {
         Snapshot details = snapshotApi.get(snap.getId());
         if (Objects.equal(snap.getVolumeId(), testVolume.getId())) {
            foundIt = true;
            assertSame(details, testSnapshot);
         }
         assertSame(details, snap);
View Full Code Here

   public void testListVolumes() {
      Set<? extends Volume> volumes = volumeApi.list().toSet();
      assertNotNull(volumes);
      boolean foundIt = false;
      for (Volume vol : volumes) {
         Volume details = volumeApi.get(vol.getId());
         assertNotNull(details);
         if (Objects.equal(details.getId(), testVolume.getId())) {
            foundIt = true;
         }
      }
      assertTrue(foundIt, "Failed to find the volume we created in list() response");
   }
View Full Code Here

   public void testListVolumesInDetail() {
      Set<? extends Volume> volumes = volumeApi.listInDetail().toSet();
      assertNotNull(volumes);
      boolean foundIt = false;
      for (Volume vol : volumes) {
         Volume details = volumeApi.get(vol.getId());
         assertNotNull(details);
         assertNotNull(details.getId());
         assertNotNull(details.getCreated());
         assertTrue(details.getSize() > -1);

         assertEquals(details.getId(), vol.getId());
         assertEquals(details.getSize(), vol.getSize());
         assertEquals(details.getName(), vol.getName());
         assertEquals(details.getDescription(), vol.getDescription());
         assertEquals(details.getCreated(), vol.getCreated());
         if (Objects.equal(details.getId(), testVolume.getId())) {
            foundIt = true;
         }
      }
      assertTrue(foundIt, "Failed to find the volume we previously created in listInDetail() response");
   }
View Full Code Here

      ).getVolumeApiForZone("RegionOne");

      CreateVolumeOptions options = CreateVolumeOptions.Builder
            .name("jclouds-test-volume")
            .description("description of test volume");
      Volume volume = api.create(1, options);
      assertEquals(volume, testVolumeCreate());
   }
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_get.json")).build()
      ).getVolumeApiForZone("RegionOne");

      Volume volume = api.get("60761c60-0f56-4499-b522-ff13e120af10");
      assertEquals(volume, testVolume());
      // double-check equals()
      assertEquals(volume.getName(), "test");
      assertEquals(volume.getZone(), "nova");
      assertEquals(volume.getStatus(), Volume.Status.IN_USE);
      assertEquals(volume.getDescription(), "This is a test volume");
      assertEquals(Iterables.getOnlyElement(volume.getAttachments()), testAttachment());
   }
View Full Code Here

        
         if (status.equals(volume.getStatus())) {
            return true;
         }
         else {
            Volume volumeUpdated = volumeApi.get(volume.getId());
            checkNotNull(volumeUpdated, "Volume %s not found.", volume.getId());
           
            return status.equals(volumeUpdated.getStatus());
         }
      }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.cinder.v1.handlers.CinderErrorHandler

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.