Queries 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetHealthCheckTemplateAttribute

The operation that you want to perform. Set the value to GetHealthCheckTemplateAttribute.

HealthCheckTemplateId String Yes hct-x4jazoyi6tvsq9****

The ID of the health check template.

Response parameters

Parameter Type Example Description
HealthCheckConnectPort Integer 80

The port that is used for health checks.

Valid values: 0 to 65535.

HealthCheckHost String $SERVER_IP

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

  • $SERVER_IP: The private IP addresses of backend servers. If $SERVER_IP is specified or HealthCheckDomain is not set, 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.
HealthCheckCodes Array of String http_2xx,http_3xx

Separate multiple HTTP status codes with commas (,).

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

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

The version of HTTP 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.
HealthCheckTemplateId String hct-x4jazoyi6tvsq9****

The ID of the health check template.

HealthCheckInterval Integer 3

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

HealthCheckMethod String GET

The HTTP method that is used for health checks.

Valid values: GET and HEAD.

Note This parameter takes effect only when 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 only letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +.

Note The URL must start with a forward slash (/). This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
HealthCheckProtocol String HTTP

The protocol that is used for health checks.

Valid values: HTTP and TCP.

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 200

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.
HealthyThreshold Integer 5

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.

RequestId String DB1AFC33-DAE8-528E-AA4D-4A6AABE71945

The ID of the request.

UnhealthyThreshold Integer 5

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.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetHealthCheckTemplateAttribute
&HealthCheckTemplateId=hct-x4jazoyi6tvsq9****
&Common request parameters

Sample success responses

XML format

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

<GetHealthCheckTemplateAttributeResponse>
    <HealthCheckConnectPort>80</HealthCheckConnectPort>
    <HealthCheckHost>$SERVER_IP</HealthCheckHost>
    <HealthCheckCodes>http_2xx,http_3xx</HealthCheckCodes>
    <HealthCheckHttpVersion>HTTP1.0</HealthCheckHttpVersion>
    <HealthCheckTemplateId>hct-x4jazoyi6tvsq9****</HealthCheckTemplateId>
    <HealthCheckInterval>3</HealthCheckInterval>
    <HealthCheckMethod>GET</HealthCheckMethod>
    <HealthCheckPath>/test/index.html</HealthCheckPath>
    <HealthCheckProtocol>HTTP</HealthCheckProtocol>
    <HealthCheckTemplateName>HealthCheckTemplate1</HealthCheckTemplateName>
    <HealthCheckTimeout>200</HealthCheckTimeout>
    <HealthyThreshold>5</HealthyThreshold>
    <RequestId>DB1AFC33-DAE8-528E-AA4D-4A6AABE71945</RequestId>
    <UnhealthyThreshold>5</UnhealthyThreshold>
</GetHealthCheckTemplateAttributeResponse>

JSON format

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

{
  "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
}

Error codes

HttpCode Error code Error message Description
404 ResourceNotFound.HealthCheckTemplate The specified resource %s is not found. The error message returned because the specified resource %s does not exist.

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