You need to enable JavaScript to run this app.
导航
DescribeHealthCheckTemplates
最近更新时间:2025.04.17 11:56:34首次发布时间:2022.05.20 22:34:23
我的收藏
有用
有用
无用
无用

请求说明

API 名称:DescribeHealthCheckTemplates。
API 域名:open.volcengineapi.com 。
API 描述:获取健康检查模板列表。单次根据 ID 可查询的模板上限为20个。

使用限制

节流限制:每秒最多提交 40 个 API 请求。

调试

URI 参数

在使用该部分 API 提交请求时必须包含以下 URI 参数。

除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数

名称类型是否必选格式说明
Action
string
[a-zA-Z]+
API 名称,如 DescribeHealthCheckTemplates。
VersionstringYYYY-MM-DDAPI 版本信息。该参数的取值是 2020-04-01 。
X-Expiresint900表示签名的有效时间,单位是秒,默认值是900。

请求参数

在使用该 API 提交请求时,请求参数中可以包含的参数如下。

参数类型是否必选参数说明示例值
HealthCheckTemplateIds.N
List of String

健康检查模板的ID,N代表健康检查模板的序号。

  • - N:表示健康检查模板的序号,取值范围为1 ~ 20。
  • 多个健康检查模板间使用“&”分隔。
HealthCheckTemplateIds.1=hctpl-123****765&HealthCheckTemplateIds.2=hctpl-123****123
HealthCheckTemplateName
String健康检查模板的名称。test
PageSizeInteger分页查询时每页的行数,取值1-100,默认为10。20
PageNumberInteger列表的页码,默认值为 1。1
ProjectNameString健康检查模板所属项目名称。default
TagFiltersArray健康检查模板关联的标签,具体参见下表 TagFilters-

TagFilters

参数

类型

是否必选

参数说明

示例

TagFilters.N.Key

String

健康检查模板标签的标签键。 指定多个标签键时,表示查询同时包含所有指定标签键的健康检查模板。

TagFilters.1.Key=k1&TagFilters.2.Key=k2

TagFilters.N.Values.N

String

健康检查模板标签的标签值。如果传入该参数,则必须先传入TagFilters.N.Key。具体规则如下:

  • 每个标签键最多可指定3个标签值。

  • 同一个标签键指定多个标签值时,表示查询各个标签值对应标签所关联健康检查模板的集合。

  • 未传入该参数时,表示查询指定标签键下所有标签值对应的标签所关联的健康检查模板。

  • 该参数取值为空时,表示查询指定标签键下标签值为空的标签所关联的健康检查模板。

TagFilters.1.Value.1=v1&TagFilters.1.Value.2=v2&TagFilters.2.Value.1=v3

返回参数

参数类型参数说明示例值
PageSize
Integer
当前分页的行数。
20
PageNumberInteger当前页码。1
TotalCountInteger符合条件的健康检查模板总数。50
HealthCheckTemplatesArray符合条件的健康检查模板详情信息,具体请参见下表 HealthCheckTemplates-

HealthCheckTemplates

参数类型参数说明示例值
HealthCheckTemplateId
String
健康检查模板 ID。
hctpl-123*******765
HealthCheckTemplateNameString健康检查模板的名称。test
HealthCheckIntervalInteger执行健康检查的时间间隔,默认为2,取值1-300。2
HealthCheckTimeoutInteger健康检查的响应超时时间,默认为2,取值1-60。2
HealthyThresholdInteger健康检查的健康阈值,默认为3,取值2-10。3
UnhealthyThresholdInteger健康检查的不健康阈值,默认为3,取值2-10。3
HealthCheckMethodString健康检查的方法,只有 HealthCheckProtocol 设置为 HTTP 时,才存在该参数。默认为GET,支持GET和HEAD。GET
HealthCheckDomainString健康检查的域名。只有 HealthCheckProtocol 设置为 HTTP 时,才存在该参数。a.com
HealthCheckURIString健康检查的路径,只有 HealthCheckProtocol 设置为 HTTP 时,才存在该参数。默认为“/”。/
HealthCheckHttpCodeString健康检查正常的HTTP状态码,只有 HealthCheckProtocol 设置为 HTTP 时,才存在该参数。默认为http_2xx、http_3xx,以半角逗号分隔。http_2xx
HealthCheckProtocolString健康检查的协议,当前支持 HTTP、TCP。HTTP
HealthCheckHttpVersionString健康检查HTTP协议版本,只有 HealthCheckProtocol 设置为 HTTP 时,才存在该参数。取值:HTTP1.0(默认)、HTTP1.1。HTTP1.0
DescriptionString健康检查的描述。test
HealthCheckPortInteger健康检查端口。参数值为0时,表示使用后端服务器端口进行健康检查。80
TagsArray健康检查模板关联的标签,具体参见下表 Tags-

