Compute V1 Client - Class HealthCheck (1.5.0)

Reference documentation and code samples for the Compute V1 Client class HealthCheck.

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.

Generated from protobuf message google.cloud.compute.v1.HealthCheck

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ check_interval_sec int

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

↳ creation_timestamp string

[Output Only] Creation timestamp in 3339 text format.

↳ description string

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

↳ grpc_health_check Google\Cloud\Compute\V1\GRPCHealthCheck
↳ healthy_threshold int

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

↳ http2_health_check Google\Cloud\Compute\V1\HTTP2HealthCheck
↳ http_health_check Google\Cloud\Compute\V1\HTTPHealthCheck
↳ https_health_check Google\Cloud\Compute\V1\HTTPSHealthCheck
↳ id int|string

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

↳ kind string

Type of the resource.

↳ log_config Google\Cloud\Compute\V1\HealthCheckLogConfig

Configure logging on this health check.

↳ name string

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]([-a-z0-9]*[a-z0-9])?, 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.

↳ region string

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

↳ self_link string

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

↳ ssl_health_check Google\Cloud\Compute\V1\SSLHealthCheck
↳ tcp_health_check Google\Cloud\Compute\V1\TCPHealthCheck
↳ timeout_sec int

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.

↳ type string

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.

↳ unhealthy_threshold int

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

getCheckIntervalSec

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

Generated from protobuf field optional int32 check_interval_sec = 345561006;

Returns
TypeDescription
int

hasCheckIntervalSec

clearCheckIntervalSec

setCheckIntervalSec

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

Generated from protobuf field optional int32 check_interval_sec = 345561006;

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getCreationTimestamp

[Output Only] Creation timestamp in 3339 text format.

Generated from protobuf field optional string creation_timestamp = 30525366;

Returns
TypeDescription
string

hasCreationTimestamp

clearCreationTimestamp

setCreationTimestamp

[Output Only] Creation timestamp in 3339 text format.

Generated from protobuf field optional string creation_timestamp = 30525366;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

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

Generated from protobuf field optional string description = 422937596;

Returns
TypeDescription
string

hasDescription

clearDescription

setDescription

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

Generated from protobuf field optional string description = 422937596;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getGrpcHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574;

Returns
TypeDescription
Google\Cloud\Compute\V1\GRPCHealthCheck|null

hasGrpcHealthCheck

clearGrpcHealthCheck

setGrpcHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574;

Parameter
NameDescription
var Google\Cloud\Compute\V1\GRPCHealthCheck
Returns
TypeDescription
$this

getHealthyThreshold

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

Generated from protobuf field optional int32 healthy_threshold = 403212361;

Returns
TypeDescription
int

hasHealthyThreshold

clearHealthyThreshold

setHealthyThreshold

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

Generated from protobuf field optional int32 healthy_threshold = 403212361;

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getHttp2HealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986;

Returns
TypeDescription
Google\Cloud\Compute\V1\HTTP2HealthCheck|null

hasHttp2HealthCheck

clearHttp2HealthCheck

setHttp2HealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986;

Parameter
NameDescription
var Google\Cloud\Compute\V1\HTTP2HealthCheck
Returns
TypeDescription
$this

getHttpHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940;

Returns
TypeDescription
Google\Cloud\Compute\V1\HTTPHealthCheck|null

hasHttpHealthCheck

clearHttpHealthCheck

setHttpHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940;

Parameter
NameDescription
var Google\Cloud\Compute\V1\HTTPHealthCheck
Returns
TypeDescription
$this

getHttpsHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905;

Returns
TypeDescription
Google\Cloud\Compute\V1\HTTPSHealthCheck|null

hasHttpsHealthCheck

clearHttpsHealthCheck

setHttpsHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905;

Parameter
NameDescription
var Google\Cloud\Compute\V1\HTTPSHealthCheck
Returns
TypeDescription
$this

getId

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

Generated from protobuf field optional uint64 id = 3355;

Returns
TypeDescription
int|string

hasId

clearId

setId

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

Generated from protobuf field optional uint64 id = 3355;

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getKind

Type of the resource.

Generated from protobuf field optional string kind = 3292052;

Returns
TypeDescription
string

hasKind

clearKind

setKind

Type of the resource.

Generated from protobuf field optional string kind = 3292052;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLogConfig

Configure logging on this health check.

Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741;

Returns
TypeDescription
Google\Cloud\Compute\V1\HealthCheckLogConfig|null

hasLogConfig

clearLogConfig

setLogConfig

Configure logging on this health check.

Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741;

Parameter
NameDescription
var Google\Cloud\Compute\V1\HealthCheckLogConfig
Returns
TypeDescription
$this

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]([-a-z0-9]*[a-z0-9])?, 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.

Generated from protobuf field optional string name = 3373707;

Returns
TypeDescription
string

hasName

clearName

setName

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]([-a-z0-9]*[a-z0-9])?, 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.

Generated from protobuf field optional string name = 3373707;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRegion

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

Generated from protobuf field optional string region = 138946292;

Returns
TypeDescription
string

hasRegion

clearRegion

setRegion

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

Generated from protobuf field optional string region = 138946292;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

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

Generated from protobuf field optional string self_link = 456214797;

Returns
TypeDescription
string

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

Generated from protobuf field optional string self_link = 456214797;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getSslHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440;

Returns
TypeDescription
Google\Cloud\Compute\V1\SSLHealthCheck|null

hasSslHealthCheck

clearSslHealthCheck

setSslHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440;

Parameter
NameDescription
var Google\Cloud\Compute\V1\SSLHealthCheck
Returns
TypeDescription
$this

getTcpHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419;

Returns
TypeDescription
Google\Cloud\Compute\V1\TCPHealthCheck|null

hasTcpHealthCheck

clearTcpHealthCheck

setTcpHealthCheck

Generated from protobuf field optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419;

Parameter
NameDescription
var Google\Cloud\Compute\V1\TCPHealthCheck
Returns
TypeDescription
$this

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.

Generated from protobuf field optional int32 timeout_sec = 79994995;

Returns
TypeDescription
int

hasTimeoutSec

clearTimeoutSec

setTimeoutSec

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.

Generated from protobuf field optional int32 timeout_sec = 79994995;

Parameter
NameDescription
var int
Returns
TypeDescription
$this

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.

Generated from protobuf field optional string type = 3575610;

Returns
TypeDescription
string

hasType

clearType

setType

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.

Generated from protobuf field optional string type = 3575610;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getUnhealthyThreshold

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

Generated from protobuf field optional int32 unhealthy_threshold = 227958480;

Returns
TypeDescription
int

hasUnhealthyThreshold

clearUnhealthyThreshold

setUnhealthyThreshold

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

Generated from protobuf field optional int32 unhealthy_threshold = 227958480;

Parameter
NameDescription
var int
Returns
TypeDescription
$this