Result indicates PASS but values not added

I am using CURL and pushing a POST message via the API.
I use the API and retrieve the rule id along with the filter id.
I then update the existing rule (add an additional IP to the rule).

I then do a -X PUT using the updated filter.
The result echoed back indicates success: true, the errors and messages are both empty as well. All the ID’s align but the Rule is essentially unchanged except for the “modified_on” value which contains the new timestamp.

However, the result filter.expression does not contain the new IP.

This is how I update my firewall rule:

curl -X PUT \
     -H "X-Auth-Email: MY_EMAIL" \
     -H "X-Auth-Key: MY_KEY" \
     -H "Content-Type: application/json" \
     -d '{
    "id": "'"$filter"'",
    "paused": false,
    "description": "FILTER_NAME",
    "expression": "the expression I just built that looks just like the expression builder…but with escaped quotation marks"
}' "https://api.cloudflare.com/client/v4/zones/$zone/filters/$filter"

Thanks for the reply.
So what i did find out – is I had a wrong assumption.
I was updating the filter by attempting to use the Rule endpoint. Even though i was updating the filter within the Rule, the filter would not update as part of a Rule update.

Once I changed to the endpoint for Filters all started working.

BTW, is there a limit on how many IP’s can be added to an ip.src in clause?

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.