修改VPC通道健康检查
功能介绍
修改VPC通道健康检查。
调用方法
请参见如何调用API。
URI
PUT /v2/{project_id}/apigw/instances/{instance_id}/vpc-channels/{vpc_channel_id}/health-config
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目ID,获取方式请参见获取项目ID。 |
instance_id | 是 | String | 实例ID,在API网关控制台的“实例信息”中获取。 |
vpc_channel_id | 是 | String | VPC通道的编号 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | String | 用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
protocol | 是 | String | 使用以下协议,对VPC中主机执行健康检查:
|
path | 否 | String | 健康检查时的目标路径。protocol =http或https时必选 |
method | 否 | String | 健康检查时的请求方法 缺省值:GET |
port | 否 | Integer | 健康检查的目标端口,缺少或port =0时为VPC中主机的端口号。 如果此端口存在非0值,则使用此端口进行健康检查。 最小值:0 最大值:65535 |
threshold_normal | 是 | Integer | 正常阈值。判定VPC通道中主机正常的依据为:连续检查x成功,x为您设置的正常阈值。 最小值:1 最大值:10 |
threshold_abnormal | 是 | Integer | 异常阈值。判定VPC通道中主机异常的依据为:连续检查x失败,x为您设置的异常阈值。 最小值:1 最大值:10 |
time_interval | 是 | Integer | 间隔时间:连续两次检查的间隔时间,单位为秒。必须大于timeout字段取值。 最小值:1 最大值:300 |
http_code | 否 | String | 检查目标HTTP响应时,判断成功使用的HTTP响应码。取值范围为100到599之前的任意整数值,支持如下三种格式:
protocol =http时必选 |
enable_client_ssl | 否 | Boolean | 是否开启双向认证。如果开启,则使用实例配置中的backend_client_certificate配置项的证书 缺省值:false |
status | 否 | Integer | 健康检查状态
|
timeout | 是 | Integer | 超时时间:检查期间,无响应的时间,单位为秒。必须小于time_interval字段取值。 最小值:1 最大值:30 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
protocol | String | 使用以下协议,对VPC中主机执行健康检查:
|
path | String | 健康检查时的目标路径。protocol =http或https时必选 |
method | String | 健康检查时的请求方法 缺省值:GET |
port | Integer | 健康检查的目标端口,缺少或port =0时为VPC中主机的端口号。 如果此端口存在非0值,则使用此端口进行健康检查。 最小值:0 最大值:65535 |
threshold_normal | Integer | 正常阈值。判定VPC通道中主机正常的依据为:连续检查x成功,x为您设置的正常阈值。 最小值:1 最大值:10 |
threshold_abnormal | Integer | 异常阈值。判定VPC通道中主机异常的依据为:连续检查x失败,x为您设置的异常阈值。 最小值:1 最大值:10 |
time_interval | Integer | 间隔时间:连续两次检查的间隔时间,单位为秒。必须大于timeout字段取值。 最小值:1 最大值:300 |
http_code | String | 检查目标HTTP响应时,判断成功使用的HTTP响应码。取值范围为100到599之前的任意整数值,支持如下三种格式:
protocol =http时必选 |
enable_client_ssl | Boolean | 是否开启双向认证。如果开启,则使用实例配置中的backend_client_certificate配置项的证书 缺省值:false |
status | Integer | 健康检查状态
|
timeout | Integer | 超时时间:检查期间,无响应的时间,单位为秒。必须小于time_interval字段取值。 最小值:1 最大值:30 |
vpc_channel_id | String | VPC通道的编号 |
id | String | 健康检查的编号 |
create_time | String | 创建时间 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:401
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:403
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:404
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
状态码:500
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码 |
error_msg | String | 错误描述 |
请求示例
修改VPC通道的健康检查
{
"http_code" : "200",
"path" : "/vpc/demo",
"port" : 22,
"protocol" : "http",
"threshold_abnormal" : 5,
"threshold_normal" : 2,
"time_interval" : 10,
"timeout" : 5,
"enable_client_ssl" : false
} 响应示例
状态码:200
OK
{
"protocol" : "http",
"path" : "/vpc/demo",
"method" : "GET",
"port" : 22,
"threshold_abnormal" : 5,
"threshold_normal" : 2,
"time_interval" : 10,
"http_code" : "200",
"enable_client_ssl" : false,
"status" : 1,
"timeout" : 5,
"id" : "3b3d02026c5f402d85e8645ea95b0816",
"vpc_channel_id" : "d38c55c926ca44c2bfb37886d93b9a0d",
"create_time" : "2020-07-23T07:11:57Z"
} 状态码:400
Bad Request
{
"error_code" : "APIG.2001",
"error_msg" : "The request parameters must be specified, parameter name:members"
} 状态码:401
Unauthorized
{
"error_code" : "APIG.1002",
"error_msg" : "Incorrect token or token resolution failed"
} 状态码:403
Forbidden
{
"error_code" : "APIG.1005",
"error_msg" : "No permissions to request this method"
} 状态码:404
Not Found
{
"error_code" : "APIG.3023",
"error_msg" : "The VPC channel does not exist,id:56a7d7358e1b42459c9d730d65b14e59"
} 状态码:500
Internal Server Error
{
"error_code" : "APIG.9999",
"error_msg" : "System error"
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
错误码
请参见错误码。

