use of com.amazonaws.services.elasticloadbalancing.model.HealthCheck in project photon-model by vmware.
the class AWSLoadBalancerService method buildHealthCheckRequest.
private ConfigureHealthCheckRequest buildHealthCheckRequest(AWSLoadBalancerContext context) {
HealthCheckConfiguration healthCheckConfiguration = context.loadBalancerStateExpanded.routes.stream().filter(config -> config != null && config.healthCheckConfiguration != null).map(config -> config.healthCheckConfiguration).findFirst().orElse(null);
if (healthCheckConfiguration == null) {
return null;
}
// Construct the target HTTP:80/index.html
String target = healthCheckConfiguration.protocol + ":" + healthCheckConfiguration.port + healthCheckConfiguration.urlPath;
HealthCheck healthCheck = new HealthCheck().withHealthyThreshold(healthCheckConfiguration.healthyThreshold).withInterval(healthCheckConfiguration.intervalSeconds).withTarget(target).withTimeout(healthCheckConfiguration.timeoutSeconds).withUnhealthyThreshold(healthCheckConfiguration.unhealthyThreshold);
return new ConfigureHealthCheckRequest().withLoadBalancerName(context.loadBalancerStateExpanded.name).withHealthCheck(healthCheck);
}
Aggregations