Package org.jclouds.openstack.cinder.v1

Examples of org.jclouds.openstack.cinder.v1.CinderApiMetadata


         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


      Set<? extends Snapshot> snapshots = api.listInDetail().toSet();
      assertEquals(snapshots, ImmutableSet.of(testSnapshot()));

      // double-check individual fields
      Snapshot snappy = Iterables.getOnlyElement(snapshots);
      assertEquals(snappy.getId(), "67d03df1-ce5d-4ba7-adbe-492ceb80170b");
      assertEquals(snappy.getVolumeId(), "ea6f70ef-2784-40b9-9d14-d7f33c507c3f");
      assertEquals(snappy.getStatus(), Volume.Status.AVAILABLE);
      assertEquals(snappy.getDescription(), "jclouds test snapshot");
      assertEquals(snappy.getName(), "jclouds-test-snapshot");
      assertEquals(snappy.getSize(), 1);
   }
View Full Code Here

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

      Snapshot snapshot = api.get("67d03df1-ce5d-4ba7-adbe-492ceb80170b");
      assertEquals(snapshot, testSnapshot());
   }
View Full Code Here

      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name("jclouds-test-snapshot")
            .description("jclouds test snapshot")
            .force();

      Snapshot snapshot = api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
      assertEquals(snapshot, testSnapshotCreate());
   }
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

      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

TOP

Related Classes of org.jclouds.openstack.cinder.v1.CinderApiMetadata

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.