更新时间:2025-04-30 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
创建健康检查
调试
您可以在API Explorer中直接运行调试该接口。
接口格式
| 
         方法  | 
       
         URI  | 
       
         说明  | 
      
|---|---|---|
| 
         POST  | 
       
         /v2.0/lbaas/healthmonitors  | 
       
         创建健康检查。  | 
      
接口约束
- 安全组需放通网段100.125.0.0/16流量。
 - admin_state_up参数必须是true。
 - UDP的检查健康只能使用在UDP的后端云服务器组上。
 
具体步骤
- 设置请求消息头。Postman中设置好头部信息,将获取到的Token放入头部。
     
     图1 设置请求消息头-创建健康检查
      - 在Body标签中填写请求消息体。
     
     图2 填写请求消息体-创建健康检查
      - 填写URL。
     
     
https://elb.cn-east-2.myhuaweicloud.com/v2.0/lbaas/healthmonitors
 - 发送请求。选择请求方法为POST,点击Send按钮,得到服务端响应。
     
     
{ "healthmonitor": { "monitor_port": null, "name": "", "admin_state_up": true, "tenant_id": "0d0bf0e8fb564cc9abbe526dbdca9248", "delay": 10, "expected_codes": "200", "max_retries": 10, "http_method": "GET", "timeout": 10, "pools": [ { "id": "752c3773-a046-4966-a5d6-0ad7f9a49d0a" } ], "url_path": "/", "type": "HTTP", "id": "9b6d7438-a6eb-4d49-ae77-3c130e3b7ae8" } } 
示例代码
2中消息体内容
{ 
  "healthmonitor": { 
    "admin_state_up": true, 
    "pool_id": "752c3773-a046-4966-a5d6-0ad7f9a49d0a", 
    "delay": "10", 
    "max_retries": "10", 
    "timeout": "10", 
    "type": "HTTP" 
  } 
}