Examples of ServiceOffering


Examples of org.jclouds.cloudstack.domain.ServiceOffering

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

      String name = prefix + "-test-create-service-offering";
      String displayText = name + "-display";
      ServiceOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingClient().
            createServiceOffering(name, displayText, 2, 1024, 2048, highlyAvailable(true).storageType(StorageType.LOCAL));
         Logger.CONSOLE.info("Created Service Offering: " + offering);

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

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

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

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingClient().deleteServiceOffering(offering.getId());
         }
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.