Only update A records
This commit is contained in:
parent
f699af1eef
commit
158b701eb9
1 changed files with 3 additions and 4 deletions
|
@ -36,11 +36,10 @@ def get_sub_records(domain, subdomain, api_url, api_key, debug=False):
|
||||||
return json_object[0]
|
return json_object[0]
|
||||||
|
|
||||||
def update_sub_records(domain, subdomain, api_url, api_key, ip, ttl, debug=False):
|
def update_sub_records(domain, subdomain, api_url, api_key, ip, ttl, debug=False):
|
||||||
url = api_url + '/domains/' + domain + '/records/' + subdomain
|
url = api_url + '/domains/' + domain + '/records/' + subdomain + "/A"
|
||||||
payload = {"rrset_type": "A", "rrset_ttl": ttl, "rrset_values": [ip]}
|
payload = {"rrset_values": [ip], "rrset_ttl": ttl}
|
||||||
items = {"items": [payload]}
|
|
||||||
headers = {'Content-Type': 'application/json', 'Authorization': "Apikey " + api_key}
|
headers = {'Content-Type': 'application/json', 'Authorization': "Apikey " + api_key}
|
||||||
resp = requests.put(url, data=json.dumps(items), headers=headers)
|
resp = requests.put(url, data=json.dumps(payload), headers=headers)
|
||||||
json_object = json.loads(resp._content)
|
json_object = json.loads(resp._content)
|
||||||
return json_object
|
return json_object
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue