I found some old code from something I was testing, it's based on the Python API
indices = es.indices.get(index="*")
for k, v in sorted(indices.items()):
if k == "_all":
if k.startswith( "." ):
If I remember correctly, this gets a GET index/_settings on all indices in the cluster. If v["settings"] ["index"]["blocks"] exists ["read_only"] would be true.
Do a GET _settings on your index with the block to verify the keys, this is from memory....