HAProxy Data Plane API 使用流程

HAProxy Data Plane API 的功能是越来越强大了,以下是一个使用的整理

Data Plane API 使用流程

  1. 获取api地址(目前包含了v1,v2,推荐使用v2),比如 /v1/specification,/v2/specification
  2. 代码生成(可以通过restapi,可选)
  3. 获取配置版本,通过/vX/services/haproxy/transactions 或者官方介绍的一个/vX/services/haproxy/configuration/frontends
  4. 创建一个事物(一次提交操作) /vX/services/haproxy/transactions?version= post 请求
  5. 创建一个backend /vX/services/haproxy/configuration/backends?transaction_id= post 请求
  6. 添加server /vX/services/haproxy/configuration/servers?backend=&transaction_id= post 请求
  7. 创建frontend /vX/services/haproxy/configuration/frontends?transaction_id= post 请求
  8. 添加bind /vX/services/haproxy/configuration/binds?frontend=&transaction_id= post 请求
  9. 提交事物 /vX/services/haproxy/transactions/ post 请求

参考资料

https://www.haproxy.com/documentation/dataplaneapi/latest/#operation/getTransactions 
链接: https://pan.baidu.com/s/1lDxPfBSKnv0e292KxlgFqw 提取码: 8rgk

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/12914925.html
今日推荐