Package org.jclouds.gogrid.domain

Examples of org.jclouds.gogrid.domain.LoadBalancer$ConcreteBuilder


      Ip realIp2 = ipIterator.next();
      Ip realIp3 = ipIterator.next();

      AddLoadBalancerOptions options = new AddLoadBalancerOptions.Builder().create(LoadBalancerType.LEAST_CONNECTED,
               LoadBalancerPersistenceType.SOURCE_ADDRESS);
      LoadBalancer createdLoadBalancer = api.getLoadBalancerServices().addLoadBalancer(nameOfLoadBalancer,
               IpPortPair.builder().ip(vip).port(80).build(), Arrays.asList(IpPortPair.builder().ip(realIp1).port(80).build(),
               IpPortPair.builder().ip(realIp2).port(80).build()),
               options);
      assertNotNull(createdLoadBalancer);
      assert loadBalancerLatestJobCompleted.apply(createdLoadBalancer);

      // get load balancer by name
      Set<LoadBalancer> response = api.getLoadBalancerServices().getLoadBalancersByName(nameOfLoadBalancer);
      assert (response.size() == 1);
      createdLoadBalancer = Iterables.getOnlyElement(response);
      assertNotNull(createdLoadBalancer.getRealIpList());
      assertEquals(createdLoadBalancer.getRealIpList().size(), 2);
      assertNotNull(createdLoadBalancer.getVirtualIp());
      assertEquals(createdLoadBalancer.getVirtualIp().getIp().getIp(), vip.getIp());

      LoadBalancer editedLoadBalancer = api.getLoadBalancerServices().editLoadBalancerNamed(nameOfLoadBalancer,
               Arrays.asList(IpPortPair.builder().ip(realIp3).port(8181).build()));
      assert loadBalancerLatestJobCompleted.apply(editedLoadBalancer);
      assertNotNull(editedLoadBalancer.getRealIpList());
      assertEquals(editedLoadBalancer.getRealIpList().size(), 1);
      assertEquals(Iterables.getOnlyElement(editedLoadBalancer.getRealIpList()).getIp().getIp(), realIp3.getIp());

      int lbCountAfterAddingOneServer = api.getLoadBalancerServices().getLoadBalancerList().size();
      assert lbCountAfterAddingOneServer == lbCountBeforeTest + 1 : "There should be +1 increase in the number of load balancers since the test started";

      // delete the load balancer
