e8edbd3333f751f750df5374b9ee339905fc9963
cloudflare/Cloudflare\343\201\256Edge Cache\343\202\222API\343\201\213\343\202\211\343\201\231\343\201\271\343\201\246\345\211\212\351\231\244\343\201\231\343\202\213.md
... | ... | @@ -1 +1,15 @@ |
1 | -<https://developers.cloudflare.com/api/operations/zone-purge> |
|
... | ... | \ No newline at end of file |
0 | +<https://developers.cloudflare.com/api/operations/zone-purge> |
|
1 | + |
|
2 | +環境変数は`.env`ファイルに入れる。 |
|
3 | + |
|
4 | +```bash |
|
5 | +#!/bin/bash |
|
6 | +set -euxo pipefail |
|
7 | + |
|
8 | +source .env |
|
9 | + |
|
10 | +curl "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/purge_cache" \ |
|
11 | +--header "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \ |
|
12 | +--header "Content-Type: application/json" \ |
|
13 | +--data '{"purge_everything": true}' |
|
14 | +``` |
|
... | ... | \ No newline at end of file |