LBAddPoolInOne【新建资源池】¶
新建负载均衡资源池:新建过程可配置负载均衡所在子网网段、协议、负载均衡方法、成员、关联监控。如果不指定必要新建条件,则会返回错误信息。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
pool_provider | String | 资源池提供者(默认为haproxy) | Yes |
admin_state_up | Integer | 管理员状态(默认为1) | No |
monitor_http_method | String | 监控方法(默认为GET) | Yes |
pool_name | String | 资源池名称 | Yes |
pool_description | String | 资源池描述 | No |
pool_subnet_id | String | 资源池所选子网ID | Yes |
pool_protocol | String | 资源池协议类型,有效值有TCP,HTTP,HTTPS | Yes |
pool_lb_method | String | 负载均衡方法 | Yes |
member_protocol_port | String | 资源池成员协议端口 | Yes |
members | Array | 资源池成员信息,包括成员主机ID,分配的权重 | No |
monitor_type | String | 监控类型,有PING,TCP,HTTP,HTTPS | Yes |
monitor_delay | String | 延迟(秒) | Yes |
monitor_timeout | String | 超时(秒) | Yes |
monitor_max_retries | String | 最大重试次数 | Yes |
monitor_url_path | String | 监控网址路径 | Yes |
monitor_expected_codes | String | 期待的HTTP状态码 | Yes |
billing_type | String | 计费类型,有效值有hour | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json
JSON Data:
{
"action": "LBAddPoolInOne",
"pool_provider": "haproxy",
"admin_state_up": 1,
"monitor_http_method": "GET",
"pool_name": "LB",
"pool_description": "http-test",
"pool_subnet_id": "dcc01e93-b2c0-44f3-807d-837a0d915ec3",
"pool_protocol": "HTTP",
"pool_lb_method": "ROUND_ROBIN",
"member_protocol_port": "80",
"members": [
{
"member": "3b10f961-c2a5-4ac9-89a9-5f3d0c132cc6,192.168.100.31",
"value": "16"
},
{
"member": "5eb85b61-d8cc-41d0-bdaf-72ff0dc61907,192.168.100.30",
"value": "16"
}
],
"monitor_type": "http",
"monitor_delay": "1",
"monitor_timeout": "2",
"monitor_max_retries": "2",
"monitor_url_path": "/",
"monitor_expected_codes": "200",
"billing_type": "hour"
}
Example Response:
{
"message": "成功",
"code": 200
}