Examples of NetworkOffering


Examples of org.jclouds.cloudstack.domain.NetworkOffering

   @Test(groups = "live", enabled = true)
   public void testUpdateNetworkOffering() throws Exception {
      skipIfNotGlobalAdmin();

      NetworkOffering offering = getFirst(globalAdminClient.getOfferingClient().listNetworkOfferings(), null);
      assertNotNull(offering, "Unable to test, no network offering found.");

      String name = offering.getName();
      NetworkOfferingAvailabilityType availability = offering.getAvailability();

      try {
         NetworkOfferingAvailabilityType newValue = OPTIONAL;
         if (availability == OPTIONAL) {
            newValue = REQUIRED;
         }
         NetworkOffering updated = globalAdminClient.getOfferingClient().updateNetworkOffering(offering.getId(),
            UpdateNetworkOfferingOptions.Builder.name(prefix + name).availability(newValue));

         assertEquals(updated.getName(), prefix + name);
         assertEquals(updated.getAvailability(), newValue);

      } finally {
         globalAdminClient.getOfferingClient().updateNetworkOffering(offering.getId(),
            UpdateNetworkOfferingOptions.Builder.name(name).availability(availability));
      }
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.