Exemple #1
0
 def update(self):
     wan_ip = network.Network().get_wan_ip()
     self.log("router wan ip is " + wan_ip)
     cfapi = None
     try:
         cfapi = CloudFlare(self.username, self.key)
         self.log("logged into cloudflare with %s using %s" %
                  (self.username, self.key))
     except Exception, e:
         msg = "could not login to cloudflare with %s using %s" % (
             self.username, self.key)
         self.error(msg)
         raise DDNSError(msg)
from cloudflare import CloudFlare
from config import Config

config = Config()
cloudFlare = CloudFlare(email=config['email'],
                        apikey=config['apiKey'],
                        zone=config['zone'])

# print(cloudFlare.listRecords())
# print(cloudFlare.findRecordByName("xn--mcahiddayan-thb.com"))
print(cloudFlare.findRecordById("9ccdfe71e7913f4ec32bc74a70546b64"))