UpdateHealthCheckTemplateAttribute

更新时间:
复制 MD 格式

This operation updates the attributes of a health check template, such as its name and health check protocol.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

alb:UpdateHealthCheckTemplateAttribute

update

*HealthCheckTemplate

acs:alb:{#regionId}:{#accountId}:healthchecktemplate/{#healthchecktemplateId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

A client token used to ensure the idempotence of the request.

You must generate a unique value on your client for each request. The client token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the request as the ClientToken. The RequestId of each request is unique.

5A2CFF0E-5718-45B5-9D4D-70B******

HealthCheckTemplateName

string

No

The name of the health check template.

The name must be 2 to 128 characters long, start with a letter, a Chinese character, or a digit, and can contain letters, Chinese characters, digits, periods (.), underscores (_), hyphens (-), and spaces.

HealthCheckTemplate1

HealthCheckConnectPort

integer

No

The port used for health checks. Valid values: 0 to 65535. The default value is 0, which means the health check uses the backend server's port.

80

HealthCheckHost

string

No

The domain name used for health checks. Valid values:

  • $SERVER_IP (default): The private IP of a backend server. If you specify this value or leave the parameter empty, the load balancing service uses the private IP of the backend server for health checks.

  • domain: A domain name that is 1 to 80 characters long and can contain letters, digits, periods (.), and hyphens (-).

Note

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or HTTPS.

$SERVER_IP

HealthCheckCodes

array

No

The list of status codes that indicate a healthy state.

5

string

No

The HTTP status codes that indicate a healthy backend server.

  • If HealthCheckProtocol is set to HTTP or HTTPS, specify one or more of the following values: http_2xx (default), http_3xx, http_4xx, and http_5xx. Separate multiple values with commas.

  • If HealthCheckProtocol is set to gRPC, the valid status codes are in the range of 0 to 99. The default value is 0. You can specify up to 20 ranges, separated by commas.

Note

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP, HTTPS, or gRPC.

http_2xx

HealthCheckInterval

integer

No

The interval between health checks, in seconds. Valid values: 1 to 50. Default value: 2.

5

HealthCheckTimeout

integer

No

The timeout period, in seconds, for a health check response. A health check fails if a backend server does not respond within this period.

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

3

HealthCheckPath

string

No

The URL used for health checks.

The URL must be 1 to 80 characters long. It can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), ampersands (&), and 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, HTTPS, or gRPC.

/test/index.html

HealthCheckMethod

string

No

The method used for health checks. Valid values:

  • HEAD (default): The default method for health checks on HTTP and HTTPS listeners.

  • GET: If the response body is larger than 8 KB, it is truncated. This does not affect the health check result.

  • POST: The default method for health checks on gRPC listeners.

Note

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP, HTTPS, or gRPC.

HEAD

HealthCheckProtocol

string

No

The protocol used for health checks. Valid values:

  • HTTP (default): Checks the health of a backend server by sending an HTTP HEAD or GET request.

  • HTTPS: Checks the health of a backend server by sending an HTTPS HEAD or GET request. HTTPS is more secure than HTTP because it encrypts data.

  • TCP: Checks if a backend server port is reachable by sending a TCP SYN packet.

  • gRPC: Checks the health of a backend server by sending a POST or GET request.

HTTP

HealthCheckHttpVersion

string

No

The HTTP version used for health checks.

Valid values: HTTP1.0 and HTTP1.1.

Default value: HTTP1.1.

Note

This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or HTTPS.

HTTP1.0

HealthyThreshold

integer

No

The number of consecutive successful health checks required to change a backend server's status from unhealthy to healthy.

Valid values: 2 to 10.

Default value: 3.

4

UnhealthyThreshold

integer

No

The number of consecutive failed health checks required to change a backend server's status from healthy to unhealthy.

Valid values: 2 to 10.

Default value: 3.

4

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: Performs a dry run to check the request. The system checks for required parameters, request syntax, and business constraints without performing the operation. If the request is invalid, an error is returned. If the request is valid, the DryRunOperation error code is returned.

  • false (default): Sends a normal request. If the request is valid, a 2xx HTTP status code is returned and the operation is performed.

true

HealthCheckTemplateId

string

Yes

The health check template ID.

hct-bp1qjwo61******

Response elements

Element

Type

Description

Example

object

The response to the update request.

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF3******

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectStatus.HealthCheckTemplate The status of %s [%s] is incorrect. The status of %s [%s] is incorrect.
403 Forbidden.HealthCheckTemplate Authentication is failed for %s. Authentication is failed for %s.
404 ResourceNotFound.HealthCheckTemplate The specified resource %s is not found. The specified resource %s is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.