Tags

参数

类型

参数说明

示例

Key

String

用户标签的标签键。

key

Value

String

用户标签的标签键。

value

示例

请求示例

GET /?Action=DescribeHealthCheckTemplates&Version=2020-04-01&PageSize=20&PageNumber=1&HealthCheckTemplateIds.1=hctpl-123****765&HealthCheckTemplateIds.2=hctpl-123****123 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: alb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210816110638****2514606306AF947C",
        "Action": "DescribeHealthCheckTemplates",
        "Version": "2020-04-01",
        "Service": "alb",
        "Region": "cn-beijing"
    },  
    "Result": {
        "RequestId": "20210814160835****2514606300FFE0F3",
        "PageNumber": 1,
        "PageSize": 20,
        "TotalCount": 1,
        "HealthCheckTemplates": [
        {
            "HealthCheckTemplateId": "hctpl-123*******765",
            "HealthCheckTemplateName": "test",
            "HealthCheckPort": "0",
            "HealthCheckInterval": 2,
            "HealthCheckTimeout": 2,
            "HealthyThreshold": 3,
            "UnhealthyThreshold": 3,
            "HealthCheckMethod": "GET",
            "HealthCheckDomain": "a.com",
            "HealthCheckURI": "/",
            "HealthCheckHttpCode": "http_2xx",
            "HealthCheckProtocol": "HTTP",
            "Description": "test"
        },
        {
            "HealthCheckTemplateId": "hctpl-123*******765",
            "HealthCheckTemplateName": "test",
            "HealthCheckPort": "0",
            "HealthCheckInterval": 2,
            "HealthCheckTimeout": 2,
            "HealthyThreshold": 3,
            "UnhealthyThreshold": 3,
            "HealthCheckMethod": "HEAD",
            "HealthCheckDomain": "a.com",
            "HealthCheckURI": "/",
            "HealthCheckHttpCode": "http_2xx",
            "HealthCheckProtocol": "HTTP",
            "Description": "test"
        }
      ]
    }
}

错误码

如果响应正文包含 Error 字段,则表示 API 请求失败。此处仅展示当前 API 的错误码,更多错误码请参见公共错误码

HTTP Code

错误码

错误信息

错误描述

400LimitExceed.HealthCheckTemplateYou've reached the limit on the number of health check templates that you can operate at a time.已达到单次可操作的健康检查模板的数量上限。
400InvalidHealthCheckTemplateName.MalformedThe specified HealthCheckTemplateName is malformed.指定的 HealthCheckTemplateName 参数格式不合法。
400InvalidPaging.MalformedThe specified PageNumber or PageSize is malformed.指定的分页参数格式不合法。

400

LimitExceed.TagFilters.Values

You've reached the limit on the number of tag filter values that you can operate at a time.

已达到单次可操作的标签值的数量上限。

400

InvalidTagFilters.Key.Malformed

The specified TagFilters.Key is malformed.

指定的 TagFilters.Key 参数格式不合法。

400

InvalidTagFilters.Value.Malformed

The specified TagFilters.Value is malformed.

指定的 TagFilters.Value 参数格式不合法。

400

InvalidTagFilters.Key.Duplicated

The specified TagFilters.Key is duplicated.

指定的 TagFilters.Key 重复。