测试使用 Cloudflare 的 API 来删除对应域名的 DNS 记录,对应的测试域名中有预先添加一条 A 记录
https://api.cloudflare.com/#dns-records-for-a-zone-delete-dns-record
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$DNS_ID" \
-H "X-Auth-Email: $EMAIL" \
-H "X-Auth-Key: $GLOBAL_KEY" \
-H "Content-Type: application/json"
报错如下,提示没有 DNS 记录
{"result":null,"success":false,"errors":[{"code":81044,"message":"Record does not exist."}],"messages":[]}
疑惑了很久,不清楚为什么会出错,求大佬解答
1
bootvue 2023-02-07 17:28:22 +08:00
先 list /details 查询一下 看有没有
|
2
Microcharon OP @bootvue
谢谢,list 出测试域名的 DNS 记录后才发现原来是 DNS_ID 和 ACCOUNT_ID (账户 ID )混淆了,以为 DNS_ID 就是 ACCOUNT_ID ,列出来才知道 DNS_ID ,这下 success 了 {"result":[{"id":"bd8401829beac46cf0zc44ce93407a05","zone_id":"1659x52d329x1519x9e6x36cc40a56bf","zone_name":"jazzcat.eu.org","name":"jazzcat.eu.org","type":"A","content":"107.185.3.1","proxiable":true,"proxied":true,"ttl":1,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-02-07T07:48:26.041466Z","modified_on":"2023-02-07T07:48:26.041466Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}} |