查询健康检查列表
功能介绍
健康检查列表。
接口约束
-
分页查询使用的参数为marker、limit、page_reverse。
-
marker和page_reverse只有和limit一起使用时才会生效,单独使用无效。
调用方法
请参见如何调用API。
URI
GET /v3/{project_id}/elb/healthmonitors
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 参数解释:项目ID。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| marker | 否 | String | 上一页最后一条记录的ID。 使用说明:
|
| limit | 否 | Integer | 参数解释:每页返回的个数。 取值范围:0-2000 默认取值:2000 |
| page_reverse | 否 | Boolean | 是否反向查询。 取值:
使用说明:
|
| id | 否 | Array of strings | 健康检查ID。 支持多值查询,查询条件格式:id=xxx&id=xxx***。 |
| monitor_port | 否 | Array of integers | 健康检查端口号。 支持多值查询,查询条件格式:monitor_port=xxx&monitor_port=xxx。 |
| domain_name | 否 | Array of strings | 发送健康检查请求的域名。 取值:以数字或字母开头,只能包含数字、字母、’-’、’.’。 支持多值查询,查询条件格式:domain_name=xxx&domain_name=xxx。 |
| name | 否 | Array of strings | 健康检查名称。 支持多值查询,查询条件格式:name=xxx&name=xxx。 |
| delay | 否 | Array of integers | 健康检查间隔。 取值:1-50s。 支持多值查询,查询条件格式:delay=xxx&delay=xxx。 |
| max_retries | 否 | Array of integers | 健康检查连续成功多少次后,将后端服务器的健康检查状态由OFFLINE判定为ONLINE。取值范围:1-10。 支持多值查询,查询条件格式:max_retries=xxx&max_retries=xxx。 |
| admin_state_up | 否 | Boolean | 参数解释:健康检查的管理状态。 取值范围:
|
| max_retries_down | 否 | Array of integers | 健康检查连续失败多少次后,将后端服务器的健康检查状态由ONLINE判定为OFFLINE。取值范围:1-10。 支持多值查询,查询条件格式:max_retries_down=xxx&max_retries_down=xxx。 |
| timeout | 否 | Integer | 一次健康检查请求的超时时间。 |
| type | 否 | Array of strings | 健康检查请求协议。 取值:TCP、UDP_CONNECT、HTTP、HTTPS、TLS和GRPC。 支持多值查询,查询条件格式:type=xxx&type=xxx。 |
| expected_codes | 否 | Array of strings | 期望响应状态码。 取值:
默认值:200。 仅支持HTTP/HTTPS/GRPC设置该字段,其他协议设置不会生效。 支持多值查询,查询条件格式:expected_codes=xxx&expected_codes=xxx。 |
| url_path | 否 | Array of strings | 健康检查测试member健康时发送的http请求路径。默认为“/”。 使用说明:以“/”开头。当type为HTTP/HTTPS时生效。 支持多值查询,查询条件格式:url_path=xxx&url_path=xxx。 |
| http_method | 否 | Array of strings | HTTP请求方法。 取值:GET、HEAD、POST。 支持多值查询,查询条件格式:http_method=xxx&http_method=xxx。 |
| enterprise_project_id | 否 | Array of strings | 参数解释:所属的企业项目ID。 如果enterprise_project_id不传值,默认查询所有企业项目下的资源,鉴权按照细粒度权限鉴权,必须在用户组下分配elb:healthmonitors:list权限。 如果enterprise_project_id传值,鉴权按照企业项目权限鉴权,分为传入具体eps_id和all_granted_eps两种场景,前者查询指定eps_id的eps下的资源,后者查询的是所有有list权限的eps下的资源。 支持多值查询,查询条件格式: enterprise_project_id=xxx&enterprise_project_id=xxx。 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | 参数解释:IAM鉴权Token |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| request_id | String | 请求ID。 注:自动生成 。 |
| page_info | PageInfo object | 分页信息。 |
| healthmonitors | Array of HealthMonitor objects | 健康检查对象。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| previous_marker | String | 参数解释:分页查询结果中第一条记录的ID。通常用于配合page_reverse=true查询上一页。 |
| next_marker | String | 参数解释:分页查询结果中最后一条记录的ID。通常用于查询下一页。 |
| current_count | Integer | 参数解释:当前的记录数。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| admin_state_up | Boolean | 健康检查的管理状态。 取值范围:
默认取值:true。 |
| delay | Integer | 健康检查间隔。取值:1-50s。 |
| domain_name | String | 发送健康检查请求的域名。 取值:以数字或字母开头,只能包含数字、字母、’-’、’.’。 默认为空,表示使用负载均衡器的vip作为http请求的目的地址。 使用说明:当type为HTTP/HTTPS时生效。 |
| expected_codes | String | 期望响应状态码。 取值:
默认值:若健康检查type为GRPC,则默认值为0,;其他为200。 仅支持HTTP/HTTPS/GRPC设置该字段,其他协议设置不会生效。 |
| http_method | String | HTTP请求方法。 取值:GET、HEAD、POST,默认GET。 使用说明:当type为HTTP/HTTPS时生效。 |
| id | String | 健康检查ID |
| max_retries | Integer | 健康检查连续成功多少次后,将后端服务器的健康检查状态由OFFLINE判定为ONLINE。取值范围:1-10。 |
| max_retries_down | Integer | 健康检查连续失败多少次后,将后端服务器的健康检查状态由ONLINE判定为OFFLINE。取值范围:1-10,默认3。 |
| monitor_port | Integer | 参数解释:健康检查端口号。 取值范围:1-65535和null,传null表示使用后端服务器端口号。 默认取值:null |
| name | String | 健康检查名称。 |
| pools | Array of PoolRef objects | 健康检查所在的后端服务器组ID列表。实际只会有一个后端服务器组ID。 |
| project_id | String | 健康检查所在的项目ID。 |
| timeout | Integer | 一次健康检查请求的超时时间。 建议该值小于delay的值。 |
| type | String | 健康检查请求协议。 取值:TCP、UDP_CONNECT、HTTP、HTTPS、TLS和GRPC。 使用说明:
|
| url_path | String | 健康检查请求的请求路径。以"/"开头,默认为"/"。 支持使用字母、数字和短划线(-)、正斜线(/)、半角句号(.)、百分号(%)、半角问号(?)、井号(#)和and(&)以及扩展字符集_;~!()*[]@$^:',+ 使用说明:当type为HTTP/HTTPS时生效。 |
| created_at | String | 创建时间。格式:yyyy-MM-dd'T'HH:mm:ss'Z',UTC时区。 注意:独享型实例的历史数据以及共享型实例下的资源,不返回该字段。 |
| updated_at | String | 更新时间。格式:yyyy-MM-dd'T'HH:mm:ss'Z',UTC时区。 注意:独享型实例的历史数据以及共享型实例下的资源,不返回该字段。 |
请求示例
查询健康检查列表
GET https://{ELB_Endpoint}/v3/99a3fff0d03c428eac3678da6a7d0f24/elb/healthmonitors 响应示例
状态码:200
操作正常返回。
{
"healthmonitors" : [ {
"monitor_port" : null,
"id" : "c2b210b2-60c4-449d-91e2-9e9ea1dd7441",
"project_id" : "99a3fff0d03c428eac3678da6a7d0f24",
"domain_name" : null,
"name" : "My Healthmonitor update",
"delay" : 10,
"max_retries" : 10,
"pools" : [ {
"id" : "488acc50-6bcf-423d-8f0a-0f4184f5b8a0"
} ],
"admin_state_up" : true,
"timeout" : 30,
"type" : "HTTP",
"expected_codes" : "200",
"url_path" : "/",
"http_method" : "GET"
}, {
"monitor_port" : null,
"id" : "cda1af03-0660-4fd2-8edf-e38c79846e08",
"project_id" : "99a3fff0d03c428eac3678da6a7d0f24",
"domain_name" : "akik..un.com",
"name" : "lijunqiu",
"delay" : 50,
"max_retries" : 1,
"pools" : [ {
"id" : "ae6e45ba-be84-4074-8ac6-bc4a56484809"
} ],
"admin_state_up" : false,
"timeout" : 3,
"type" : "UDP_CONNECT",
"expected_codes" : null,
"url_path" : "/world",
"http_method" : null
} ],
"page_info" : {
"next_marker" : "cda1af03-0660-4fd2-8edf-e38c79846e08",
"previous_marker" : "c2b210b2-60c4-449d-91e2-9e9ea1dd7441",
"current_count" : 2
},
"request_id" : "814bc40e-8b0a-4ced-b8e5-f136c3e1df6a"
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | 操作正常返回。 |
错误码
请参见错误码。