Queries the attributes of a specified health check template.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListHealthCheckTemplates

The operation that you want to perform.

Set the value to ListHealthCheckTemplates

NextToken String No t-2343r

The start position of the query. If this parameter is left empty, the query starts from the beginning.

MaxResults Integer No 50

The maximum number of data records to be queried.

Valid values: 1 to 100.

Default value: 20.

HealthCheckTemplateIds Array of String No hct-bp1qjwo61pqz3ahltv****

The IDs of health check templates. You can specify 20 IDs in each call. The results are filtered based on the specified IDs.

HealthCheckTemplateNames Array of String No test

The names of health check templates. You can specify up to 10 names in each call. The results are filtered based on the specified names.

Response parameters

Parameter Type Example Description
HealthCheckTemplates Array of HealthCheckTemplate

The list of health check templates.

HealthCheckConnectPort Integer 80

The number of the port that is used for health checks.

Valid values: 0 to 65535.

Default value: 0. This value indicates that the backend server is used for health checks.

HealthCheckHost String $_ip

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

$SERVER_IP (default value): The private IP addresses of backend servers. If the $_ip parameter is set or the HealthCheckHost parameter is not set, SLB uses the private IP addresses of backend servers as the domain names for health checks.

domain: The domain name must be 1 to 80 characters in length, and can contain only letters, digits, periods (.),and hyphens (-).

Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckCodes Array of String http_2xx,http_3xx

The HTTP status code that indicates a successful health check.

Default value: http_2xx. The HTTP status code that indicates a successful health check. Multiple status codes are separated with commas.

Valid values: http_2xx, http_3xx, http_4xx, and http_5xx.

Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckHttpVersion String HTTP 1.0

The version of the HTTP protocol.

Valid values: HTTP 1.0 and HTTP 1.1.

Default value: HTTP 1.1.

Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckInterval Integer 5

The time interval between two consecutive health checks.

Valid values: 1 to 50. Unit: seconds.

Default value: 2.

HealthCheckMethod String HEAD

The health check method.

Valid values: GET and HEAD.

Default value: HEAD.

Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckPath String /test/index.html

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain 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 (/).

HealthCheckProtocol String HTTP

The protocol that is used for health checks.

Valid values: HTTP and TCP.

Default value: HTTP.

HealthCheckTemplateId String hct-bp1qjwo61pqz3ahltv****

The ID of the health check template.

HealthCheckTemplateName String HealthCheckTemplate1

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.

HealthCheckTimeout Integer 3

The timeout period of a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails.

Valid values: 1 to 300. Unit: seconds.

Default value: 5.

Note If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
HealthyThreshold Integer 4

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success).

Valid values: 2 to 10.

Default value: 3.

UnhealthyThreshold Integer 4

Specifies the number of times that an healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail).

Valid values: 2 to 10.

Default value: 3.

MaxResults Integer 50

The maximum number of data records that was queried.

Valid values: 1 to 100.

Default value: 20.

NextToken String t-2343r

The position where the query started. If this parameter was left empty, the query started from the beginning.

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

The ID of the request.

TotalCount Integer 1000

The total data volume of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListHealthCheckTemplates
&NextToken=t-2343r
&MaxResults=50
&HealthCheckTemplateIds=["hct-bp1qjwo61pqz3ahltv****"]
&HealthCheckTemplateNames=["test"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListHealthCheckTemplatesResponse>
    <HealthCheckTemplates>
        <HealthCheckConnectPort>80</HealthCheckConnectPort>
        <HealthCheckHost>$_ip</HealthCheckHost>
        <HealthCheckCodes>http_2xx,http_3xx</HealthCheckCodes>
        <HealthCheckHttpVersion>HTTP 1.0</HealthCheckHttpVersion>
        <HealthCheckInterval>5</HealthCheckInterval>
        <HealthCheckMethod>HEAD</HealthCheckMethod>
        <HealthCheckPath>/test/index.html</HealthCheckPath>
        <HealthCheckProtocol>HTTP</HealthCheckProtocol>
        <HealthCheckTemplateId>hct-bp1qjwo61pqz3ahltv****</HealthCheckTemplateId>
        <HealthCheckTemplateName>HealthCheckTemplate1</HealthCheckTemplateName>
        <HealthCheckTimeout>3</HealthCheckTimeout>
        <HealthyThreshold>4</HealthyThreshold>
        <UnhealthyThreshold>4</UnhealthyThreshold>
    </HealthCheckTemplates>
    <MaxResults>50</MaxResults>
    <NextToken>t-2343r</NextToken>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    <TotalCount>1000</TotalCount>
</ListHealthCheckTemplatesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HealthCheckTemplates" : {
    "HealthCheckConnectPort" : 80,
    "HealthCheckHost" : "$_ip",
    "HealthCheckCodes" : "http_2xx,http_3xx",
    "HealthCheckHttpVersion" : "HTTP 1.0",
    "HealthCheckInterval" : 5,
    "HealthCheckMethod" : "HEAD",
    "HealthCheckPath" : "/test/index.html",
    "HealthCheckProtocol" : "HTTP",
    "HealthCheckTemplateId" : "hct-bp1qjwo61pqz3ahltv****",
    "HealthCheckTemplateName" : "HealthCheckTemplate1",
    "HealthCheckTimeout" : 3,
    "HealthyThreshold" : 4,
    "UnhealthyThreshold" : 4
  },
  "MaxResults" : 50,
  "NextToken" : "t-2343r",
  "RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "TotalCount" : 1000
}

Error codes

For a list of error codes, visit the API Error Center.