# Compute Engine v1 API - Class HealthCheck (3.28.0)

3.28.0 (latest) 3.27.0 3.26.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class HealthCheck : IMessage<HealthCheck>, IEquatable<HealthCheck>, IDeepCloneable<HealthCheck>, IBufferMessage, IMessage

Reference documentation and code samples for the Compute Engine v1 API class HealthCheck.

Represents a health check resource.

Google Compute Engine has two health check resources:

- [Regional](https://docs.cloud.google.com/compute/docs/reference/rest/v1/regionHealthChecks)
- [Global](https://docs.cloud.google.com/compute/docs/reference/rest/v1/healthChecks)

These health check resources can be used for load balancing and for
autohealing VMs in a managed instance group (MIG).

**Load balancing**

Health check requirements vary depending on the type of load balancer. For
details about the type of health check supported for
each load balancer and corresponding backend type,
see Health
checks overview: Load balancer guide.

**Autohealing in MIGs**

The health checks that you use for autohealing VMs in a MIG can be either
regional or global. For more information, see Set up an
application health check and autohealing.

For more information, seeHealth checks
overview.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> HealthCheck

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[HealthCheck](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HealthCheck), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[HealthCheck](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HealthCheck), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[HealthCheck](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HealthCheck), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Compute.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1)

## Assembly

Google.Cloud.Compute.V1.dll

## Constructors

### HealthCheck()

    public HealthCheck()

### HealthCheck(HealthCheck)

    public HealthCheck(HealthCheck other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HealthCheck` |

## Properties

### CheckIntervalSec

    public int CheckIntervalSec { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### CreationTimestamp

    public string CreationTimestamp { get; set; }

Output only. \[Output Only\] Creation timestamp in3339
text format.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Description

    public string Description { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### GrpcHealthCheck

    public GRPCHealthCheck GrpcHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.GRPCHealthCheck` |   |

### GrpcTlsHealthCheck

    public GRPCTLSHealthCheck GrpcTlsHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.GRPCTLSHealthCheck` |   |

### HasCheckIntervalSec

    public bool HasCheckIntervalSec { get; }

Gets whether the "check_interval_sec" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasCreationTimestamp

    public bool HasCreationTimestamp { get; }

Gets whether the "creation_timestamp" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasDescription

    public bool HasDescription { get; }

Gets whether the "description" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasHealthyThreshold

    public bool HasHealthyThreshold { get; }

Gets whether the "healthy_threshold" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasId

    public bool HasId { get; }

Gets whether the "id" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasKind

    public bool HasKind { get; }

Gets whether the "kind" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasName

    public bool HasName { get; }

Gets whether the "name" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasRegion

    public bool HasRegion { get; }

Gets whether the "region" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasSelfLink

    public bool HasSelfLink { get; }

Gets whether the "self_link" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasTimeoutSec

    public bool HasTimeoutSec { get; }

Gets whether the "timeout_sec" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasType

    public bool HasType { get; }

Gets whether the "type" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasUnhealthyThreshold

    public bool HasUnhealthyThreshold { get; }

Gets whether the "unhealthy_threshold" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HealthyThreshold

    public int HealthyThreshold { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### Http2HealthCheck

    public HTTP2HealthCheck Http2HealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HTTP2HealthCheck` |   |

### HttpHealthCheck

    public HTTPHealthCheck HttpHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HTTPHealthCheck` |   |

### HttpsHealthCheck

    public HTTPSHealthCheck HttpsHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HTTPSHealthCheck` |   |

### Id

    public ulong Id { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.uint64` |   |

### Kind

    public string Kind { get; set; }

Output only. Type of the resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### LogConfig

    public HealthCheckLogConfig LogConfig { get; set; }

Configure logging on this health check.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HealthCheckLogConfig` |   |

### Name

    public string Name { get; set; }

Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Region

    public string Region { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### SelfLink

    public string SelfLink { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### SourceRegions

    public RepeatedField<string> SourceRegions { get; }

The list of cloud regions from which health checks are performed. If any
regions are specified, then exactly 3 regions should be specified. The
region names must be valid names of Google Cloud regions.
This can only be set for global health check.
If this list is non-empty, then there are restrictions
on what other health check fields are supported and what other resources
can use this health check:

- SSL, HTTP2, and GRPC protocols are not supported.
- The TCP request field is not supported.
- The proxyHeader field for HTTP, HTTPS, and TCP is not supported.
- The checkIntervalSec field must be at least 30.
- The health check cannot be used with BackendService nor with managed instance group auto-healing.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### SslHealthCheck

    public SSLHealthCheck SslHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.SSLHealthCheck` |   |

### TcpHealthCheck

    public TCPHealthCheck TcpHealthCheck { get; set; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.TCPHealthCheck` |   |

### TimeoutSec

    public int TimeoutSec { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### Type

    public string Type { get; set; }

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 matchtype field.
Check the Type enum for the list of possible values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### UnhealthyThreshold

    public int UnhealthyThreshold { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |