Creates a health check template in a region.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. Note
If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
| 5A2CFF0E-5718-45B5-9D4D-70B3FF3898 |
HealthCheckTemplateName | string | Yes | 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 |
HealthCheckConnectPort | integer | No | 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 a backend server is used for health checks. | 80 |
HealthCheckHost | string | No | The domain name that is used for health checks. Valid values:
Note
This parameter takes effect only if HealthCheckProtocol is set to HTTP or HTTPS.
| $_ip |
HealthCheckCodes | array | No | The HTTP status codes that indicate a healthy backend server. | |
string | No | The HTTP status code that indicates a healthy backend server.
Note
This parameter is available only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.
| http_2xx,http_3xx | |
HealthCheckInterval | integer | No | The interval at which health checks are performed. Valid values: 1 to 50. Default value: 2. | 2 |
HealthCheckTimeout | integer | No | 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. Valid values: 1 to 300. Default value: 5. 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.
| 5 |
HealthCheckPath | string | No | The URL that is used for health checks. The URL must be 1 to 80 characters in length, and can contain letters, digits, the following special characters: - / . % ? # &, and the following extended characters: Note
This parameter is available only if HealthCheckProtocol is set to HTTP or HTTPS.
| /test/index.html |
HealthCheckMethod | string | No | The HTTP method that is used for health checks. Valid values:
Note
This parameter is available only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.
| HEAD |
HealthCheckProtocol | string | No | The protocol that is used for health checks. Valid values:
| HTTP |
HealthCheckHttpVersion | string | No | The HTTP version for health checks. Valid values: HTTP 1.0 and HTTP 1.1. Default value: HTTP 1.1. Note
This parameter is available only if HealthCheckProtocol is set to HTTP or HTTPS.
| HTTP 1.0 |
HealthyThreshold | integer | No | 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 |
UnhealthyThreshold | integer | No | 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 |
DryRun | boolean | No | Specifies whether to perform only a dry run, without performing the actual request. Valid values:
| true |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The tag key. The tag key can be up to 128 characters in length and cannot start with | env |
Value | string | No | The tag value. The tag value can be up to 128 characters in length and cannot start with | product |
Response parameters
Examples
Sample success responses
JSON
format
{
"HealthCheckTemplateId": "hct-1224334",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | QuotaExceeded.HealthCheckTemplatesNum | The quota of %s is exceeded, usage %s/%s. | The quota of %s is exceeded. Usage: %s/%s. |
403 | Forbidden.HealthCheckTemplate | Authentication has failed for HealthCheckTemplate. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-18 | The Error code has changed | View Change Details |