com.pulumi.digitalocean.outputs.LoadBalancerHealthcheck Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.digitalocean.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class LoadBalancerHealthcheck {
/**
* @return The number of seconds between two consecutive health checks. If not specified, the default value is `10`.
*
*/
private @Nullable Integer checkIntervalSeconds;
/**
* @return The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. If not specified, the default value is `5`.
*
*/
private @Nullable Integer healthyThreshold;
/**
* @return The path on the backend Droplets to which the Load Balancer instance will send a request.
*
*/
private @Nullable String path;
/**
* @return An integer representing the port on the backend Droplets on which the health check will attempt a connection.
*
*/
private Integer port;
/**
* @return The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https` or `tcp`.
*
*/
private String protocol;
/**
* @return The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is `5`.
*
*/
private @Nullable Integer responseTimeoutSeconds;
/**
* @return The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. If not specified, the default value is `3`.
*
*/
private @Nullable Integer unhealthyThreshold;
private LoadBalancerHealthcheck() {}
/**
* @return The number of seconds between two consecutive health checks. If not specified, the default value is `10`.
*
*/
public Optional checkIntervalSeconds() {
return Optional.ofNullable(this.checkIntervalSeconds);
}
/**
* @return The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. If not specified, the default value is `5`.
*
*/
public Optional healthyThreshold() {
return Optional.ofNullable(this.healthyThreshold);
}
/**
* @return The path on the backend Droplets to which the Load Balancer instance will send a request.
*
*/
public Optional path() {
return Optional.ofNullable(this.path);
}
/**
* @return An integer representing the port on the backend Droplets on which the health check will attempt a connection.
*
*/
public Integer port() {
return this.port;
}
/**
* @return The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https` or `tcp`.
*
*/
public String protocol() {
return this.protocol;
}
/**
* @return The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is `5`.
*
*/
public Optional responseTimeoutSeconds() {
return Optional.ofNullable(this.responseTimeoutSeconds);
}
/**
* @return The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. If not specified, the default value is `3`.
*
*/
public Optional unhealthyThreshold() {
return Optional.ofNullable(this.unhealthyThreshold);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(LoadBalancerHealthcheck defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable Integer checkIntervalSeconds;
private @Nullable Integer healthyThreshold;
private @Nullable String path;
private Integer port;
private String protocol;
private @Nullable Integer responseTimeoutSeconds;
private @Nullable Integer unhealthyThreshold;
public Builder() {}
public Builder(LoadBalancerHealthcheck defaults) {
Objects.requireNonNull(defaults);
this.checkIntervalSeconds = defaults.checkIntervalSeconds;
this.healthyThreshold = defaults.healthyThreshold;
this.path = defaults.path;
this.port = defaults.port;
this.protocol = defaults.protocol;
this.responseTimeoutSeconds = defaults.responseTimeoutSeconds;
this.unhealthyThreshold = defaults.unhealthyThreshold;
}
@CustomType.Setter
public Builder checkIntervalSeconds(@Nullable Integer checkIntervalSeconds) {
this.checkIntervalSeconds = checkIntervalSeconds;
return this;
}
@CustomType.Setter
public Builder healthyThreshold(@Nullable Integer healthyThreshold) {
this.healthyThreshold = healthyThreshold;
return this;
}
@CustomType.Setter
public Builder path(@Nullable String path) {
this.path = path;
return this;
}
@CustomType.Setter
public Builder port(Integer port) {
if (port == null) {
throw new MissingRequiredPropertyException("LoadBalancerHealthcheck", "port");
}
this.port = port;
return this;
}
@CustomType.Setter
public Builder protocol(String protocol) {
if (protocol == null) {
throw new MissingRequiredPropertyException("LoadBalancerHealthcheck", "protocol");
}
this.protocol = protocol;
return this;
}
@CustomType.Setter
public Builder responseTimeoutSeconds(@Nullable Integer responseTimeoutSeconds) {
this.responseTimeoutSeconds = responseTimeoutSeconds;
return this;
}
@CustomType.Setter
public Builder unhealthyThreshold(@Nullable Integer unhealthyThreshold) {
this.unhealthyThreshold = unhealthyThreshold;
return this;
}
public LoadBalancerHealthcheck build() {
final var _resultValue = new LoadBalancerHealthcheck();
_resultValue.checkIntervalSeconds = checkIntervalSeconds;
_resultValue.healthyThreshold = healthyThreshold;
_resultValue.path = path;
_resultValue.port = port;
_resultValue.protocol = protocol;
_resultValue.responseTimeoutSeconds = responseTimeoutSeconds;
_resultValue.unhealthyThreshold = unhealthyThreshold;
return _resultValue;
}
}
}