Hi guys,
I was configure a script for added multiple ASN rule on IP firewall, it is successfully created rule, but few of the option is unable to do it.
Below is the script i do:
ASN_name=$(cat ASN_name.txt)
for ASN_name in ASN_name;
do
update=(curl -X POST “https://api.cloudflare.com/client/v4/zones/xxxxxxxxxxx/firewall/access_rules/rules” -H “X-Auth-Email: $auth_email” -H “X-Auth-Key: $auth_key” -H
“Content-Type: application/json” --data “{ “mode”:“whitelist,“configuration”:{“target”:“asn”,“value”:”$ASN_name”},“notes”:“CHINANET-BACKBONE”}")
if [[ $update != ““success”:true” ]]; then
message="$ASN_name FAILED create domain. DUMPING RESULTS: $update"
log “$message”
echo -e “$message”
#exit 1
else
message="$ASN_name domain created"
log “$message”
echo “$message”
fi
done
I need to configure the “mode : All websites in account.” Example : (Cloudflare.png), i was check the Cloudflare Api document but can’t find it.