From 0d1589b1d9d97f78ec18ccbfd5f4d879fde63207 Mon Sep 17 00:00:00 2001 From: Paul Simon Date: Thu, 19 Apr 2012 15:46:55 +0000 Subject: [PATCH] Updated DNS API Methods. Updated execute domain.resource.list to return first list item. Changed GETIP option to point to a currently working website. The API URI is changed. --- LinodeDynDNS.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LinodeDynDNS.py b/LinodeDynDNS.py index 1528c9b..af5cae1 100755 --- a/LinodeDynDNS.py +++ b/LinodeDynDNS.py @@ -47,13 +47,13 @@ # header("Content-type: text/plain"); # printf("%s", $_SERVER["REMOTE_ADDR"]); # -GETIP = "http://hosted.jedsmith.org/ip.php" +GETIP = "http://corz.org/ip" # # If for some reason the API URI changes, or you wish to send requests to a # different URI for debugging reasons, edit this. {0} will be replaced with the # API key set above, and & will be added automatically for parameters. # -API = "https://api.linode.com/api/?api_key={0}&resultFormat=JSON" +API = "https://api.linode.com/?api_key={0}&resultFormat=JSON" # # Comment or remove this line to indicate that you edited the options above. # @@ -122,7 +122,7 @@ def ip(): def main(): try: - res = execute("domainResourceGet", {"ResourceID": RESOURCE})["DATA"] + res = execute("domain.resource.list", {"ResourceID": RESOURCE,"DomainID":304090})["DATA"][0] if(len(res)) == 0: raise Exception("No such resource?".format(RESOURCE)) public = ip() @@ -136,7 +136,7 @@ def main(): "Target": public, "TTL_Sec": res["TTL_SEC"] } - execute("domainResourceSave", request) + execute("domain.resource.update", request) print("OK {0} -> {1}".format(old, public)) return 1 else: