Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.DiskOffering


   }

   /** Test requires a custom disk offering to be available */
   public void testCreateVolumeFromCustomDiskOffering() {
      final int size = 1;
      DiskOffering offering = null;
      for (DiskOffering candidate : client.getOfferingClient().listDiskOfferings()) {
         if (candidate.isCustomized()) {
            offering = candidate;
            break;
         }
      }
     
      assertNotNull("No custom disk offering found!", offering);
     
      AsyncCreateResponse job = client.getVolumeClient().createVolumeFromCustomDiskOfferingInZone(
                prefix + "-jclouds-volume", offering.getId(), zoneId, size);
      assertTrue(jobComplete.apply(job.getJobId()));
      logger.info("created volume "+job.getId());
     
      Volume volume = findVolumeWithId(job.getId());
      try {
View Full Code Here


      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingClient().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
View Full Code Here

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingClient().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingClient().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingClient().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

   }

   /** Test requires a custom disk offering to be available */
   public void testCreateVolumeFromCustomDiskOffering() {
      final int size = 1;
      DiskOffering offering = null;
      for (DiskOffering candidate : client.getOfferingApi().listDiskOfferings()) {
         if (candidate.isCustomized()) {
            offering = candidate;
            break;
         }
      }
     
      assertNotNull("No custom disk offering found!", offering);
     
      AsyncCreateResponse job = client.getVolumeApi().createVolumeFromCustomDiskOfferingInZone(
                prefix + "-jclouds-volume", offering.getId(), zoneId, size);
      assertTrue(jobComplete.apply(job.getJobId()));
      logger.info("created volume "+job.getId());
     
      Volume volume = findVolumeWithId(job.getId());
      try {
View Full Code Here

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingApi().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingApi().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingApi().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingApi().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingApi().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
View Full Code Here

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingClient().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingClient().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingClient().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingClient().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
View Full Code Here

   }

   /** Test requires a custom disk offering to be available */
   public void testCreateVolumeFromCustomDiskOffering() {
      final int size = 1;
      DiskOffering offering = null;
      for (DiskOffering candidate : client.getOfferingClient().listDiskOfferings()) {
         if (candidate.isCustomized()) {
            offering = candidate;
            break;
         }
      }
     
      assertNotNull("No custom disk offering found!", offering);
     
      AsyncCreateResponse job = client.getVolumeClient().createVolumeFromCustomDiskOfferingInZone(
                prefix + "-jclouds-volume", offering.getId(), zoneId, size);
      assertTrue(jobComplete.apply(job.getJobId()));
      logger.info("created volume "+job.getId());
     
      Volume volume = findVolumeWithId(job.getId());
      try {
View Full Code Here

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingApi().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingApi().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingApi().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.cloudstack.domain.DiskOffering

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.