Class HealthCheck (1.25.0)

public final class HealthCheck extends GeneratedMessageV3 implements HealthCheckOrBuilder

Represents a Health Check resource. Google Compute Engine has two Health Check resources: * Global * Regional Internal HTTP(S) load balancers must use regional health checks (compute.v1.regionHealthChecks). Traffic Director must use global health checks (compute.v1.HealthChecks). Internal TCP/UDP load balancers can use either regional or global health checks (compute.v1.regionHealthChecks or compute.v1.HealthChecks). External HTTP(S), TCP proxy, and SSL proxy load balancers as well as managed instance group auto-healing must use global health checks (compute.v1.HealthChecks). Backend service-based network load balancers must use regional health checks (compute.v1.regionHealthChecks). Target pool-based network load balancers must use legacy HTTP health checks (compute.v1.httpHealthChecks). For more information, see Health checks overview.

Protobuf type google.cloud.compute.v1.HealthCheck

Static Fields

CHECK_INTERVAL_SEC_FIELD_NUMBER

public static final int CHECK_INTERVAL_SEC_FIELD_NUMBER
Field Value
TypeDescription
int

CREATION_TIMESTAMP_FIELD_NUMBER

public static final int CREATION_TIMESTAMP_FIELD_NUMBER
Field Value
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

GRPC_HEALTH_CHECK_FIELD_NUMBER

public static final int GRPC_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

HEALTHY_THRESHOLD_FIELD_NUMBER

public static final int HEALTHY_THRESHOLD_FIELD_NUMBER
Field Value
TypeDescription
int

HTTP2_HEALTH_CHECK_FIELD_NUMBER

public static final int HTTP2_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

HTTPS_HEALTH_CHECK_FIELD_NUMBER

public static final int HTTPS_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

HTTP_HEALTH_CHECK_FIELD_NUMBER

public static final int HTTP_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
TypeDescription
int

KIND_FIELD_NUMBER

public static final int KIND_FIELD_NUMBER
Field Value
TypeDescription
int

LOG_CONFIG_FIELD_NUMBER

public static final int LOG_CONFIG_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

REGION_FIELD_NUMBER

public static final int REGION_FIELD_NUMBER
Field Value
TypeDescription
int
public static final int SELF_LINK_FIELD_NUMBER
Field Value
TypeDescription
int

SSL_HEALTH_CHECK_FIELD_NUMBER

public static final int SSL_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

TCP_HEALTH_CHECK_FIELD_NUMBER

public static final int TCP_HEALTH_CHECK_FIELD_NUMBER
Field Value
TypeDescription
int

TIMEOUT_SEC_FIELD_NUMBER

public static final int TIMEOUT_SEC_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

UNHEALTHY_THRESHOLD_FIELD_NUMBER

public static final int UNHEALTHY_THRESHOLD_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static HealthCheck getDefaultInstance()
Returns
TypeDescription
HealthCheck

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static HealthCheck.Builder newBuilder()
Returns
TypeDescription
HealthCheck.Builder

newBuilder(HealthCheck prototype)

public static HealthCheck.Builder newBuilder(HealthCheck prototype)
Parameter
NameDescription
prototypeHealthCheck
Returns
TypeDescription
HealthCheck.Builder

parseDelimitedFrom(InputStream input)

public static HealthCheck parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static HealthCheck parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static HealthCheck parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static HealthCheck parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static HealthCheck parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static HealthCheck parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static HealthCheck parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HealthCheck
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<HealthCheck> parser()
Returns
TypeDescription
Parser<HealthCheck>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCheckIntervalSec()

public int getCheckIntervalSec()

How often (in seconds) to send a health check. The default value is 5 seconds.

optional int32 check_interval_sec = 345561006;

Returns
TypeDescription
int

The checkIntervalSec.

getCreationTimestamp()

public String getCreationTimestamp()

[Output Only] Creation timestamp in 3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
String

The creationTimestamp.

getCreationTimestampBytes()

public ByteString getCreationTimestampBytes()

[Output Only] Creation timestamp in 3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
ByteString

The bytes for creationTimestamp.

getDefaultInstanceForType()

public HealthCheck getDefaultInstanceForType()
Returns
TypeDescription
HealthCheck

getDescription()

public String getDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
TypeDescription
ByteString

