I have been looking for some time to find out the proper syntax out to shutdown a pool in a cloudflare loadbalancer via api request. As you can find different syntaxes regarding authentication bearer versus keys in their documentation, that seems not up to date at the moment.
ACCOUNT_ID=15AAAAAA3492893hd
POOL_ID=9898AJJJ23287bhs
CF_CI_API_TOKEN=HSAUIH&DY78h3e_HAd7ag3
curl -f -X PATCH "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/load_balancers/pools/$POOL_ID" \
-H "Authorization: Bearer $CF_CI_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "enabled": false }'
Leave a Reply