Package org.jclouds.rackspace.cloudloadbalancers.v1.domain

Examples of org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerStats


      loadBalancerUsages = api.getReportApiForZone(zone).listCurrentLoadBalancerUsage(lb.getId()).concat();
      assertNotNull(loadBalancerUsages);
     
      try {
         LoadBalancerStats loadBalancerStats = api.getReportApiForZone(zone).getLoadBalancerStats(lb.getId());
         assertNotNull(loadBalancerStats);
      }
      catch (HttpResponseException e) {
         // CLB sometimes doesn't like it when you get stats on a newly created LB so ignore a 500
         if (e.getResponse().getStatusCode() != 500) {
View Full Code Here


            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/report-loadbalancerstats-get.json")).build()
      ).getReportApiForZone("DFW");
           
      LoadBalancerStats loadBalancerStats = api.getLoadBalancerStats(2000);
     
      assertEquals(loadBalancerStats.getConnectTimeOut(), 2);
      assertEquals(loadBalancerStats.getConnectError(), 0);
      assertEquals(loadBalancerStats.getConnectFailure(), 0);
      assertEquals(loadBalancerStats.getDataTimedOut(), 10);
      assertEquals(loadBalancerStats.getKeepAliveTimedOut(), 0);
      assertEquals(loadBalancerStats.getMaxConn(), 22);
   }  
View Full Code Here

      loadBalancerUsages = api.getReportApiForZone(zone).listCurrentLoadBalancerUsage(lb.getId()).concat();
      assertNotNull(loadBalancerUsages);
     
      try {
         LoadBalancerStats loadBalancerStats = api.getReportApiForZone(zone).getLoadBalancerStats(lb.getId());
         assertNotNull(loadBalancerStats);
      }
      catch (HttpResponseException e) {
         // CLB sometimes doesn't like it when you get stats on a newly created LB so ignore a 500
         if (e.getResponse().getStatusCode() != 500) {
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/report-loadbalancerstats-get.json")).build()
      ).getReportApiForZone("DFW");
           
      LoadBalancerStats loadBalancerStats = api.getLoadBalancerStats(2000);
     
      assertEquals(loadBalancerStats.getConnectTimeOut(), 2);
      assertEquals(loadBalancerStats.getConnectError(), 0);
      assertEquals(loadBalancerStats.getConnectFailure(), 0);
      assertEquals(loadBalancerStats.getDataTimedOut(), 10);
      assertEquals(loadBalancerStats.getKeepAliveTimedOut(), 0);
      assertEquals(loadBalancerStats.getMaxConn(), 22);
   }  
View Full Code Here

      loadBalancerUsages = api.getReportApiForZone(zone).listCurrentLoadBalancerUsage(lb.getId()).concat();
      assertNotNull(loadBalancerUsages);
     
      try {
         LoadBalancerStats loadBalancerStats = api.getReportApiForZone(zone).getLoadBalancerStats(lb.getId());
         assertNotNull(loadBalancerStats);
      }
      catch (HttpResponseException e) {
         // CLB sometimes doesn't like it when you get stats on a newly created LB so ignore a 500
         if (e.getResponse().getStatusCode() != 500) {
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/report-loadbalancerstats-get.json")).build()
      ).getReportApi("DFW");

      LoadBalancerStats loadBalancerStats = api.getLoadBalancerStats(2000);

      assertEquals(loadBalancerStats.getConnectTimeOut(), 2);
      assertEquals(loadBalancerStats.getConnectError(), 0);
      assertEquals(loadBalancerStats.getConnectFailure(), 0);
      assertEquals(loadBalancerStats.getDataTimedOut(), 10);
      assertEquals(loadBalancerStats.getKeepAliveTimedOut(), 0);
      assertEquals(loadBalancerStats.getMaxConn(), 22);
   }
View Full Code Here

      loadBalancerUsages = api.getReportApi(region).listCurrentLoadBalancerUsage(lb.getId()).concat();
      assertNotNull(loadBalancerUsages);

      try {
         LoadBalancerStats loadBalancerStats = api.getReportApi(region).getLoadBalancerStats(lb.getId());
         assertNotNull(loadBalancerStats);
      }
      catch (HttpResponseException e) {
         // CLB sometimes doesn't like it when you get stats on a newly created LB so ignore a 500
         if (e.getResponse().getStatusCode() != 500) {
View Full Code Here

         Map<String, String> metadataMap = ImmutableMap.<String, String> of(
               "key1", "value1",
               "key2", "value2",
               "key3", "value3");
        
         Metadata metadata = api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).createMetadata(node.getId(), metadataMap);
         assertEquals(metadata, getExpectedMetadata());
         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));

         metadata = api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).getMetadata(node.getId());
         assertEquals(metadata, getExpectedMetadata());

         assertTrue(api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).updateMetadatum(node.getId(), metadata.getId("key1"), "key1-updated"));
         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
         metadata = api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).getMetadata(node.getId());
         assertEquals(metadata.get("key1"), "key1-updated");

         assertTrue(api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).deleteMetadatum(node.getId(), metadata.getId("key1")));
         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
         metadata = api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).getMetadata(node.getId());
         assertNull(metadata.get("key1"));

         assertTrue(api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).deleteMetadata(node.getId(),
               ImmutableList.<Integer> of(metadata.getId("key2"), metadata.getId("key3"))));
         assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(lb.getRegion())).apply(lb));
         metadata = api.getNodeApiForZoneAndLoadBalancer(lb.getRegion(), lb.getId()).getMetadata(node.getId());
         assertEquals(metadata.size(), 0);
      }
   }
View Full Code Here

      }
      super.tearDown();
   }

   private Metadata getExpectedMetadata() {
      Metadata metadata = new Metadata();
      metadata.put("key1", "value1");
      metadata.put("key2", "value2");
      metadata.put("key3", "value3");

      return metadata;
   }
View Full Code Here

      return "/loadbalancer-get.json";
   }

   @Override
   public LoadBalancer expected() {
      Metadata metadata = new Metadata();
      metadata.put("color", "red");
      metadata.putId("color", 1);
      metadata.put("label", "web-load-balancer");
      metadata.putId("label", 2);
     
      return LoadBalancer
            .builder()
            .region("DFW")
            .id(2000)
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.cloudloadbalancers.v1.domain.LoadBalancerStats

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.