Package org.jclouds.rackspace.cloudloadbalancers.v1

Examples of org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApiMetadata$Builder


                  .endpoint(endpoint)
                  .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/nodes-list.json")).build()
      ).getNodeApiForZoneAndLoadBalancer("DFW", 2000);

      AddNode addNode1 = AddNode.builder()
            .address("10.1.1.1")
            .condition(Node.Condition.ENABLED)
            .port(80)
            .weight(3)
            .build();
     
      AddNode addNode2 = AddNode.builder()
            .address("10.1.1.2")
            .condition(Node.Condition.ENABLED)
            .type(Node.Type.SECONDARY)
            .port(80)
            .weight(8)
            .build();

      AddNode addNode3 = AddNode.builder()
            .address("10.1.1.3")
            .condition(Node.Condition.DISABLED)
            .port(80)
            .weight(12)
            .build();
View Full Code Here


public class ContentCachingApiLiveTest extends BaseCloudLoadBalancersApiLiveTest {
   private LoadBalancer lb;
   private String zone;

   public void testCreateLoadBalancer() {
      AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build();
      CreateLoadBalancer createLB = CreateLoadBalancer.builder()
            .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build();

      zone = Iterables.getFirst(api.getConfiguredZones(), null);
      lb = api.getLoadBalancerApiForZone(zone).create(createLB);
View Full Code Here

                  .endpoint(endpoint)
                  .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/loadbalancer-get.json")).build()
      ).getLoadBalancerApiForZone("DFW");

      AddNode addNode1 = AddNode.builder()
            .address("10.1.1.1")
            .condition(Node.Condition.ENABLED)
            .port(80)
            .build();
     
      AddNode addNode2 = AddNode.builder()
            .address("10.1.1.2")
            .condition(Node.Condition.ENABLED)
            .port(80)
            .build();
     
View Full Code Here

                  .endpoint(endpoint)
                  .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/nodes-list.json")).build()
      ).getNodeApiForZoneAndLoadBalancer("DFW", 2000);

      AddNode addNode1 = AddNode.builder()
            .address("10.1.1.1")
            .condition(Node.Condition.ENABLED)
            .port(80)
            .weight(3)
            .build();
     
      AddNode addNode2 = AddNode.builder()
            .address("10.1.1.2")
            .condition(Node.Condition.ENABLED)
            .type(Node.Type.SECONDARY)
            .port(80)
            .weight(8)
            .build();

      AddNode addNode3 = AddNode.builder()
            .address("10.1.1.3")
            .condition(Node.Condition.DISABLED)
            .port(80)
            .weight(12)
            .build();
View Full Code Here

      accessRules.put(accessRule4.getAddress(), accessRule4);
   }

   public void testCreateLoadBalancer() {
      AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build();
      CreateLoadBalancer createLB = CreateLoadBalancer.builder()
            .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build();

      zone = "ORD";//Iterables.getFirst(api.getConfiguredZones(), null);
      lb = api.getLoadBalancerApiForZone(zone).create(createLB);
     
View Full Code Here

            .port(80)
            .build();
     
      Set<AddNode> addNodes = Sets.newHashSet(addNode1, addNode2);

      CreateLoadBalancer createLB = CreateLoadBalancer.builder()
            .name("sample-loadbalancer")
            .protocol("HTTP")
            .port(80)
            .algorithm(LoadBalancer.Algorithm.RANDOM)
            .virtualIPType(VirtualIP.Type.PUBLIC)
View Full Code Here

   private LoadBalancer lb;
   private String zone;

   public void testCreateLoadBalancer() {
      AddNode addNode = AddNode.builder().address("192.168.1.1").port(8080).build();
      CreateLoadBalancer createLB = CreateLoadBalancer.builder()
            .name(prefix+"-jclouds").protocol("HTTP").port(80).virtualIPType(Type.PUBLIC).node(addNode).build();

      zone = Iterables.getFirst(api.getConfiguredZones(), null);
      lb = api.getLoadBalancerApiForZone(zone).create(createLB);
     
View Full Code Here

            .port(80)
            .build();
     
      Set<AddNode> addNodes = Sets.newHashSet(addNode1, addNode2);

      CreateLoadBalancer createLB = CreateLoadBalancer.builder()
            .name("sample-loadbalancer")
            .protocol("HTTP")
            .port(80)
            .algorithm(LoadBalancer.Algorithm.RANDOM)
            .virtualIPType(VirtualIP.Type.PUBLIC)
View Full Code Here

   public void testCreateLoadBalancers() {
      assertTrue(api.getConfiguredZones().size() > 0, "Need to have some zones!");
      Logger.getAnonymousLogger().info("running against zones " + api.getConfiguredZones());
      for (String zone : api.getConfiguredZones()) {
         Logger.getAnonymousLogger().info("starting lb in zone " + zone);
         LoadBalancer lb = api.getLoadBalancerApiForZone(zone).create(
                  CreateLoadBalancer.builder().name(prefix + "-" + zone).protocol("HTTP").port(80).virtualIPType(
                           Type.PUBLIC).node(AddNode.builder().address("192.168.1.1").port(8080).build()).build());
         nodes.put(lb, new HashSet<Node>());

         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
      }
   }
View Full Code Here

   }

   @Test(dependsOnMethods = "testCreateLoadBalancers")
   public void testAddNodes() throws Exception {
      for (Map.Entry<LoadBalancer, Set<Node>> entry : nodes.entrySet()) {
         LoadBalancer lb = entry.getKey();
         Set<Node> nodeSet = entry.getValue();
         String region = lb.getRegion();
         Logger.getAnonymousLogger().info("starting node on loadbalancer " + lb.getId() + " in region " + region);
         Set<Node> newNodes = api.getNodeApiForZoneAndLoadBalancer(region, lb.getId()).add(
                  ImmutableSet.<AddNode> of(AddNode.builder().address("192.168.1.2").port(8080).build()));

         for (Node n : newNodes) {
            assertEquals(n.getStatus(), Node.Status.ONLINE);
            nodeSet.add(n);
            assertEquals(api.getNodeApiForZoneAndLoadBalancer(region, lb.getId()).get(n.getId()).getStatus(),
                     Node.Status.ONLINE);
         }

         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApiMetadata$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.