The bytes for description.

getGrpcHealthCheck()

public GRPCHealthCheck getGrpcHealthCheck()

optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574;

Returns
TypeDescription
GRPCHealthCheck

The grpcHealthCheck.

getGrpcHealthCheckOrBuilder()

public GRPCHealthCheckOrBuilder getGrpcHealthCheckOrBuilder()

optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574;

Returns
TypeDescription
GRPCHealthCheckOrBuilder

getHealthyThreshold()

public int getHealthyThreshold()

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

optional int32 healthy_threshold = 403212361;

Returns
TypeDescription
int

The healthyThreshold.

getHttp2HealthCheck()

public HTTP2HealthCheck getHttp2HealthCheck()

optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986;

Returns
TypeDescription
HTTP2HealthCheck

The http2HealthCheck.

getHttp2HealthCheckOrBuilder()

public HTTP2HealthCheckOrBuilder getHttp2HealthCheckOrBuilder()

optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986;

Returns
TypeDescription
HTTP2HealthCheckOrBuilder

getHttpHealthCheck()

public HTTPHealthCheck getHttpHealthCheck()

optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940;

Returns
TypeDescription
HTTPHealthCheck

The httpHealthCheck.

getHttpHealthCheckOrBuilder()

public HTTPHealthCheckOrBuilder getHttpHealthCheckOrBuilder()

optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940;

Returns
TypeDescription
HTTPHealthCheckOrBuilder

getHttpsHealthCheck()

public HTTPSHealthCheck getHttpsHealthCheck()

optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905;

Returns
TypeDescription
HTTPSHealthCheck

The httpsHealthCheck.

getHttpsHealthCheckOrBuilder()

public HTTPSHealthCheckOrBuilder getHttpsHealthCheckOrBuilder()

optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905;

Returns
TypeDescription
HTTPSHealthCheckOrBuilder

getId()

public long getId()

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Returns
TypeDescription
long

The id.

getKind()

public String getKind()

Type of the resource.

optional string kind = 3292052;

Returns
TypeDescription
String

The kind.

getKindBytes()

public ByteString getKindBytes()

Type of the resource.

optional string kind = 3292052;

Returns
TypeDescription
ByteString

The bytes for kind.

getLogConfig()

public HealthCheckLogConfig getLogConfig()

Configure logging on this health check.

optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741;

Returns
TypeDescription
HealthCheckLogConfig

The logConfig.

getLogConfigOrBuilder()

public HealthCheckLogConfigOrBuilder getLogConfigOrBuilder()

Configure logging on this health check.

optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741;

Returns
TypeDescription
HealthCheckLogConfigOrBuilder

getName()

public String getName()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression a-z?, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash.

optional string name = 3373707;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression a-z?, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash.

optional string name = 3373707;

Returns
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<HealthCheck> getParserForType()
Returns
TypeDescription
Parser<HealthCheck>
Overrides

getRegion()

public String getRegion()

[Output Only] Region where the health check resides. Not applicable to global health checks.

optional string region = 138946292;

Returns
TypeDescription
String

The region.

getRegionBytes()

public ByteString getRegionBytes()

[Output Only] Region where the health check resides. Not applicable to global health checks.

optional string region = 138946292;

Returns
TypeDescription
ByteString

The bytes for region.

public String getSelfLink()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
TypeDescription
String

The selfLink.

getSelfLinkBytes()

public ByteString getSelfLinkBytes()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
TypeDescription
ByteString

The bytes for selfLink.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSslHealthCheck()

public SSLHealthCheck getSslHealthCheck()

optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440;

Returns
TypeDescription
SSLHealthCheck

The sslHealthCheck.

getSslHealthCheckOrBuilder()

public SSLHealthCheckOrBuilder getSslHealthCheckOrBuilder()

optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440;

Returns
TypeDescription
SSLHealthCheckOrBuilder

getTcpHealthCheck()

public TCPHealthCheck getTcpHealthCheck()

optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419;

Returns
TypeDescription
TCPHealthCheck

The tcpHealthCheck.

getTcpHealthCheckOrBuilder()

public TCPHealthCheckOrBuilder getTcpHealthCheckOrBuilder()

optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419;

