Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.Zone


      Set<Zone> response = client.getZoneApi().listZones();
      assert null != response;
      long zoneCount = response.size();
      assertTrue(zoneCount >= 0);
      for (Zone zone : response) {
         Zone newDetails = Iterables.getOnlyElement(client.getZoneApi().listZones(
               ListZonesOptions.Builder.id(zone.getId())));
         assertEquals(zone, newDetails);
         assertEquals(zone, client.getZoneApi().getZone(zone.getId()));
         assert zone.getId() != null : zone;
         assert zone.getName() != null : zone;
View Full Code Here


   @Test
   public void testCreateVlanIPRange() {
      skipIfNotGlobalAdmin();

      final Zone zone = Iterables.find(client.getZoneApi().listZones(), ZonePredicates.supportsAdvancedNetworks());
      final NetworkOffering offering = Iterables.tryFind(client.getOfferingApi().listNetworkOfferings(),
                                                         NetworkOfferingPredicates.supportsGuestVirtualNetworks()).orNull();

      if (offering != null) {
         Set<Network> suitableNetworks = Sets.filter(client.getNetworkApi().listNetworks(
                                                                                         zoneId(zone.getId()).isSystem(false).trafficType(TrafficType.GUEST)),
                                                     new Predicate<Network>() {
                                                        @Override
                                                        public boolean apply(Network network) {
                                                           return network.getNetworkOfferingId().equals(offering.getId());
                                                        }
                                                     });

         if (!suitableNetworks.isEmpty()) {
            network = Iterables.get(suitableNetworks, 0);
            usingExistingNetwork = true;

         } else if (network == null) {
            network = client.getNetworkApi().createNetworkInZone(zone.getId(),
                                                                 offering.getId(), "net-" + prefix, "jclouds test " + prefix);
            usingExistingNetwork = false;
         }

         range = globalAdminClient.getVlanClient().createVlanIPRange("172.19.1.1", "172.19.1.199", CreateVlanIPRangeOptions.Builder
View Full Code Here

   @Test
   public void testCreateUpdateDeleteZone() {
      skipIfNotGlobalAdmin();

      Zone zone = null;
      String zoneName = prefix + "-zone";
      try {
         zone = globalAdminClient.getZoneApi().createZone(zoneName,
            NetworkType.BASIC, "8.8.8.8", "10.10.10.10");

         assertNotNull(zone);
         assertEquals(zone, globalAdminClient.getZoneApi().getZone(zone.getId()));
         assertEquals(zone.getNetworkType(), NetworkType.BASIC);
         assertEquals(zone.getDNS(), ImmutableList.of("8.8.8.8"));
         assertEquals(zone.getInternalDNS(), ImmutableList.of("10.10.10.10"));

         Zone updated = globalAdminClient.getZoneApi().updateZone(zone.getId(),
            name(zoneName + "-2").externalDns(ImmutableList.of("8.8.4.4")));
         assertEquals(updated.getId(), zone.getId());
         assertEquals(updated.getDNS(), ImmutableList.of("8.8.4.4"));

      } finally {
         if (zone != null) {
            globalAdminClient.getZoneApi().deleteZone(zone.getId());
         }
View Full Code Here

TOP

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

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.