API Custom rule question

I want to create a script that disables my custom rule for my api when my VPS uses 90%+ cpu. But I can’t find an API to simply enable or disable it. Is it possible? Maybe any alternatives how to defend my API?

Depends on how set up your rule, but probably doing an update of the rule via Cloudflare API Documentation to enable/disable is what you are looking for.

1 Like

I’m fairly new to Cloudflare, but I’ve been having fun using bash again! I haven’t used it in 20 years until now :slight_smile:

If your VPS is running Linux, you could possibly use this in your bash to regularly read the CPU usage:

And then when it’s over 90%, use cURL to disable the rule.

1 Like

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