Returns
TypeDescription
TCPHealthCheckOrBuilder

getTimeoutSec()

public int getTimeoutSec()

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

optional int32 timeout_sec = 79994995;

Returns
TypeDescription
int

The timeoutSec.

getType()

public String getType()

Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
TypeDescription
ByteString

The bytes for type.

getUnhealthyThreshold()

public int getUnhealthyThreshold()

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

optional int32 unhealthy_threshold = 227958480;

Returns
TypeDescription
int

The unhealthyThreshold.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasCheckIntervalSec()

public boolean hasCheckIntervalSec()

How often (in seconds) to send a health check. The default value is 5 seconds.

optional int32 check_interval_sec = 345561006;

Returns
TypeDescription
boolean

Whether the checkIntervalSec field is set.

hasCreationTimestamp()

public boolean hasCreationTimestamp()

[Output Only] Creation timestamp in 3339 text format.

optional string creation_timestamp = 30525366;

Returns
TypeDescription
boolean

Whether the creationTimestamp field is set.

hasDescription()

public boolean hasDescription()

An optional description of this resource. Provide this property when you create the resource.

optional string description = 422937596;

Returns
TypeDescription
boolean

Whether the description field is set.

hasGrpcHealthCheck()

public boolean hasGrpcHealthCheck()

optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574;

Returns
TypeDescription
boolean

Whether the grpcHealthCheck field is set.

hasHealthyThreshold()

public boolean hasHealthyThreshold()

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.

optional int32 healthy_threshold = 403212361;

Returns
TypeDescription
boolean

Whether the healthyThreshold field is set.

hasHttp2HealthCheck()

public boolean hasHttp2HealthCheck()

optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986;

Returns
TypeDescription
boolean

Whether the http2HealthCheck field is set.

hasHttpHealthCheck()

public boolean hasHttpHealthCheck()

optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940;

Returns
TypeDescription
boolean

Whether the httpHealthCheck field is set.

hasHttpsHealthCheck()

public boolean hasHttpsHealthCheck()

optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905;

Returns
TypeDescription
boolean

Whether the httpsHealthCheck field is set.

hasId()

public boolean hasId()

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

optional uint64 id = 3355;

Returns
TypeDescription
boolean

Whether the id field is set.

hasKind()

public boolean hasKind()

Type of the resource.

optional string kind = 3292052;

Returns
TypeDescription
boolean

Whether the kind field is set.

hasLogConfig()

public boolean hasLogConfig()

Configure logging on this health check.

optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741;

Returns
TypeDescription
boolean

Whether the logConfig field is set.

hasName()

public boolean hasName()

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression a-z?, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash.

optional string name = 3373707;

Returns
TypeDescription
boolean

Whether the name field is set.

hasRegion()

public boolean hasRegion()

[Output Only] Region where the health check resides. Not applicable to global health checks.

optional string region = 138946292;

Returns
TypeDescription
boolean

Whether the region field is set.

public boolean hasSelfLink()

[Output Only] Server-defined URL for the resource.

optional string self_link = 456214797;

Returns
TypeDescription
boolean

Whether the selfLink field is set.

hasSslHealthCheck()

public boolean hasSslHealthCheck()

optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440;

Returns
TypeDescription
boolean

Whether the sslHealthCheck field is set.

hasTcpHealthCheck()

public boolean hasTcpHealthCheck()

optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419;

Returns
TypeDescription
boolean

Whether the tcpHealthCheck field is set.

hasTimeoutSec()

public boolean hasTimeoutSec()

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.

optional int32 timeout_sec = 79994995;

Returns
TypeDescription
boolean

Whether the timeoutSec field is set.

hasType()

public boolean hasType()

Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. Check the Type enum for the list of possible values.

optional string type = 3575610;

Returns
TypeDescription
boolean

Whether the type field is set.

hasUnhealthyThreshold()

public boolean hasUnhealthyThreshold()

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.

optional int32 unhealthy_threshold = 227958480;

Returns
TypeDescription
boolean

Whether the unhealthyThreshold field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public HealthCheck.Builder newBuilderForType()
Returns
TypeDescription
HealthCheck.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected HealthCheck.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
HealthCheck.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public HealthCheck.Builder toBuilder()
Returns
TypeDescription
HealthCheck.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException