How can I search for which domains are using Cache Reserve?

I received an invoice for Cache Reserve usage.
** I am wondering if I can search for which domain(s) are using Cache Reserve in my account?

Thank you,
Brent :sunglasses:

You can use the API to check whether Cache Reserve is active for any domain:

A little Script that loops through your domains should quickly find the culprit.

1 Like

Hey Laudian,

Thank you - that sounds fairly easy.
However I haven’t written a script since I used to write batch files for DOS.
So unfortunately I don’t think this is in my skill set.

Does anyone already have such a script ready to go?

Brent :sunglasses:

You can try this Python script for Linux:

import os, json


stream = os.popen(f"""curl -s --request GET \
  --url \
  --header 'Authorization: Bearer {bearer}' \
  --header 'Content-Type: application/json'""")
zones = json.loads(["result"]

for zone in zones:
    id = zone["id"]
    name = zone["name"]
    stream = os.popen(f"""curl -s --request GET \
  --url{id}/cache/cache_reserve \
  --header 'Authorization: Bearer {bearer}' \
  --header 'Content-Type: application/json'""")

    output = json.loads(
        reserve_status = output["result"]["value"]
        print(name + ": " + reserve_status)
        print(name + ": " + "Cache Reserve not available for this domain")

Replace YOUR_API_TOKEN with a token that you create. I used Read all resources for the token, though you don’t need all of those obviously.

I’m afraid I can’t test if this is working because Cache Reserve is not available on my account

Thank you Laudian,
There are errors in the script, but I can’t fix them.
It’s OK, I will just look at each domain, and keep track manually.

Brent :sunglasses:

What errors?

It doesn’t matter - I don’t want to bother you any further.
I went through my domains manually and found them all.
I appreciate your time very much.
Have a great weekend!
Brent :sunglasses:

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