- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- IAM Permissions
- Examples
- Try it!
Returns the specified HealthCheck resource. Gets a list of available health checks by making a list()
request.
HTTP request
GET https://compute.googleapis.com/compute/beta/projects/{project}/global/healthChecks/{resourceId}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
resourceId |
Name of the HealthCheck resource to return. |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
JSON representation | |
---|---|
{ "id": string, "creationTimestamp": string, "name": string, "description": string, "checkIntervalSec": integer, "timeoutSec": integer, "unhealthyThreshold": integer, "healthyThreshold": integer, "type": enum, "tcpHealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "request": string, "response": string, "proxyHeader": enum }, "sslHealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "request": string, "response": string, "proxyHeader": enum }, "httpHealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "host": string, "requestPath": string, "proxyHeader": enum, "response": string }, "httpsHealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "host": string, "requestPath": string, "proxyHeader": enum, "response": string }, "http2HealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "host": string, "requestPath": string, "proxyHeader": enum, "response": string }, "grpcHealthCheck": { "port": integer, "portName": string, "portSpecification": enum, "grpcServiceName": string }, "selfLink": string, "region": string, "logConfig": { "enable": boolean }, "kind": string } |
Fields | |
---|---|
id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
creationTimestamp |
[Output Only] Creation timestamp in 3339 text format. |
name |
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. Specifically, the name must be 1-63 characters long and match the regular expression |
description |
An optional description of this resource. Provide this property when you create the resource. |
checkIntervalSec |
How often (in seconds) to send a health check. The default value is 5 seconds. |
timeoutSec |
How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for |
unhealthyThreshold |
A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. |
healthyThreshold |
A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. |
type |
Specifies the type of the healthCheck, either |
tcpHealthCheck |
|
tcpHealthCheck.port |
The TCP port number for the health check request. The default value is |
tcpHealthCheck.portName |
Port name as defined in |
tcpHealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, TCP health check follows behavior specified in |
tcpHealthCheck.request |
The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. |
tcpHealthCheck.response |
The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. |
tcpHealthCheck.proxyHeader |
Specifies the type of proxy header to append before sending data to the backend, either |
sslHealthCheck |
|
sslHealthCheck.port |
The TCP port number for the health check request. The default value is |
sslHealthCheck.portName |
Port name as defined in |
sslHealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, SSL health check follows behavior specified in |
sslHealthCheck.request |
The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. |
sslHealthCheck.response |
The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. |
sslHealthCheck.proxyHeader |
Specifies the type of proxy header to append before sending data to the backend, either |
httpHealthCheck |
|
httpHealthCheck.port |
The TCP port number for the health check request. The default value is |
httpHealthCheck.portName |
Port name as defined in |
httpHealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, HTTP health check follows behavior specified in |
httpHealthCheck.host |
The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. |
httpHealthCheck.requestPath |
The request path of the HTTP health check request. The default value is |
httpHealthCheck.proxyHeader |
Specifies the type of proxy header to append before sending data to the backend, either |
httpHealthCheck.response |
The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. |
httpsHealthCheck |
|
httpsHealthCheck.port |
The TCP port number for the health check request. The default value is |
httpsHealthCheck.portName |
Port name as defined in InstanceGroup#NamedPort#name. If both port and portName are defined, port takes precedence. |
httpsHealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, HTTPS health check follows behavior specified in |
httpsHealthCheck.host |
The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. |
httpsHealthCheck.requestPath |
The request path of the HTTPS health check request. The default value is |
httpsHealthCheck.proxyHeader |
Specifies the type of proxy header to append before sending data to the backend, either |
httpsHealthCheck.response |
The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. |
http2HealthCheck |
|
http2HealthCheck.port |
The TCP port number for the health check request. The default value is |
http2HealthCheck.portName |
Port name as defined in |
http2HealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, HTTP2 health check follows behavior specified in |
http2HealthCheck.host |
The value of the host header in the HTTP/2 health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. |
http2HealthCheck.requestPath |
The request path of the HTTP/2 health check request. The default value is |
http2HealthCheck.proxyHeader |
Specifies the type of proxy header to append before sending data to the backend, either |
http2HealthCheck.response |
The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. |
grpcHealthCheck |
|
grpcHealthCheck.port |
The port number for the health check request. Must be specified if portName and portSpecification are not set or if portSpecification is USE_FIXED_PORT. Valid values are |
grpcHealthCheck.portName |
Port name as defined in |
grpcHealthCheck.portSpecification |
Specifies how port is selected for health checking, can be one of following values: If not specified, gRPC health check follows behavior specified in |
grpcHealthCheck.grpcServiceName |
The gRPC service name for the health check. This field is optional. The value of grpcServiceName has the following meanings by convention: |
selfLink |
[Output Only] Server-defined URL for the resource. |
region |
[Output Only] Region where the health check resides. Not applicable to global health checks. |
logConfig |
Configure logging on this health check. |
logConfig.enable |
Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. |
kind |
Type of the resource. |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.healthChecks.get
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.