I am planing to switch to update the dns record public ip to cloudflare API by using scheduler script.

Code: Select all
# get the public ip address
:global getPublicIp [/tool/fetch url=https://api.ipify.org output=user as-value];
:global debugA1 ($getPublicIp->"data");
# set the public ip address
:local zoneId xxxxxxxxxxxxx
:local redordId xxxxxxxxxxxxx
:local authApiToken xxxxxxxxxxxxx
:global updateCloudflareRecord [/tool fetch url="https://api.cloudflare.com/client/v4/zones/$zoneId/dns_records/$redordId" http-method=patch http-header-field="Content-Type: application/json,Authorization: Bearer $authApiToken" http-data="{\"content\":\"$debugA1\"}" output=user as-value];
:global debugB1 ($updateCloudflareRecord->"status")
:global debugB2 ($updateCloudflareRecord->"data")