add option ttl
Signed-off-by: KenWong <xinxijishuwyq@gmail.com>
This commit is contained in:
parent
3f2346db6f
commit
cbfd628f22
@ -48,13 +48,17 @@ def commitRecord(ip):
|
|||||||
subdomains = c["subdomains"]
|
subdomains = c["subdomains"]
|
||||||
response = cf_api("zones/" + c['zone_id'], "GET", c)
|
response = cf_api("zones/" + c['zone_id'], "GET", c)
|
||||||
base_domain_name = response["result"]["name"]
|
base_domain_name = response["result"]["name"]
|
||||||
|
ttl = 120
|
||||||
|
if "ttl" in c:
|
||||||
|
ttl=c["ttl"]
|
||||||
for subdomain in subdomains:
|
for subdomain in subdomains:
|
||||||
exists = False
|
exists = False
|
||||||
record = {
|
record = {
|
||||||
"type": ip["type"],
|
"type": ip["type"],
|
||||||
"name": subdomain,
|
"name": subdomain,
|
||||||
"content": ip["ip"],
|
"content": ip["ip"],
|
||||||
"proxied": c["proxied"]
|
"proxied": c["proxied"],
|
||||||
|
"ttl": ttl
|
||||||
}
|
}
|
||||||
list = cf_api(
|
list = cf_api(
|
||||||
"zones/" + c['zone_id'] + "/dns_records?per_page=100&type=" + ip["type"], "GET", c)
|
"zones/" + c['zone_id'] + "/dns_records?per_page=100&type=" + ip["type"], "GET", c)
|
||||||
|
|||||||
@ -13,7 +13,8 @@
|
|||||||
"",
|
"",
|
||||||
"subdomain"
|
"subdomain"
|
||||||
],
|
],
|
||||||
"proxied": false
|
"proxied": false,
|
||||||
|
"ttl": 120
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user