Hi there,
I successfully install and use dataplaneapi for regular tasks like adding backend or ACL. my current issue is how can i perform following http-check with dataplaneapi:
backend test.com
option httpchk
http-check connect port 443 send-proxy ssl alpn h2,http/1.1
http-check send meth GET uri / hdr host test.com
http-check expect status 200-399
server edge-1 a1.b1.c1.d1:443 check send-proxy-v2 fall 3 rise 3
server edge-2 a2.b2.c2.d2:443 send-proxy-v2 check fall 10 rise 3
server edge-3 a3.b3.c3.d3:443 check-send-proxy check send-proxy-v2 fall 3 rise 3
I tried many way such as following but it doesn’t help:
curl -X POST --user admin:adminpwd -H “Content-Type: application/json” -d ‘{“httpchk_params”:{},“log_health_checks”:“enabled”,“mode”:“tcp”,“name”:“test.com”,
“http-check”:{“headers”:null,“alpn”:“h2,http/1.1”,“index”:0,“port”:443,“send_proxy”:true,“ssl”:true,“type”:“connect”},
“http-check”:{“headers”:[{“fmt”:“test.com”,“name”:“host”}],“index”:0,“method”:“GET”,“type”:“send”,“uri”:“/”},
“http-check”: {“index”: 0, “type”: “expect”, “match”: “status”, “pattern”:“200-399”}}’ “http://127.0.0.1:5555/v2/services/haproxy/configuration/backends?version=10”
After running above curl command i get {“code”:500,“message”:“invalid data”}. I know i can’t add unique keys in json. but how can i add health checks in such a way Dataplaneapi accept the POST request. I also use following curl command to just add one http-check at a time but i got again 500 code error.
curl -X POST --user admin:adminpwd -H “Content-Type: application/json” -d '{“httpchk_params”:{},“log_health_checks”:“enabled”,“mode”:“tcp”,“name”:“test.com”,
“http-check”:{“headers”:[{“fmt”:“test.com”,“name”:“host”}],“index”:0,“method”:“GET”,“type”:“send”,“uri”:“/”}
/configuration/backends?version=10"
How can I add this health-checks appropriately?
tnx