Package org.jclouds.openstack.cinder.v1.options

Examples of org.jclouds.openstack.cinder.v1.options.CreateSnapshotOptions$Builder


   public static void main(String[] args) throws IOException {
      CreateVolumeAndAttach createVolumeAndAttach = new CreateVolumeAndAttach(args[0], args[1]);

      try {
         NodeMetadata node = createVolumeAndAttach.createServer();
         Volume volume = createVolumeAndAttach.createVolume();
         createVolumeAndAttach.attachVolume(volume, node);
         createVolumeAndAttach.mountVolume(node);
      }
      catch (Exception e) {
         e.printStackTrace();
View Full Code Here


            .metadata(ImmutableMap.of("key1", "value1"));

      System.out.format("Create Volume%n");

      // 100 GB is the minimum volume size on the Rackspace Cloud
      Volume volume = volumeApi.create(100, options);

      // Wait for the volume 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 (!VolumePredicates.awaitAvailable(volumeApi).apply(volume)) {
View Full Code Here

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

      try {
         Volume volume = createSnapshot.getVolume();
         createSnapshot.createSnapshot(volume);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
View Full Code Here

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

      try {
         Volume volume = deleteVolume.getVolume();
         deleteVolume.deleteVolume(volume);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
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

      String zone = Iterables.getFirst(api.getConfiguredZones(), "nova");
      quotaApi = api.getQuotaApi(zone);
   }

   public void testGetStorageQuotas() throws ExecutionException, InterruptedException {
      VolumeQuota volumeQuota = quotaApi.getByTenant("demo");

      assertTrue(volumeQuota.getGigabytes() >= 0);
      assertTrue(volumeQuota.getVolumes() >= 0);
      assertTrue(volumeQuota.getSnapshots() >= 0);
   }
View Full Code Here

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

      VolumeType type = api.get("1");
      assertEquals(type, testVolumeType());
   }
View Full Code Here

   public void testListAndGetVolumeTypes() {
      Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toSet();
      assertNotNull(volumeTypes);

      for (VolumeType vt : volumeTypes) {
         VolumeType details = volumeTypeApi.get(vt.getId());
         assertNotNull(details);
      }
   }
View Full Code Here

   public void testListAndGetVolumeTypes() {
      Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toSet();
      assertNotNull(volumeTypes);

      for (VolumeType vt : volumeTypes) {
         VolumeType details = volumeTypeApi.get(vt.getId());
         assertNotNull(details);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.cinder.v1.options.CreateSnapshotOptions$Builder

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.