View Full Code Here


      ParseLoadBalancerListFromJsonResponse parser = i.getInstance(ParseLoadBalancerListFromJsonResponse.class);
      SortedSet<LoadBalancer> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());

      Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");

      LoadBalancer loadBalancer = LoadBalancer.builder().id(6372L).name("Balancer")
            .virtualIp(IpPortPair.builder().ip(Ip.builder().id(1313082L)
                  .ip("204.51.240.181").subnet("204.51.240.176/255.255.255.240").isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build())
            .realIpList(
                  IpPortPair.builder().ip(Ip.builder().id(1313086L).ip("204.51.240.185").subnet("204.51.240.176/255.255.255.240")
                        .isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build(),
View Full Code Here

      Ip realIp2 = ipIterator.next();
      Ip realIp3 = ipIterator.next();

      AddLoadBalancerOptions options = new AddLoadBalancerOptions.Builder().create(LoadBalancerType.LEAST_CONNECTED,
               LoadBalancerPersistenceType.SOURCE_ADDRESS);
      LoadBalancer createdLoadBalancer = api.getLoadBalancerServices().addLoadBalancer(nameOfLoadBalancer,
               IpPortPair.builder().ip(vip).port(80).build(), Arrays.asList(IpPortPair.builder().ip(realIp1).port(80).build(),
               IpPortPair.builder().ip(realIp2).port(80).build()),
               options);
      assertNotNull(createdLoadBalancer);
      assert loadBalancerLatestJobCompleted.apply(createdLoadBalancer);

      // get load balancer by name
      Set<LoadBalancer> response = api.getLoadBalancerServices().getLoadBalancersByName(nameOfLoadBalancer);
      assert response.size() == 1;
      createdLoadBalancer = Iterables.getOnlyElement(response);
      assertNotNull(createdLoadBalancer.getRealIpList());
      assertEquals(createdLoadBalancer.getRealIpList().size(), 2);
      assertNotNull(createdLoadBalancer.getVirtualIp());
      assertEquals(createdLoadBalancer.getVirtualIp().getIp().getIp(), vip.getIp());

      LoadBalancer editedLoadBalancer = api.getLoadBalancerServices().editLoadBalancerNamed(nameOfLoadBalancer,
               Arrays.asList(IpPortPair.builder().ip(realIp3).port(8181).build()));
      assert loadBalancerLatestJobCompleted.apply(editedLoadBalancer);
      assertNotNull(editedLoadBalancer.getRealIpList());
      assertEquals(editedLoadBalancer.getRealIpList().size(), 1);
      assertEquals(Iterables.getOnlyElement(editedLoadBalancer.getRealIpList()).getIp().getIp(), realIp3.getIp());

      int lbCountAfterAddingOneServer = api.getLoadBalancerServices().getLoadBalancerList().size();
      assert lbCountAfterAddingOneServer == lbCountBeforeTest + 1 : "There should be +1 increase in the number of load balancers since the test started";

      // delete the load balancer
View Full Code Here

      Ip realIp2 = ipIterator.next();
      Ip realIp3 = ipIterator.next();

      AddLoadBalancerOptions options = new AddLoadBalancerOptions.Builder().create(LoadBalancerType.LEAST_CONNECTED,
               LoadBalancerPersistenceType.SOURCE_ADDRESS);
      LoadBalancer createdLoadBalancer = api.getLoadBalancerServices().addLoadBalancer(nameOfLoadBalancer,
               IpPortPair.builder().ip(vip).port(80).build(), Arrays.asList(IpPortPair.builder().ip(realIp1).port(80).build(),
               IpPortPair.builder().ip(realIp2).port(80).build()),
               options);
      assertNotNull(createdLoadBalancer);
      assert loadBalancerLatestJobCompleted.apply(createdLoadBalancer);

      // get load balancer by name
      Set<LoadBalancer> response = api.getLoadBalancerServices().getLoadBalancersByName(nameOfLoadBalancer);
      assert (response.size() == 1);
      createdLoadBalancer = Iterables.getOnlyElement(response);
      assertNotNull(createdLoadBalancer.getRealIpList());
      assertEquals(createdLoadBalancer.getRealIpList().size(), 2);
      assertNotNull(createdLoadBalancer.getVirtualIp());
      assertEquals(createdLoadBalancer.getVirtualIp().getIp().getIp(), vip.getIp());

      LoadBalancer editedLoadBalancer = api.getLoadBalancerServices().editLoadBalancerNamed(nameOfLoadBalancer,
               Arrays.asList(IpPortPair.builder().ip(realIp3).port(8181).build()));
      assert loadBalancerLatestJobCompleted.apply(editedLoadBalancer);
      assertNotNull(editedLoadBalancer.getRealIpList());
      assertEquals(editedLoadBalancer.getRealIpList().size(), 1);
      assertEquals(Iterables.getOnlyElement(editedLoadBalancer.getRealIpList()).getIp().getIp(), realIp3.getIp());

      int lbCountAfterAddingOneServer = api.getLoadBalancerServices().getLoadBalancerList().size();
      assert lbCountAfterAddingOneServer == lbCountBeforeTest + 1 : "There should be +1 increase in the number of load balancers since the test started";

      // delete the load balancer
View Full Code Here

      ParseLoadBalancerListFromJsonResponse parser = i.getInstance(ParseLoadBalancerListFromJsonResponse.class);
      SortedSet<LoadBalancer> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());

      Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");

      LoadBalancer loadBalancer = LoadBalancer.builder().id(6372L).name("Balancer")
            .virtualIp(IpPortPair.builder().ip(Ip.builder().id(1313082L)
                  .ip("204.51.240.181").subnet("204.51.240.176/255.255.255.240").isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build())
            .realIpList(
                  IpPortPair.builder().ip(Ip.builder().id(1313086L).ip("204.51.240.185").subnet("204.51.240.176/255.255.255.240")
                        .isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build(),
View Full Code Here

      ParseLoadBalancerListFromJsonResponse parser = i.getInstance(ParseLoadBalancerListFromJsonResponse.class);
      SortedSet<LoadBalancer> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());

      Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");

      LoadBalancer loadBalancer = LoadBalancer.builder().id(6372L).name("Balancer")
            .virtualIp(IpPortPair.builder().ip(Ip.builder().id(1313082L)
                  .ip("204.51.240.181").subnet("204.51.240.176/255.255.255.240").isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build())
            .realIpList(
                  IpPortPair.builder().ip(Ip.builder().id(1313086L).ip("204.51.240.185").subnet("204.51.240.176/255.255.255.240")
                        .isPublic(true).state(IpState.ASSIGNED).datacenter(dc).build()).port(80).build(),
View Full Code Here

      Ip realIp2 = ipIterator.next();
      Ip realIp3 = ipIterator.next();

      AddLoadBalancerOptions options = new AddLoadBalancerOptions.Builder().create(LoadBalancerType.LEAST_CONNECTED,
               LoadBalancerPersistenceType.SOURCE_ADDRESS);
      LoadBalancer createdLoadBalancer = api.getLoadBalancerServices().addLoadBalancer(nameOfLoadBalancer,
               IpPortPair.builder().ip(vip).port(80).build(), Arrays.asList(IpPortPair.builder().ip(realIp1).port(80).build(),
               IpPortPair.builder().ip(realIp2).port(80).build()),
               options);
      assertNotNull(createdLoadBalancer);
      assert loadBalancerLatestJobCompleted.apply(createdLoadBalancer);

      // get load balancer by name
      Set<LoadBalancer> response = api.getLoadBalancerServices().getLoadBalancersByName(nameOfLoadBalancer);
      assert response.size() == 1;
      createdLoadBalancer = Iterables.getOnlyElement(response);
      assertNotNull(createdLoadBalancer.getRealIpList());
      assertEquals(createdLoadBalancer.getRealIpList().size(), 2);
      assertNotNull(createdLoadBalancer.getVirtualIp());
      assertEquals(createdLoadBalancer.getVirtualIp().getIp().getIp(), vip.getIp());

      LoadBalancer editedLoadBalancer = api.getLoadBalancerServices().editLoadBalancerNamed(nameOfLoadBalancer,
               Arrays.asList(IpPortPair.builder().ip(realIp3).port(8181).build()));
      assert loadBalancerLatestJobCompleted.apply(editedLoadBalancer);
      assertNotNull(editedLoadBalancer.getRealIpList());
      assertEquals(editedLoadBalancer.getRealIpList().size(), 1);
      assertEquals(Iterables.getOnlyElement(editedLoadBalancer.getRealIpList()).getIp().getIp(), realIp3.getIp());

      int lbCountAfterAddingOneServer = api.getLoadBalancerServices().getLoadBalancerList().size();
      assert lbCountAfterAddingOneServer == lbCountBeforeTest + 1 : "There should be +1 increase in the number of load balancers since the test started";

      // delete the load balancer
View Full Code Here

TOP

Related Classes of org.jclouds.gogrid.domain.LoadBalancer$ConcreteBuilder

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.