Neutron/LBaaS/APIRevisionProposals
建议 1
用例
SSL 终止
单次创建 LB 调用
请求
POST /loadbalancers
{
"loadbalancer":
{
"name": "Single Call LB",
"port":443,
"protocol": "HTTPS",
"ssl_decryption":
{
"certificate": "CERTIFICATE",
"private_key": "PRIVATE_KEY",
"intermediate_certificate": "INTERMEDIATE_CERTIFICATE"
},
"vips":[
{
"type":"IPv4",
"subnet_id":"SUBNET_UUID"
}
],
"pool":{
"name": "pool1”,
“subnet_id”: “SUBNET_UUID”,
"algorithm": "ROUNDROBIN",
"session_persistence": "COOKIE",
"members": [{
"ip": "10.1.1.1",
"port": 80,
"enabled": true
}],
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
}
}
响应
{
"loadbalancer":
{
"id": "LB_UUID",
"name": "Single Call LB",
"port":443,
"protocol": "HTTPS",
"ssl_decryption":
{
"id": SSL_DECRYPTION_UUID",
"certificate": "CERTIFICATE",
"private_key": "PRIVATE_KEY",
"intermediate_certificate": "INTERMEDIATE_CERTIFICATE"
},
"vips":[
{
"id": "VIP_UUID",
"address": "12.1.1.1",
"type":"IPv4",
"subnet_id":"SUBNET_UUID"
}
],
"pool":{
"id": "POOL_UUID",
"name": "pool1”,
“subnet_id”: “SUBNET_UUID”,
"algorithm": "ROUNDROBIN",
"session_persistence": "COOKIE",
"members": [{
"id": "MEMBER_UUID",
"ip": "10.1.1.1",
"port": 80,
"enabled": true
}],
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
}
}
按每个基本元素创建
1. 创建 VIP
请求
POST /vips
{
"vip":
{
"type": "IPv4",
"subnet_id": "SUBNET_UUID"
}
}
响应
{
"vip":
{
"id": "VIP_UUID",
"address": "12.1.1.1",
"type": "IPv4",
"subnet_id": "SUBNET_UUID"
}
}
2. 创建 Pool
请求
POST /pools
{
"pool": {
"name": "pool1",
"algorithm": "ROUNDROBIN",
"session_persistence": "SOURCE_IP",
"subnet_id": "SUBNET_UUID",
"members": [
{
"ip": "10.1.1.1",
"port": 80
}
]
}
}
响应
{
"pool": {
"id": "POOL_UUID",
"name": "pool1",
"algorithm": "ROUNDROBIN",
"session_persistence": "SOURCE_IP",
"subnet_id": "SUBNET_UUID",
"members": [
{
"id": "MEMBER_UUID",
"ip": "10.1.1.1",
"port": 80
}
]
}
}
3. 在 Pool 上创建健康检查
请求
POST /pools/{pool_uuid}/health_monitor
{
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
响应
{
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
4. 创建 SSL 解密
请求
POST /ssl_decryption
{
"ssl_decryption":
{
"certificate": "CERTIFICATE",
"private_key": "PRIVATE_KEY",
"intermediate_certificate": "INTERMEDIATE_CERTIFICATE"
}
}
响应
{
"ssl_decryption":
{
"id": "SSL_DECRYPTION_UUID",
"certificate": "CERTIFICATE",
"private_key": "PRIVATE_KEY",
"intermediate_certificate": "INTERMEDIATE_CERTIFICATE"
}
}
5. 创建负载均衡器
请求
POST /loadbalancers
{
"loadbalancer":
{
"name": "Single Call LB",
"port":443,
"protocol": "HTTPS",
"ssl_decryption":
{
"id": "SSL_DECRYPTION_UUID"
},
"vips":[
{
"id": "VIP_UUID"
}
],
"pool":{
"id": "POOL_UUID"
}
}
}
L7 交换/内容交换
单次创建 LB 调用
在此示例中,多个 pool 在附加到负载均衡器对象的 content_switching 对象中定义。规则应为在 content_switching 对象中定义的每个 pool 定义。
请求
POST /loadbalancers
{
"loadbalancer":
{
"name": "Single Call LB",
"port":443,
"protocol": "HTTPS",
"content_switching":
{
"enabled": true,
"pools": [
{
"name": "pool2",
"subnet_id": "SUBNET_UUID",
"algorithm": "ROUNDROBIN",
"session_persistence": "COOKIE",
"members": [
{
"ip":"10.1.1.2",
"port": 80,
"enabled": true
},
"rules":[
{
"type": "path",
"match": "/index.html"
}]
}]
},
"vips":[
{
"type":"IPv4",
"subnet_id":"SUBNET_UUID"
}
],
"pool":{
"name": "pool1”,
“subnet_id”: “SUBNET_UUID”,
"algorithm": "ROUNDROBIN",
"session_persistence": "COOKIE",
"members": [{
"ip": "10.1.1.1",
"port": 80,
"enabled": true
}],
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
}
}
响应
{
"loadbalancer":
{
"id": "LB_UUID",
"name": "Single Call LB",
"port":443,
"protocol": "HTTPS",
"ssl_decryption":
{
"id": SSL_DECRYPTION_UUID",
"certificate": "CERTIFICATE",
"private_key": "PRIVATE_KEY",
"intermediate_certificate": "INTERMEDIATE_CERTIFICATE"
},
"vips":[
{
"id": "VIP_UUID",
"address": "12.1.1.1",
"type":"IPv4",
"subnet_id":"SUBNET_UUID"
}
],
"pool":{
"id": "POOL_UUID",
"name": "pool1”,
“subnet_id”: “SUBNET_UUID”,
"algorithm": "ROUNDROBIN",
"session_persistence": "COOKIE",
"members": [{
"id": "MEMBER_UUID",
"ip": "10.1.1.1",
"port": 80,
"enabled": true
}],
"health_monitor": {
"type": "HTTPS",
"delay": 1,
"timeout": 10,
"interval": 1
}
}
}
}
按每个基本元素创建