All Products
Search
Document Center

Server Load Balancer:GetHealthCheckTemplateAttribute

Last Updated:Mar 01, 2024

Queries the details about a health check template.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alb:GetHealthCheckTemplateAttributeRead
  • HealthCheckTemplate
    acs:alb:{#regionId}:{#accountId}:healthchecktemplate/{#healthchecktemplateId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
HealthCheckTemplateIdstringYes

The ID of the health check template.

hct-x4jazoyi6tvsq9****

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

HealthCheckConnectPortinteger

The port that is used for health checks.

Valid values: 0 to 65535.

80
HealthCheckHoststring

The domain name that you want to use for health checks. Valid values:

  • $SERVER_IP: the private IP addresses of backend servers. If you do not set the HealthCheckHost parameter or set the parameter to $SERVER_IP, the Application Load Balancer (ALB) instance uses the private IP addresses of backend servers for health checks.
  • domain: The domain name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), and hyphens (-).
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
$SERVER_IP
HealthCheckCodesarray

The HTTP status codes that are used to determine whether the backend server passes the health check.

  • If HealthCheckProtocol is set to HTTP, HealthCheckCodes can be set to http_2xx (default), http_3xx, http_4xx, and http_5xx. Separate multiple HTTP status codes with a comma (,).
  • If HealthCheckProtocol is set to gRPC, HealthCheckCodes can be set to 0 to 99. Default value: 0. Value ranges are supported. You can enter up to 20 value ranges and separate them with a comma (,).
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
string

The HTTP status codes that are used to determine whether the backend server passes the health check.

  • If HealthCheckProtocol is set to HTTP, HealthCheckCodes can be set to http_2xx (default), http_3xx, http_4xx, and http_5xx. Separate multiple HTTP status codes with a comma (,).
  • If HealthCheckProtocol is set to gRPC, HealthCheckCodes can be set to 0 to 99. Default value: 0. Value ranges are supported. You can enter up to 20 value ranges and separate them with a comma (,).
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
http_2xx,http_3xx
HealthCheckHttpVersionstring

The HTTP version that is used for health checks.

Valid values: HTTP1.0 and HTTP1.1.

Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
HTTP1.0
HealthCheckTemplateIdstring

The ID of the health check template.

hct-x4jazoyi6tvsq9****
HealthCheckIntervalinteger

The interval at which health checks are performed. Unit: seconds. Valid values: 1 to 50.

3
HealthCheckMethodstring

The method that you want to use for the health check. Valid values:

  • HEAD: By default, the ALB instance sends HEAD requests to a backend server to perform HTTP health checks.
  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
  • POST: gRPC health checks automatically use the POST method.
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
GET
HealthCheckPathstring

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain only letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
/test/index.html
HealthCheckProtocolstring

The protocol that you want to use for health checks. Valid values:

  • HTTP (default): To perform HTTP health checks, ALB sends HEAD or GET requests to a backend server to check whether the backend server is healthy.
  • TCP: To perform TCP health checks, ALB sends SYN packets to a backend server to check whether the port of the backend server is available to receive requests.
  • gRPC: To perform gRPC health checks, ALB sends POST or GET requests to a backend server to check whether the backend server is healthy.
HTTP
HealthCheckTemplateNamestring

The name of the health check template.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

HealthCheckTemplate1
HealthCheckTimeoutinteger

The timeout period of a health check. If a backend server does not respond within the specified timeout period, the backend server fails the health check. Unit: seconds.

Valid values: 1 to 300.

Note If the value of the HealthCheckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the timeout period specified by the HealthCheckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is used as the timeout period.
200
HealthyThresholdinteger

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from fail to success.

Valid values: 2 to 10.

5
RequestIdstring

The request ID.

DB1AFC33-DAE8-528E-AA4D-4A6AABE71945
UnhealthyThresholdinteger

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from success to fail.

Valid values: 2 to 10.

5
Tagsobject []

The tags.

Keystring

The tag key. The tag key can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

env
Valuestring

The tag value. The tag value can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

product

Examples

Sample success responses

JSONformat

{
  "HealthCheckConnectPort": 80,
  "HealthCheckHost": "$SERVER_IP",
  "HealthCheckCodes": [
    "http_2xx,http_3xx"
  ],
  "HealthCheckHttpVersion": "HTTP1.0",
  "HealthCheckTemplateId": "hct-x4jazoyi6tvsq9****",
  "HealthCheckInterval": 3,
  "HealthCheckMethod": "GET",
  "HealthCheckPath": "/test/index.html",
  "HealthCheckProtocol": "HTTP",
  "HealthCheckTemplateName": "HealthCheckTemplate1",
  "HealthCheckTimeout": 200,
  "HealthyThreshold": 5,
  "RequestId": "DB1AFC33-DAE8-528E-AA4D-4A6AABE71945",
  "UnhealthyThreshold": 5,
  "Tags": [
    {
      "Key": "env",
      "Value": "product"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404ResourceNotFound.HealthCheckTemplateThe specified resource %s is not found.The specified resource %s is not found.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-18The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
    Added Error Codes: 403