All Products
Search
Document Center

Server Load Balancer:UpdateHealthCheckTemplateAttribute

Last Updated:Apr 20, 2023

Modifies the attributes of a health check template.

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 keyAssociation operation
alb:UpdateHealthCheckTemplateAttributeWrite
  • ALB
    acs:alb:{#regionId}:{#accountId}:healthchecktemplate/{#healthchecktemplateId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. The token can contain only ASCII characters.

NoteIf you do not set this parameter, the system automatically sets ClientToken to the value of RequestId. The value of RequestId may be different for each API request.
5A2CFF0E-5718-45B5-9D4D-70B3FF3898
HealthCheckTemplateNamestringNo

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
HealthCheckConnectPortintegerNo

The port that is used for health checks. Valid values: 0 to 65535.

Default value: 0. If you set the value to 0, the port of the backend server is used for health checks.

80
HealthCheckHoststringNo

The domain name that is used for health checks. Valid values:

  • $SERVER_IP (default): 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) 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 (-).
NoteThis parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
$_ip
HealthCheckIntervalintegerNo

The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.

5
HealthCheckTimeoutintegerNo

The timeout period of a health check. If a backend server does not return a health check response within the specified timeout period, the server fails the health check.

Unit: seconds. Valid values: 1 to 300. Default value: 5.

NoteIf 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.
3
HealthCheckPathstringNo

The URL path 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 path must start with a forward slash (/).

NoteThis parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
/test/index.html
HealthCheckMethodstringNo

The HTTP method that is used for health checks. Valid values:

  • HEAD: By default, HTTP health checks use the HEAD method.
  • GET: If the size of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
  • POST: By default, gRPC health checks use the POST method.
NoteThis parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
HEAD
HealthCheckProtocolstringNo

The protocol that is used 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
HealthCheckHttpVersionstringNo

The HTTP version that is used for health checks.

Valid values: HTTP1.0 and HTTP1.1.

Default value: HTTP1.1.

NoteThis parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
HTTP1.0
HealthyThresholdintegerNo

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.

Default value: 3.

4
UnhealthyThresholdintegerNo

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.

Default value: 3.

4
DryRunbooleanNo

Specifies whether to only precheck this request. Valid values:

  • true: prechecks the request without modifying the attributes of the health check template. The system checks the required parameters, request syntax, and limits. If the request fails to pass the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the health check template is modified.
true
HealthCheckTemplateIdstringYes

The ID of the template.

hct-bp1qjwo61pqz3ahltv0mw

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

365F4154-92F6-4AE4-92F8-7FF34B540710

Examples

Sample success responses

JSONformat

{
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710"
}

Error codes

HTTP status codeError codeError messageDescription
400IncorrectStatus.HealthCheckTemplateThe status of %s [%s] is incorrect.The status of %s [%s] is incorrect.
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.