Merge pull request #25 from xinxijishuwyq/master

add option ttl
This commit is contained in:
Timothy Miller 2020-12-12 15:22:40 -05:00 committed by GitHub
commit 18ad6c6bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -48,13 +48,17 @@ def commitRecord(ip):
subdomains = c["subdomains"]
response = cf_api("zones/" + c['zone_id'], "GET", c)
base_domain_name = response["result"]["name"]
ttl = 120
if "ttl" in c:
ttl=c["ttl"]
for subdomain in subdomains:
exists = False
record = {
"type": ip["type"],
"name": subdomain,
"content": ip["ip"],
"proxied": c["proxied"]
"proxied": c["proxied"],
"ttl": ttl
}
list = cf_api(
"zones/" + c['zone_id'] + "/dns_records?per_page=100&type=" + ip["type"], "GET", c)

View File

@ -13,7 +13,8 @@
"",
"subdomain"
],
"proxied": false
"proxied": false,
"ttl": 120
}
]
}