Package org.jclouds.rackspace.cloudloadbalancers.v1

Examples of org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApi


*/
@Test(groups = "unit", testName = "CloudLoadBalancersUKProviderTest")
public class CloudLoadBalancersUKProviderTest extends BaseProviderMetadataTest {

   public CloudLoadBalancersUKProviderTest() {
      super(new CloudLoadBalancersUKProviderMetadata(), new CloudLoadBalancersApiMetadata());
   }
View Full Code Here


            responseWithAccess,
            authenticatedGET().method(POST).endpoint(endpoint).payload(payloadFromResource("/accesslist-create.json")).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).build()
      ).getAccessRuleApiForZoneAndLoadBalancer("DFW", 2000);
  
      AccessRule accessRule1 = AccessRule.deny("206.160.163.21");
      AccessRule accessRule2 = AccessRule.deny("206.160.165.11");
      AccessRule accessRule3 = AccessRule.deny("206.160.163.22");
     
      List<AccessRule> accessList = ImmutableList.<AccessRule> of(accessRule1, accessRule2, accessRule3);
      api.create(accessList);
   }
View Full Code Here

   }
  
   @Test(dependsOnMethods = "testCreateAccessList")
   public void testRemoveSingleAccessRule() throws Exception {
      Iterable<AccessRuleWithId> actualAccessList = api.getAccessRuleApiForZoneAndLoadBalancer(zone, lb.getId()).list();
      AccessRuleWithId removedAccessRule = Iterables.getFirst(actualAccessList, null);
      accessRules.remove(removedAccessRule.getAddress());
     
      assertTrue(api.getAccessRuleApiForZoneAndLoadBalancer(zone, lb.getId()).delete(removedAccessRule.getId()));
      assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(zone)).apply(lb));
     
      assertExpectedAccessRules(accessRules);
   }
View Full Code Here

   }
  
   @Test(dependsOnMethods = "testRemoveSingleAccessRule")
   public void testRemoveManyAccessRules() throws Exception {
      Iterable<AccessRuleWithId> actualAccessList = api.getAccessRuleApiForZoneAndLoadBalancer(zone, lb.getId()).list();
      AccessRuleWithId removedAccessRule1 = Iterables.getFirst(actualAccessList, null);
      AccessRuleWithId removedAccessRule2 = Iterables.getLast(actualAccessList);
      List<Integer> removedAccessRuleIds = ImmutableList.<Integer> of(removedAccessRule1.getId(), removedAccessRule2.getId());
      accessRules.remove(removedAccessRule1.getAddress());
      accessRules.remove(removedAccessRule2.getAddress());
     
      assertTrue(api.getAccessRuleApiForZoneAndLoadBalancer(zone, lb.getId()).delete(removedAccessRuleIds));
      assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(zone)).apply(lb));
     
      assertExpectedAccessRules(accessRules);
View Full Code Here

            .healthMonitor(HealthMonitor.builder().type(Type.CONNECT).delay(10).timeout(5).attemptsBeforeDeactivation(2).build())
            .sslTermination(SSLTermination.builder().enabled(true).secureTrafficOnly(false).securePort(443).build())
            .sourceAddresses(SourceAddresses.builder().ipv6Public("2001:4800:7901::5/64").ipv4Public("174.143.139.137").ipv4Servicenet("10.183.250.137").build())
            .connectionThrottle(ConnectionThrottle.builder().maxConnections(100).minConnections(10).maxConnectionRate(50).rateInterval(60).build())
            .accessRules(ImmutableSet.of(
                  new AccessRuleWithId(22215, "1.2.3.4/32", AccessRule.Type.DENY),
                  new AccessRuleWithId(22217, "12.0.0.0/8", AccessRule.Type.ALLOW)))
            .virtualIPs(ImmutableSet.of(
                  new VirtualIPWithId(VirtualIP.Type.PUBLIC, VirtualIP.IPVersion.IPV4, 1000, "206.10.10.210"),
                  new VirtualIPWithId(VirtualIP.Type.PUBLIC, VirtualIP.IPVersion.IPV6, 1001, "2001:4800:7901:0000:9a32:3c2a:0000:0001")))
            .nodes(ImmutableSet.of(
                  Node.builder().id(1041).address("10.1.1.1").port(80).condition(Node.Condition.ENABLED).status(Node.Status.ONLINE).build(),
View Full Code Here

      assertTrue(api.deleteAll());
   }

   private Iterable<AccessRuleWithId> getAccessRules() {
      AccessRuleWithId accessRule1 = new AccessRuleWithId(23, "206.160.163.21", AccessRule.Type.DENY);
      AccessRuleWithId accessRule2 = new AccessRuleWithId(24, "206.160.165.11", AccessRule.Type.DENY);
      AccessRuleWithId accessRule3 = new AccessRuleWithId(25, "206.160.163.22", AccessRule.Type.DENY);

      return ImmutableList.<AccessRuleWithId> of(accessRule1, accessRule2, accessRule3);
   }
View Full Code Here

            .healthMonitor(HealthMonitor.builder().type(Type.CONNECT).delay(10).timeout(5).attemptsBeforeDeactivation(2).build())
            .sslTermination(SSLTermination.builder().enabled(true).secureTrafficOnly(false).securePort(443).build())
            .sourceAddresses(SourceAddresses.builder().ipv6Public("2001:4800:7901::5/64").ipv4Public("174.143.139.137").ipv4Servicenet("10.183.250.137").build())
            .connectionThrottle(ConnectionThrottle.builder().maxConnections(100).minConnections(10).maxConnectionRate(50).rateInterval(60).build())
            .accessRules(ImmutableSet.of(
                  new AccessRuleWithId(22215, "1.2.3.4/32", AccessRule.Type.DENY),
                  new AccessRuleWithId(22217, "12.0.0.0/8", AccessRule.Type.ALLOW)))
            .virtualIPs(ImmutableSet.of(
                  new VirtualIPWithId(VirtualIP.Type.PUBLIC, VirtualIP.IPVersion.IPV4, 1000, "206.10.10.210"),
                  new VirtualIPWithId(VirtualIP.Type.PUBLIC, VirtualIP.IPVersion.IPV6, 1001, "2001:4800:7901:0000:9a32:3c2a:0000:0001")))
            .nodes(ImmutableSet.of(
                  Node.builder().id(1041).address("10.1.1.1").port(80).condition(Node.Condition.ENABLED).status(Node.Status.ONLINE).build(),
View Full Code Here

      accessRules.put(accessRule3.getAddress(), accessRule3);
      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

                  .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

TOP

Related Classes of org.jclouds.rackspace.cloudloadbalancers.v1.CloudLoadBalancersApi

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.